:root {
  --bg: #f5efe2;
  --panel: rgba(255, 250, 242, 0.88);
  --panel-border: rgba(107, 72, 32, 0.12);
  --text: #2b2116;
  --muted: #6e5a42;
  --accent: #a44c1c;
  --accent-strong: #7f3410;
  --shadow: 0 24px 60px rgba(72, 41, 17, 0.14);
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 28%),
    radial-gradient(circle at right, rgba(241, 195, 122, 0.35), transparent 25%),
    linear-gradient(135deg, #efe2c4 0%, #f9f4eb 48%, #f2dfc0 100%);
  min-height: 100vh;
}

.screen { min-height: 100vh; }
.stack > * + * { margin-top: 0.9rem; }
.hidden { display: none !important; }

.panel, .vote-shell, .present-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent);
}

.muted { color: var(--muted); }
.vote-screen, .control-screen { padding: 1.25rem; }
.vote-shell { max-width: 760px; margin: 0 auto; padding: 1.25rem; }

.egg-card {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  align-items: center;
  margin: 1.2rem 0;
}

.egg-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  background: #fff7ea;
}

.vote-form { display: grid; gap: 1rem; }

.criterion {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(107, 72, 32, 0.12);
}

.criterion-header, .slider-labels, .button-row, .present-hero, .present-result-card, .footer-pill, .score-line, .live-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.slider-value { font-weight: 700; color: var(--accent-strong); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.slider-labels { font-size: 0.85rem; color: var(--muted); }

.submit-button, .action-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.action-button.ghost {
  background: white;
  color: var(--accent-strong);
  border: 1px solid rgba(127, 52, 16, 0.18);
}

.status-panel { margin-top: 1rem; padding: 1rem 1.2rem; }
.comment-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(107, 72, 32, 0.18);
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.present-screen {
  padding: 2rem;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.5rem;
}

.present-card {
  height: 100%;
  padding: 2rem;
  display: grid;
  gap: 1.6rem;
}

.lobby-layout { grid-template-columns: 1.2fr 0.8fr; align-items: center; }
.present-title { font-size: clamp(2.4rem, 5vw, 5rem); line-height: 0.96; margin: 0; }
.present-subtitle { font-size: 1.25rem; max-width: 36rem; }

.qr-card {
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  justify-self: end;
  text-align: center;
}

.qr-card img { width: min(24vw, 240px); border-radius: 18px; }
.voting-layout { grid-template-columns: 1fr 1fr; align-items: center; }

.present-image {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.6);
  padding: 1rem;
}

.present-result-grid, .scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.comment-wall {
  display: grid;
  gap: 0.75rem;
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.comment-pill {
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(107, 72, 32, 0.1);
}

.comment-panel {
  min-height: 14rem;
}

.podium-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  padding-top: 10rem;
}

.podium-slot {
  padding: 1.25rem;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(229,212,184,0.95));
  border: 1px solid rgba(107, 72, 32, 0.12);
  text-align: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.podium-first { min-height: 440px; }
.podium-second { min-height: 300px; }
.podium-third { min-height: 230px; }

.podium-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.hidden-podium {
  opacity: 0.28;
  transform: translateY(10px);
}

.podium-image {
  width: min(100%, 180px);
  aspect-ratio: 1;
  object-fit: contain;
  position: absolute;
  bottom: calc(100% - 1.5rem);
  left: 50%;
  transform: translateX(-50%);
}

.podium-third .podium-image,
.podium-second .podium-image {
  width: min(100%, 360px);
}

.podium-first .podium-image {
  width: min(100%, 540px);
}

.present-result-card {
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  border: 1px solid rgba(107, 72, 32, 0.1);
}

.meter { height: 12px; border-radius: 999px; background: rgba(164, 76, 28, 0.12); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d97b2a, #a44c1c); }
.radar { width: 220px; aspect-ratio: 1; display: block; margin: 0 auto; }

.present-footer { display: flex; justify-content: flex-end; gap: 1rem; }

.footer-pill {
  padding: 0.85rem 1.2rem;
  background: rgba(43, 33, 22, 0.82);
  color: white;
  border-radius: 999px;
}

.control-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.25rem;
}

.panel { padding: 1.4rem; }
.link-list { display: grid; gap: 0.75rem; }
.link-list a { color: var(--accent-strong); text-decoration: none; font-weight: 700; }
.live-metrics { padding: 0.9rem 1rem; border-radius: 20px; background: rgba(255, 255, 255, 0.7); }

.debug-panel {
  padding: 1rem;
  border-radius: 20px;
  background: rgba(43, 33, 22, 0.06);
  border: 1px dashed rgba(107, 72, 32, 0.22);
}

.censored-image {
  filter: blur(34px) grayscale(1) saturate(0);
}

@media (max-width: 900px) {
  .lobby-layout, .voting-layout, .control-grid, .egg-card, .podium-layout { grid-template-columns: 1fr; }
  .qr-card { justify-self: start; }
  .present-footer { justify-content: center; }
}
