/* =============================================================================
   GOLDEN ROAD LoL — styles  (mobile-first, fixed-viewport)
   -----------------------------------------------------------------------------
   The game lives in #app, a max-540px column. Draft & result screens are sized
   to fit common phones without scrolling; #app scrolls only as a fallback.
   ============================================================================= */
:root {
  --bg: #0a0e1a; --panel: #141b2e; --panel2: #1a2237; --line: #25304b;
  --gold: #c8aa6e; --gold-bright: #f0d28a; --blue: #5bc0de; --teal: #0596aa;
  --cream: #f0e6d2; --muted: #8a93a8; --muted2: #5d6b88; --red: #e0556b; --green: #46d39a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 50% -10%, #182238 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #10283a 0%, transparent 55%),
    var(--bg);
  color: var(--cream);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.4;
}

/* persistent legal footer (accessible from every screen) */
#site-footer { flex: none; display: flex; align-items: center; justify-content: center; gap: 7px; height: 22px; font-size: 9.5px; letter-spacing: .03em; background: var(--bg); border-top: 1px solid var(--line); }
#site-footer a { color: var(--gold); text-decoration: none; font-weight: 700; }
#site-footer a:hover { text-decoration: underline; }
#site-footer .dot, #site-footer .disc { color: var(--muted2); }

/* cookie / ads consent banner */
#consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #0d1322; border-top: 1px solid var(--gold); padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 9px; box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
#consent[hidden] { display: none; }
#consent p { margin: 0; font-size: 12.5px; color: var(--cream); text-align: center; }
#consent a { color: var(--blue); }
.consent-btns { display: flex; gap: 8px; justify-content: center; }
.consent-btns button { flex: 1; max-width: 220px; appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--cream); font-weight: 700; font-size: 12.5px; padding: 11px 12px; border-radius: 9px; cursor: pointer; text-transform: uppercase; letter-spacing: .03em; }
.consent-btns .accept { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #20170a; border-color: var(--gold-bright); }

.layout { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; align-items: stretch; gap: 14px; width: 100%; }
#app {
  flex: 1 1 auto; width: 100%; max-width: 540px; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 9px 11px 12px;
}
.screen { animation: fade .3s ease; }
.screen.draft, .screen.result { display: flex; flex-direction: column; min-height: 100%; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-weight: 800; letter-spacing: .04em; }
b { color: var(--cream); }
.role-svg, .role-img { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.role-img { object-fit: contain; }

/* ------------------------------- buttons -------------------------------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel2);
  color: var(--cream); font-size: 14px; font-weight: 700; letter-spacing: .03em;
  padding: 13px 16px; border-radius: 10px; cursor: pointer; transition: .15s; text-transform: uppercase;
}
.btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #20170a; border-color: var(--gold-bright); box-shadow: 0 6px 20px -8px var(--gold); }
.btn.primary:hover { box-shadow: 0 8px 26px -8px var(--gold); }
.btn.ghost { background: transparent; }
.btn.replay { background: linear-gradient(180deg, #2aa7bd, #0c6577); color: #eafdff; border-color: #5bc0de; box-shadow: 0 6px 22px -8px rgba(91,192,222,.6); }
.btn.replay:hover { border-color: #d3f3fb; box-shadow: 0 10px 28px -8px rgba(91,192,222,.8); }
.btn.share { background: var(--panel); flex: 1; }
.btn.big { font-size: 16px; padding: 15px 22px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ------------------------------- topbar --------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1px 7px; border-bottom: 1px solid var(--line); margin-bottom: 9px; gap: 8px; flex: none;
}
.tb-logo { font-weight: 800; letter-spacing: .1em; color: var(--gold); font-size: 13px; cursor: pointer; white-space: nowrap; }
.tb-logo b { color: var(--blue); }
.tb-title { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* -------------------------------- start --------------------------------- */
.hero { text-align: center; padding: 14px 6px 4px; }
.hero-kicker { color: var(--teal); text-transform: uppercase; letter-spacing: .2em; font-size: 11px; font-weight: 700; }
.hero-title {
  font-size: clamp(38px, 12vw, 70px); line-height: .95; margin: 8px 0 4px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 70%, #9a7d44);
  -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .02em;
}
.hero-title span { display: block; font-size: .42em; letter-spacing: .5em; color: var(--blue); -webkit-text-fill-color: var(--blue); }
.hero-sub { max-width: 600px; margin: 12px auto 18px; color: var(--muted); font-size: 14.5px; }
.hero-sub b { color: var(--gold); }
.trophies { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 4px; margin-bottom: 20px; }
.trophy { background: var(--panel); border: 1px solid var(--line); color: var(--cream); padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.trophy-arrow { color: var(--gold); font-weight: 800; }
.hero-best { margin-top: 14px; color: var(--muted); font-size: 12.5px; }
.hero-best b { color: var(--cream); }
.rules { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
.rule { display: flex; gap: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.rule-ico { font-size: 22px; line-height: 1; }
.rule-h { font-weight: 800; margin-bottom: 2px; }
.rule-p { color: var(--muted); font-size: 13px; }
.start-legal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.start-legal p { color: var(--muted2); font-size: 11px; line-height: 1.55; max-width: 600px; margin: 0 auto; }
.start-legal-links { margin-top: 8px !important; font-size: 12px !important; }
.start-legal-links a { color: var(--gold); text-decoration: none; font-weight: 700; }
.start-legal-links a:hover { text-decoration: underline; }

/* ----------------------------- roster bar ------------------------------- */
.roster-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 5px; flex: none; }
.rb-slot { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 3px; text-align: center; transition: .2s; position: relative; overflow: hidden; }
.rb-slot.open { border-style: dashed; border-color: #34507c; }
.rb-slot.filled { border-color: #33507a; }
.rb-icon { font-size: 17px; line-height: 1.1; }
.rb-role { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 1px; }
.rb-player { font-weight: 800; font-size: 11.5px; margin-top: 2px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-slot:not(.filled) .rb-player { color: var(--muted); }
.rb-meta { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------- wheels --------------------------------- */
.region-label { text-align: center; color: var(--teal); letter-spacing: .16em; font-size: 11px; font-weight: 700; text-transform: uppercase; min-height: 14px; margin-bottom: 6px; flex: none; }
.wheels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; flex: none; }
.wheel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 10px; padding: 7px 6px; text-align: center; }
.wheel-label { font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.wheel-window { height: 32px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(0,0,0,.2); border-radius: 7px; }
.wheel-value { font-size: clamp(13px, 4vw, 18px); font-weight: 800; color: var(--cream); white-space: nowrap; padding: 0 3px; }
.wheel.spinning .wheel-value { animation: blur .12s linear infinite; color: var(--blue); }
.wheel.landed { border-color: var(--gold); }
.wheel.landed .wheel-value { color: var(--gold-bright); }
@keyframes blur { 0% { filter: blur(.4px); transform: translateY(-2px); } 50% { filter: blur(1.1px); transform: translateY(2px); } 100% { filter: blur(.4px); transform: translateY(-2px); } }

/* ------------------------------ rerolls --------------------------------- */
.rerolls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: none; }
.reroll-btn { appearance: none; background: var(--panel); border: 1px solid var(--line); color: var(--cream); padding: 9px 3px; border-radius: 9px; font-weight: 700; font-size: 10px; line-height: 1; white-space: nowrap; cursor: pointer; transition: .15s; display: flex; align-items: center; justify-content: center; gap: 4px; }
.reroll-btn:hover:not(:disabled) { border-color: var(--blue); }
.reroll-btn:disabled { opacity: .35; cursor: not-allowed; }
.rr-count { flex: none; min-width: 14px; padding: 1px 4px; border-radius: 5px; background: var(--teal); color: #04222a; font-weight: 800; text-align: center; }
.reroll-note { text-align: center; color: var(--muted2); font-size: 9.5px; margin: 3px 0 5px; flex: none; }

/* ----------------------------- candidates ------------------------------- */
.cand-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 1px 0 5px; line-height: 1.4; flex: none; }
.cand-hint b { color: var(--gold); }
.cand-open { display: inline-block; margin-top: 2px; color: var(--teal); font-weight: 700; font-size: 11px; }
.cand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; align-content: start; }
.cand-card {
  text-align: left; background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 11px; padding: 8px 9px; cursor: pointer;
  transition: .15s; color: var(--cream); position: relative; overflow: hidden;
}
.cand-card:hover:not(.used) { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 10px 24px -16px var(--gold); }
.cand-card.used { opacity: .42; cursor: not-allowed; filter: grayscale(.7); }
.cc-name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-role { font-size: 10px; color: var(--blue); margin-top: 1px; font-weight: 700; }
.cc-team { font-size: 11.5px; color: var(--cream); margin-top: 5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-year { font-size: 10px; color: var(--muted); }
.cc-pick { margin-top: 6px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--gold); }
.cc-used { margin-top: 6px; font-size: 10px; font-weight: 700; color: var(--muted); }

/* ------------------------------- result --------------------------------- */
.tr-wrap { text-align: center; margin: 0 0 5px; flex: none; }
.tr-label { text-transform: uppercase; letter-spacing: .18em; font-size: 10.5px; color: var(--muted); }
.tr-value {
  font-size: clamp(32px, 10vw, 48px); font-weight: 800; line-height: 1;
  background: linear-gradient(180deg, #aee6f4, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.roster-summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1px 11px; margin-bottom: 4px; flex: none; }
.rs-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.rs-row:last-child { border-bottom: none; }
.rs-ico { font-size: 14px; width: 18px; text-align: center; }
.rs-name { font-weight: 800; font-size: 13.5px; }
.rs-team { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.path-title { text-align: center; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-size: 10.5px; margin-bottom: 4px; flex: none; }

/* The Golden Road — a staggered zig-zag of 6 medallion stops, Worlds = finale */
.road { position: relative; height: 156px; margin: 4px 0 4px; flex: none; }
.road-track { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.road-line { stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; animation: roadline .55s ease forwards .15s; }
@keyframes roadline { to { opacity: .95; } }

.road-node { position: absolute; width: 0; height: 0; z-index: 1; opacity: 0; animation: fadein .3s ease forwards; }
@keyframes fadein { to { opacity: 1; } }

.rn-badge {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; background: radial-gradient(circle at 50% 32%, #243456, var(--panel2));
  border: 2px solid #33436a; color: var(--cream); box-shadow: inset 0 1px 2px rgba(255,255,255,.07);
}
.rn-badge.champ { background: radial-gradient(circle at 50% 28%, var(--gold-bright), var(--gold) 70%, #9a7d44); color: #20170a; border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(200,170,110,.18), 0 6px 16px -6px rgba(200,170,110,.7); }
.rn-badge.miss { color: var(--red); border-color: rgba(224,85,107,.6); background: radial-gradient(circle at 50% 35%, rgba(224,85,107,.2), rgba(224,85,107,.05)); }
.rn-badge.finale { width: 48px; height: 48px; font-size: 20px; border-width: 3px; box-shadow: 0 0 0 4px rgba(91,192,222,.14), 0 8px 22px -8px rgba(91,192,222,.55); }
.rn-badge.finale.champ { box-shadow: 0 0 0 4px rgba(200,170,110,.24), 0 10px 28px -8px rgba(200,170,110,.9); }
.rn-badge.finale.miss { box-shadow: 0 0 0 4px rgba(224,85,107,.18), 0 8px 22px -8px rgba(224,85,107,.5); }
.rn-acc { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.rn-badge.finale .rn-acc { top: -17px; font-size: 17px; }

.rn-text { position: absolute; left: 0; width: 104px; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.road-node.top .rn-text { top: -22px; transform: translate(-50%, -100%); }
.road-node.bottom .rn-text { top: 22px; transform: translate(-50%, 0); }
.road-node.finale.bottom .rn-text { top: 29px; }
.rn-stage { font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); line-height: 1.1; }
.rn-place { font-size: 10px; font-weight: 800; color: var(--cream); line-height: 1.1; }
.road-node.champ .rn-stage, .road-node.finale .rn-stage { color: var(--gold); }
.road-node.champ .rn-place { color: var(--gold-bright); }
.road-node.miss .rn-place { color: var(--red); }
.road-node.finale .rn-place { color: var(--blue); }
.road-node.finale.champ .rn-place { color: var(--gold-bright); }

.verdict { text-align: center; margin: 0 0 2px; padding: 9px 12px; border-radius: var(--radius); font-size: clamp(16px, 5vw, 22px); font-weight: 800; letter-spacing: .05em; animation: pop .4s ease; flex: none; }
.verdict.win { background: linear-gradient(180deg, rgba(200,170,110,.22), rgba(200,170,110,.05)); border: 1px solid var(--gold); color: var(--gold-bright); }
.verdict.fail { background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.verdict-sub { font-size: 11.5px; font-weight: 600; margin-top: 4px; color: var(--cream); }
.verdict.fail .verdict-sub { color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 9px; flex: none; }
.action-row { display: flex; gap: 8px; }
.action-row .btn { flex: 1 1 0; min-width: 0; font-size: 14px; padding: 14px 10px; }
.result-tagline { text-align: center; color: var(--muted); font-size: 11px; margin-top: 3px; flex: none; }

/* ------------------------------- share ---------------------------------- */
.share-card { background: linear-gradient(160deg, #0c1322, #14213a); border: 2px solid var(--gold); border-radius: 16px; padding: 16px 14px; text-align: center; margin-bottom: 12px; }
.sc-title { font-family: Georgia, serif; font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: .05em; }
.sc-title span { color: var(--blue); letter-spacing: .3em; }
.sc-status { font-weight: 800; letter-spacing: .08em; margin: 6px 0; font-size: 14px; }
.sc-status.win { color: var(--gold-bright); }
.sc-status.fail { color: var(--muted); }
.sc-tr { font-size: 15px; color: var(--cream); margin-bottom: 8px; }
.sc-tr b { color: var(--blue); font-size: 22px; }
.share-card .roster-summary { background: rgba(0,0,0,.25); margin: 10px 0; text-align: left; }
.sc-path { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 8px; }
.scp { background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 11.5px; font-weight: 700; }
.scp i { display: block; font-style: normal; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.sc-watermark { margin-top: 11px; color: var(--gold); font-weight: 800; letter-spacing: .12em; font-size: 12.5px; }

.share-row { display: flex; gap: 8px; margin-bottom: 6px; }
.save-msg { text-align: center; color: var(--green); font-size: 12.5px; min-height: 16px; font-weight: 700; }

/* ------------------------------- toast ---------------------------------- */
.toast { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%) translateY(20px); background: var(--panel2); border: 1px solid var(--gold); color: var(--cream); padding: 11px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: 0; transition: .25s; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------ larger screens -------------------------- */
@media (min-width: 768px) {
  #app { padding: 14px 16px 16px; }
  .topbar { font-size: 14px; padding-bottom: 10px; margin-bottom: 12px; }
  .tb-logo { font-size: 14px; } .tb-title { font-size: 11px; }
  .rules { grid-template-columns: 1fr 1fr; }
  .roster-bar { gap: 7px; margin-bottom: 12px; }
  .rb-slot { padding: 9px 5px; } .rb-icon { font-size: 19px; } .rb-player { font-size: 13px; } .rb-meta { font-size: 10px; }
  .wheels { gap: 9px; margin-bottom: 11px; } .wheel { padding: 10px 8px; } .wheel-window { height: 40px; } .wheel-label { font-size: 10px; }
  .rerolls { gap: 8px; } .reroll-btn { font-size: 12px; padding: 11px 6px; }
  .reroll-note { font-size: 11px; }
  .cand-hint { font-size: 13px; } .cand-grid { gap: 9px; }
  .cand-card { padding: 12px 13px; } .cc-name { font-size: 17px; } .cc-team { font-size: 13px; }
  .rs-name { font-size: 14.5px; } .rs-team { font-size: 12.5px; } .rs-row { padding: 7px 0; }
  .road { height: 196px; }
  .rn-badge { width: 44px; height: 44px; font-size: 18px; } .rn-badge.finale { width: 60px; height: 60px; font-size: 24px; }
  .rn-stage { font-size: 9.5px; } .rn-place { font-size: 11px; } .rn-text { width: 120px; }
  .road-node.top .rn-text { top: -28px; } .road-node.bottom .rn-text { top: 28px; } .road-node.finale.bottom .rn-text { top: 37px; }
  .btn.big { font-size: 17px; padding: 16px 26px; }
}
