:root {
  color-scheme: dark;
  --bg: #04150c;
  --felt: #063f1d;
  --felt2: #0a5a28;
  --panel: #222220;
  --panel2: #30302d;
  --gold: #ffe47a;
  --gold2: #ffc232;
  --red: #d91f3c;
  --red2: #ff3f63;
  --cream: #fff5c7;
  --muted: #b8bfac;
  --line: rgba(255, 228, 122, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0e0f0d;
  color: white;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 0;
}

.phone {
  position: relative;
  overflow: hidden;
  width: min(100vw, 430px);
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(20, 145, 60, 0.6), transparent 34%),
    linear-gradient(180deg, #062d17 0%, #03120b 72%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 20px 80px rgba(0,0,0,.5);
}

.phone::before {
  position: absolute;
  inset: 46px 0 70px;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
}

.game-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 14px;
  background: #171716;
  border-bottom: 1px solid rgba(255, 228, 122, .18);
}

.logo {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 2px 0 #6b3b06;
}

.home-word {
  min-width: 54px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #f2ead0;
  font-size: 11px;
  font-weight: 1000;
}

.top-link {
  display: grid;
  min-width: 46px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 228, 122, .36);
  border-radius: 999px;
  background: rgba(255, 228, 122, .08);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 48px);
  padding: 14px 18px 32px;
}

.floating-badge {
  width: fit-content;
  margin: 2px auto 10px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.hero-card {
  position: relative;
  overflow: hidden;
  height: 150px;
  border: 2px solid rgba(255,228,122,.7);
  border-radius: 9px;
  background: #0b0d0b;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.home-hero {
  height: 164px;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  background: #07130c;
}

.hero-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 18%, rgba(0,0,0,.75));
  content: "";
}

.hero-card h1 {
  position: absolute;
  right: 12px;
  bottom: 16px;
  left: 12px;
  z-index: 2;
  margin: 0;
  color: white;
  font-size: 20px;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 0 #000;
}

.event-chip {
  position: absolute;
  z-index: 2;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 950;
}

.headline {
  padding: 14px 8px 12px;
  text-align: center;
}

.headline h2, .unlock-stage h1, .gift-card h1 {
  margin: 0 0 8px;
  color: var(--cream);
  font-size: 24px;
  line-height: 1.04;
  font-weight: 1000;
  text-shadow: 0 3px 0 #08210f;
}

.headline p, .gift-card p, .unlock-stage p {
  margin: 0;
  color: #d8e0c8;
  font-size: 13px;
  line-height: 1.35;
}

.headline b { color: var(--gold); }
.headline em {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff29b, var(--gold2));
  color: #392b02;
  font-style: normal;
  text-shadow: none;
}
.single-line-title {
  font-size: 21px !important;
  white-space: nowrap;
}
.headline.compact { padding-top: 6px; }
.headline.invite { padding-top: 44px; }

.home-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 2px;
}

.home-summary div {
  display: grid;
  min-height: 82px;
  place-items: center;
  border: 1px solid rgba(255, 228, 122, .24);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
}

.home-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.home-summary strong {
  color: var(--gold);
  font-size: 38px;
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 3px 0 #4b2b00;
}

.home-summary small {
  color: var(--cream);
  font-size: 16px;
}

.home-progress {
  margin-top: 8px;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.letter-grid-big {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0 24px;
}

.letter-card {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 58px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.1);
}

.letter-grid-big .letter-card { min-height: 92px; }

.letter-card span {
  color: rgba(255,255,255,.28);
  font-size: 22px;
  font-weight: 1000;
}

.letter-grid-big .letter-card span { font-size: 34px; }

.letter-card small {
  color: rgba(255,255,255,.25);
  font-size: 8px;
  font-weight: 900;
}

.letter-card.on {
  border-color: #fff2a8;
  background: linear-gradient(180deg, #fff29b, #ffd45a);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.22), 0 10px 20px rgba(255,194,50,.22);
  animation: unlockPulse .45s ease both;
}

.letter-card.on span { color: #392b02; text-shadow: 0 2px 0 rgba(255,255,255,.35); }
.letter-card.on small { color: rgba(57,43,2,.62); }

@keyframes unlockPulse {
  from { transform: scale(.94); filter: brightness(.85); }
  to { transform: scale(1); filter: brightness(1); }
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.btn {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 12px 14px;
  border-radius: 8px;
  background: #2c2d29;
  color: white;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
}

.btn.gold {
  background: linear-gradient(180deg, #ffea91, var(--gold2));
  color: #3d2a00;
  box-shadow: 0 7px 0 #b57908;
}

.btn.red {
  background: linear-gradient(180deg, var(--red2), var(--red));
  box-shadow: 0 7px 0 #7d0f21;
}

.combine-cta {
  min-height: 60px;
  font-size: 16px;
  letter-spacing: .2px;
  animation: combinePulse 1.1s ease-in-out infinite alternate;
}

.combine-cta:disabled {
  animation: none;
}

.combine-cta.locked-combine {
  animation: none;
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.6);
  box-shadow: none;
}

@keyframes combinePulse {
  from { box-shadow: 0 7px 0 #7d0f21, 0 0 0 rgba(255,63,99,0); }
  to { box-shadow: 0 7px 0 #7d0f21, 0 0 24px rgba(255,63,99,.42); }
}

.btn.dark {
  border: 1px solid rgba(255,228,122,.3);
  background: #2b2d28;
  color: var(--gold);
}

.btn.helper {
  min-height: 42px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,228,122,.4);
  background: rgba(255,228,122,.12);
  color: var(--gold);
  box-shadow: none;
}

.btn.outline {
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: #d9dfcf;
}

.btn.qa {
  border: 1px dashed rgba(255,228,122,.55);
  background: rgba(255,228,122,.09);
  color: var(--gold);
}

.btn.small { min-height: 46px; font-size: 11px; }
.btn:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .45; box-shadow: none; }

.action-hint {
  margin: -2px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.collection-panel, .admin-grid, .gift-card {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(31, 32, 29, .88);
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 950;
}

.progress {
  overflow: hidden;
  height: 8px;
  margin: 8px 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #fff4ad);
}

.challenge-head {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 6px 0 8px;
}

.goal-pill {
  display: grid;
  min-width: 210px;
  padding: 10px 18px;
  border: 1px solid rgba(255,228,122,.5);
  border-radius: 999px;
  background: rgba(23,23,22,.8);
  box-shadow: 0 0 18px rgba(255,228,122,.22);
  text-align: center;
}

.goal-pill small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.goal-pill b { font-size: 13px; }

.step-card {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  text-align: center;
}

.compact-step {
  padding: 8px 12px;
}

.compact-step b {
  font-size: 18px;
}

.step-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.step-card b {
  color: var(--cream);
  font-size: 18px;
  font-weight: 1000;
}

.step-card p {
  margin: 6px auto 0;
  max-width: 300px;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  line-height: 1.35;
}

.step-meter {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  margin-top: 10px;
}

.step-meter i {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}

.step-meter i.done {
  background: var(--gold);
}

.step-meter i.now {
  background: var(--red2);
  box-shadow: 0 0 14px rgba(255, 63, 99, .45);
}

.challenge-tools {
  display: flex;
  gap: 14px;
}

.challenge-tools button {
  background: transparent;
  color: #d7dac8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.table-zone {
  position: relative;
  display: grid;
  min-height: 405px;
  place-items: center;
  padding-bottom: 20px;
}

.quiz-table {
  display: grid;
  gap: 8px;
  min-height: auto;
  align-content: center;
  padding: 4px 0;
}

.three-player-table {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.seat {
  display: grid;
  min-height: auto;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  text-align: center;
}

.seat small,
.quiz-zone small {
  color: var(--gold);
  font-size: 9px;
  font-weight: 1000;
  text-transform: uppercase;
}

.seat b {
  color: rgba(255,255,255,.78);
  font-size: 10px;
}

.seat em {
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.table-center {
  background: rgba(255,228,122,.08);
}

.player-hand-zone {
  grid-column: auto;
  padding: 8px 6px;
  border: 1px solid rgba(255,228,122,.18);
  border-radius: 10px;
  background: rgba(255,228,122,.06);
}

.unknown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.unknown-row span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,228,122,.16);
  color: var(--gold);
  font-size: 11px;
  font-weight: 1000;
}

.card-back {
  display: inline-block;
  position: relative;
  width: 42px;
  height: 58px;
  border: 1px solid rgba(255,228,122,.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(135deg, transparent 75%, rgba(255,255,255,.08) 75%) 0 0 / 8px 8px,
    #173621;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.18);
}

.card-back em {
  position: absolute;
  right: 3px;
  bottom: 4px;
  left: 3px;
  color: rgba(255,255,255,.62);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.discard-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mini-cards .playing-card,
.discard-row .playing-card {
  width: 42px;
  height: 58px;
}

.mini-cards .playing-card b,
.discard-row .playing-card b {
  font-size: 15px;
}

.mini-cards .playing-card i,
.discard-row .playing-card i {
  font-size: 20px;
}

.quiz-zone {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.inline-hand {
  padding-bottom: 4px;
}

.answer-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 228, 122, .24);
  border-radius: 12px;
  background: rgba(0, 0, 0, .26);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
}

.choice-title {
  color: var(--gold);
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.choice-grid {
  display: grid;
  gap: 9px;
}

.choice-btn {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: #262923;
  color: white;
  font-size: 13px;
  font-weight: 950;
}

.choice-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.choice-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.choice-part {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.choice-part b {
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
}

.choice-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
}

.mini-face {
  display: inline-grid;
  min-width: 31px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  background: #fffaf0;
  color: #161616;
  font-style: normal;
  font-weight: 1000;
  font-size: 12px;
}

.mini-face.red {
  color: #e92345;
}

.choice-btn:active {
  transform: translateY(2px);
}

.pick-zone, .meld-area {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.pick-zone em {
  color: white;
  font-size: 10px;
  font-style: normal;
  text-transform: none;
}

.live-zone {
  animation: glowZone 1.3s ease-in-out infinite alternate;
}

@keyframes glowZone {
  from { filter: drop-shadow(0 0 0 rgba(255, 228, 122, 0)); transform: translateY(0); }
  to { filter: drop-shadow(0 0 18px rgba(255, 228, 122, .55)); transform: translateY(-2px); }
}

.hint {
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.24);
  color: rgba(255,255,255,.62);
  font-size: 11px;
  text-align: center;
}

.action-log {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.action-log span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.76);
  font-size: 10px;
  font-weight: 800;
}

.hand-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  width: min(100vw, 430px);
  margin: 0 auto;
  padding: 10px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.8) 18%);
}

.hand-label {
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-align: right;
  text-transform: uppercase;
}

.hand-cards, .mini-cards {
  display: flex;
  justify-content: center;
  gap: 0;
}

.hand-cards .playing-card { margin-left: -9px; }
.hand-cards .playing-card:first-child { margin-left: 0; }

.playing-card {
  display: grid;
  width: 52px;
  height: 72px;
  place-items: center;
  grid-template-rows: 1fr 1fr;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 7px;
  background: #fffaf0;
  color: #151515;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  animation: cardIn .28s ease both;
}

.playing-card.black { color: #151515; }
.playing-card b {
  display: block;
  color: currentColor !important;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  opacity: 1 !important;
  text-shadow: none;
}
.playing-card i {
  display: block;
  color: currentColor !important;
  font-size: 24px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  opacity: 1 !important;
  text-shadow: none;
}
.playing-card.red { color: #e92345; }
.playing-card.selected { transform: translateY(-10px); outline: 3px solid var(--gold); }
.playing-card.used { opacity: .32; }
.playing-card.target {
  outline: 3px solid var(--gold);
  box-shadow: 0 8px 18px rgba(0,0,0,.25), 0 0 24px rgba(255,228,122,.5);
}

@keyframes cardIn {
  from { transform: translateY(12px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast, .success-note {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.toast {
  border: 1px solid rgba(255,63,99,.38);
  background: rgba(217,31,60,.18);
  color: #ffd7de;
}

.modal-backdrop {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.68);
}

.modal-card {
  display: grid;
  width: min(100%, 360px);
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255,228,122,.38);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(35,37,31,.98), rgba(17,28,20,.98));
  box-shadow: 0 20px 55px rgba(0,0,0,.56);
  text-align: center;
}

.modal-card h2 {
  margin: 0;
  color: var(--gold);
  font-size: 20px;
  line-height: 1.1;
}

.modal-card p {
  margin: 0;
  color: white;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.42;
}

.modal-card small {
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 850;
}

.success-note {
  border: 1px solid rgba(255,228,122,.4);
  background: rgba(255,228,122,.13);
  color: var(--cream);
}

.unlock-stage {
  display: grid;
  justify-items: center;
  padding: 24px 8px 14px;
  text-align: center;
}

.big-unlock {
  display: grid;
  width: 122px;
  height: 160px;
  margin-top: 18px;
  place-items: center;
  border: 3px solid var(--gold);
  border-radius: 9px;
  background: rgba(255,228,122,.13);
  color: var(--gold);
  font-size: 74px;
  font-weight: 1000;
  text-shadow: 0 4px 0 #111;
  animation: pop .5s ease both;
}

@keyframes pop {
  from { transform: scale(.72) rotate(-4deg); opacity: .2; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.gift-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 32px;
  padding: 24px 18px;
  text-align: center;
}

.gift-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: #38a45d;
  color: white;
  font-size: 28px;
}

.gift-card small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.gift-code {
  width: 100%;
  padding: 18px 12px;
  border: 1px dashed var(--gold2);
  border-radius: 10px;
  background: #090909;
  color: white;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 1000;
  letter-spacing: .5px;
}

.gift-actions {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reward-note {
  max-width: 280px;
  color: var(--cream) !important;
  font-weight: 850;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(0,0,0,.25);
  color: white;
}

.admin-grid {
  display: grid;
  gap: 10px;
}
