.tasting-body {
  overflow: auto;
  color: var(--foam);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 244, 207, 0.055), transparent 26rem),
    linear-gradient(180deg, #020303 0%, #010202 46%, #000 100%);
  background-color: #000;
}

.tier-results-page {
  min-height: 100svh;
  color: #a4f4ff;
  background:
    linear-gradient(90deg, #020808 0%, rgba(0, 0, 0, 0.9) 7%, rgba(0, 0, 0, 0.48) 18%, transparent 34%, transparent 66%, rgba(0, 0, 0, 0.48) 82%, rgba(0, 0, 0, 0.9) 93%, #020808 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.08) 36%, rgba(0, 0, 0, 0.5) 82%, #000 100%),
    url("../assets/maelstrom-full-section-bg.webp");
  background-color: #020808;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: clamp(760px, 54vw, 1040px) auto;
}

.tier-results-page .tasting-shell {
  min-height: 100svh;
}

.tier-results-page .tasting-hero,
.tier-results-page .tasting-board {
  background: transparent;
}

.tier-results-page .tasting-hero::after {
  background:
    radial-gradient(circle at 50% 46%, rgba(0, 221, 255, 0.1), transparent 24rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.52));
}

.tasting-shell {
  min-height: 100vh;
}

body.vote-confirmed {
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 244, 207, 0.06), transparent 25rem),
    radial-gradient(circle at 50% 78%, rgba(184, 131, 50, 0.08), transparent 18rem),
    #020202;
}

body.vote-confirmed .tasting-shell {
  display: none;
}

body.vote-confirmed .site-header {
  display: none;
}

.vote-thanks {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 244, 207, 0.06), transparent 24rem),
    linear-gradient(180deg, rgba(1, 4, 5, 0.86), rgba(0, 0, 0, 0.98));
  place-items: center;
}

.vote-thanks[hidden] {
  display: none;
}

.vote-thanks::before {
  position: absolute;
  inset: -18vmax;
  content: "";
  background:
    repeating-conic-gradient(from 20deg, rgba(240, 201, 108, 0.055) 0deg 8deg, transparent 8deg 20deg),
    radial-gradient(circle, transparent 0 24%, rgba(0, 0, 0, 0.82) 68%);
  filter: blur(18px);
  opacity: 0.5;
  animation: thanks-drift 30s linear infinite;
}

.vote-thanks-content {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  justify-items: center;
  text-align: center;
  transform: translateY(-1.2svh);
}

.vote-thanks-logo {
  display: block;
  width: min(220px, 42vw);
  max-height: min(58svh, 520px);
  height: auto;
  margin-bottom: clamp(0.75rem, 2.5vw, 1.2rem);
  filter:
    invert(1)
    drop-shadow(0 0 14px rgba(164, 244, 255, 0.18))
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.66));
  transform-origin: 50% 43%;
  animation: up-is-down-swing 2400ms cubic-bezier(0.44, 0, 0.18, 1) 260ms both;
  user-select: none;
}

.vote-thanks h2 {
  max-width: min(13ch, 100%);
  margin: 0.1rem 0 0;
  color: #fff0c4;
  font-size: clamp(2rem, 7vw, 3.9rem);
  line-height: 0.92;
  text-shadow:
    0 2px 0 rgba(111, 53, 29, 0.9),
    0 0 28px rgba(240, 201, 108, 0.2),
    0 18px 38px rgba(0, 0, 0, 0.72);
}

.vote-home-button {
  width: min(210px, 58vw);
  margin-top: clamp(0.9rem, 3vw, 1.35rem);
  font-size: clamp(0.62rem, 2.4vw, 0.76rem);
}

.tasting-hero {
  position: relative;
  display: grid;
  min-height: 58svh;
  overflow: hidden;
  place-items: center;
}

.tasting-hero.compact {
  min-height: 42svh;
}

.tasting-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 244, 207, 0.07), transparent 20rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.92));
}

.tasting-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(860px, calc(100vw - 32px));
  text-align: center;
  place-items: center;
}

.tasting-hero h1 {
  margin: 0.16em 0;
  color: #fff0c4;
  font-size: clamp(3.1rem, 10vw, 8.2rem);
  line-height: 0.9;
}

.tasting-hero h1.page-title {
  color: #030707;
}

.tier-results-title {
  display: grid;
  max-width: min(1100px, calc(100vw - 64px));
  gap: 0.02em;
  text-align: center;
  white-space: normal;
}

.tier-results-title span {
  display: block;
}

.tier-results-page .tasting-hero p:last-child {
  color: rgba(164, 244, 255, 0.84);
  text-shadow: 0 0 12px rgba(0, 199, 235, 0.34), 0 2px 10px rgba(0, 0, 0, 0.84);
}

.tasting-hero p:last-child {
  width: min(640px, 100%);
  margin: 0;
  color: rgba(245, 231, 200, 0.82);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.tasting-board {
  display: grid;
  gap: 1.2rem;
  padding: clamp(24px, 5vw, 64px);
}

.tasting-instructions,
.results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.results-toolbar:empty {
  display: none;
}

.tasting-instructions {
  align-items: start;
  flex-direction: column;
  max-width: 760px;
}

.tasting-instructions h2,
.results-toolbar h2 {
  margin: 0;
  color: #fff0c4;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.tasting-instructions p:last-child {
  margin: 0;
  color: rgba(245, 231, 200, 0.72);
  line-height: 1.65;
}

.tier-summary {
  display: grid;
  gap: 0.55rem;
}

.tier-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  min-height: 58px;
  overflow: hidden;
  background: rgba(6, 6, 6, 0.74);
  border: 1px solid rgba(245, 231, 200, 0.14);
  border-radius: 8px;
}

.tier-label {
  display: grid;
  color: #120904;
  background: linear-gradient(145deg, #ffe6a0, #c6943a);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  place-items: center;
}

.tier-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.6rem;
  color: rgba(245, 231, 200, 0.62);
}

.tier-pill {
  padding: 0.42rem 0.55rem;
  color: #fff0c4;
  background: rgba(245, 231, 200, 0.07);
  border: 1px solid rgba(245, 231, 200, 0.13);
  border-radius: 999px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cocktail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cocktail-card,
.taster-form,
.leader-card,
.submission-card {
  background: rgba(6, 6, 6, 0.78);
  border: 1px solid rgba(245, 231, 200, 0.15);
  border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(255, 244, 207, 0.035), 0 24px 52px rgba(0, 0, 0, 0.34);
}

.cocktail-card {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1rem, 2.5vw, 1.45rem);
}

.cocktail-card h3 {
  margin: 0;
  color: #fff0c4;
  font-size: 1.28rem;
}

.cocktail-card p {
  margin: 0;
  color: rgba(245, 231, 200, 0.7);
  line-height: 1.55;
}

.tier-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.tier-buttons button,
.taster-form button,
.results-toolbar button {
  min-height: 42px;
  color: #f5e7c8;
  cursor: pointer;
  background: rgba(245, 231, 200, 0.07);
  border: 1px solid rgba(245, 231, 200, 0.18);
  border-radius: 6px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.tier-buttons button.active,
.taster-form button {
  color: #130905;
  background: linear-gradient(145deg, #ffe6a0, #c6943a);
}

.taster-form {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1rem, 2.5vw, 1.45rem);
}

.taster-form label {
  display: grid;
  gap: 0.35rem;
  color: #f0c96c;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.taster-form input,
.taster-form textarea {
  width: 100%;
  padding: 0.78rem 0.82rem;
  color: #fff0c4;
  background: rgba(1, 7, 8, 0.82);
  border: 1px solid rgba(245, 231, 200, 0.2);
  border-radius: 6px;
}

.taster-form.is-locked {
  opacity: 0.72;
}

.taster-form.is-locked button {
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.save-status {
  min-height: 1.3em;
  margin: 0;
  color: rgba(245, 231, 200, 0.78);
}

.leaderboard,
.submission-log {
  display: grid;
  gap: 0.8rem;
}

.leader-card,
.submission-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.leader-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.leader-rank {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  color: #130905;
  background: linear-gradient(145deg, #ffe6a0, #c6943a);
  border-radius: 50%;
  font-weight: 900;
  place-items: center;
}

.leader-name,
.submission-card strong {
  color: #fff0c4;
  font-size: 1.05rem;
}

.leader-score {
  color: #f0c96c;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 900;
}

.tier-results-page .leader-card,
.tier-results-page .submission-card {
  color: #a4f4ff;
  background:
    radial-gradient(circle at 86% 0%, rgba(0, 221, 255, 0.12), transparent 9rem),
    linear-gradient(145deg, rgba(0, 13, 15, 0.9), rgba(6, 22, 23, 0.8)),
    url("../assets/parchment-background.webp");
  background-size: cover;
  border-color: rgba(128, 241, 255, 0.2);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.48),
    0 0 18px rgba(0, 184, 220, 0.08),
    0 18px 28px rgba(0, 0, 0, 0.34);
}

.tier-results-page .leader-rank {
  color: #031214;
  background: linear-gradient(145deg, #c9fbff, #55dceb);
  box-shadow: 0 0 16px rgba(0, 221, 255, 0.34);
}

.tier-results-page .leader-name,
.tier-results-page .submission-card strong,
.tier-results-page .leader-score {
  color: #a4f4ff;
  text-shadow: 0 0 10px rgba(0, 199, 235, 0.34);
}

.tier-results-page .submission-card small {
  color: rgba(164, 244, 255, 0.58);
}

@media (min-width: 721px) {
  .tier-results-page .tasting-shell {
    padding-top: 150px;
  }

  .tier-results-page .tasting-hero.compact {
    min-height: clamp(390px, 48svh, 540px);
  }
}

.submission-card small {
  color: rgba(245, 231, 200, 0.58);
}

.qr-panel {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: clamp(1rem, 4vw, 2rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(6, 6, 6, 0.78);
  border: 1px solid rgba(245, 231, 200, 0.15);
  border-radius: 8px;
}

.qr-code {
  width: min(260px, 100%);
  height: auto;
  padding: 12px;
  background: #f5e7c8;
  border-radius: 8px;
}

.qr-target {
  max-width: 100%;
  padding: 0.75rem 0.85rem;
  color: rgba(245, 231, 200, 0.78);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  background: rgba(2, 8, 9, 0.66);
  border: 1px solid rgba(245, 231, 200, 0.14);
  border-radius: 6px;
}

.qr-panel h2 {
  margin: 0.25rem 0 0.7rem;
  color: #fff0c4;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.qr-panel p {
  color: rgba(245, 231, 200, 0.76);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.hero-actions.left {
  justify-content: flex-start;
}

@keyframes up-is-down-swing {
  0% {
    opacity: 0;
    transform: translateY(18px) rotate(0deg) scale(0.92);
  }

  18% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }

  42% {
    transform: rotate(188deg) scale(1);
  }

  58% {
    transform: rotate(172deg);
  }

  73% {
    transform: rotate(183deg);
  }

  86% {
    transform: rotate(178deg);
  }

  100% {
    opacity: 1;
    transform: rotate(180deg);
  }
}

@keyframes thanks-drift {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .tasting-shell {
    padding-top: max(142px, calc(env(safe-area-inset-top) + 132px));
  }

  .vote-thanks-content {
    width: min(390px, calc(100vw - 28px));
    max-height: calc(100svh - 28px);
  }

  .vote-thanks-logo {
    width: min(170px, 46vw);
    max-height: 50svh;
    margin-bottom: 0.75rem;
  }

  .vote-thanks h2 {
    max-width: 11ch;
    font-size: clamp(1.85rem, 11vw, 3.2rem);
  }

  .vote-home-button {
    width: min(190px, 64vw);
    margin-top: 0.7rem;
  }

  .tasting-hero {
    min-height: 38svh;
  }

  .tasting-hero.compact {
    min-height: 32svh;
  }

  .tasting-hero h1 {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .tasting-hero h1.tier-results-title {
    width: calc(100vw - 28px);
    max-width: 12ch;
    font-size: clamp(2.25rem, 11.5vw, 3.75rem);
    line-height: 0.9;
  }

  .tasting-hero p:last-child {
    width: min(31rem, calc(100vw - 34px));
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .tasting-board {
    padding: 22px 14px;
  }

  .cocktail-list {
    grid-template-columns: 1fr;
  }

  .tier-row {
    grid-template-columns: 42px 1fr;
    gap: 0.58rem;
  }

  .tier-buttons {
    gap: 0.28rem;
  }

  .tier-buttons button,
  .remove-rank {
    min-height: 38px;
    padding-inline: 0.45rem;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .leader-card {
    grid-template-columns: auto 1fr;
  }

  .leader-score {
    grid-column: 2;
  }

  .qr-panel {
    grid-template-columns: 1fr;
  }

  .qr-code {
    justify-self: center;
  }
}
