:root {
  color-scheme: light;
  --bg: #fffaf2;
  --surface: #ffffff;
  --ink: #202124;
  --muted: #68615a;
  --line: #e6dbcf;
  --red: #d94235;
  --green: #157a5b;
  --yellow: #f7c948;
  --blue: #2a63d4;
  --shadow: 0 18px 45px rgba(78, 47, 23, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.82), rgba(255, 250, 242, 1)),
    radial-gradient(circle at 20% 0%, rgba(247, 201, 72, 0.22), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(21, 122, 91, 0.16), transparent 32%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body[data-theme="mint"] {
  --bg: #f2fff8;
  --surface: #ffffff;
  --ink: #163329;
  --muted: #4e6a5f;
  --line: #cfe7dc;
  --red: #cf3e4f;
  --green: #0f8a60;
  --yellow: #f3d35f;
  --blue: #1d73c9;
  background:
    linear-gradient(180deg, rgba(242, 255, 248, 0.88), rgba(242, 255, 248, 1)),
    radial-gradient(circle at 18% 0%, rgba(15, 138, 96, 0.2), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(29, 115, 201, 0.14), transparent 32%);
}

body[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #1f2937;
  --ink: #f8fafc;
  --muted: #d7e0ee;
  --line: #4b5d73;
  --red: #fb7185;
  --green: #34d399;
  --yellow: #facc15;
  --blue: #60a5fa;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 1)),
    radial-gradient(circle at 20% 0%, rgba(96, 165, 250, 0.16), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(52, 211, 153, 0.12), transparent 32%);
}

body.welcome-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 250, 242, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

body[data-theme="mint"] .site-header {
  background: rgba(242, 255, 248, 0.9);
}

body[data-theme="midnight"] .site-header {
  background: rgba(17, 24, 39, 0.9);
}

body[data-theme="midnight"] input {
  color: var(--ink);
  background: #0f172a;
  border-color: var(--line);
}

body[data-theme="midnight"] input::placeholder {
  color: #94a3b8;
}

body[data-theme="midnight"] .main-nav a:hover,
body[data-theme="midnight"] .cart-pill,
body[data-theme="midnight"] .secondary,
body[data-theme="midnight"] .filter-button,
body[data-theme="midnight"] .google-button,
body[data-theme="midnight"] .icon-button {
  color: var(--ink);
  background: #0f172a;
}

body[data-theme="midnight"] .hero-copy,
body[data-theme="midnight"] .hero-panel,
body[data-theme="midnight"] .side-panel,
body[data-theme="midnight"] .game-card,
body[data-theme="midnight"] .product-card,
body[data-theme="midnight"] .reward-item,
body[data-theme="midnight"] .admin-grid > div,
body[data-theme="midnight"] .play-panel,
body[data-theme="midnight"] .login-card,
body[data-theme="midnight"] .welcome-form,
body[data-theme="midnight"] .cart-line,
body[data-theme="midnight"] .order-item,
body[data-theme="midnight"] .timing-card,
body[data-theme="midnight"] .inventory-item {
  color: var(--ink);
  background: var(--surface);
}

body[data-theme="midnight"] .stat-grid div,
body[data-theme="midnight"] .dashboard-list div,
body[data-theme="midnight"] .empty-state,
body[data-theme="midnight"] .stack-tower,
body[data-theme="midnight"] .ingredient-clue,
body[data-theme="midnight"] .score-row span,
body[data-theme="midnight"] .wordle-row span,
body[data-theme="midnight"] .qty-controls button,
body[data-theme="midnight"] .settings-promo,
body[data-theme="midnight"] .tag {
  color: var(--ink);
  background: #0f172a;
  border-color: var(--line);
}

body[data-theme="midnight"] .xp-card,
body[data-theme="midnight"] .wordle-art {
  color: var(--ink);
  background: #10251f;
  border-color: #256b55;
}

body[data-theme="midnight"] .xp-card div:first-child,
body[data-theme="midnight"] .xp-card span {
  color: #a7f3d0;
}

body[data-theme="midnight"] .xp-track,
body[data-theme="midnight"] .pass-progress,
body[data-theme="midnight"] .timing-bar {
  background: #020617;
  border-color: var(--line);
}

body[data-theme="midnight"] .pass-reward,
body[data-theme="midnight"] .promo-form {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

body[data-theme="midnight"] .promo-status {
  color: var(--muted);
}

body[data-theme="midnight"] .product-art svg {
  filter: drop-shadow(8px 10px 0 rgba(0, 0, 0, 0.35));
}

.guest-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px clamp(16px, 4vw, 48px);
  color: #fff;
  background: #202124;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 850;
  text-align: center;
}

.guest-bar.hidden {
  display: none;
}

.guest-bar .button {
  min-height: 36px;
  white-space: nowrap;
}

.guest-bar:not(.hidden) + .site-header {
  top: 57px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--yellow);
}

.brand small,
.profile-mini span,
.profile-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(32, 33, 36, 0.92), rgba(44, 64, 54, 0.9)),
    radial-gradient(circle at 18% 20%, rgba(247, 201, 72, 0.4), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(217, 66, 53, 0.34), transparent 30%);
}

.welcome-screen.hidden {
  display: none;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  gap: 22px;
  width: min(1060px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: clamp(18px, 4vw, 34px);
  background: #fffaf2;
  border: 1px solid #f0dfcc;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.welcome-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-copy h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 4.25rem);
}

.welcome-copy p:not(.eyebrow) {
  max-width: 620px;
  color: #423d39;
  font-size: 1.06rem;
}

.welcome-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.welcome-preview span {
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
}

.welcome-actions {
  display: grid;
  gap: 12px;
  align-content: center;
}

.welcome-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.welcome-form h2 {
  font-size: 1.2rem;
}

.welcome-form label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.welcome-peek {
  justify-self: center;
  color: var(--ink);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 750;
}

.main-nav a:hover,
.cart-pill {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.cart-pill span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 4px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.78rem;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 86px);
  padding: 52px 0 34px;
}

.hero-copy,
.hero-panel,
.side-panel,
.game-card,
.product-card,
.reward-item,
.admin-grid > div {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  position: relative;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -78px;
  bottom: -84px;
  width: min(42%, 280px);
  aspect-ratio: 1;
  background:
    linear-gradient(135deg, rgba(217, 66, 53, 0.96), rgba(247, 201, 72, 0.95)),
    url("data:image/svg+xml,%3Csvg width='240' height='240' viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23202124' stroke-width='8'%3E%3Cpath d='M52 63h136l-13 122H65z' fill='%23fffaf2'/%3E%3Cpath d='M76 63c3-19 18-30 44-30s41 11 44 30'/%3E%3Cpath d='M83 105h74M88 139h64'/%3E%3C/g%3E%3C/svg%3E") center / 74% no-repeat;
  border: 4px solid var(--ink);
  border-radius: 8px;
  transform: rotate(-5deg);
  z-index: 0;
  opacity: 0.22;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 670px;
  margin-bottom: 24px;
  color: #423d39;
  font-size: 1.08rem;
}

.hero-actions,
.filter-row,
.shop-actions,
.auth-actions,
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.filter-button,
.icon-button,
.link-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary {
  color: #fff;
  background: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
}

.secondary,
.filter-button,
.google-button,
.icon-button {
  background: #fff;
}

.google-button {
  color: var(--ink);
  border-color: #c9d2df;
}

.google-button::before {
  content: "G";
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 950;
}

.filter-button.active {
  color: #fff;
  background: var(--ink);
}

.full {
  width: 100%;
}

.hero-panel {
  align-self: center;
  padding: 22px;
}

.profile-mini,
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 950;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.stat-grid div,
.dashboard-list div {
  padding: 14px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-grid span,
.dashboard-list strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 950;
}

.stat-grid small,
.dashboard-list span,
.microcopy {
  color: var(--muted);
  font-size: 0.86rem;
}

.xp-card {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  padding: 14px;
  background: #e9f5ef;
  border: 1px solid #b9ddce;
  border-radius: 8px;
}

.xp-card div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 900;
}

.xp-card span {
  color: #3d6f60;
}

.xp-track {
  height: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #b9ddce;
  border-radius: 999px;
}

.xp-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 220ms ease;
}

.account-xp {
  margin: 0 0 18px;
}

.name-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.name-tag.green {
  background: var(--green);
}

.name-tag.red {
  background: var(--red);
}

.name-tag.blue {
  background: var(--blue);
}

.name-tag.gold {
  color: var(--ink);
  background: var(--yellow);
}

.login-card {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.auth-actions {
  margin-top: 12px;
}

.login-card label,
.account-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section {
  padding: 46px 0;
  scroll-margin-top: 88px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading a {
  color: var(--red);
  font-weight: 900;
}

.section-heading.tight {
  margin-bottom: 12px;
}

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

.product-grid.dense {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-actions {
  justify-content: center;
  margin-top: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.product-art {
  display: grid;
  min-height: 170px;
  place-items: center;
  background: var(--art-bg, #f8d66d);
  border-bottom: 1px solid var(--line);
}

.product-art svg {
  width: 74%;
  max-width: 210px;
  filter: drop-shadow(8px 10px 0 rgba(32, 33, 36, 0.16));
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 8px;
  background: #f5eee4;
  border-radius: 999px;
  color: #574d45;
  font-size: 0.78rem;
  font-weight: 850;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.price {
  font-size: 1.2rem;
  font-weight: 950;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 92px;
  padding: 18px;
}

.cart-items,
.order-list,
.reward-list,
.match-log {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: #fff7e6;
  border: 1px dashed #d8c5ae;
  border-radius: 8px;
}

.cart-line,
.order-item,
.reward-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e6;
  cursor: pointer;
  font-weight: 950;
}

.cart-summary {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.cart-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cart-summary dt {
  color: var(--muted);
}

.cart-summary dd {
  margin: 0;
  font-weight: 900;
}

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

.game-card {
  padding: 18px;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
}

.hidden {
  display: none !important;
}

.extra-games {
  margin-top: 16px;
}

.game-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 120px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wordle-art {
  background: #e9f5ef;
}

.wordle-art span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 950;
}

.trivia-art {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #853bce);
  font-size: 1.4rem;
  font-weight: 950;
}

.trivia-art span {
  padding: 8px 10px;
  border: 2px solid #fff;
  border-radius: 8px;
}

.stack-art,
.match-art,
.dash-art,
.guess-art,
.cart-art,
.ingredient-art {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 950;
}

.stack-art {
  background: linear-gradient(135deg, #157a5b, #f7c948);
}

.match-art {
  background: linear-gradient(135deg, #d94235, #f8b4d9);
}

.dash-art {
  background: linear-gradient(135deg, #2a63d4, #157a5b);
}

.guess-art {
  background: linear-gradient(135deg, #853bce, #2a63d4);
}

.cart-art {
  background: linear-gradient(135deg, #202124, #d94235);
}

.ingredient-art {
  background: linear-gradient(135deg, #ef9d66, #157a5b);
}

.stack-art span,
.match-art span,
.dash-art span,
.guess-art span,
.cart-art span,
.ingredient-art span {
  padding: 8px 10px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
}

.status-card {
  background: #202124;
  color: #fff;
}

.status-card p,
.status-card .link-button {
  color: #f8efe3;
}

.versus-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.versus-card > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.versus-card small {
  color: #f8efe3;
}

.play-panel {
  margin-top: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.play-panel.hidden {
  display: none;
}

.play-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.wordle-board {
  display: grid;
  gap: 8px;
  max-width: 360px;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.wordle-row span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: #f5eee4;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 950;
}

.wordle-row .correct {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.wordle-row .present {
  background: var(--yellow);
  border-color: #c89b23;
}

.wordle-row .missing {
  color: #fff;
  background: #77706a;
  border-color: #77706a;
}

.game-form,
.trivia-board {
  display: grid;
  gap: 12px;
}

.game-form {
  max-width: 520px;
  margin-top: 16px;
}

.game-form label,
.trivia-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.score-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.score-row span {
  padding: 8px 10px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #423d39;
  font-weight: 850;
}

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

.game-message {
  margin: 0;
  color: var(--green);
  font-weight: 850;
}

.mini-game {
  display: grid;
  gap: 14px;
}

.stack-tower {
  display: flex;
  min-height: 150px;
  align-items: flex-end;
  gap: 5px;
  padding: 12px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stack-tower span {
  width: 34px;
  height: 26px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 5px;
  transform: rotate(-2deg);
}

.stack-tower span:nth-child(2n) {
  background: var(--red);
  transform: rotate(3deg);
}

.stack-timing-grid {
  display: grid;
  gap: 12px;
}

.timing-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timing-card div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.timing-card strong {
  font-weight: 950;
}

.timing-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.timing-bar {
  position: relative;
  height: 28px;
  overflow: hidden;
  background: #f5efe4;
  border: 2px solid var(--ink);
  border-radius: 8px;
}

.timing-target {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(26, 31, 36, 0.12);
}

.timing-target.steady {
  background: #67c587;
}

.timing-target.risky {
  background: #f7c948;
}

.timing-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--red);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  animation: stackSweep var(--timing-speed, 1700ms) linear infinite;
}

@keyframes stackSweep {
  0% {
    left: 0;
  }

  50% {
    left: calc(100% - 4px);
  }

  100% {
    left: 0;
  }
}

.ingredient-clue {
  width: fit-content;
  padding: 10px 14px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 950;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
}

.confetti.hidden {
  display: none;
}

.confetti span {
  position: absolute;
  left: var(--left);
  top: -24px;
  width: 10px;
  height: 18px;
  background: var(--color);
  border-radius: 3px;
  animation: confetti-fall 1.7s ease-in forwards;
  animation-delay: var(--delay);
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(520deg);
    opacity: 0;
  }
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
}

.safety-chip {
  padding: 8px 10px;
  color: var(--green);
  background: #e9f5ef;
  border: 1px solid #b9ddce;
  border-radius: 999px;
  font-weight: 900;
}

.reward-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.reward-item.locked {
  opacity: 0.7;
}

.reward-cost {
  color: var(--red);
  font-weight: 950;
}

.dashboard-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.inventory-card {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inventory-list {
  display: grid;
  gap: 12px;
}

.inventory-group {
  display: grid;
  gap: 8px;
}

.inventory-group h4 {
  margin: 0;
}

.name-tag-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.name-tag-option.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 122, 91, 0.14);
}

.name-tag-option small {
  color: var(--muted);
  font-weight: 900;
}

.inventory-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inventory-item span {
  color: var(--green);
  font-weight: 900;
}

.inventory-item small {
  color: var(--muted);
}

.account-tools {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-form {
  display: grid;
  gap: 6px;
}

.account-form h3 {
  margin-bottom: 0;
}

.settings-section {
  scroll-margin-top: 88px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 16px;
}

.settings-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-panel h3 {
  margin: 0;
}

.avatar-picker,
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.avatar-option,
.theme-option {
  min-height: 48px;
  padding: 8px;
  color: var(--ink);
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 950;
  cursor: pointer;
}

body[data-theme="midnight"] .avatar-option,
body[data-theme="midnight"] .theme-option {
  background: #0f172a;
}

.avatar-option {
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.avatar-option.selected,
.theme-option.selected,
.settings-promo.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(21, 122, 91, 0.22);
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.theme-swatch.classic {
  background: linear-gradient(135deg, #fffaf2 50%, #f7c948 50%);
}

.theme-swatch.mint {
  background: linear-gradient(135deg, #f2fff8 50%, #0f8a60 50%);
}

.theme-swatch.midnight {
  background: linear-gradient(135deg, #111827 50%, #60a5fa 50%);
}

.settings-promo-list {
  display: grid;
  gap: 10px;
}

.settings-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #fff7e6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

body[data-theme="midnight"] .settings-promo {
  background: #0f172a;
}

.settings-promo div {
  display: grid;
  gap: 2px;
}

.settings-promo span,
.settings-promo small {
  color: var(--muted);
}

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

.pass-section {
  scroll-margin-top: 88px;
}

.pass-shell {
  padding: 18px;
  background: #202124;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.pass-bar {
  position: relative;
  display: grid;
  gap: 12px;
}

.pass-progress {
  height: 18px;
  overflow: hidden;
  background: #fffaf2;
  border: 2px solid #fff;
  border-radius: 999px;
}

.pass-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
}

.pass-bar input[type="range"] {
  width: 100%;
  accent-color: var(--yellow);
  cursor: grab;
}

.pass-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.pass-summary span {
  color: #f8efe3;
}

.pass-rewards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pass-reward {
  min-height: 132px;
  padding: 14px;
  background: #fffaf2;
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 8px;
}

.pass-reward span,
.pass-reward small {
  color: var(--green);
  font-weight: 900;
}

.pass-reward.locked {
  opacity: 0.62;
}

.pass-reward.selected {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.28);
}

.admin-grid > div {
  padding: 18px;
}

.promo-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 22px;
  align-items: center;
  margin-bottom: 36px;
  padding: 24px;
  background: #202124;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.promo-section .eyebrow {
  color: #8bd8b8;
}

.promo-copy p {
  max-width: 680px;
  color: #f4eadf;
}

.promo-form {
  padding: 16px;
  background: #fffaf2;
  color: var(--ink);
  border: 1px solid #f4eadf;
  border-radius: 8px;
}

.promo-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

.promo-status {
  margin: 12px 0 6px;
  color: #4d463f;
  font-size: 0.92rem;
}

.promo-form .link-button:disabled {
  color: #938980;
  cursor: not-allowed;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: min(380px, calc(100% - 32px));
  padding: 14px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 33, 36, 0.62);
}

.detail-modal.hidden {
  display: none;
}

.detail-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-card ul {
  margin: 0;
  padding-left: 20px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.nutrition-grid div {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nutrition-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: capitalize;
}

.nutrition-grid strong {
  display: block;
  margin-top: 4px;
}

body[data-theme="midnight"] .detail-card {
  color: var(--ink);
  background: #111827;
  border-color: var(--line);
}

body[data-theme="midnight"] .detail-card h2,
body[data-theme="midnight"] .detail-card h3,
body[data-theme="midnight"] #detailDescription,
body[data-theme="midnight"] #detailExpiry,
body[data-theme="midnight"] #detailIngredients {
  color: var(--ink);
}

body[data-theme="midnight"] .detail-card .section-heading {
  border-bottom-color: var(--line);
}

body[data-theme="midnight"] .nutrition-grid div {
  color: var(--ink);
  background: #0f172a;
  border-color: var(--line);
}

body[data-theme="midnight"] .nutrition-grid span {
  color: #d7e0ee;
}

@media (max-width: 920px) {
  .site-header,
  .guest-bar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .hero,
  .welcome-card,
  .split-section,
  .promo-section,
  .game-grid,
  .settings-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy::after {
    width: 190px;
    opacity: 0.42;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    padding-top: 24px;
  }

  .hero-copy,
  .hero-panel,
  .side-panel,
  .game-card,
  .product-body {
    padding: 16px;
  }

  .product-grid,
  .product-grid.dense {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .nutrition-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .avatar-picker,
  .theme-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-promo {
    align-items: stretch;
    flex-direction: column;
  }

  .wordle-art span {
    width: 34px;
    height: 34px;
  }
}
