:root {
  color-scheme: dark;
  --night: #07101b;
  --panel: rgba(12, 24, 38, .92);
  --panel2: #152638;
  --line: rgba(238, 243, 234, .14);
  --chalk: #eef3ea;
  --muted: #93a6b8;
  --gold: #ffd23f;
  --sand: #ff8a1f;
  --sky: #19c3c9;
  --red: #ff5a4f;
  --green: #6ad06a;
  --display: "Arial Narrow", Impact, sans-serif;
  --body: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 15px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app { position: relative; width: 100%; height: 100%; overflow: hidden; }
#stage { position: absolute; inset: 0; }
.game-canvas { position: absolute; inset: 0; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
input { font: inherit; color: var(--chalk); background: #0b1826; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; -webkit-user-select: text; user-select: text; }
input[type="color"] { width: 44px; height: 32px; padding: 2px; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; }
.eyebrow { font-family: var(--display); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: var(--gold); }
.label { font-family: var(--display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; letter-spacing: .02em; }
h2 { font-size: 28px; font-weight: 900; }
.sec { font-size: 17px; margin: 18px 0 8px; color: var(--chalk); }

/* ---------- screens ---------- */
#screens { position: absolute; inset: 0; pointer-events: none; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; pointer-events: auto;
  background: linear-gradient(180deg, rgba(7, 16, 27, .78), rgba(7, 16, 27, .9));
  padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.screen.title {
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 138, 31, .4), transparent 60%), linear-gradient(180deg, rgba(11, 26, 43, .75), rgba(7, 16, 27, .92));
}
.wrap { max-width: 1040px; margin: 0 auto; }

.title-card { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 14vw, 120px); line-height: .9; margin: 0; text-transform: uppercase; }
h1 .t1 { color: var(--sand); }
h1 .t2 { color: var(--sky); }
.tagline { margin: 0; color: var(--muted); font-size: 17px; }
.big-btn {
  margin-top: 12px; padding: 16px 40px; border: 0; border-radius: 999px; background: var(--gold); color: #1c1400;
  font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(255, 210, 63, .3);
}
.big-btn:active { transform: scale(.97); }
.status { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px 16px;
  font-family: var(--display); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: 15px;
}
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); color: #1c1400; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { background: #4a1616; border-color: #7a2a2a; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 14px 30px; font-size: 20px; }
.chip {
  border: 1px solid var(--line); background: rgba(21, 38, 56, .8); border-radius: 999px; padding: 7px 13px;
  font-size: 13px; font-weight: 600;
}
.chip.on { background: var(--gold); color: #1c1400; border-color: transparent; }
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.row.end { justify-content: flex-end; }
.wrap-row { flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.col-btns { display: flex; flex-direction: column; gap: 10px; }

.scr-head { display: flex; align-items: center; gap: 12px; max-width: 1040px; margin: 0 auto 8px; }
.scr-head h2 { flex: 1; }
.btn.back { padding: 8px 12px; }
.coins { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--gold); white-space: nowrap; }
.coins.big { font-size: 26px; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, #ffd23f 45%, #b8860b); box-shadow: 0 0 0 2px rgba(0, 0, 0, .3) inset; display: inline-block; }
.coins.big .coin { width: 24px; height: 24px; }

/* ---------- home ---------- */
.home { max-width: 980px; margin: 0 auto; }
.home-top { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.hb-club { flex: 1; min-width: 0; }
.hb-club h2 { font-size: clamp(24px, 5vw, 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.xpbar { flex: 1; max-width: 220px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sand), var(--gold)); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles.small { grid-template-columns: repeat(4, 1fr); }
.tile {
  position: relative; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-height: 104px;
  background: linear-gradient(160deg, rgba(30, 52, 76, .95), rgba(14, 28, 44, .95)); display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
}
.tiles.small .tile { min-height: 70px; align-items: center; justify-content: center; }
.tile b { font-family: var(--display); font-size: 24px; text-transform: uppercase; font-weight: 900; }
.tile span { font-size: 13px; color: var(--muted); }
.tile:active { transform: scale(.98); }
.t-play { grid-column: span 2; grid-row: span 2; background: linear-gradient(150deg, #ff8a1f, #b3470c); border-color: transparent; }
.t-play b { font-size: 40px; }
.t-play span { color: #ffe2c4; }
.t-draft { background: linear-gradient(150deg, #5a2a8a, #26124a); }
.t-store { background: linear-gradient(150deg, #8a6a12, #3a2a06); }
.t-online { background: linear-gradient(150deg, #0f6f73, #07353a); }
.dot { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.settings { margin-top: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.set { display: flex; flex-direction: column; gap: 4px; }

/* ---------- tabs, modal, toast ---------- */
.tabs { display: flex; gap: 6px; max-width: 1040px; margin: 0 auto 10px; }
.tab { flex: 1; border: 1px solid var(--line); background: var(--panel); padding: 10px; border-radius: 10px; font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.tab.on { background: var(--gold); color: #1c1400; }
.modal-wrap { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { width: 100%; max-width: 460px; max-height: 92%; overflow: auto; background: #0e1c2c; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; padding: 14px 16px 6px; position: sticky; top: 0; background: #0e1c2c; z-index: 1; }
.modal-head h3 { flex: 1; font-size: 20px; }
.modal .x { background: none; border: 0; font-size: 28px; line-height: 1; padding: 0 6px; color: var(--muted); }
.modal-body { padding: 6px 16px 16px; }
.toast { position: absolute; left: 50%; bottom: 28px; transform: translate(-50%, 40px); opacity: 0; background: #0e1c2c; border: 1px solid var(--gold); padding: 10px 18px; border-radius: 999px; z-index: 80; transition: .25s; pointer-events: none; max-width: 90%; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- player cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcard {
  position: relative; border-radius: 12px; padding: 10px 10px 8px; min-height: 196px; display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(160deg, #6b4a2a, #3a2412); border: 2px solid #a87a4a; color: #fff; cursor: pointer; overflow: hidden;
}
.pcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .12) 45%, transparent 60%); pointer-events: none; }
.pcard.silver { background: linear-gradient(160deg, #8e9aa6, #4e5864); border-color: #d0d8e0; }
.pcard.gold { background: linear-gradient(160deg, #c99a2a, #6e4d0c); border-color: #ffd23f; }
.pcard.elite { background: linear-gradient(160deg, #2a6fd0, #10265a); border-color: #7ab8ff; }
.pcard.hero { background: linear-gradient(160deg, #b0237a, #3a0a52); border-color: #ff9ae0; box-shadow: 0 0 18px rgba(255, 120, 220, .35); }
.pc-top { display: flex; align-items: center; gap: 6px; }
.pc-ovr { font-family: var(--display); font-size: 34px; font-weight: 900; line-height: 1; }
.pc-pos { font-family: var(--display); font-weight: 800; font-size: 16px; }
.pc-top .flag { margin-left: auto; }
.pc-num { position: absolute; right: 10px; top: 42px; font-family: var(--display); font-size: 40px; font-weight: 900; opacity: .22; }
.pc-name { font-family: var(--display); font-weight: 800; font-size: 18px; text-transform: uppercase; margin-top: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; font-size: 12px; }
.pc-stats b { font-size: 14px; }
.pcard.small { min-height: 0; }
.flag { display: inline-flex; width: 24px; height: 16px; border-radius: 2px; overflow: hidden; flex-direction: column; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); flex-shrink: 0; }
.flag i { flex: 1; }
.stars { display: inline-flex; gap: 1px; font-size: 12px; color: rgba(255, 255, 255, .25); }
.stars b.on { color: var(--gold); }

/* ---------- store ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pack { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; background: var(--panel); }
.pack-art { width: 64px; height: 84px; border-radius: 8px; display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-weight: 900; margin-bottom: 6px; background: linear-gradient(160deg, #3a8c3b, #1b4d22); box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.pack-gold .pack-art, .pack-starter .pack-art { background: linear-gradient(160deg, #ffd23f, #b8860b); color: #3a2a00; }
.pack-premium .pack-art { background: linear-gradient(160deg, #7ab8ff, #1a4aa0); }
.pack-hero .pack-art { background: linear-gradient(160deg, #ff9ae0, #6a1a8a); }
.pack-name { font-family: var(--display); font-weight: 900; font-size: 19px; text-transform: uppercase; }
.pack-desc { font-size: 13px; color: var(--muted); }
.pack-price { margin-top: 6px; font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 17px; }
.pack.owned { border-color: var(--gold); }

/* ---------- walkout ---------- */
.walkout { position: absolute; inset: 0; z-index: 90; background: #000; overflow: hidden; display: grid; place-items: center; cursor: pointer; }
.walkout .fw { position: absolute; inset: 0; width: 100%; height: 100%; }
.walkout .spot { position: absolute; left: 50%; top: -10%; width: 70vmin; height: 120vmin; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 100%, rgba(255, 240, 200, .5), transparent 65%); opacity: 0; transition: opacity 1s; clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.walkout.s1 .spot { opacity: 1; }
.wo-stage { position: absolute; font-family: var(--display); font-weight: 900; text-transform: uppercase; color: #fff; opacity: 0; transform: scale(.6); transition: .5s; text-align: center; }
.wo-nat { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 34px; top: 30%; }
.wo-nat .flag { width: 96px; height: 64px; }
.wo-pos { font-size: 60px; top: 48%; color: var(--sky); }
.wo-ovr { font-size: 110px; top: 58%; color: var(--gold); }
.walkout.s2 .wo-nat, .walkout.s3 .wo-pos, .walkout.s4 .wo-ovr { opacity: 1; transform: scale(1); }
.walkout.s3 .wo-nat, .walkout.s4 .wo-pos, .walkout.s5 .wo-stage { opacity: 0; transform: scale(1.4); }
.wo-pos, .wo-ovr { top: auto; }
.wo-card { width: 210px; opacity: 0; transform: perspective(700px) rotateY(180deg) scale(.5); transition: 1s cubic-bezier(.2, .9, .2, 1.1); }
.walkout.s5 .wo-card { opacity: 1; transform: perspective(700px) rotateY(0) scale(1.15); }
.wo-card .pcard { min-height: 250px; }
.wo-tap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .6); font-size: 14px; }

/* ---------- lineup ---------- */
.lineup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.teamline { display: flex; gap: 14px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.teamline b { font-family: var(--display); font-size: 22px; color: var(--gold); }
.teamline .btn { margin-left: auto; }
.minipitch {
  position: relative; width: 100%; aspect-ratio: 68 / 80; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .5);
  background: repeating-linear-gradient(0deg, #2f7d32 0 10%, #3a8c3b 10% 20%);
}
.minipitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(255, 255, 255, .5); }
.minipitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, .5); border-radius: 50%; transform: translate(-50%, -50%); }
.slot {
  position: absolute; z-index: 1; transform: translate(-50%, -50%); width: 68px; min-height: 56px; border-radius: 10px; border: 2px dashed rgba(255, 255, 255, .6);
  background: rgba(0, 0, 0, .35); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px; font-size: 11px; line-height: 1.1;
}
.slot em { font-style: normal; font-weight: 800; font-size: 10px; opacity: .85; }
.slot b { font-family: var(--display); font-size: 20px; }
.slot span { max-width: 62px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.filled { border-style: solid; background: linear-gradient(160deg, #6b4a2a, #3a2412); }
.slot.filled.silver { background: linear-gradient(160deg, #8e9aa6, #4e5864); }
.slot.filled.gold { background: linear-gradient(160deg, #c99a2a, #6e4d0c); }
.slot.filled.elite { background: linear-gradient(160deg, #2a6fd0, #10265a); }
.slot.filled.hero { background: linear-gradient(160deg, #b0237a, #3a0a52); }
.slot.oop { border-color: var(--red); }
.slot.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 63, .5); }
.chem { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #07101b; }
.chem.c0 { background: var(--red); } .chem.c1 { background: #ff9a3c; } .chem.c2 { background: var(--gold); } .chem.c3 { background: var(--green); }
.plist { display: flex; flex-direction: column; gap: 4px; }
.prow {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-left: 5px solid #a87a4a; border-radius: 8px;
  background: var(--panel); padding: 7px 10px; text-align: left;
}
.prow.silver { border-left-color: #d0d8e0; } .prow.gold { border-left-color: var(--gold); } .prow.elite { border-left-color: #7ab8ff; } .prow.hero { border-left-color: #ff9ae0; }
.prow .ovr { font-family: var(--display); font-size: 20px; width: 30px; }
.prow .pos { font-weight: 800; font-size: 12px; width: 34px; color: var(--muted); }
.prow .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.fit.f2 { background: rgba(106, 208, 106, .2); color: var(--green); }
.fit.f1 { background: rgba(255, 210, 63, .18); color: var(--gold); }
.fit.f0 { background: rgba(255, 90, 79, .2); color: var(--red); }
.tag { font-style: normal; font-size: 11px; color: var(--sky); white-space: nowrap; }
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.detail-side { display: flex; flex-direction: column; gap: 10px; }
.detail-side label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.clubedit { display: grid; grid-template-columns: 1fr 240px; gap: 20px; }
.ce-form > label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label.col { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 10px; }
.ce-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kits { display: flex; gap: 12px; }
.kit { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- play, results, events ---------- */
.versus { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 24px 0; }
.versus.small { margin: 10px 0; }
.vs-team { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; min-width: 200px; text-align: center; }
.vs-mid { font-family: var(--display); font-weight: 900; font-size: 34px; color: var(--muted); }
.big-ovr { font-family: var(--display); font-size: 48px; color: var(--gold); line-height: 1; }
.results { max-width: 720px; }
.res-title { font-size: 40px; margin: 4px 0 10px; }
.res-score { display: flex; align-items: center; justify-content: center; gap: 20px; }
.res-score > b { font-family: var(--display); font-size: 64px; font-weight: 900; }
.rs-team { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 160px; text-align: center; font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.scorers ul { list-style: none; padding: 0; margin: 6px 0; font-size: 14px; }
.scorers ul:first-child { text-align: right; }
.stats { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 12px 0; }
.srow { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; padding: 4px 0; }
.srow > b { font-family: var(--display); font-size: 18px; text-align: center; }
.srow span { display: flex; flex-direction: column; align-items: center; font-size: 13px; color: var(--muted); gap: 3px; }
.srow span i { width: 100%; height: 5px; border-radius: 3px; background: rgba(25, 195, 201, .5); overflow: hidden; }
.srow span em { display: block; height: 100%; background: var(--sand); }
.rewards { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.xp { font-family: var(--display); font-weight: 900; font-size: 24px; color: var(--sky); }
.lvlup { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--gold); text-transform: uppercase; }
.objs { display: flex; flex-direction: column; gap: 8px; }
.obj { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.obj i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.obj.big { grid-template-columns: 1fr auto; }
.obj.big > div { display: flex; flex-direction: column; gap: 4px; }
.obj em { display: block; height: 100%; background: var(--gold); }
.obj.done { border-color: rgba(106, 208, 106, .6); }
.claimed { color: var(--green); font-weight: 700; font-size: 13px; }
.season { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.season .xpbar { flex-basis: 100%; max-width: none; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.lv { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; opacity: .6; }
.lv.reach { opacity: 1; border-color: rgba(255, 210, 63, .5); }
.lv.packlv { background: linear-gradient(160deg, rgba(90, 42, 138, .5), rgba(14, 28, 44, .9)); }
.lvn { font-family: var(--display); font-weight: 900; font-size: 22px; }
.lvr { font-size: 13px; }

/* ---------- draft and penalties ---------- */
.intro { max-width: 640px; margin: 10px auto; }
.rw-table { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.rw-table div { display: flex; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.draft-pick { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 18px; align-items: start; }
.pick { display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; }
.pick .pcard { width: 100%; }
.pk-board { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.pk-board div { display: flex; align-items: center; gap: 6px; }
.pk-board b { width: 50px; font-family: var(--display); }
.pk { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.pk.goal { background: var(--green); } .pk.save, .pk.miss { background: var(--red); }
.pk-s { margin-left: auto; font-family: var(--display); font-size: 26px; font-weight: 900; }
.pk-msg { text-align: center; font-family: var(--display); font-size: 22px; font-weight: 800; min-height: 1.4em; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; font-family: var(--display); }
.hud-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: flex-start; gap: 10px; }
.pp { background: rgba(7, 16, 27, .75); border-radius: 10px; padding: 6px 10px; min-width: 130px; }
.pp-name { font-weight: 900; font-size: 16px; text-transform: uppercase; color: var(--gold); }
.pp-pos { font-size: 12px; color: var(--muted); font-family: var(--body); }
.stam { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); margin-top: 4px; overflow: hidden; }
.stam i { display: block; height: 100%; width: 100%; background: var(--green); }
.sb { margin: 0 auto; display: flex; align-items: center; gap: 0; background: rgba(7, 16, 27, .85); border-radius: 10px; overflow: hidden; font-weight: 900; font-size: 20px; }
.sb-t { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.sb-t b { width: 6px; height: 22px; border-radius: 2px; display: inline-block; }
.sb-score { background: var(--chalk); color: #07101b; padding: 6px 12px; min-width: 70px; text-align: center; }
.sb-clock { padding: 6px 12px; background: rgba(255, 210, 63, .15); color: var(--gold); min-width: 64px; text-align: center; }
.hud-btns { display: flex; gap: 6px; pointer-events: auto; }
.hb { background: rgba(7, 16, 27, .75); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 800; font-size: 12px; }
.hb.off { color: var(--muted); }
.ticker { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 46px); left: 50%; transform: translate(-50%, -8px); opacity: 0; background: rgba(7, 16, 27, .8); padding: 6px 14px; border-radius: 99px; font-family: var(--body); font-size: 14px; transition: .3s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.ticker.on { opacity: 1; transform: translate(-50%, 0); }
.banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center; opacity: 0; transform: scale(.8); transition: .3s; }
.banner.on { opacity: 1; transform: scale(1); }
.bn-main { display: inline-block; font-weight: 900; font-size: clamp(38px, 9vw, 76px); text-transform: uppercase; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 30px rgba(255, 138, 31, .7); letter-spacing: .03em; }
.bn-sub { font-size: 20px; color: var(--gold); font-weight: 800; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.radar { position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: 170px; height: 110px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); }
.powerbar { position: absolute; width: 70px; height: 9px; margin-left: -35px; margin-top: -30px; border-radius: 5px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .6); overflow: hidden; opacity: 0; }
.powerbar.on { opacity: 1; }
.powerbar i { display: block; height: 100%; width: 0; }
.replay { position: absolute; inset: 0; display: none; }
.replay.on { display: block; }
.replay-badge { position: absolute; top: 60px; left: 14px; background: var(--red); color: #fff; font-weight: 900; padding: 4px 12px; border-radius: 6px; letter-spacing: .1em; animation: blink 1s infinite; }
.replay-skip { position: absolute; bottom: 30px; right: 20px; pointer-events: auto; background: var(--gold); color: #1c1400; border: 0; border-radius: 99px; padding: 12px 26px; font-family: var(--display); font-weight: 900; font-size: 18px; text-transform: uppercase; }
@keyframes blink { 50% { opacity: .5; } }
.hud.replaying .touch, .hud.replaying .radar, .hud.replaying .keyhint { display: none; }
.keyhint { position: absolute; left: 10px; bottom: 8px; max-width: calc(50% - 100px); font-family: var(--body); font-size: 11px; color: rgba(255, 255, 255, .6); background: rgba(7, 16, 27, .6); padding: 6px 8px; border-radius: 6px; }
.hud.is-touch .keyhint { display: none; }
.touch { display: none; }
.hud.is-touch .touch { display: block; }
.joy-zone { position: absolute; left: 0; top: 70px; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; }
.joy-base { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); display: none; }
.joy-base.on { display: block; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: translate(-50%, -50%); }
.tbtns { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 250px; height: 220px; pointer-events: none; }
.tb {
  position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55);
  background: rgba(7, 16, 27, .55); color: #fff; font-family: var(--display); font-weight: 900; font-size: 13px; letter-spacing: .04em;
  display: grid; place-items: center; -webkit-user-select: none; user-select: none;
}
.tb.down { background: rgba(255, 210, 63, .6); color: #1c1400; }
.tb-a { right: 0; bottom: 0; width: 96px; height: 96px; font-size: 17px; background: rgba(255, 138, 31, .55); }
.tb-b { right: 110px; bottom: 0; width: 72px; height: 72px; }
.tb-c { right: 104px; bottom: 84px; width: 64px; height: 64px; font-size: 11px; }
.tb-d { right: 14px; bottom: 110px; width: 64px; height: 64px; }
.tb-e { right: 190px; bottom: 6px; width: 58px; height: 58px; font-size: 11px; }
.hud.defend .tb-a { background: rgba(25, 195, 201, .5); }
.hud.is-touch.replaying .touch { display: none; }
.sb, .sb-score, .sb-clock { white-space: nowrap; }
.hud.is-touch .radar { top: calc(max(8px, env(safe-area-inset-top)) + 52px); right: 10px; left: auto; bottom: auto; transform: none; }
.hud.is-touch .ticker { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 236px); }

body:not(.menu) #screens .screen { background: none; }

/* ---------- P1 to P4 additions ---------- */
select { font: inherit; color: var(--chalk); background: #0b1826; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.navfocus { outline: 3px solid var(--gold) !important; outline-offset: 2px; }
.t-street { background: linear-gradient(150deg, #2f6e8c, #122a3a); }
.t-couch { background: linear-gradient(150deg, #b0237a, #3a0a52); }
.t-skill { background: linear-gradient(150deg, #3a8c3b, #12361a); }
.gz { color: var(--gold); font-size: 11px; }

/* HUD: couch chips, effect icons, confetti, big banners */
.chips { display: none; flex-direction: column; gap: 4px; }
.hud.couch .chips { display: flex; }
.hud.couch .pp { display: none; }
.chip-h { display: flex; align-items: center; gap: 6px; background: rgba(7, 16, 27, .75); border-left: 4px solid; border-radius: 8px; padding: 4px 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.chip-h i { width: 10px; height: 10px; border-radius: 50%; }
.chip-h em { font-style: normal; font-family: var(--body); font-weight: 400; color: var(--muted); text-transform: none; }
.pp-fx { font-size: 18px; min-height: 0; line-height: 1.2; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.banner.big .bn-main { color: var(--gold); font-size: clamp(46px, 11vw, 96px); text-shadow: 0 5px 0 rgba(0, 0, 0, .4), 0 0 40px rgba(255, 210, 63, .8); }
.bars .powerbar { border-width: 2px; }
.hud.couch .keyhint { max-width: calc(50% - 100px); font-size: 10px; }

/* Street Rules and Couch Match setup */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 12px 0; }
.opt { position: relative; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 60px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.opt b { font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.opt span { font-size: 13px; color: var(--muted); }
.opt i { position: absolute; right: 12px; top: 12px; font-style: normal; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.opt.on { border-color: var(--gold); }
.opt.on i { background: var(--gold); color: #1c1400; }
.join-help { display: flex; flex-wrap: wrap; gap: 8px 18px; background: var(--panel); border: 1px dashed var(--gold); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.cslots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cslot { display: flex; align-items: center; gap: 10px; min-height: 76px; border: 2px dashed var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(12, 24, 38, .7); }
.cslot.on { border-style: solid; background: var(--panel); }
.cdot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.cs-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cs-main input { padding: 6px 8px; font-weight: 800; }
.cs-side { display: flex; flex-direction: column; gap: 4px; }
.cslot .x { background: none; border: 0; font-size: 24px; color: var(--muted); }

/* G1 to G10 additions */
.sbw { margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hype { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 900; letter-spacing: .12em; color: var(--gold); }
.hud.nohype .hype { display: none; }
.hy { width: 90px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); }
.hy-a { transform: scaleX(-1); }
.hy i { display: block; height: 100%; width: 0; transition: width .3s; }
.hy.on { box-shadow: 0 0 12px var(--gold); animation: blink .4s infinite; }
.objective { background: rgba(7, 16, 27, .85); border: 1px solid var(--gold); border-radius: 99px; padding: 3px 12px; font-size: 13px; font-family: var(--body); }
.objective .tick { color: var(--green); }
.objective.done { border-color: var(--green); }
.combo { font-size: 22px; font-weight: 900; opacity: 0; transform: scale(.7); transition: .2s; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); }
.combo.on { opacity: 1; transform: scale(1); }
.hb-tac { min-height: 48px; min-width: 48px; }
.hud-btns .hb { min-height: 36px; }
.pops { position: absolute; inset: 0; pointer-events: none; }
.pop { position: absolute; transform: translate(-50%, -100%); font-weight: 900; font-size: 22px; color: #fff; white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 0 16px rgba(255, 138, 31, .8); }
.pop.trick { color: var(--gold); font-size: 26px; }
.pop.good { color: var(--green); }
.pop.bad { color: var(--red); }
.ballmark { position: absolute; transform: translate(-50%, -50%); color: #fff; font-size: 20px; text-shadow: 0 0 6px #000; pointer-events: none; }
.rating { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 64px); left: 10px; background: rgba(7, 16, 27, .8); border: 1px solid var(--gold); border-radius: 8px; padding: 4px 10px; font-weight: 900; color: var(--gold); }
.powerbar.timing { background: linear-gradient(90deg, rgba(0, 0, 0, .6) calc(100% - var(--win)), rgba(106, 208, 106, .8) calc(100% - var(--win))); }
.powerbar.timing i { width: 3px !important; position: relative; }
.ctl { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctl th { text-align: left; color: var(--gold); font-family: var(--display); text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ctl td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctl td:first-child { font-weight: 700; }
.tac { display: flex; flex-direction: column; gap: 8px; }
.battery { width: 34px; height: 12px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 3px; overflow: hidden; display: inline-block; }
.battery i { display: block; height: 100%; }
.potm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; justify-content: center; background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.potm b { font-family: var(--display); font-size: 22px; text-transform: uppercase; }
.potm em { font-style: normal; font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--gold); }
.rlist { flex-basis: 100%; display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); }
.rlist b { color: var(--chalk); }
.scout { margin: -10px 0 10px; color: var(--muted); }
.scout b { color: var(--chalk); }
.center-set { align-items: center; margin-bottom: 8px; }
.pc-sm { font-size: 11px; font-weight: 800; color: var(--gold); letter-spacing: .05em; }
.t-scen { background: linear-gradient(150deg, #b3470c, #3a1a06); }
.t-pro { background: linear-gradient(150deg, #1a4aa0, #0a1a3a); }
.t-goals { background: linear-gradient(150deg, #8a1a3a, #2a0a14); }
.scens { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.scen { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.scen.active { border-color: var(--gold); }
.scen p { margin: 0; font-size: 14px; }
.scen .btn { align-self: flex-start; }
.scen-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 19px; text-transform: uppercase; }
.conds { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.sstars b { color: rgba(255, 255, 255, .2); font-size: 16px; }
.sstars b.on { color: var(--gold); }
.scen-stars .sstars b { font-size: 34px; }
.goalrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.goalrow > div { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.gotm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; background: linear-gradient(90deg, rgba(255, 210, 63, .18), var(--panel)); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; }
.savegoal { position: absolute; z-index: 30; bottom: 30px; right: 140px; background: var(--sky); color: #04222a; border: 0; border-radius: 99px; padding: 12px 22px; font-family: var(--display); font-weight: 900; font-size: 18px; text-transform: uppercase; }
.reelbar { position: absolute; z-index: 30; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: rgba(7, 16, 27, .88); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; max-width: 94%; }
.reelbar > b { font-family: var(--display); text-transform: uppercase; margin-right: 4px; }

/* Skill games */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.sk-tile { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: linear-gradient(160deg, rgba(30, 52, 76, .95), rgba(14, 28, 44, .95)); display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.sk-tile b { font-family: var(--display); font-size: 21px; text-transform: uppercase; }
.sk-tile span { font-size: 13px; color: var(--muted); }
.sk-tile em { font-style: normal; font-size: 12px; color: var(--sky); margin-top: auto; }
.medals { display: flex; gap: 6px; }
.md { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.md.bronze.on { background: #cd7f32; } .md.silver.on { background: #d0d8e0; } .md.gold.on { background: var(--gold); }
.medal-big { font-family: var(--display); font-weight: 900; font-size: 30px; text-transform: uppercase; padding: 6px 18px; border-radius: 99px; color: #1c1400; }
.medal-big.bronze { background: #cd7f32; } .medal-big.silver { background: #d0d8e0; } .medal-big.gold { background: var(--gold); }
.hs { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 3px; }
.hs li span { display: inline-block; min-width: 140px; }
.namefield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.skillhud { display: none; position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 54px); left: 50%; transform: translateX(-50%); z-index: 25;
  text-align: center; font-family: var(--display); pointer-events: none; flex-direction: column; align-items: center; gap: 2px; }
body.skill-on .skillhud { display: flex; }
body.skill-on .hud .sb, body.skill-on .hud .radar { display: none; }
.sk-title { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.sk-score { font-size: 40px; font-weight: 900; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.sk-left { font-size: 18px; font-weight: 800; background: rgba(7, 16, 27, .7); padding: 2px 12px; border-radius: 99px; }
.sk-msg { margin-top: 10px; font-size: 28px; font-weight: 900; color: #fff; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 20px rgba(255, 138, 31, .7); }
.skillhud .btn { pointer-events: auto; margin-top: 8px; }
.sk-bar { position: relative; width: 22px; height: 180px; margin-top: 12px; border-radius: 11px; background: rgba(7, 16, 27, .7); border: 2px solid rgba(255, 255, 255, .5); overflow: hidden; }
.sk-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: 11.7%; background: rgba(106, 208, 106, .5); }
.sk-bar.hot i { background: var(--green); }
.sk-bar b { position: absolute; left: 3px; width: 12px; height: 12px; margin-bottom: -6px; border-radius: 50%; background: #fff; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .t-play { grid-column: span 2; grid-row: auto; min-height: 120px; }
  .t-play b { font-size: 32px; }
  .settings { grid-template-columns: 1fr; }
  .cslots { grid-template-columns: 1fr; }
  .lineup, .draft-pick, .clubedit, .detail { grid-template-columns: 1fr; }
  .detail .pcard { max-width: 220px; margin: 0 auto; }
  .versus { gap: 10px; }
  .vs-team { min-width: 0; flex: 1; padding: 12px; }
  .vs-mid { font-size: 22px; }
  .res-score > b { font-size: 46px; }
  .tiles.small { grid-template-columns: repeat(2, 1fr); }
  .pp { min-width: 0; max-width: 34%; }
  .pp-name { font-size: 13px; }
  .sb { font-size: 16px; }
  .sb-t { padding: 5px 6px; }
  .sb-clock, .sb-score { padding: 5px 7px; min-width: 0; }
  .radar { width: 130px; height: 84px; }
  .hb-mute { display: none; }
  .hud-top { gap: 4px; left: 6px; right: 6px; }
  .hb-tac { font-size: 0; min-width: 44px; min-height: 44px; }
  .hb-tac::before { content: "\2699"; font-size: 20px; }
  .hb-pause { min-width: 44px; min-height: 44px; }
  .pp { max-width: 24%; padding: 4px 6px; }
  .pp-pos { display: none; }
  .hy { width: 48px; }
  .sb-clock { font-size: 13px; }
}
@media (max-height: 500px) {
  .radar { width: 120px; height: 78px; }
  .tbtns { transform: scale(.85); transform-origin: right bottom; }
}
