/* Win Isthihaaru — brand palette from isthihaaru-logo/README.md
   Ocean #04303A · Lagoon #0E948C · Shallow #43C6BA · Coral #E2543A · Sand #F2EDE3
   Dark ground, so: Shallow (not Lagoon) for the ring role, Coral rationed. */

:root {
  --ocean: #04303A;
  --ocean-deep: #022229;
  --ocean-panel: #073B46;
  --ocean-line: #0d5460;
  --lagoon: #0E948C;
  --shallow: #43C6BA;
  --coral: #E2543A;
  --sand: #F2EDE3;
  --sand-dim: #b9c7c8;
  --radius: 14px;
  --header-h: 68px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .8);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Several components below set display on classes; [hidden] has to win. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--ocean-deep);
  color: var(--sand);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--shallow); }

/* Cards are <button>s — without this the UA's buttontext colour wins and the
   advertiser name renders black on the dark face. */
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ------------------------------- header ------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(4, 48, 58, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ocean-line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sand); flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; }
.brand b { font-size: 1.02rem; font-weight: 700; letter-spacing: -.02em; }
.brand span { color: var(--shallow); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.nav a, .nav button.navlink {
  color: var(--sand-dim);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: 9px 13px;
  border-radius: 9px;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.nav a:hover, .nav button.navlink:hover { color: var(--sand); background: rgba(67, 198, 186, .1); }
.nav button.navlink[aria-expanded="true"] { color: var(--sand); background: rgba(67, 198, 186, .14); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--ocean-line);
  color: var(--sand-dim);
  white-space: nowrap;
}
.chip b { color: var(--shallow); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .875rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: #ef6449; }
.btn-ghost { background: transparent; color: var(--sand); border-color: var(--ocean-line); }
.btn-ghost:hover { border-color: var(--shallow); color: var(--shallow); }
.btn-solid { background: var(--shallow); color: var(--ocean-deep); }
.btn-solid:hover { background: #5ad6cb; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 7px 13px; font-size: .8rem; }

/* --------------------------- pricing drawer --------------------------- */

.drawer {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 99;
  background: var(--ocean);
  border-bottom: 1px solid var(--ocean-line);
  box-shadow: var(--shadow);
  display: none;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.drawer.open { display: block; animation: slideDown .22s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }

.drawer-inner { padding: 26px 0 30px; }
.drawer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.drawer-head h2 { margin: 0 0 4px; font-size: 1.25rem; letter-spacing: -.02em; }
.drawer-head p { margin: 0; color: var(--sand-dim); font-size: .875rem; max-width: 52ch; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.plan {
  border: 1px solid var(--ocean-line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--ocean-panel);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.plan.hot { border-color: var(--coral); }
.plan .tag {
  position: absolute; top: -9px; left: 16px;
  background: var(--coral); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.plan h3 { margin: 0; font-size: 1rem; }
.plan .price { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.plan .price small { font-size: .8rem; font-weight: 500; color: var(--sand-dim); letter-spacing: 0; }
.plan .price .cur { font-size: .95rem; color: var(--shallow); margin-right: 3px; }
.plan .blurb { color: var(--sand-dim); font-size: .84rem; margin: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .84rem; color: var(--sand-dim); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li::before { content: "—"; color: var(--shallow); flex-shrink: 0; }
.plan .btn { margin-top: auto; width: 100%; }

/* --------------------------------- hero -------------------------------- */

main { padding-top: var(--header-h); }

.hero { padding: 54px 0 30px; text-align: center; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -.035em;
  line-height: 1.03;
}
.hero h1 em { font-style: normal; color: var(--shallow); }
.hero p.lede { margin: 0 auto 22px; max-width: 56ch; color: var(--sand-dim); font-size: 1.02rem; }

.status-bar {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
  margin-bottom: 8px;
}
.stat {
  background: var(--ocean); border: 1px solid var(--ocean-line);
  border-radius: 999px; padding: 8px 16px;
  font-size: .82rem; color: var(--sand-dim);
  display: inline-flex; gap: 8px; align-items: center;
}
.stat b { color: var(--sand); font-variant-numeric: tabular-nums; }
/* ---------------- top banner: the premium placement ---------------- */
.topbanner-wrap { padding-top: 18px; }

.topbanner {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--ocean-line);
  background: var(--ocean);
  text-decoration: none;
  line-height: 0;                 /* no gap under the image */
}
/* Capped so an over-tall upload can't push the game below the fold. Wider
   artwork simply gets more of its middle shown. */
.topbanner img {
  width: 100%;
  height: clamp(72px, 12vw, 132px);
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Each banner fades in as the strip cycles, so a change is noticed without
   being distracting. */
@keyframes tbIn { from { opacity: 0; } to { opacity: 1; } }
.topbanner.tb-in { animation: tbIn .45s ease; }

.topbanner .tb-tag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(2, 34, 41, .8); backdrop-filter: blur(6px);
  color: var(--sand); font-size: .6rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; line-height: 1;
}

/* Unsold, so the space advertises itself instead of sitting blank. */
.topbanner.empty {
  line-height: 1.4;
  border-style: dashed;
  border-color: var(--ocean-line);
  background: linear-gradient(120deg, rgba(67, 198, 186, .06), rgba(226, 84, 58, .05));
  padding: 20px 22px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  transition: border-color .15s, background .15s;
}
.topbanner.empty:hover { border-color: var(--shallow); background: rgba(67, 198, 186, .1); }
.topbanner.empty .tb-kicker {
  font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--shallow);
  border: 1px solid var(--shallow); border-radius: 999px; padding: 4px 10px;
}
.topbanner.empty .tb-line { color: var(--sand-dim); font-size: .88rem; flex: 1; min-width: 200px; }
.topbanner.empty .tb-cta { color: var(--sand); font-size: .84rem; font-weight: 600; }

@media (max-width: 560px) {
  .topbanner.empty { padding: 16px; gap: 10px; }
  .topbanner.empty .tb-line { font-size: .8rem; }
}

/* Who's playing. The name is set larger and brighter than the sentence around
   it, so a player can see at a glance whose entries these are — it matters on
   a shared phone. */
.who-line {
  margin-top: 18px;
  font-size: .9rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.who-line .player-name {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--sand);
  line-height: 1.15;
}
.who-line .player-rest { color: var(--sand-dim); font-size: .86rem; }

.stat.live b { color: var(--coral); }
.stat.grabs {
  border-color: var(--coral); color: var(--sand);
  background: rgba(226, 84, 58, .16);
  animation: pulse 2.2s ease-in-out infinite;
}
.stat.grabs b { color: var(--coral); }
@keyframes pulse { 50% { background: rgba(226, 84, 58, .3); } }

/* ------------------------------- the wall ------------------------------ */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: 40px 0 16px;
}
.section-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.025em; }
.section-head p { margin: 0; color: var(--sand-dim); font-size: .875rem; }

/* Fixed column counts rather than auto-fill, so the hand lays out as even
   rows — eight cards read as two rows of four, not five and three. */
.wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-bottom: 10px;
}
@media (max-width: 1000px) { .wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .wall { grid-template-columns: repeat(2, 1fr); } }

.card { perspective: 1400px; aspect-ratio: 3 / 4; cursor: pointer; border: 0; padding: 0; background: none; }
.card:focus-visible { outline: 2px solid var(--shallow); outline-offset: 4px; border-radius: var(--radius); }

.card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .75s cubic-bezier(.4, .2, .2, 1);
  transform-style: preserve-3d;
}
.card.flipped .card-inner { transform: rotateY(180deg); }
.card:not(.flipped):hover .card-inner { transform: translateY(-5px) rotateY(-4deg); }
.card.busy .card-inner { transform: rotateY(90deg); transition-duration: .35s; }

.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--ocean-line);
  box-shadow: var(--shadow);
}

.face-front { background: var(--ocean-panel); }

/* ---- premium format: the advertiser's own finished poster, full-bleed ---- */
.face-front.poster { padding: 0; background: var(--ocean-deep); }
.face-front.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-front.poster .brandtag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(2, 34, 41, .82); backdrop-filter: blur(6px);
  color: var(--sand); font-size: .64rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
}

/* ---- standard format: a card we build from their words and brand colour --- */
.face-front.designed {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .18), transparent 60%),
    var(--brand, var(--lagoon));
  padding: 0;
}
.face-front.designed .designed-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 20px 15px 12px; text-align: center;
}
.face-front.designed .headline {
  font-size: clamp(.95rem, 3.4vw, 1.35rem);
  font-weight: 800; line-height: .95; letter-spacing: -.045em;
  text-transform: uppercase; color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  text-wrap: balance;
}
.face-front.designed .product {
  font-size: .88rem; font-weight: 600; line-height: 1.25;
  color: rgba(255, 255, 255, .95); text-wrap: balance;
}
.face-front.designed .designed-foot {
  background: rgba(2, 34, 41, .5); backdrop-filter: blur(4px);
  padding: 10px 13px 12px; text-align: center;
}
.face-front .cat {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255, 255, 255, .7); font-weight: 700; display: block; margin-bottom: 3px;
}
.face-front .tagline {
  font-size: .82rem; font-weight: 700; color: #fff; letter-spacing: -.01em;
}
.face-front .flip-hint {
  position: absolute; top: 10px; right: 10px;
  background: rgba(2, 34, 41, .8); backdrop-filter: blur(6px);
  border: 1px solid rgba(67, 198, 186, .35);
  color: var(--shallow);
  font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}

.face-back {
  transform: rotateY(180deg);
  background: var(--ocean);
  padding: 20px 16px;
  align-items: center; justify-content: center; text-align: center;
  gap: 8px;
}
.face-back.win { background: linear-gradient(160deg, #7a2417, var(--coral) 55%, #f0714f); border-color: var(--coral); }
.face-back.win .kicker { color: rgba(255, 255, 255, .85); }
.face-back.win .prize { color: #fff; }
.face-back.win .from, .face-back.win .code { color: rgba(255, 255, 255, .9); }

.face-back .icon { font-size: 2rem; line-height: 1; }
.face-back .kicker {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 700; color: var(--shallow);
}
.face-back .prize { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.face-back .from { font-size: .78rem; color: var(--sand-dim); }
.face-back .code {
  margin-top: 4px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .78rem; letter-spacing: .12em;
  border: 1px dashed rgba(255, 255, 255, .5); border-radius: 8px; padding: 5px 10px;
}
.face-back .visit { margin-top: 6px; font-size: .76rem; }

/* A card that has just rotated onto the wall announces itself once. */
@keyframes arrive {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
.card.arriving { animation: arrive .5s cubic-bezier(.2, .9, .3, 1.1); }
.card.arriving .face-front { border-color: var(--shallow); }

/* A card that has been turned has done its job — it clears out and the next
   advertiser is dealt into the slot. */
@keyframes retire {
  to { opacity: 0; transform: translateY(-18px) scale(.9); }
}
.card.retiring { animation: retire .32s ease forwards; pointer-events: none; }
.card.taken .flip-hint { color: var(--sand-dim); border-color: var(--ocean-line); }

/* ------------------------------- winners ------------------------------- */

.winners {
  border: 1px solid var(--ocean-line); border-radius: var(--radius);
  background: var(--ocean); overflow: hidden;
}
.winners table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.winners th {
  text-align: left; padding: 12px 16px;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--sand-dim); font-weight: 700;
  border-bottom: 1px solid var(--ocean-line);
}
.winners td { padding: 13px 16px; border-bottom: 1px solid rgba(13, 84, 96, .5); }
.winners tr:last-child td { border-bottom: 0; }
.winners .who { font-weight: 600; }
.winners .prize-cell { color: var(--coral); font-weight: 600; }
.empty { padding: 34px 20px; text-align: center; color: var(--sand-dim); font-size: .9rem; }

/* ------------------------------ how it works --------------------------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step {
  border: 1px solid var(--ocean-line); border-radius: var(--radius);
  padding: 18px; background: var(--ocean);
}
.step .n {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(67, 198, 186, .14); color: var(--shallow);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  margin-bottom: 10px;
}
.step p { margin: 0; font-size: .88rem; color: var(--sand-dim); }

/* --------------------------------- forms ------------------------------- */

.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field label { font-size: .78rem; font-weight: 600; color: var(--sand-dim); }
.field input, .field textarea, .field select {
  background: var(--ocean-deep);
  border: 1px solid var(--ocean-line);
  color: var(--sand);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: .9rem;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--shallow);
}
.field textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.book {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
  border: 1px solid var(--ocean-line); border-radius: var(--radius);
  background: var(--ocean); padding: 26px;
}
@media (max-width: 820px) { .book { grid-template-columns: 1fr; } }
.book h2 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -.025em; }
.book .muted { color: var(--sand-dim); font-size: .9rem; }
.contact-line { display: flex; gap: 10px; align-items: center; font-size: .88rem; margin-top: 10px; }
.contact-line span { color: var(--sand-dim); }

/* -------------------------------- modal -------------------------------- */

.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 20, 25, .78); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--ocean); border: 1px solid var(--ocean-line);
  border-radius: 18px; padding: 26px;
  width: min(430px, 100%); box-shadow: var(--shadow);
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.modal h2 { margin: 0 0 6px; font-size: 1.2rem; letter-spacing: -.02em; }
.modal p.sub { margin: 0 0 18px; color: var(--sand-dim); font-size: .88rem; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--ocean-panel); border: 1px solid var(--ocean-line);
  color: var(--sand); padding: 12px 20px; border-radius: 999px;
  font-size: .875rem; z-index: 300; box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.2);
  max-width: calc(100% - 40px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: var(--coral); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 250; }

/* -------------------------------- footer ------------------------------- */

footer {
  margin-top: 56px; padding: 26px 0 34px;
  border-top: 1px solid var(--ocean-line);
  color: var(--sand-dim); font-size: .82rem;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
footer a { color: var(--sand-dim); }

/* The nav swaps to short labels rather than overflowing the fixed header. */
.nav .sm { display: none; }

@media (max-width: 720px) {
  .nav .hide-sm { display: none; }
  .nav .lg { display: none; }
  .nav .sm { display: inline; }
  .header-inner { gap: 10px; }
  .brand b { font-size: .95rem; }
  .nav a, .nav button.navlink { padding: 9px 10px; }
  .wall { gap: 12px; }
  .wrap { width: calc(100% - 28px); }
  .hero { padding: 34px 0 22px; }
}

@media (max-width: 380px) {
  .brand b { display: none; }
}
