/* Dumbest Ways to Win — v0.2 visual pass.
 * Stage language mined from the Ad Strategy artifacts: deep plum stage
 * (#2b1832), gold type, the real title band and the real printed cards.
 * Print ratio of the cards is 544x741 (about 0.734). */
:root {
  --plum: #2b1832;
  --plum-deep: #1c0f22;
  --gold: #fbdb65;
  --orange: #ff8200;
  --cream: #f3ead9;
  --muted: #c9b8d9;
  --card-w: min(74vw, 300px);
}
* { box-sizing: border-box; }
html { background: var(--plum-deep); }
body {
  margin: 0;
  color: var(--cream);
  font-family: Georgia, 'Times New Roman', serif;
  background:
    radial-gradient(ellipse 120% 55% at 50% -8%, rgba(251, 219, 101, .14), transparent 60%),
    radial-gradient(ellipse 90% 50% at 50% 115%, rgba(125, 85, 199, .20), transparent 65%),
    linear-gradient(180deg, var(--plum) 0%, var(--plum-deep) 100%);
  min-height: 100vh;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage { max-width: 680px; margin: 0 auto; padding: 22px 16px 42px; text-align: center; }

/* ---- header ---- */
.titleband {
  width: min(100%, 560px); height: auto; display: block; margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 0 1px rgba(251, 219, 101, .25);
}
.tagline { color: var(--gold); font-style: italic; font-size: 1.3rem; margin: 16px 0 8px; }
.sub { color: var(--muted); line-height: 1.5; margin: 0 auto; max-width: 48ch; }

/* ---- the pile ---- */
.pile { margin-top: 26px; }
.cardzone {
  position: relative;
  width: var(--card-w);
  aspect-ratio: 544 / 741;
  margin: 0 auto;
  perspective: 1400px;
}
.stack {
  position: absolute; inset: 0;
  border-radius: 16px;
  background-image: url('assets/card-back.jpg');
  background-size: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
}
.stack-1 { transform: rotate(-2.2deg) translate(-5px, 3px); filter: brightness(.82); }
.stack-2 { transform: rotate(1.8deg) translate(6px, 6px); filter: brightness(.62); }
.flipper {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .58s cubic-bezier(.2, .7, .3, 1.15);
}
.flipper.flipped { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .35);
  background: #fdfdf8;
}
.face img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.backface { background: #27418f; }
.frontface { transform: rotateY(180deg); }
.pile-badge {
  position: absolute; right: 10px; bottom: 10px;
  background: var(--gold); color: #2b1832;
  font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: .95rem;
  min-width: 2.3em; padding: .28em .45em; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.status { color: var(--cream); font-style: italic; margin: 18px 0 0; min-height: 1.4em; }
.wild { margin: 12px auto 0; max-width: 480px; background: #7d55c7; color: #fff; border-radius: 10px; padding: 8px 12px; }
.wild-label { font-weight: bold; margin-right: 8px; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.controls { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
button.draw {
  background: linear-gradient(180deg, #ffc53d, var(--orange));
  color: #2b1832; border: 0; font-size: 1.2rem; font-weight: bold;
  padding: 15px 30px; border-radius: 999px; cursor: pointer; font-family: inherit;
  box-shadow: 0 8px 20px rgba(255, 130, 0, .35);
}
button.draw:active { transform: scale(.97); }
button.draw:disabled { opacity: .45; cursor: default; box-shadow: none; }
button.ghost {
  background: transparent; color: var(--cream); border: 1px solid rgba(243, 234, 217, .4);
  padding: 14px 18px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 1rem;
}
.counts { color: var(--muted); margin-top: 12px; }

/* ---- history strip ---- */
.history { margin: 18px auto 0; max-width: 560px; }
.history-label { display: block; color: var(--muted); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip {
  font-family: Arial, Helvetica, sans-serif; font-size: .78rem; font-weight: bold; letter-spacing: .03em;
  background: rgba(251, 219, 101, .13); color: var(--gold);
  border: 1px solid rgba(251, 219, 101, .35);
  padding: 5px 10px; border-radius: 999px;
}
.chip.latest { background: var(--gold); color: #2b1832; }

/* ---- buy strip ---- */
.buy {
  margin: 34px auto 0; max-width: 560px;
  display: flex; gap: 18px; align-items: center; text-align: left;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(251, 219, 101, .22);
  border-radius: 14px; padding: 16px;
}
.cover { width: 92px; height: auto; border-radius: 8px; box-shadow: 0 8px 18px rgba(0, 0, 0, .5); flex: none; }
.buy-title { margin: 0 0 4px; font-size: 1.12rem; color: var(--cream); }
.buy-sub { margin: 0 0 8px; color: var(--muted); line-height: 1.45; font-size: .95rem; }
a.store { color: var(--gold); }

/* ---- footer ---- */
.foot { margin-top: 30px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fine { color: var(--muted); font-size: .9rem; margin: 0; }
.copyright { color: #9d8ab2; font-size: .85rem; margin: 0; }

/* ---- interim passcode gate (removed when Passport login lands) ---- */
.gate {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(28, 15, 34, .55);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
}
.gate[hidden] { display: none; }
.gate-panel {
  background: linear-gradient(180deg, #38204a, #241231);
  border: 1px solid rgba(251, 219, 101, .45); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  max-width: 430px; width: 100%; padding: 22px 22px 18px; text-align: center;
}
.gate-band { width: 100%; height: auto; border-radius: 10px; display: block; }
.gate-title { color: var(--gold); margin: 16px 0 6px; font-size: 1.45rem; }
.gate-sub { color: var(--muted); line-height: 1.5; margin: 0 0 16px; font-size: .98rem; }
.gate-panel form { display: flex; flex-direction: column; gap: 10px; }
.gate-panel input {
  font-family: Arial, Helvetica, sans-serif; font-size: 1.05rem; text-align: center;
  padding: 13px 14px; border-radius: 999px; border: 1px solid rgba(251, 219, 101, .4);
  background: rgba(0, 0, 0, .35); color: var(--cream); outline: none;
}
.gate-panel input:focus { border-color: var(--gold); }
.gate-error { color: #ff9d7a; margin: 2px 0 0; font-size: .95rem; }
a.gate-passport {
  display: block; text-decoration: none; text-align: center;
  background: linear-gradient(180deg, #ffc53d, var(--orange));
  color: #2b1832; font-size: 1.12rem; font-weight: bold;
  padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(255, 130, 0, .35);
}
.gate-note { color: var(--gold); line-height: 1.5; margin: 14px 0 0; font-size: .95rem; }
.gate-alt { margin: 14px 0 0; display: flex; gap: 16px; justify-content: center; }
.gate-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font-family: inherit; font-size: .95rem;
  text-decoration: underline; text-underline-offset: 3px;
}
a.gate-link { display: inline-block; }
.gate-buy { color: var(--muted); margin: 16px 0 0; font-size: .95rem; }
.gate-buy a { color: var(--gold); }
.gate.shake .gate-panel { animation: shake .4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

@media (max-width: 480px) {
  .buy { flex-direction: column; text-align: center; }
  .tagline { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .flipper { transition: none; }
}
