:root {
  color-scheme: dark;
  --bg: #07100d;
  --panel: rgba(10, 24, 19, 0.82);
  --panel-2: rgba(17, 39, 30, 0.9);
  --line: rgba(168, 255, 196, 0.16);
  --text: #eefdf3;
  --muted: #9bb7a5;
  --green: #39ff88;
  --gold: #ffd66b;
  --red: #ff6b6b;
  --blue: #8ed8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(57,255,136,.20), transparent 32rem),
    linear-gradient(140deg, #06110e 0%, #07100d 45%, #0b1714 100%);
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
main { width: min(1220px, calc(100vw - 28px)); margin: 0 auto; padding: 26px 0 48px; }
.screen { display: none; }
.screen.active { display: block; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* Offscreen webviews (Unity editor preview) never advance CSS animations, leaving
   animated content stuck at opacity 0 — skip entry animations in-app. */
html.in-app .screen.active { animation: none; }
.bg-orb { position: fixed; width: 380px; height: 380px; filter: blur(80px); opacity: .28; border-radius: 50%; pointer-events: none; }
.orb-a { background: #39ff88; left: -140px; top: 120px; }
.orb-b { background: #1d8fff; right: -160px; bottom: 80px; }

.hero, .result-hero { text-align: center; padding: 40px 18px 20px; }
.logo {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border: 1px solid rgba(57,255,136,.38);
  border-radius: 22px;
  color: var(--green);
  background: linear-gradient(145deg, rgba(57,255,136,.16), rgba(255,255,255,.04));
  box-shadow: 0 0 42px rgba(57,255,136,.18);
  font-weight: 950;
  letter-spacing: -0.06em;
}
.logo-image {
  display: block;
  object-fit: cover;
  background: #f69a21;
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; color: var(--green); font-size: 12px; font-weight: 800; margin: 0 0 10px; }
h1 { font-size: clamp(38px, 7vw, 78px); line-height: .92; letter-spacing: -0.07em; margin: 0 auto; max-width: 900px; }
h2 { margin: 0; letter-spacing: -0.035em; }
h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: .02em; color: #d8eadf; }
.subcopy { max-width: 780px; margin: 22px auto; color: var(--muted); font-size: 18px; line-height: 1.55; }
.formation-roll-copy { margin: 14px auto 0; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.hero-stats, .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-stats span {
  border: 1px solid var(--line); background: rgba(255,255,255,.045); color: #cce7d6;
  border-radius: 999px; padding: 9px 12px; font-size: 13px;
}

.seo-content {
  width: min(920px, calc(100vw - 28px));
  margin: -12px auto 46px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px;
  color: #cfe5d7;
  background: rgba(10, 24, 19, .68);
  box-shadow: var(--shadow);
}
.seo-content h2 { font-size: clamp(26px, 4vw, 42px); margin-bottom: 10px; }
.seo-content p { color: var(--muted); line-height: 1.58; margin: 10px 0; }
.seo-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.seo-links span { border: 1px solid rgba(57,255,136,.25); border-radius: 999px; padding: 8px 10px; background: rgba(57,255,136,.08); color: #dfffe9; font-size: 13px; font-weight: 850; }
html.in-app .seo-content { display: none; }

/* ---- Calm landing hierarchy: keep SEO crawlable, but move it below the first play screen ---- */
.webview-landing {
  display: none;
  position: relative;
  padding: 0 20px 48px;
}
.webview-landing.active { display: block; }
.landing-play {
  position: relative;
  width: 100%;
  min-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.webview-landing .logo {
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  border-radius: 18px;
}
.webview-landing .eyebrow {
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: .18em;
}
.webview-landing h1 {
  font-size: clamp(42px, 12.5vw, 64px);
  max-width: 420px;
}
.webview-landing .hero-stats {
  display: none;
}
.webview-landing .formation-roll-copy {
  max-width: 310px;
  margin: 4px auto 4px;
  font-size: 11px;
  line-height: 1.28;
  letter-spacing: .035em;
}
.webview-landing .locale-picker {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
  opacity: .82;
}
.webview-landing .locale-picker label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.webview-landing .locale-picker select {
  max-width: 118px;
  padding: 7px 28px 7px 10px;
  font-size: 12px;
  background: rgba(0,0,0,.24);
}
.webview-landing .start-cta {
  width: min(420px, 100%);
  min-height: 78px;
  margin: 8px auto 0;
  border-radius: 24px;
  font-size: clamp(38px, 12vw, 58px);
}
.webview-landing .seo-content {
  width: min(680px, calc(100vw - 40px));
  margin: 10px auto 48px;
  padding: 18px;
  border-radius: 22px;
  box-shadow: none;
  text-align: left;
}
.webview-landing .seo-content h2 {
  font-size: clamp(20px, 5.2vw, 30px);
  line-height: 1.08;
}
.webview-landing .seo-content p {
  font-size: 14px;
  line-height: 1.48;
}
.webview-landing .seo-links span {
  padding: 6px 8px;
  font-size: 11px;
}
@media (max-height: 720px) {
  .webview-landing .logo { width: 52px; height: 52px; margin-bottom: 10px; }
  .webview-landing h1 { font-size: clamp(38px, 11vw, 54px); }
  .webview-landing .formation-roll-copy { display: none; }
  .webview-landing .landing-play { min-height: calc(100dvh - 36px); }
}


.setup-panel, .board-panel, .choices-panel, .panel, .share-panel {
  border: 1px solid var(--line); background: var(--panel); border-radius: 26px; padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.setup-panel { max-width: 1060px; margin: 14px auto 22px; }
.setup-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.seed-panel { padding: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.2); border-radius: 20px; }
.seed-panel.compact { width: min(360px, 100%); }
.seed-panel label { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.seed-panel input { width: 100%; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.26); color: var(--text); border-radius: 12px; padding: 12px 14px; outline: none; }
.seed-panel small, .option-help { display: block; color: var(--muted); margin: 8px 0 0; font-size: 12px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.option-group { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); border-radius: 18px; padding: 14px; }
.option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.option-btn {
  border: 1px solid rgba(255,255,255,.12); color: var(--text); background: rgba(0,0,0,.18);
  border-radius: 999px; padding: 9px 12px; font-size: 13px; font-weight: 850; transition: border-color .16s, background .16s, transform .16s;
}
.option-btn:hover { transform: translateY(-1px); border-color: rgba(57,255,136,.38); }
.option-btn.active { color: #04110a; background: var(--green); border-color: var(--green); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 26px auto; max-width: 880px; }
.mode-grid.single-mode { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.mode-card {
  text-align: left; border: 1px solid var(--line); color: var(--text);
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  padding: 26px; border-radius: 28px; min-height: 230px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, background .18s;
}
.mode-card:hover { transform: translateY(-4px); border-color: rgba(57,255,136,.5); background: linear-gradient(145deg, rgba(57,255,136,.14), rgba(255,255,255,.04)); }
.mode-card.primary { border-color: rgba(57,255,136,.32); }
.mode-icon { font-size: 32px; display: block; margin-bottom: 18px; }
.mode-card h2 { font-size: 28px; }
.mode-card p { color: var(--muted); line-height: 1.45; min-height: 44px; }
.mode-card b { color: var(--green); }
.legal-note { max-width: 760px; margin: 24px auto 0; color: #759282; text-align: center; font-size: 12px; }
.seed-input-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.webview-landing {
  min-height: calc(100dvh - 16px);
  display: none;
  place-items: center;
  align-content: center;
  gap: 24px;
  padding: 20px 14px 34px;
  text-align: center;
}
.webview-landing.active { display: grid; }
.webview-landing .hero { padding: 0; }
.webview-landing h1 { font-size: clamp(46px, 14vw, 78px); max-width: 520px; }
.webview-landing .hero-stats { margin-top: 18px; }
.locale-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto -8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
}
.locale-picker select {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(0,0,0,.32);
  outline: none;
}
.locale-picker select:focus { border-color: rgba(57,255,136,.55); box-shadow: 0 0 0 3px rgba(57,255,136,.12); }

.start-cta {
  width: min(520px, 100%);
  min-height: 82px;
  border: 0;
  border-radius: 24px;
  color: #04110a;
  background: linear-gradient(135deg, #fff86b 0%, #39ff88 52%, #00d7ff 100%);
  box-shadow: 0 18px 54px rgba(57,255,136,.34), inset 0 -8px 18px rgba(0,0,0,.20);
  font-size: clamp(34px, 10vw, 54px);
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.start-cta:active { transform: scale(.98); }
.action-prompt {
  position: sticky;
  top: 0;
  z-index: 5;
  border: 1px solid rgba(255,248,107,.52);
  border-radius: 18px;
  padding: 12px 14px;
  margin: 0 0 10px;
  color: #07100d;
  background: linear-gradient(135deg, #fff86b, #39ff88);
  box-shadow: 0 10px 30px rgba(57,255,136,.22);
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 1000;
  letter-spacing: .04em;
  text-align: center;
}

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 8px 0 22px; }
.topbar h1 { font-size: clamp(30px, 5vw, 56px); max-width: none; }
.roll-subtext { color: var(--muted); margin: 10px 0 0; }
.draft-hud { display: grid; grid-template-columns: repeat(3, minmax(88px, 1fr)); gap: 8px; min-width: min(430px, 46vw); }
.draft-hud div {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 10px 11px;
  background: rgba(0,0,0,.24);
  text-align: center;
}
.draft-hud span { display: block; color: var(--muted); font-size: 10px; font-weight: 950; letter-spacing: .13em; }
.draft-hud b { display: block; margin-top: 4px; color: #f3fff8; font-size: 18px; line-height: 1; white-space: nowrap; }
.draft-hud b.rolling { color: var(--gold); animation: pulseSpin .72s ease-in-out infinite alternate; }

.formation-reveal-banner {
  margin: -2px auto 14px;
  max-width: 760px;
  border: 1px solid rgba(255,214,107,.48);
  border-radius: 28px;
  padding: 18px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,214,107,.26), transparent 58%),
    linear-gradient(145deg, rgba(255,214,107,.18), rgba(57,255,136,.08));
  box-shadow: 0 22px 70px rgba(255,214,107,.16), var(--shadow);
}
.formation-reveal-banner[hidden] { display: none !important; }
.formation-reveal-banner span { display: block; color: var(--green); font-size: 12px; font-weight: 1000; letter-spacing: .18em; }
.formation-reveal-banner strong { display: block; margin: 7px 0 3px; color: var(--gold); font-size: clamp(44px, 10vw, 84px); line-height: .88; letter-spacing: -.075em; text-shadow: 0 0 34px rgba(255,214,107,.26); }
.formation-reveal-banner small { color: #ffe6a5; font-weight: 850; letter-spacing: .02em; }
.formation-reveal-banner.rolling strong { animation: reelTick .09s linear infinite; }
.formation-reveal-banner.locked { border-color: rgba(57,255,136,.5); background: linear-gradient(145deg, rgba(57,255,136,.18), rgba(255,214,107,.08)); }

.spin-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}
.spin-stage.single-reel {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 760px;
  margin-inline: auto;
}
.spin-tile {
  position: relative;
  min-height: 128px;
  border: 1px solid rgba(168,255,196,.20);
  border-radius: 24px;
  padding: 16px 18px 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}
.tile-reroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 auto 10px;
  border: 1px solid rgba(142,216,255,.34);
  border-radius: 999px;
  padding: 7px 11px;
  color: #d9f3ff;
  background: rgba(142,216,255,.14);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  transition: transform .14s, border-color .14s, background .14s;
}
.tile-reroll-btn:not(:disabled):hover { transform: translateY(-1px); border-color: rgba(57,255,136,.5); background: rgba(57,255,136,.16); }
.spin-tile::after {
  content: '';
  position: absolute;
  inset: 48px 10px 10px;
  border-radius: 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 28%, transparent 72%, rgba(0,0,0,.20));
  opacity: 0;
  transition: opacity .16s;
}
.spin-tile.rolling {
  border-color: rgba(255,214,107,.72);
  background: linear-gradient(145deg, rgba(255,214,107,.18), rgba(57,255,136,.07));
  box-shadow: 0 18px 60px rgba(255,214,107,.18), var(--shadow);
}
.spin-tile.rolling::after { opacity: 1; }
.spin-tile.rolling strong { animation: reelTick .09s linear infinite; color: var(--gold); text-shadow: 0 0 28px rgba(255,214,107,.32); }
.spin-stage.spinning .spin-btn { filter: saturate(1.15); animation: pulseSpin .72s ease-in-out infinite alternate; }
@keyframes reelTick { 0% { transform: translateY(-3px); opacity: .78; } 100% { transform: translateY(3px); opacity: 1; } }
@keyframes pulseSpin { from { transform: scale(.98); } to { transform: scale(1.03); } }
.spin-tile span { display: block; color: var(--green); font-size: 12px; font-weight: 950; letter-spacing: .16em; }
.spin-tile strong { display: block; margin: 8px 0 4px; font-size: clamp(26px, 5vw, 48px); line-height: .9; letter-spacing: -0.06em; }
.spin-tile small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.spin-stage.spun .spin-tile { border-color: rgba(57,255,136,.38); background: linear-gradient(145deg, rgba(57,255,136,.13), rgba(255,255,255,.035)); }
.spin-btn {
  width: 132px; height: 132px; border: 0; border-radius: 999px;
  background: radial-gradient(circle at 35% 28%, #ffffff, #39ff88 34%, #0a5f34 74%);
  color: #031008; font-weight: 1000; font-size: 21px; letter-spacing: .08em;
  box-shadow: 0 18px 50px rgba(57,255,136,.24), inset 0 -10px 22px rgba(0,0,0,.24);
  transition: transform .16s, filter .16s;
}
.spin-btn:not(:disabled):hover { transform: rotate(-3deg) scale(1.04); filter: brightness(1.08); }
.spin-btn:disabled { background: rgba(255,255,255,.11); color: var(--muted); box-shadow: none; }

.choice-controls[hidden] { display: none !important; }
.choice-controls {
  display: grid;
  grid-template-columns: 1fr minmax(180px, .65fr) minmax(150px, .45fr);
  gap: 10px;
  margin: -4px 0 14px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-btn, .choice-controls input, .choice-controls select {
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  background: rgba(0,0,0,.22);
  border-radius: 999px;
  padding: 10px 12px;
}
.filter-btn { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.filter-btn.active { color: #04110a; background: var(--green); border-color: var(--green); }
.choice-controls input { border-radius: 14px; outline: none; }
.choice-controls select { border-radius: 14px; }

.draft-layout, .result-layout { display: grid; grid-template-columns: .95fr 1.05fr; gap: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.panel-head p { color: var(--muted); margin: 5px 0 0; max-width: 420px; font-size: 14px; }
.choice-formation-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255,214,107,.34);
  border-radius: 999px;
  padding: 8px 11px;
  color: #ffe6a5;
  background: rgba(255,214,107,.12);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.choice-formation-badge.rolling { animation: pulseSpin .72s ease-in-out infinite alternate; color: var(--gold); }
.spin-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 280px; }
.reroll-btn { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--gold); color: #181104; font-weight: 950; white-space: nowrap; }
.reroll-btn.secondary { background: rgba(142,216,255,.16); color: #d9f3ff; border: 1px solid rgba(142,216,255,.34); }
.reroll-btn.wildcard { background: linear-gradient(135deg, #ffd66b, #39ff88); color: #07100d; }

.lineup-board.pitch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 560px;
  padding: 20px 16px;
  border-radius: 24px;
  border: 1px solid rgba(168,255,196,.22);
  background:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, transparent 0 64px, rgba(255,255,255,.16) 65px 66px, transparent 67px),
    linear-gradient(180deg, rgba(26,130,69,.92), rgba(12,90,48,.92));
  background-size: 100% 112px, 100% 100%, 100% 100%;
  overflow: hidden;
}
.lineup-board.pitch::before {
  content: '';
  position: absolute;
  inset: 50% 16px auto;
  height: 1px;
  background: rgba(255,255,255,.18);
}
.line-row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--slot-count), minmax(0, 1fr)); gap: 10px; align-items: center; }
.line-row.attack { padding: 2px 36px 0; }
.line-row.midfield { padding: 0 8px; }
.line-row.defense { padding: 0 4px; }
.line-row.keeper { padding: 0 34%; }
.slot {
  min-height: 92px; border: 1px dashed rgba(255,255,255,.28); border-radius: 16px; color: var(--text); background: rgba(0,0,0,.26); text-align: center; padding: 10px; transition: transform .14s, border-color .14s, background .14s;
}
.slot:not(:disabled):hover { transform: translateY(-2px); border-color: var(--green); background: rgba(57,255,136,.16); }
.slot.filled { border-style: solid; background: linear-gradient(145deg, rgba(4,26,14,.82), rgba(255,255,255,.08)); }
.slot.autofilled { opacity: .76; border-color: rgba(255,255,255,.16); background: linear-gradient(145deg, rgba(6,33,18,.58), rgba(255,255,255,.045)); }
.slot.autofilled .slot-pos { color: #b9d8c3; }
.slot.target { border-style: solid; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,214,107,.14); }
.slot-pos { color: var(--green); font-size: 12px; font-weight: 950; }
.slot strong { display: block; margin: 8px 0 4px; font-size: 14px; line-height: 1.05; }
.slot small { color: #c8dfd0; line-height: 1.2; }

.live-rating { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.live-rating div { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 10px 8px; text-align: center; background: rgba(0,0,0,.2); }
.live-rating span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.live-rating b { display: block; color: var(--text); font-size: 21px; margin: 4px 0; }
.live-rating small { color: var(--green); font-size: 10px; }

.choice-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.player-table {
  display: grid;
  gap: 7px;
  width: 100%;
}
.player-row {
  display: grid;
  grid-template-columns: 86px minmax(170px, 1.8fr) minmax(80px, .75fr) 56px 56px 70px minmax(90px, .9fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  text-align: left;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.player-row.selected { transform: translateY(-1px); border-color: var(--green); box-shadow: 0 0 0 1px rgba(57,255,136,.20); }
@media (hover: hover) and (pointer: fine) {
  .player-row:not(.table-head):hover { transform: translateY(-1px); border-color: var(--green); box-shadow: 0 0 0 1px rgba(57,255,136,.20); }
}
.player-row.table-head { color: var(--muted); background: rgba(0,0,0,.24); border-style: dashed; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.player-row strong { color: var(--text); font-size: 18px; }
.player-row small { display: block; color: var(--muted); font-size: 11px; line-height: 1.25; }
.player-row.mythic .pick-cell { color: #ffe27a; }
.player-row.icon .pick-cell { color: #ffad57; }
.player-row.legend .pick-cell { color: #a6e5ff; }
.player-row.rare .pick-cell { color: #8fffba; }
.player-row.hero .pick-cell { color: #d7b6ff; }
.player-row.depth .pick-cell { color: #c8d0cc; }
.pick-cell { font-size: 11px; font-weight: 950; letter-spacing: .08em; }
.name-cell b { display: block; font-size: 15px; letter-spacing: -0.02em; }
.fit-cell { color: #d8eadf; }
.player-card {
  position: relative; text-align: left; min-height: 272px; border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 16px; color: var(--text);
  background: linear-gradient(155deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  overflow: hidden; transition: transform .14s, border-color .14s, box-shadow .14s;
}
.player-card::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 160px; height: 160px; border-radius: 50%; opacity: .28; filter: blur(20px); background: currentColor; }
.player-card:hover, .player-card.selected { transform: translateY(-3px); border-color: var(--green); box-shadow: 0 0 0 1px rgba(57,255,136,.22), var(--shadow); }
.player-card.mythic { color: #ffe27a; }
.player-card.icon { color: #ffad57; }
.player-card.legend { color: #a6e5ff; }
.player-card.rare { color: #8fffba; }
.player-card.hero { color: #d7b6ff; }
.player-card.depth { color: #c8d0cc; }
.card-top { display: flex; justify-content: space-between; color: currentColor; font-size: 12px; font-weight: 950; letter-spacing: .1em; }
.player-card h3 { color: var(--text); margin: 18px 0 4px; font-size: 25px; letter-spacing: -0.045em; }
.meta { color: var(--muted); margin: 0 0 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 12px 0; }
.stat-grid div { background: rgba(0,0,0,.24); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 7px 5px; text-align: center; }
.stat-grid b { display: block; color: var(--text); }
.stat-grid span { display: block; color: var(--muted); font-size: 10px; }
.hiddenStats, .empty-choice { margin: 14px 0; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; color: var(--muted); padding: 16px; background: rgba(0,0,0,.22); }
.empty-choice { min-height: 180px; display: grid; place-items: center; text-align: center; grid-column: 1 / -1; }
.empty-choice b { display: block; color: var(--text); font-size: 22px; margin-bottom: 8px; }
.formation-choice b { font-size: clamp(34px, 9vw, 58px); letter-spacing: -.06em; color: var(--gold); }
.desc { color: #d8eadf; min-height: 42px; line-height: 1.35; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; }
.traits span { color: #07100d; background: currentColor; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 850; }

.result-hero { position: relative; }
.sim-hero h1 { color: var(--gold); text-shadow: 0 0 42px rgba(255,214,107,.22); }
.sim-board { max-width: 760px; margin: 0 auto; }
.sim-progress {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.24);
  margin-bottom: 14px;
}
.sim-progress::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, rgba(57,255,136,.78), rgba(255,214,107,.88));
  transition: width .22s ease-out;
}
.sim-progress span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 11px 14px;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
}
.sim-match-list {
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
}
.sim-match {
  animation: simMatchIn .18s ease-out both;
}
.sim-match strong {
  color: var(--gold);
}
@keyframes simMatchIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.result-hero h1 { color: var(--green); text-shadow: 0 0 42px rgba(57,255,136,.25); }
.result-hero p:not(.eyebrow) { color: var(--muted); font-size: 18px; }
.grade { width: 78px; height: 78px; display: grid; place-items: center; margin: 18px auto 0; border-radius: 50%; border: 1px solid rgba(255,214,107,.5); color: var(--gold); background: rgba(255,214,107,.1); font-size: 30px; font-weight: 950; }
.score-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.score-row div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; text-align: center; }
.score-row span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.score-row b { display: block; margin-top: 8px; font-size: 28px; }
.match-list { display: grid; gap: 14px; }
.campaign-section { display: grid; gap: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 12px; background: rgba(255,255,255,.03); }
.campaign-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 7px; }
.campaign-section-head h3 { margin: 0 0 4px; color: var(--text); font-size: 18px; letter-spacing: -0.03em; }
.campaign-section-head span { color: var(--muted); font-size: 12px; }
.campaign-section-head strong { color: var(--green); white-space: nowrap; }
.match { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.18); border-radius: 14px; padding: 12px; }
.match b { display: block; }
.match span, .match small { color: var(--muted); }
.match strong { font-size: 24px; color: var(--text); }
.match small { grid-column: 1 / -1; }
.match.clean { border-color: rgba(57,255,136,.28); }
.match.loss { border-color: rgba(255,107,107,.35); }
.match.draw { border-color: rgba(255,214,107,.32); }
.match.locked { opacity: .62; border-style: dashed; }
.winner-card { border: 1px solid rgba(255,214,107,.45); border-radius: 16px; padding: 14px; background: linear-gradient(135deg, rgba(255,214,107,.16), rgba(57,255,136,.10)); }
.winner-card span { display: block; color: var(--gold); font-size: 11px; font-weight: 950; letter-spacing: .14em; }
.winner-card b { display: block; margin: 5px 0; font-size: 20px; }
.winner-card small { color: var(--muted); }
.result-lineup { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.mini-card { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 11px; background: rgba(255,255,255,.045); }
.mini-card span { color: var(--green); font-weight: 950; font-size: 12px; }
.mini-card b { display: block; margin: 5px 0; }
.mini-card small { color: var(--muted); }
.result-actions { display: flex; justify-content: center; gap: 10px; margin: -6px 0 16px; }
.result-actions button { border: 0; border-radius: 999px; padding: 14px 22px; background: var(--green); color: #04110a; font-weight: 950; box-shadow: 0 14px 30px rgba(57,255,136,.18); }
.result-actions button.secondary { background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--line); box-shadow: none; }

@media (max-width: 980px) {
  .mode-grid, .draft-layout, .result-layout, .option-grid, .spin-stage, .choice-controls { grid-template-columns: 1fr; }
  .topbar, .setup-head { flex-direction: column; }
  .draft-hud { min-width: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seed-panel.compact { width: 100%; }
}
@media (max-width: 700px) {
  html { height: 100%; }
  body { min-height: 100dvh; }
  main { width: 100%; padding: 8px; }
  .screen.active { animation: none; }
  .screen.draft.active {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 16px);
    min-height: 0;
    gap: 8px;
    overflow: hidden;
  }
  .screen.results.active, .screen.sim-screen.active {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 16px);
    min-height: 0;
    overflow: hidden;
  }
  .hero { padding: 18px 8px 10px; }
  .landing h1 { font-size: clamp(32px, 11vw, 42px); }
  .landing .subcopy { margin: 10px auto; font-size: 13px; line-height: 1.35; }
  .formation-roll-copy { margin-top: 8px; font-size: 11px; }
  .logo { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 16px; }
  .setup-panel { margin: 8px auto; padding: 10px; border-radius: 18px; }
  .setup-head { display: block; margin-bottom: 8px; }
  .setup-head h2 { font-size: 18px; }
  .option-help, .seed-panel small, .legal-note { display: none; }
  .seed-panel.compact { width: 100%; padding: 10px; }
  .mode-grid.single-mode { margin: 10px auto; }
  .mode-card { min-height: 0; padding: 16px; border-radius: 20px; }
  .mode-card h2 { font-size: 20px; }
  .mode-card p { min-height: 0; margin: 7px 0; font-size: 13px; }
  .mode-icon { margin-bottom: 8px; }
  .draft .topbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 0;
    gap: 8px;
  }
  .draft .topbar .eyebrow, .draft .roll-subtext { display: none; }
  .draft .topbar h1 { font-size: 20px; line-height: 1.02; letter-spacing: -0.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .draft-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; gap: 5px; }
  .draft-hud div { border-radius: 12px; padding: 6px 5px; }
  .draft-hud span { font-size: 7px; letter-spacing: .08em; }
  .draft-hud b { font-size: 13px; }
  .formation-reveal-banner { flex: 0 0 auto; margin: -2px 0 0; border-radius: 18px; padding: 10px 12px; }
  .formation-reveal-banner span { font-size: 9px; }
  .formation-reveal-banner strong { font-size: clamp(34px, 10vw, 48px); }
  .spin-stage.single-reel {
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 72px;
    max-width: none;
    gap: 8px;
    margin: 0;
  }
  .spin-tile { min-height: 64px; border-radius: 16px; padding: 8px 10px; }
  .spin-tile span, .spin-tile small { display: none; }
  .spin-tile strong { margin: 6px 0 0; font-size: clamp(22px, 7vw, 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tile-reroll-btn { min-height: 24px; margin-bottom: 0; padding: 4px 8px; font-size: 10px; }
  .spin-btn { width: 72px; height: 64px; border-radius: 18px; font-size: 13px; }
  .draft-layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 42dvh) minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }
  .board-panel, .choices-panel, .panel, .share-panel { border-radius: 18px; padding: 10px; box-shadow: none; }
  .board-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
  }
  .panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head p, #pickHint { display: none; }
  .choice-formation-badge { padding: 6px 8px; font-size: 10px; }
  .spin-tools { display: flex; justify-content: flex-end; gap: 5px; min-width: 0; }
  .reroll-btn { margin-top: 0; padding: 7px 8px; font-size: 10px; }
  .lineup-board.pitch { min-height: 0; height: 100%; border-radius: 16px; padding: 8px; gap: 4px; }
  .line-row { gap: 4px; }
  .line-row.attack, .line-row.midfield, .line-row.defense, .line-row.keeper { padding-inline: 0; }
  .slot { min-height: 42px; border-radius: 10px; padding: 4px 3px; }
  .slot-pos { font-size: 9px; }
  .slot strong { margin: 3px 0 0; font-size: 10px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .slot small { display: none; }
  .live-rating { grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
  .live-rating div { border-radius: 10px; padding: 5px 4px; }
  .live-rating span { font-size: 8px; letter-spacing: .04em; }
  .live-rating b { font-size: 14px; margin: 1px 0; }
  .live-rating small { display: none; }
  .choices-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .choice-controls { grid-template-columns: minmax(0, 1fr) 108px; gap: 6px; margin: 0 0 6px; }
  .filter-row { display: none; }
  .choice-controls input, .choice-controls select { min-width: 0; padding: 8px 9px; font-size: 12px; border-radius: 12px; }
  .choice-grid { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .player-table { height: 100%; max-height: 100%; overflow-y: auto; display: block; padding-right: 2px; }
  .player-row { grid-template-columns: 44px minmax(0, 1fr) 44px 40px; gap: 6px; padding: 7px 8px; border-radius: 10px; }
  .player-row.table-head { position: sticky; top: 0; z-index: 2; background: #0b1a14; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
  .player-row strong { font-size: 14px; }
  .player-row small { font-size: 10px; }
  .player-row > span:nth-child(5), .player-row > span:nth-child(6), .player-row > span:nth-child(7) { display: none; }
  .pick-cell { font-size: 9px; }
  .name-cell b { font-size: 13px; }
  .empty-choice { min-height: 100%; margin: 0; }
  .sim-board, .result-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .screen.results.active .result-hero, .screen.sim-screen.active .result-hero { flex: 0 0 auto; padding: 10px 8px 8px; }
  .screen.results.active .result-hero h1, .screen.sim-screen.active .result-hero h1 { font-size: 28px; }
  .screen.results.active .result-hero p:not(.eyebrow), .screen.sim-screen.active .result-hero p:not(.eyebrow) { font-size: 12px; margin: 6px 0 0; }
  .grade { width: 48px; height: 48px; margin-top: 8px; font-size: 20px; }
  .score-row { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
  .score-row div { border-radius: 12px; padding: 8px 4px; }
  .score-row span { font-size: 7px; letter-spacing: .06em; }
  .score-row b { margin-top: 3px; font-size: 14px; }
  .result-layout { grid-template-columns: 1fr; gap: 8px; }
  .result-layout .panel:nth-child(2), .share-panel { display: none; }
  .sim-match-list, .match-list { overflow-y: auto; }
  .choice-grid, .result-lineup { grid-template-columns: 1fr; }
}

/* ---- GENERATED: in-app mobile layout (mirrors the max-width media blocks above;
   the Unity webview viewport can be wide in points, so width queries alone miss it).
   Regenerate when editing the 980px/700px blocks. ---- */
html.in-app .mode-grid, html.in-app .draft-layout, html.in-app .result-layout, html.in-app .option-grid, html.in-app .spin-stage, html.in-app .choice-controls { grid-template-columns: 1fr; }
html.in-app .topbar, html.in-app .setup-head { flex-direction: column; }
html.in-app .draft-hud { min-width: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.in-app .seed-panel.compact { width: 100%; }
html.in-app { height: 100%; }
html.in-app body { min-height: var(--appvh, 100dvh); }
html.in-app main { width: 100%; padding: 8px; }
html.in-app .screen.active { animation: none; }
html.in-app .screen.draft.active {
    display: flex;
    flex-direction: column;
    height: calc(var(--appvh, 100dvh) - 16px);
    min-height: 0;
    gap: 8px;
    overflow: hidden;
  }
html.in-app .screen.results.active, html.in-app .screen.sim-screen.active {
    display: flex;
    flex-direction: column;
    height: calc(var(--appvh, 100dvh) - 16px);
    min-height: 0;
    overflow: hidden;
  }
html.in-app .hero { padding: 18px 8px 10px; }
html.in-app .landing h1 { font-size: clamp(32px, 11vw, 42px); }
html.in-app .landing .subcopy { margin: 10px auto; font-size: 13px; line-height: 1.35; }
html.in-app .formation-roll-copy { margin-top: 8px; font-size: 11px; }
html.in-app .logo { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 16px; }
html.in-app .setup-panel { margin: 8px auto; padding: 10px; border-radius: 18px; }
html.in-app .setup-head { display: block; margin-bottom: 8px; }
html.in-app .setup-head h2 { font-size: 18px; }
html.in-app .option-help, html.in-app .seed-panel small, html.in-app .legal-note { display: none; }
html.in-app .seed-panel.compact { width: 100%; padding: 10px; }
html.in-app .mode-grid.single-mode { margin: 10px auto; }
html.in-app .mode-card { min-height: 0; padding: 16px; border-radius: 20px; }
html.in-app .mode-card h2 { font-size: 20px; }
html.in-app .mode-card p { min-height: 0; margin: 7px 0; font-size: 13px; }
html.in-app .mode-icon { margin-bottom: 8px; }
html.in-app .draft .topbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 0;
    gap: 8px;
  }
html.in-app .draft .topbar .eyebrow, html.in-app .draft .roll-subtext { display: none; }
html.in-app .draft .topbar h1 { font-size: 20px; line-height: 1.02; letter-spacing: -0.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.in-app .draft-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; gap: 5px; }
html.in-app .draft-hud div { border-radius: 12px; padding: 6px 5px; }
html.in-app .draft-hud span { font-size: 7px; letter-spacing: .08em; }
html.in-app .draft-hud b { font-size: 13px; }
html.in-app .formation-reveal-banner { flex: 0 0 auto; margin: -2px 0 0; border-radius: 18px; padding: 10px 12px; }
html.in-app .formation-reveal-banner span { font-size: 9px; }
html.in-app .formation-reveal-banner strong { font-size: clamp(34px, 10vw, 48px); }
html.in-app .spin-stage.single-reel {
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 72px;
    max-width: none;
    gap: 8px;
    margin: 0;
  }
html.in-app .spin-tile { min-height: 64px; border-radius: 16px; padding: 8px 10px; }
html.in-app .spin-tile span, html.in-app .spin-tile small { display: none; }
html.in-app .spin-tile strong { margin: 6px 0 0; font-size: clamp(22px, 7vw, 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.in-app .tile-reroll-btn { min-height: 24px; margin-bottom: 0; padding: 4px 8px; font-size: 10px; }
html.in-app .spin-btn { width: 72px; height: 64px; border-radius: 18px; font-size: 13px; }
html.in-app .draft-layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, calc(var(--appvh, 100dvh) * .42)) minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }
html.in-app .board-panel, html.in-app .choices-panel, html.in-app .panel, html.in-app .share-panel { border-radius: 18px; padding: 10px; box-shadow: none; }
html.in-app .board-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
  }
html.in-app .panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
html.in-app .panel-head h2 { font-size: 16px; }
html.in-app .panel-head p, html.in-app #pickHint { display: none; }
html.in-app .spin-tools { display: flex; justify-content: flex-end; gap: 5px; min-width: 0; }
html.in-app .reroll-btn { margin-top: 0; padding: 7px 8px; font-size: 10px; }
html.in-app .lineup-board.pitch { min-height: 0; height: 100%; border-radius: 16px; padding: 8px; gap: 4px; }
html.in-app .line-row { gap: 4px; }
html.in-app .line-row.attack, html.in-app .line-row.midfield, html.in-app .line-row.defense, html.in-app .line-row.keeper { padding-inline: 0; }
html.in-app .slot { min-height: 42px; border-radius: 10px; padding: 4px 3px; }
html.in-app .slot-pos { font-size: 9px; }
html.in-app .slot strong { margin: 3px 0 0; font-size: 10px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.in-app .slot small { display: none; }
html.in-app .live-rating { grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
html.in-app .live-rating div { border-radius: 10px; padding: 5px 4px; }
html.in-app .live-rating span { font-size: 8px; letter-spacing: .04em; }
html.in-app .live-rating b { font-size: 14px; margin: 1px 0; }
html.in-app .live-rating small { display: none; }
html.in-app .choices-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
html.in-app .choice-controls { grid-template-columns: minmax(0, 1fr) 108px; gap: 6px; margin: 0 0 6px; }
html.in-app .filter-row { display: none; }
html.in-app .choice-controls input, html.in-app .choice-controls select { min-width: 0; padding: 8px 9px; font-size: 12px; border-radius: 12px; }
html.in-app .choice-grid { flex: 1 1 auto; min-height: 0; overflow: hidden; }
html.in-app .player-table { height: 100%; max-height: 100%; overflow-y: auto; display: block; padding-right: 2px; }
html.in-app .player-row { grid-template-columns: 44px minmax(0, 1fr) 44px 40px; gap: 6px; padding: 7px 8px; border-radius: 10px; }
html.in-app .player-row.table-head { position: sticky; top: 0; z-index: 2; background: #0b1a14; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
html.in-app .player-row strong { font-size: 14px; }
html.in-app .player-row small { font-size: 10px; }
html.in-app .player-row > span:nth-child(5), html.in-app .player-row > span:nth-child(6), html.in-app .player-row > span:nth-child(7) { display: none; }
html.in-app .pick-cell { font-size: 9px; }
html.in-app .name-cell b { font-size: 13px; }
html.in-app .empty-choice { min-height: 100%; margin: 0; }
html.in-app .sim-board, html.in-app .result-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; }
html.in-app .screen.results.active .result-hero, html.in-app .screen.sim-screen.active .result-hero { flex: 0 0 auto; padding: 10px 8px 8px; }
html.in-app .screen.results.active .result-hero h1, html.in-app .screen.sim-screen.active .result-hero h1 { font-size: 28px; }
html.in-app .screen.results.active .result-hero p:not(.eyebrow), html.in-app .screen.sim-screen.active .result-hero p:not(.eyebrow) { font-size: 12px; margin: 6px 0 0; }
html.in-app .grade { width: 48px; height: 48px; margin-top: 8px; font-size: 20px; }
html.in-app .score-row { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
html.in-app .score-row div { border-radius: 12px; padding: 8px 4px; }
html.in-app .score-row span { font-size: 7px; letter-spacing: .06em; }
html.in-app .score-row b { margin-top: 3px; font-size: 14px; }
html.in-app .result-layout { grid-template-columns: 1fr; gap: 8px; }
html.in-app .result-layout .panel:nth-child(2), html.in-app .share-panel { display: none; }
html.in-app .sim-match-list, html.in-app .match-list { overflow-y: auto; }
html.in-app .choice-grid, html.in-app .result-lineup { grid-template-columns: 1fr; }
html.in-app .webview-landing { min-height: calc(var(--appvh, 100dvh) - 16px); }
/* Large blurs are expensive in webviews (the Unity editor preview repaints the
   page into a bitmap every frame); drop the decorative orbs in-app. */
html.in-app .bg-orb { display: none; }
/* In-app, prefer natural document flow over the fixed app-height layout: zoom
   semantics differ across WebKit builds and the fixed heights clip the pitch. */
html.in-app .screen.draft.active,
html.in-app .screen.results.active,
html.in-app .screen.sim-screen.active {
  height: auto;
  min-height: calc(var(--appvh, 100dvh) - 16px);
  overflow: visible;
}
html.in-app .draft-layout { grid-template-rows: auto auto; overflow: visible; }
html.in-app .board-panel { overflow: visible; }
html.in-app .lineup-board.pitch { height: auto; min-height: 340px; }
html.in-app .choices-panel { overflow: visible; }
/* Same natural-flow preference for phone browsers: the fixed app-height layout
   clips anything past the fold (squad stats on results) with no way to scroll. */
@media (max-width: 700px) {
  .screen.draft.active, .screen.results.active, .screen.sim-screen.active {
    height: auto;
    min-height: calc(100dvh - 16px);
    overflow: visible;
  }
  .draft-layout { grid-template-rows: auto auto; overflow: visible; }
  .board-panel { overflow: visible; }
  .lineup-board.pitch { height: auto; min-height: 340px; }
  .choices-panel { overflow: visible; }
}
/* ---- Formation shape: center short bands (lone DM, CM pairs, front threes) ---- */
.line-row.count-1 { padding-inline: 34%; }
.line-row.count-2 { padding-inline: 17%; }
.line-row.count-3 { padding-inline: 5%; }
html.in-app .line-row.count-1 { padding-inline: 33%; }
html.in-app .line-row.count-2 { padding-inline: 16%; }
html.in-app .line-row.count-3 { padding-inline: 4%; }

/* ---- Spin CTA: full-width, unmistakable on phones and in-app ---- */
@media (max-width: 700px) {
  .spin-stage.single-reel { grid-template-columns: 1fr; }
  .spin-btn {
    width: 100%; height: 72px; border-radius: 20px;
    font-size: 24px; letter-spacing: .12em; text-transform: uppercase;
    background: linear-gradient(135deg, #fff86b 0%, #39ff88 52%, #00d7ff 100%);
    color: #04110a;
    box-shadow: 0 14px 44px rgba(57,255,136,.35), inset 0 -8px 18px rgba(0,0,0,.20);
  }
  .spin-btn:disabled { background: rgba(255,255,255,.11); color: var(--muted); box-shadow: none; }
  .spin-tile strong { font-size: clamp(26px, 8vw, 34px); }
}
html.in-app .spin-stage.single-reel { grid-template-columns: 1fr; }
html.in-app .spin-btn {
  width: 100%; height: 72px; border-radius: 20px;
  font-size: 24px; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(135deg, #fff86b 0%, #39ff88 52%, #00d7ff 100%);
  color: #04110a;
  box-shadow: 0 14px 44px rgba(57,255,136,.35), inset 0 -8px 18px rgba(0,0,0,.20);
}
html.in-app .spin-btn:disabled { background: rgba(255,255,255,.11); color: var(--muted); box-shadow: none; }
html.in-app .spin-tile strong { font-size: clamp(26px, 8vw, 34px); }

/* nudge the player toward the spin when it is the required action */
.spin-stage:not(.spun):not(.spinning) .spin-btn:not(:disabled) { animation: spinNudge 1s ease-in-out infinite alternate; }
@keyframes spinNudge {
  from { transform: scale(1); }
  to { transform: scale(1.025); box-shadow: 0 16px 56px rgba(57,255,136,.6), inset 0 -8px 18px rgba(0,0,0,.20); }
}

/* ---- Reel readability: pronounced roll while spinning, pop on landing ---- */
.spin-tile.rolling strong { animation: reelRoll .14s linear infinite; }
@keyframes reelRoll {
  0% { transform: translateY(-12px); opacity: .25; filter: blur(2px); }
  55% { opacity: 1; filter: blur(0); }
  100% { transform: translateY(12px); opacity: .25; filter: blur(2px); }
}
.spin-stage.spun .spin-tile strong { animation: reelLand .34s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes reelLand { from { transform: scale(1.3); } to { transform: scale(1); } }

/* ---- HYPER-MOBILE single-screen draft (82-0 style): compact top, scrolling
   card list as the main surface, slot rail pinned at the bottom, pitch as an
   on-demand overlay via the rail's XI button. ---- */
.mini-stats, .slot-rail { display: none; }
.rail-slot {
  flex: 0 0 auto; min-width: 54px; max-width: 70px;
  border-radius: 10px; border: 1px dashed rgba(168,255,196,.4);
  background: rgba(0,0,0,.25); color: var(--text);
  padding: 4px 3px; text-align: center;
}
.rail-slot span { display: block; font-size: 9px; font-weight: 950; color: var(--green); letter-spacing: .05em; }
.rail-slot small { display: block; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-slot.filled { border-style: solid; border-color: rgba(57,255,136,.55); background: rgba(57,255,136,.12); }
.rail-slot.filled small { color: var(--text); }
.rail-slot.eligible { border-style: solid; border-color: var(--gold); background: rgba(255,214,107,.14); box-shadow: 0 0 10px rgba(255,214,107,.3); }
.rail-slot.pitch-toggle { border-style: solid; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.mini-stats div { flex: 1; display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 3px 2px; }
.mini-stats span { font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mini-stats b { font-size: 13px; }
html.in-app .screen.draft.active {
  display: flex; flex-direction: column; gap: 6px;
  height: calc(var(--appvh, 100dvh) - 12px);
  min-height: 0;
  overflow: hidden;
  position: relative;
}
html.in-app .draft .topbar { margin: 0; flex: 0 0 auto; }
html.in-app .draft .topbar h1 { font-size: 17px; }
html.in-app .mini-stats { display: flex; gap: 5px; flex: 0 0 auto; }
html.in-app .action-prompt { padding: 8px 10px; font-size: 14px; margin: 0; flex: 0 0 auto; }
html.in-app .spin-stage.single-reel { margin: 0; flex: 0 0 auto; }
html.in-app .spin-stage.spun .spin-btn { display: none; }
html.in-app .spin-stage.spun .spin-tile { min-height: 40px; padding: 4px 8px; }
html.in-app .spin-stage.spun .spin-tile strong { font-size: 18px; margin: 2px 0 0; }
html.in-app .spin-stage.spun .tile-reroll-btn { min-height: 20px; padding: 2px 6px; }
html.in-app .draft-layout { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; gap: 0; }
html.in-app .board-panel { display: none; }
html.in-app .screen.draft.pitch-open .board-panel {
  display: grid; position: absolute; left: 4px; right: 4px; top: 4px; bottom: 64px;
  z-index: 30; background: rgba(8, 22, 16, .97);
  border: 1px solid rgba(168,255,196,.28); border-radius: 16px;
  overflow: auto; padding: 10px;
}
html.in-app .screen.draft.pitch-open .lineup-board.pitch { min-height: 300px; }
html.in-app .choices-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
html.in-app .choices-panel .panel-head { margin: 0 0 4px; }
html.in-app .choices-panel .panel-head h2 { font-size: 13px; }
html.in-app #choiceHint { display: none; }
html.in-app .choice-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
html.in-app .slot-rail { display: flex; gap: 4px; overflow-x: auto; flex: 0 0 auto; padding: 2px 0 4px; }
@media (max-width: 700px) {
.screen.draft.active {
  display: flex; flex-direction: column; gap: 6px;
  height: calc(var(--appvh, 100dvh) - 12px);
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.draft .topbar { margin: 0; flex: 0 0 auto; }
.draft .topbar h1 { font-size: 17px; }
.mini-stats { display: flex; gap: 5px; flex: 0 0 auto; }
.action-prompt { padding: 8px 10px; font-size: 14px; margin: 0; flex: 0 0 auto; }
.spin-stage.single-reel { margin: 0; flex: 0 0 auto; }
.spin-stage.spun .spin-btn { display: none; }
.spin-stage.spun .spin-tile { min-height: 40px; padding: 4px 8px; }
.spin-stage.spun .spin-tile strong { font-size: 18px; margin: 2px 0 0; }
.spin-stage.spun .tile-reroll-btn { min-height: 20px; padding: 2px 6px; }
.draft-layout { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; gap: 0; }
.board-panel { display: none; }
.screen.draft.pitch-open .board-panel {
  display: grid; position: absolute; left: 4px; right: 4px; top: 4px; bottom: 64px;
  z-index: 30; background: rgba(8, 22, 16, .97);
  border: 1px solid rgba(168,255,196,.28); border-radius: 16px;
  overflow: auto; padding: 10px;
}
.screen.draft.pitch-open .lineup-board.pitch { min-height: 300px; }
.choices-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.choices-panel .panel-head { margin: 0 0 4px; }
.choices-panel .panel-head h2 { font-size: 13px; }
#choiceHint { display: none; }
.choice-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.slot-rail { display: flex; gap: 4px; overflow-x: auto; flex: 0 0 auto; padding: 2px 0 4px; }

}
/* ---- Two-row formation rail, clear of the home indicator; share CTA ---- */
.slot-rail { flex-direction: column; }
.rail-row { display: flex; gap: 4px; }
.rail-slot { flex: 1 1 0; min-width: 0; max-width: none; }
html.in-app .slot-rail, html.in-app .screen.draft .slot-rail {
  flex-direction: column; overflow: visible;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 700px) {
  .slot-rail { flex-direction: column; overflow: visible; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .screen.draft.pitch-open .board-panel { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
html.in-app .screen.draft.pitch-open .board-panel { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.share-cta {
  width: 100%;
  min-height: 56px;
  border: 0; border-radius: 16px;
  color: #04110a; font-size: 18px; font-weight: 1000; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(135deg, #fff86b 0%, #39ff88 52%, #00d7ff 100%);
  box-shadow: 0 12px 36px rgba(57,255,136,.3), inset 0 -6px 14px rgba(0,0,0,.18);
}
/* ---- Finger-sized country reroll, docked to the right of the reel tile ---- */
html.in-app .spin-tile, .spin-tile { position: relative; }
html.in-app .tile-reroll-btn,
html.in-app .spin-stage.spun .tile-reroll-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  min-height: 46px; margin: 0; padding: 8px 12px;
  font-size: 13px; font-weight: 900; border-radius: 12px; z-index: 2;
}
html.in-app .spin-tile { padding-right: 128px; }
html.in-app .spin-stage.spun .spin-tile { min-height: 56px; }
@media (max-width: 700px) {
  .tile-reroll-btn, .spin-stage.spun .tile-reroll-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    min-height: 46px; margin: 0; padding: 8px 12px;
    font-size: 13px; font-weight: 900; border-radius: 12px; z-index: 2;
  }
  .spin-tile { padding-right: 128px; }
  .spin-stage.spun .spin-tile { min-height: 56px; }
}
/* country label reads from the left of the tile, rolling and locked alike */
html.in-app .spin-tile { text-align: left; padding-left: 14px; }
@media (max-width: 700px) {
  .spin-tile { text-align: left; padding-left: 14px; }
}
/* ---- Rarity: drop the text chip, keep the tier as a left edge tint ---- */
.player-row { grid-template-columns: 32px minmax(170px, 1.8fr) minmax(80px, .75fr) 56px 56px 70px minmax(90px, .9fr); }
.player-row.mythic { border-left: 3px solid #ffe27a; }
.player-row.icon { border-left: 3px solid #ffad57; }
.player-row.legend { border-left: 3px solid #a6e5ff; }
.player-row.rare { border-left: 3px solid #8fffba; }
.player-row.hero { border-left: 3px solid #d7b6ff; }
.pick-cell { color: var(--green); font-weight: 950; text-align: center; }
html.in-app .player-row { grid-template-columns: 22px minmax(0, 1fr) 44px 40px; }
@media (max-width: 700px) {
  .player-row { grid-template-columns: 22px minmax(0, 1fr) 44px 40px; }
}

/* ---- Locked country: identical type to the rolling state, it just settles ---- */
html.in-app .spin-stage.spun .spin-tile strong {
  font-size: clamp(26px, 8vw, 34px);
  margin: 2px 0 0;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255,214,107,.32);
}
@media (max-width: 700px) {
  .spin-stage.spun .spin-tile strong {
    font-size: clamp(26px, 8vw, 34px);
    margin: 2px 0 0;
    color: var(--gold);
    text-shadow: 0 0 28px rgba(255,214,107,.32);
  }
}

/* ---- Reroll reads as a real button ---- */
.tile-reroll-btn {
  border: 1px solid rgba(57,255,136,.55);
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(160deg, rgba(57,255,136,.28), rgba(0,0,0,.35));
  box-shadow: 0 4px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.18);
}
.tile-reroll-btn:disabled { opacity: .4; }
/* ---- Squad stats table on the results screen ---- */
.squad-stats { display: flex; flex-direction: column; gap: 4px; }
.stat-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(7, 34px);
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.07);
}
.stat-line span { min-width: 0; }
.stat-line span b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.stat-line span small { color: var(--muted); font-size: 10px; }
.stat-line > b { text-align: center; font-size: 13px; }
.stat-line-head { background: transparent; border-style: dashed; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.stat-line-head span, .stat-line-head b { font-size: 9px; }
.stat-line.star { border-color: rgba(255,214,107,.55); background: rgba(255,214,107,.10); }
.stat-line.star span b { color: var(--gold); }
html.in-app .stat-line { grid-template-columns: minmax(0, 1fr) repeat(7, 26px); gap: 3px; }
@media (max-width: 700px) {
  .stat-line { grid-template-columns: minmax(0, 1fr) repeat(7, 26px); gap: 3px; }
}
.match .scorers { display: block; font-style: normal; color: #9fe8bb; font-size: 10px; margin-top: 2px; }
/* ---- Formation picker on the landing screen ---- */
.formation-pick { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.formation-pick button {
  border: 1px solid rgba(168,255,196,.3);
  background: rgba(0,0,0,.3);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
}
.formation-pick button.active {
  color: #04110a;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(57,255,136,.35);
}
