:root {
  --ink: #173d37;
  --ink-soft: #41645e;
  --paper: #f6f0e4;
  --paper-deep: #eee3d1;
  --white: #fffdf8;
  --lime: #cde86e;
  --mint: #72c7a0;
  --coral: #ef8a6b;
  --lilac: #b9a6d8;
  --line: rgba(23, 61, 55, 0.18);
  --shadow: 0 18px 50px rgba(23, 61, 55, 0.11);
  --radius: 22px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }
[hidden]::before, [hidden]::after { content: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 12%, rgba(205, 232, 110, 0.38), transparent 25rem),
    radial-gradient(circle at 95% 35%, rgba(185, 166, 216, 0.26), transparent 27rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-150%);
}
.skip-link:focus { opacity: 1; pointer-events: auto; transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
}

.mode-chip,
.total-votes {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.65);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.hero {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0 64px;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  right: 2%;
  top: 22%;
  border: 28px solid var(--coral);
  border-radius: 52% 48% 60% 40%;
  transform: rotate(14deg);
  opacity: 0.82;
}

.eyebrow,
.card-label {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 10vw, 7.6rem);
  line-height: 0.82;
  font-weight: 700;
}

.hero h1 em { color: var(--coral); font-weight: 400; }

.hero-copy {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.6;
}

.round-status {
  width: fit-content;
  min-height: 44px;
  margin-top: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
}

.winner {
  position: relative;
  overflow: hidden;
  margin: 0 0 48px;
  padding: clamp(28px, 6vw, 62px);
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--ink);
}

.winner::after {
  content: "WINNER";
  position: absolute;
  right: -18px;
  bottom: -22px;
  color: rgba(23, 61, 55, 0.12);
  font-weight: 950;
  font-size: clamp(4rem, 14vw, 10rem);
  letter-spacing: -0.08em;
}

.winner h2 { position: relative; z-index: 1; margin: 0 0 8px; font-size: clamp(2.3rem, 6vw, 4.5rem); }
.winner p { position: relative; z-index: 1; margin: 0; font-weight: 700; }

.voter-panel {
  max-width: 760px;
  margin: 0 auto 48px;
  padding: clamp(28px, 6vw, 52px);
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--ink);
}

.voter-panel h2 { margin-bottom: 10px; font-size: clamp(2.4rem, 6vw, 4rem); }
.voter-panel > p:not(.eyebrow) { max-width: 580px; color: var(--ink-soft); line-height: 1.55; }
.voter-form { margin-top: 26px; }
.voter-form label { display: block; margin-bottom: 8px; font-weight: 900; }
.name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.name-row input {
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 12px;
}
.voting-as { min-height: 38px; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; color: var(--white); background: var(--ink); font-size: 0.82rem; font-weight: 850; }

.menu-section { padding: 42px 0 90px; }

.section-heading,
.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); }

.search {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 330px);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.search input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.drink-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 30px rgba(23, 61, 55, 0.055);
}

.drink-card:nth-child(4n + 1) .number { background: var(--lime); }
.drink-card:nth-child(4n + 2) .number { background: var(--mint); }
.drink-card:nth-child(4n + 3) .number { background: var(--lilac); }
.drink-card:nth-child(4n + 4) .number { background: var(--coral); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 950; }
.strong-label { padding: 6px 9px; color: #6d2016; background: #ffd8cc; border-radius: 999px; font-size: 0.68rem; font-weight: 950; letter-spacing: 0.08em; }
.drink-card h3 { min-height: 2.2em; margin-bottom: 10px; font-size: 1.65rem; line-height: 1.08; }
.taste { min-height: 3em; margin-bottom: 20px; color: var(--ink-soft); line-height: 1.5; }

.strength-note {
  margin: -8px 0 24px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.strength-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto 0 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 10px;
}

.stars { color: rgba(181, 111, 0, 0.28); font-size: 1.02rem; letter-spacing: 0.06em; white-space: nowrap; }
.stars span { color: #b56f00; }
.strength-label { font-size: 0.76rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }

.details-button,
.vote-button {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 850;
}

.details-button { width: 100%; color: var(--ink); background: transparent; border: 1px solid var(--line); }
.details-button:hover { background: var(--paper); }
.recipe-details { padding-top: 16px; line-height: 1.55; }
.recipe-details p:last-child { margin-bottom: 0; }
.recipe-details strong { display: block; margin-bottom: 4px; }

.vote-button { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--white); background: var(--ink); border: 2px solid var(--ink); }
.vote-button:hover:not(:disabled) { color: var(--ink); background: var(--lime); }
.vote-strength { color: var(--lime); font-size: 0.82rem; letter-spacing: 0.03em; white-space: nowrap; }
.vote-button:hover:not(:disabled) .vote-strength { color: var(--ink); }

.empty-state { padding: 40px; text-align: center; color: var(--ink-soft); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px max(16px, calc((100vw - 1180px) / 2));
  color: var(--paper);
  background: var(--ink);
}
footer strong { letter-spacing: 0.08em; }
footer span { color: #c8d7d2; }

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100% - 40px));
  padding: 16px 18px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 750;
}

.text-link { min-height: 44px; display: inline-flex; align-items: center; color: inherit; font-weight: 800; }
.admin-main { padding-top: 68px; padding-bottom: 80px; }
.login-panel { width: min(100%, 520px); margin: 5vh auto; padding: clamp(26px, 6vw, 50px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-panel h1, .dashboard h1 { margin-bottom: 14px; font-size: clamp(2.7rem, 7vw, 5rem); }
.login-panel > p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.6; }
.login-panel form { display: grid; gap: 12px; margin-top: 28px; }
.login-panel label { font-weight: 850; }
.login-panel input { min-height: 50px; padding: 0 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }

.button { min-height: 46px; padding: 10px 17px; border-radius: 12px; font-weight: 850; }
.button.primary { color: var(--white); background: var(--ink); border: 2px solid var(--ink); }
.button.primary:hover:not(:disabled) { color: var(--ink); background: var(--lime); }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.danger { color: #681d13; background: #ffd8cc; border: 2px solid #a13c2d; }
.form-message { min-height: 1.4em; margin: 0; color: #a13c2d; font-weight: 750; }

.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.control-card { padding: clamp(24px, 4vw, 38px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.control-card.accent-card { background: var(--lime); }
.control-card h2 { margin-bottom: 18px; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.muted, .fine-print { color: var(--ink-soft); line-height: 1.55; }
.fine-print { margin: 16px 0 0; font-size: 0.85rem; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: rgba(255, 253, 248, 0.55); border: 1px solid rgba(23, 61, 55, 0.22); border-radius: 14px; }
.segmented button { min-height: 46px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-weight: 850; }
.segmented button.active { color: var(--white); background: var(--ink); }
.admin-status { margin-bottom: 20px; padding: 14px; background: var(--paper); border-radius: 12px; line-height: 1.5; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.leaderboard-section { margin-top: 52px; }
.leaderboard { display: grid; gap: 10px; }
.leader-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-height: 64px; padding: 10px 16px; background: rgba(255, 253, 248, 0.78); border: 1px solid var(--line); border-radius: 14px; }
.leader-rank { width: 34px; height: 34px; display: grid; place-items: center; background: var(--paper-deep); border-radius: 50%; font-weight: 900; }
.leader-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.leader-votes { font-variant-numeric: tabular-nums; font-weight: 950; }
.admin-message { min-height: 1.5em; margin-top: 20px; font-weight: 800; }
.leader-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.voter-names { color: var(--ink-soft); font-size: 0.8rem; line-height: 1.4; }
.candidate-row { min-height: 74px; }
.admin-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-empty { padding: 34px; text-align: center; color: var(--ink-soft); background: rgba(255, 253, 248, 0.78); border: 1px solid var(--line); border-radius: 14px; }
.reset-section { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 46px; padding: clamp(24px, 4vw, 38px); background: rgba(255, 216, 204, 0.48); border: 1px solid rgba(161, 60, 45, 0.35); border-radius: var(--radius); }
.reset-section h2 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.reset-section p { margin-bottom: 0; }

@media (max-width: 860px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header { width: min(100% - 24px, 1180px); min-height: 66px; }
  main { width: min(100% - 24px, 1180px); }
  .hero { min-height: 390px; padding: 60px 0 48px; }
  .hero::after { width: 110px; height: 110px; border-width: 18px; top: 18%; opacity: 0.45; }
  .section-heading, .dashboard-heading { align-items: stretch; flex-direction: column; }
  .name-row { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .drink-card h3, .taste { min-height: auto; }
  footer { flex-direction: column; }
  .text-link { font-size: 0.84rem; }
  .admin-chips { justify-content: flex-start; }
  .reset-section { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
