:root {
  --bg: #07090f;
  --glass: rgba(14, 17, 26, 0.94);
  --glass-2: rgba(24, 28, 40, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --cyan: #2cf2b5;
  --blue: #1f6bff;
  --gold: #ffd23f;
  --home: #1d5cff;
  --away: #e0202a;
  --text: #f3f7ff;
  --muted: #8b93a7;
  --radius: 10px;
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --display: 'Barlow Condensed', 'Arial Narrow', 'Arial Black', sans-serif;
  --ui: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --btn-scale: 1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--ui); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: none;
}
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
svg { display: block; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 20; }

#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(0, 4, 20, 0.38) 100%), linear-gradient(180deg, rgba(255, 220, 160, 0.05), transparent 30%); }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 60; }
#fade.on { opacity: 1; }

/* ---------------- shared bits ---------------- */
.crest {
  width: 46px; aspect-ratio: 1; display: grid; place-items: center; flex: none;
  clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%);
  font-family: var(--display); font-size: 22px; color: #fff;
}
.crest span { transform: translateY(-2px); text-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.crest-home { background: linear-gradient(160deg, #5a8dff, #1240c8 60%, #0a2a8f); }
.crest-away { background: repeating-linear-gradient(90deg, #e3222b 0 8px, #8e0a12 8px 13px); }
.crest-away span { color: var(--gold); }
.crest.big { width: clamp(84px, 24vh, 130px); font-size: clamp(40px, 11vh, 64px); }
.load-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.12); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 14px rgba(62, 232, 255, 0.7); transition: width .25s ease; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon-btn .ico { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.94); }

.mbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 14px; font-weight: 700; font-size: 17px; letter-spacing: .5px;
  background: var(--glass-2); border: 1px solid var(--line); transition: transform .08s, background .15s;
}
.mbtn .ico { width: 18px; height: 18px; }
.mbtn:active { transform: scale(.97); }
.mbtn.primary { background: linear-gradient(180deg, #ffe45c, #ffb800); color: #1a1200; border: 0; font-family: var(--display); letter-spacing: 1px; box-shadow: 0 8px 22px rgba(255, 184, 0, .3); }
.mbtn.danger { color: #ff8a8a; }

/* ---------------- boot: studio sting ---------------- */
#boot { z-index: 50; background: #02040c; }
#studio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; animation: studioOut .5s ease 2.3s forwards; }
.studio-mark { width: clamp(80px, 22vh, 120px); height: auto; }
.studio-mark .ring { stroke-dasharray: 277; stroke-dashoffset: 277; animation: ring 1s cubic-bezier(.6,0,.2,1) .15s forwards; transform-origin: 60px 60px; transform: rotate(-90deg); }
.studio-mark .orbit { transform-origin: 60px 60px; opacity: 0; animation: orbit 1.1s cubic-bezier(.5,0,.2,1) .5s forwards; }
.studio-mark .bolt { opacity: 0; transform-origin: 60px 60px; animation: bolt .45s cubic-bezier(.2,1.6,.4,1) .95s forwards; }
.studio-name { font-family: var(--display); font-size: clamp(26px, 8vh, 44px); letter-spacing: 6px; background: linear-gradient(90deg, #fff, #9fdcff); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; animation: rise .6s ease 1.1s forwards; }
.studio-sub { font-weight: 700; color: var(--cyan); letter-spacing: 6px; font-size: 14px; opacity: 0; animation: rise .6s ease 1.35s forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }
@keyframes orbit { 0% { opacity: 0; transform: rotate(-200deg); } 100% { opacity: 1; transform: rotate(0); } }
@keyframes bolt { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: scale(1); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(12px); } 100% { opacity: 1; transform: none; } }
@keyframes studioOut { to { opacity: 0; transform: scale(1.06); visibility: hidden; } }

/* ---------------- boot: title / loading ---------------- */
#title { position: absolute; inset: 0; opacity: 0; animation: fadeIn .8s ease 2.5s forwards; overflow: hidden; }
@keyframes fadeIn { to { opacity: 1; } }
.title-art, .hero-art, .pm-art { position: absolute; inset: 0; background: url('../assets/hero.jpg') center/cover no-repeat; }
.title-art { animation: kenburns 18s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.16) translate(-2.5%, 1.5%); } }
.title-shade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(3,6,18,.92) 0%, rgba(3,6,18,.55) 38%, rgba(3,6,18,0) 65%),
  linear-gradient(0deg, rgba(3,6,18,.95) 0%, rgba(3,6,18,0) 45%); }
.title-logo { position: absolute; left: calc(36px + var(--sl)); top: 14%; line-height: .9; }
.tl-super { font-family: var(--display); font-style: italic; font-size: clamp(40px, 13vh, 84px); letter-spacing: 1px; background: linear-gradient(180deg, #fff 40%, #a9cbff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.tl-27 { font-family: var(--display); font-style: italic; font-size: clamp(64px, 24vh, 150px); color: var(--gold); text-shadow: 0 0 34px rgba(255, 210, 63, .45), 0 6px 0 rgba(0,0,0,.35); margin-top: -4px; }
.tl-by { margin-top: 10px; font-size: clamp(14px, 3.6vh, 19px); color: #cfdcff; letter-spacing: 2px; text-transform: uppercase; }
.tl-by b { color: var(--cyan); }
.title-foot { position: absolute; left: calc(36px + var(--sl)); right: calc(36px + var(--sr)); bottom: calc(22px + var(--sb)); max-width: 560px; }
.load-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 7px; letter-spacing: 1px; text-transform: uppercase; }
#load-pct { color: #fff; }
.load-tip { margin-top: 9px; font-size: 14px; color: #c6d3f0; min-height: 18px; }
.tap-start { display: none; margin-top: 12px; font-family: var(--display); letter-spacing: 3px; font-size: clamp(16px, 4.4vh, 22px); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
#title.ready .tap-start { display: block; }
#title.ready .load-row, #title.ready .load-bar { opacity: .35; }
@keyframes pulse { 50% { opacity: .35; } }
.title-ver { position: absolute; right: calc(16px + var(--sr)); bottom: calc(12px + var(--sb)); font-size: 12px; color: rgba(255,255,255,.4); letter-spacing: 1px; }

/* ---------------- main menu (hub) ---------------- */
#menu { display: flex; flex-direction: column; padding: calc(10px + var(--st)) calc(16px + var(--sr)) calc(8px + var(--sb)) calc(16px + var(--sl));
  background: linear-gradient(90deg, rgba(3,7,22,.88), rgba(3,7,22,.55) 55%, rgba(3,7,22,.3)), linear-gradient(0deg, rgba(3,7,22,.8), transparent 40%); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-style: italic; color: #111; background: linear-gradient(135deg, #ffe45c, #ffb300); box-shadow: 0 6px 18px rgba(255,190,0,.3); }
.brand-txt b { display: block; font-family: var(--display); font-style: italic; letter-spacing: 1px; font-size: 18px; }
.brand-txt small { color: var(--muted); font-weight: 700; letter-spacing: 2px; font-size: 11px; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.page { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.tile { position: relative; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; text-align: left; }
.tile-hero { padding: 16px 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.45); transition: transform .12s; }
.tile-hero:active { transform: scale(.985); }
.tile-hero.loading { filter: grayscale(.7) brightness(.75); pointer-events: none; }
.hero-art { transition: transform 6s ease; }
.tile-hero:hover .hero-art { transform: scale(1.06); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,8,26,.95) 8%, rgba(4,8,26,.35) 60%, rgba(4,8,26,.1)); }
.tile-hero > *:not(.hero-art):not(.hero-shade) { position: relative; }
.tile-tag { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-weight: 700; font-size: 12px; letter-spacing: 2px; padding: 4px 10px; border-radius: 30px; background: rgba(62,232,255,.14); color: var(--cyan); border: 1px solid rgba(62,232,255,.35); }
.tile-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 1.6s infinite; }
.tile-title { font-family: var(--display); font-style: italic; font-size: clamp(34px, 11vh, 60px); line-height: .95; text-shadow: 0 4px 20px rgba(0,0,0,.5); }
.matchup { display: flex; align-items: center; gap: 12px; }
.mu-team { display: flex; align-items: center; gap: 8px; font-size: clamp(15px, 4vh, 20px); }
.mu-team .crest { width: 34px; font-size: 16px; }
.mu-vs { font-family: var(--display); color: var(--muted); font-size: 14px; }
.tile-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-meta span { font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,.1); color: #dfe8ff; }
.play-fab { position: absolute !important; right: 16px; bottom: 16px; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: #1a1200; background: linear-gradient(180deg, #ffe45c, #ffb800); box-shadow: 0 0 0 6px rgba(255,210,63,.18), 0 10px 26px rgba(255,180,0,.45); animation: fab 2.2s ease-in-out infinite; }
.play-fab .ico { width: 30px; height: 30px; margin-left: 3px; }
@keyframes fab { 50% { box-shadow: 0 0 0 12px rgba(255,210,63,.05), 0 10px 26px rgba(255,180,0,.45); } }
.hub-col { display: grid; grid-template-rows: auto auto 1fr; gap: 10px; min-height: 0; }
.tile-quick { padding: 12px 14px; display: grid; gap: 10px; }
.q-row label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.seg { display: flex; background: rgba(255,255,255,.06); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 6px 4px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.seg button.on { background: linear-gradient(180deg, #3b7bff, #1f4fd6); color: #fff; box-shadow: 0 3px 12px rgba(42,107,255,.45); }
.tile-small { display: flex; align-items: center; gap: 12px; padding: 10px 14px; transition: transform .1s, border-color .15s; }
.tile-small:active { transform: scale(.98); }
.tile-small .ico { width: 30px; height: 30px; color: var(--cyan); flex: none; }
.tile-small b { display: block; font-family: var(--display); letter-spacing: 1px; font-size: 16px; }
.tile-small small { color: var(--muted); font-weight: 600; font-size: 13px; }
.ticker { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: #c3d0ee; min-height: 22px; }
.tk-label { font-weight: 700; font-size: 11px; letter-spacing: 2px; padding: 2px 8px; border-radius: 6px; background: var(--gold); color: #1a1200; }
#tip-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.install-tip { color: var(--muted); white-space: nowrap; }

/* ---------------- pre-match loading ---------------- */
#prematch { z-index: 40; background: #02040c; overflow: hidden; }
.pm-art { filter: blur(6px) brightness(.55); transform: scale(1.1); }
.pm-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(10,20,60,.2), rgba(2,4,14,.9) 75%), linear-gradient(90deg, rgba(29,92,255,.35), transparent 35%, transparent 65%, rgba(224,32,42,.35)); }
.pm-head { position: absolute; top: calc(16px + var(--st)); left: 0; right: 0; display: flex; justify-content: center; gap: 12px; align-items: center; font-weight: 700; letter-spacing: 3px; font-size: 13px; color: var(--muted); }
.pm-head b { color: var(--cyan); }
.pm-teams { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 8vw, 90px); }
.pm-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pm-home { animation: slideL .7s cubic-bezier(.2,.9,.3,1) both; }
.pm-away { animation: slideR .7s cubic-bezier(.2,.9,.3,1) both; }
@keyframes slideL { from { opacity: 0; transform: translateX(-60px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(60px); } }
.pm-name { font-family: var(--display); font-size: clamp(22px, 7vh, 38px); text-shadow: 0 4px 16px rgba(0,0,0,.6); }
.pm-sub { font-weight: 700; letter-spacing: 3px; font-size: 12px; color: var(--muted); }
.pm-vs { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise .6s ease .3s both; }
.pm-vs b { font-family: var(--display); font-style: italic; font-size: clamp(36px, 12vh, 64px); color: var(--gold); text-shadow: 0 0 30px rgba(255,210,63,.4); }
.pm-vs small { font-weight: 700; letter-spacing: 2px; color: #c7d4f2; font-size: 12px; white-space: nowrap; }
.pm-foot { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--sb)); width: min(560px, 80vw); text-align: center; }
.pm-tip { font-size: 14px; color: #d6e1ff; margin-bottom: 9px; min-height: 18px; }
.pm-studio { margin-top: 10px; font-family: var(--display); letter-spacing: 4px; font-size: 11px; color: rgba(255,255,255,.35); }

/* ---------------- modal + settings ---------------- */
.modal { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(2, 5, 16, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: calc(10px + var(--st)) calc(12px + var(--sr)) calc(10px + var(--sb)) calc(12px + var(--sl)); }
.modal-card { width: min(760px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 20px; background: linear-gradient(160deg, rgba(14,26,62,.96), rgba(6,12,32,.96)); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .22s cubic-bezier(.2,1.4,.4,1); overflow: hidden; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--display); font-style: italic; letter-spacing: 2px; font-size: 20px; }
.icon-btn.close { width: 36px; height: 36px; font-size: 16px; }
.set-body { display: flex; min-height: 0; flex: 1; }
.set-tabs { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-right: 1px solid var(--line); min-width: 128px; overflow: auto; }
.set-tabs button { text-align: left; padding: 9px 12px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--muted); letter-spacing: .5px; }
.set-tabs button.on { background: rgba(62,232,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.set-pane { flex: 1; overflow: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl b { display: block; font-size: 16px; }
.set-row .lbl small { color: var(--muted); font-size: 13px; font-weight: 600; }
.set-row .seg { min-width: 220px; }
.toggle { width: 54px; height: 30px; border-radius: 20px; background: rgba(255,255,255,.14); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.toggle.on { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.toggle.on::after { transform: translateX(24px); }
.range { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.range input { flex: 1; accent-color: var(--cyan); height: 28px; touch-action: none; }
.range output { width: 44px; text-align: right; font-weight: 700; }
.cam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; }
.cam-card { padding: 9px 8px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); text-align: center; transition: border-color .15s, background .15s; }
.cam-card svg { width: 100%; height: 44px; color: #9fb4e6; }
.cam-card b { display: block; margin-top: 4px; font-size: 15px; }
.cam-card small { color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.15; display: block; }
.cam-card.on { border-color: var(--cyan); background: rgba(62,232,255,.1); box-shadow: 0 0 0 1px var(--cyan) inset; }
.cam-card.on svg { color: var(--cyan); }
.set-note { color: var(--gold); font-size: 12px; font-weight: 700; }
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px; overflow: auto; }
.hg { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.hg h4 { margin: 0 0 4px; font-family: var(--display); letter-spacing: 1px; color: var(--cyan); font-size: 14px; }
.hg p { margin: 0; font-size: 14px; color: #d3def7; line-height: 1.3; }

/* ---------------- pause ---------------- */
#pause { z-index: 30; background: linear-gradient(90deg, rgba(2,5,16,.85), rgba(2,5,16,.35)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pause-panel { position: absolute; left: calc(14px + var(--sl)); top: calc(10px + var(--st)); bottom: calc(10px + var(--sb)); width: min(380px, 60vw); display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line-2); overflow: auto; animation: slideL .3s cubic-bezier(.2,.9,.3,1); }
.pp-head { display: flex; align-items: center; justify-content: space-between; }
.pp-head h2 { margin: 0; font-family: var(--display); font-style: italic; letter-spacing: 2px; font-size: 24px; }
.pp-score { display: flex; align-items: center; gap: 7px; font-family: var(--display); font-size: 14px; }
.pp-score b { background: #fff; color: #08102a; padding: 2px 8px; border-radius: 6px; }
.pp-score small { color: var(--muted); font-family: var(--ui); font-weight: 700; }
.pp-h { color: #7aa2ff; } .pp-a { color: #ff7a80; }
.pp-label { font-weight: 700; font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.cam-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cam-strip button { padding: 7px 4px; border-radius: 10px; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted); }
.cam-strip button.on { color: #fff; border-color: var(--cyan); background: rgba(62,232,255,.12); }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: auto; }

/* ---------------- result ---------------- */
#result { z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(2,5,16,.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.result-card { width: min(560px, 92vw); max-height: 96vh; overflow: auto; padding: 14px 20px; border-radius: 22px; background: linear-gradient(160deg, rgba(14,26,62,.95), rgba(6,12,32,.95)); border: 1px solid var(--line-2); display: grid; gap: 8px; text-align: center; animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.rc-tag { justify-self: center; font-weight: 700; letter-spacing: 3px; font-size: 12px; padding: 3px 12px; border-radius: 20px; background: var(--gold); color: #1a1200; }
.final { display: flex; align-items: center; justify-content: center; gap: 22px; font-family: var(--display); font-size: 17px; }
.ft-team { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ft-score { display: flex; align-items: center; gap: 10px; font-size: 52px; }
.ft-score i { width: 14px; height: 4px; background: var(--muted); border-radius: 2px; }
#ft-msg { font-family: var(--display); color: var(--cyan); letter-spacing: 2px; }
#ft-stats { display: grid; gap: 7px; }
.st-row { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; font-weight: 700; }
.st-row .bar { position: relative; height: 22px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; display: flex; }
.st-row .bar i { height: 100%; }
.st-row .bar .h { background: linear-gradient(90deg, #1d5cff, #4f86ff); }
.st-row .bar .a { background: linear-gradient(90deg, #ff4d55, #c3141c); }
.st-row .bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #000; }
.row { display: flex; gap: 10px; margin-top: 4px; }
.row .mbtn { flex: 1; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#scorebar {
  position: absolute; top: calc(8px + var(--st)); left: calc(10px + var(--sl));
  display: flex; align-items: stretch; height: 30px; border-radius: 9px; overflow: hidden;
  background: rgba(6, 12, 32, 0.88); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.4); font-family: var(--display); font-size: 15px;
}
.sb-team { display: flex; align-items: center; gap: 6px; padding: 0 9px; }
.sb-team i { width: 5px; height: 18px; border-radius: 3px; }
.sb-home i { background: var(--home); color: var(--home); box-shadow: 0 0 8px currentColor; }
.sb-away i { background: var(--away); color: var(--away); box-shadow: 0 0 8px currentColor; }
.sb-score { display: flex; align-items: center; gap: 7px; padding: 0 10px; background: linear-gradient(180deg, #fff, #dfe6f5); color: #08102a; font-size: 17px; }
.sb-score b { width: 7px; height: 3px; background: #08102a55; border-radius: 2px; }
#clock { display: flex; align-items: center; padding: 0 10px; background: linear-gradient(180deg, #2a6bff, #1c4fd6); font-family: var(--ui); font-weight: 700; font-size: 16px; min-width: 62px; justify-content: center; }
#pause-btn {
  position: absolute; top: calc(8px + var(--st)); right: calc(10px + var(--sr)); width: 40px; height: 34px; pointer-events: auto;
  background: rgba(6, 12, 32, 0.8); border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 5px;
}
#pause-btn span { width: 5px; height: 15px; background: #fff; border-radius: 2px; }
#radar { position: absolute; top: calc(6px + var(--st)); left: 50%; transform: translateX(-50%); width: 168px; height: 109px; opacity: .9; }
#player-tag {
  position: absolute; left: calc(10px + var(--sl)); top: calc(44px + var(--st)); display: flex; align-items: center; gap: 6px;
  background: rgba(6, 12, 32, 0.72); border: 1px solid var(--line); border-radius: 9px; padding: 3px 9px 3px 4px; font-weight: 700; font-size: 15px; flex-wrap: wrap; width: 160px;
}
#pt-num { background: var(--home); border-radius: 5px; padding: 0 6px; font-family: var(--display); font-size: 13px; }
#stamina { width: 100%; height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
#stamina i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #39ff88, #c8ff39); }
#power { position: absolute; overflow: visible; width: 70px; height: 9px; border-radius: 5px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.5); transform: translate(-50%, -50%); display: none; }
#power i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #39ff88, #ffd21f 70%, #ff3b3b); }
#power.chip { border-color: #ffe45c; }
#power.chip i { background: linear-gradient(90deg, #fff6b0, #ffe45c); }

#banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; transform: scale(.8); transition: opacity .3s, transform .3s cubic-bezier(.2, 1.6, .4, 1); }
#banner.show { opacity: 1; transform: scale(1); }
#banner .b1 { font-family: var(--display); font-style: italic; font-size: clamp(46px, 15vh, 110px); line-height: 1; letter-spacing: 3px;
  background: linear-gradient(180deg, #fff 30%, #ffd21f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
#banner .b2 { display: inline-block; margin-top: 8px; font-family: var(--display); font-size: clamp(15px, 4vh, 24px); padding: 4px 16px; border-radius: 8px; background: rgba(6, 12, 32, .85); }
#banner.home .b2 { background: var(--home); }
#banner.away .b2 { background: var(--away); }
#event { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); font-family: var(--display); font-style: italic; font-size: clamp(18px, 5vh, 30px); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 20px rgba(62,232,255,.6); opacity: 0; transition: opacity .2s; white-space: nowrap; }
#event.show { opacity: 1; }
#hint { position: absolute; bottom: calc(14px + var(--sb)); left: 50%; transform: translateX(-50%); background: rgba(6,12,32,.85); border: 1px solid var(--line); padding: 6px 14px; border-radius: 10px; font-weight: 700; font-size: 15px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#hint.show { opacity: 1; }
#replay-badge { position: absolute; top: calc(52px + var(--st)); right: calc(14px + var(--sr)); display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 8px;
  background: rgba(6, 12, 32, .85); font-family: var(--display); font-style: italic; letter-spacing: 2px; font-size: 16px; opacity: 0; transition: opacity .25s; }
#replay-badge.show { opacity: 1; }
#replay-badge i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; animation: pulse 1s infinite; }
#replay-badge small { font-family: var(--ui); font-style: normal; letter-spacing: 0; font-size: 11px; color: var(--muted); }
#hud.replaying #radar, #hud.replaying #player-tag, #hud.replaying #event, #hud.replaying #power { display: none !important; }
#hud.no-radar #radar { display: none; }
#fps { position: absolute; bottom: calc(4px + var(--sb)); left: calc(8px + var(--sl)); font: 700 11px var(--ui); color: #9fe; opacity: .8; display: none; }
#hud.show-fps #fps { display: block; }

/* ---------------- touch controls ---------------- */
#controls { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#joy-zone { position: absolute; left: 0; top: 22%; width: 50%; bottom: 0; pointer-events: auto; touch-action: none; }
#joy-base {
  position: absolute; width: 130px; height: 130px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(62,232,255,.04), rgba(255,255,255,.1)); border: 2px solid rgba(255,255,255,.25);
  left: calc(110px + var(--sl)); top: calc(100% - 110px - var(--sb)); pointer-events: none; transition: opacity .15s;
}
#joy-base::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.14); }
#joy-base.idle, #joy-base:not(.active):not(.idle) { opacity: .5; }
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff, #b9c9ef); box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 0 4px rgba(62,232,255,.15);
}
#buttons { position: absolute; right: calc(10px + var(--sr)); bottom: calc(8px + var(--sb)); width: 300px; height: 240px; pointer-events: none; transform: scale(var(--btn-scale)); transform-origin: bottom right; }
.btn {
  position: absolute; border-radius: 50%; pointer-events: auto; touch-action: none; display: grid; place-items: center;
  font-family: var(--display); font-size: 12px; letter-spacing: .5px; color: #fff;
  --c: 120, 150, 220;
  background: radial-gradient(circle at 50% 25%, rgba(255,255,255,.32), rgba(255,255,255,.04) 60%), rgba(var(--c), .38);
  border: 2px solid rgba(var(--c), .9); box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 0 18px rgba(var(--c), .35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: transform .06s, background .1s;
}
.btn span { text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }
.btn.down { transform: scale(.9); background: radial-gradient(circle at 50% 25%, rgba(255,255,255,.55), rgba(255,255,255,.15) 60%), rgba(var(--c), .7); }
.b-sprint { width: 104px; height: 104px; right: 6px; bottom: 8px; font-size: 15px; --c: 140, 160, 200; }
.b-pass { width: 82px; height: 82px; right: 122px; bottom: 4px; font-size: 14px; --c: 42, 120, 255; }
.b-shoot { width: 82px; height: 82px; right: 112px; bottom: 106px; font-size: 14px; --c: 240, 60, 70; }
.b-through { width: 66px; height: 66px; right: 22px; bottom: 128px; font-size: 11px; --c: 30, 200, 130; }
.b-skill { width: 62px; height: 62px; right: 214px; bottom: 28px; font-size: 10px; --c: 170, 90, 255; }
#controls.defend .b-pass { --c: 255, 170, 30; }
#controls.defend .b-shoot { --c: 255, 100, 40; }
.btn .flick {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-style: normal; font-family: var(--ui); font-weight: 700; font-size: 10px; letter-spacing: .5px; line-height: 1;
  padding: 2px 5px; border-radius: 6px; background: rgba(5, 10, 28, .82); color: #ffe45c; border: 1px solid rgba(255, 228, 92, .35);
  display: flex; align-items: center; gap: 2px;
}
.btn .flick .ico { width: 8px; height: 8px; }
.btn.flicked { box-shadow: 0 0 0 4px rgba(255, 228, 92, .8), 0 0 22px rgba(255, 228, 92, .7); }
.btn.flicked .flick { background: #ffe45c; color: #1a1200; }
#controls.defend .flick, #controls.defend .sk { display: none; }
.btn .sk { position: absolute; width: 9px; height: 9px; color: #ffe45c; pointer-events: none; filter: drop-shadow(0 1px 1px #000); }
.sk-u { top: 3px; left: 50%; transform: translateX(-50%); } .sk-d { bottom: 3px; left: 50%; transform: translateX(-50%); }
.sk-l { left: 4px; top: 50%; transform: translateY(-50%); } .sk-r { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-height: 380px) {
  #buttons { transform: scale(calc(var(--btn-scale) * .82)); }
  #joy-base { width: 110px; height: 110px; }
  .tile-quick { padding: 9px 12px; gap: 7px; }
  .set-row { padding: 8px 0; }
}
@media (max-width: 640px) {
  .page { grid-template-columns: 1fr; overflow: auto; }
  .set-tabs { min-width: 100px; }
  .cam-grid { grid-template-columns: repeat(2, 1fr); }
  .help-grid { grid-template-columns: 1fr; }
}

/* ---------------- rotate prompt ---------------- */
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-family: var(--display); text-align: center; padding: 20px; }
#rotate .phone { width: 54px; height: 92px; border: 4px solid #fff; border-radius: 10px; animation: rot 1.8s ease-in-out infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}

/* ================= icons ================= */
.ico { width: 1em; height: 1em; fill: currentColor; flex: none; }
.ico.in { display: inline-block; vertical-align: -2px; width: 12px; height: 12px; color: var(--cyan); }
.install-tip { display: inline-flex; align-items: center; gap: 5px; }
.install-tip .ico { width: 14px; height: 14px; }

/* ================= top bar: tabs + coins ================= */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs button { position: relative; display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 10px; font-family: var(--display); letter-spacing: 1px; font-size: 14px; color: var(--muted); text-transform: uppercase; transition: color .15s, background .15s; }
.tabs button .ico { width: 18px; height: 18px; }
.tabs button.on { color: #fff; background: linear-gradient(180deg, rgba(62,232,255,.22), rgba(42,107,255,.22)); box-shadow: inset 0 -2px 0 var(--cyan); }
.tabs .dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ff4d55; box-shadow: 0 0 8px #ff4d55; display: none; }
.tabs .dot.on { display: block; }
.coin-pill { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 8px; border-radius: 12px; background: var(--glass); border: 1px solid rgba(255,210,63,.35); font-family: var(--display); font-size: 16px; color: #ffe27a; }
.coin-pill .ico { width: 22px; height: 22px; }
.coin-pill.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* ================= play page: team tile ================= */
.tile-team { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.tt-ovr { width: 58px; height: 58px; border-radius: 14px; display: grid; place-content: center; text-align: center; background: linear-gradient(160deg, #ffe39a, #d9a43a); color: #2b1d00; flex: none; box-shadow: 0 6px 16px rgba(217,164,58,.35); }
.tt-ovr b { font-family: var(--display); font-size: 26px; line-height: 1; }
.tt-ovr small { font-weight: 700; font-size: 8.5px; letter-spacing: 1px; }
.tt-info b { display: block; font-family: var(--display); font-size: 17px; letter-spacing: .5px; }
.tt-info small { color: var(--muted); font-weight: 700; font-size: 13px; }
.tt-stars { display: flex; gap: 4px; margin-top: 3px; }
.tt-stars span { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: linear-gradient(90deg, #5b2bd6, #b45cff); color: #ffe27a; }

/* ================= player cards ================= */
/* sized in em: set font-size on .pcard to scale the whole card (10px = 100 x 140) */
.pcard {
  --bg1: #ffe39a; --bg2: #d9a43a; --fg: #2b1d00; --edge: rgba(255,255,255,.55);
  position: relative; width: 10em; height: 14em; font-size: 10px; flex: none; color: var(--fg);
  clip-path: polygon(12% 0, 88% 0, 100% 7%, 100% 86%, 50% 100%, 0 86%, 0 7%);
  background: linear-gradient(165deg, var(--bg1), var(--bg2)); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; padding: .55em .6em 0;
}
.pcard::after { content: ''; position: absolute; inset: -40% -60%; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.42) 50%, transparent 58%); transform: translateX(-60%); pointer-events: none; }
.pcard.t-star::after, .pcard.t-icon::after, .pcard.t-rare::after { animation: shine 3.4s ease-in-out infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.pc-top { position: relative; width: 100%; height: 6.3em; flex: none; }
.pc-ovr { position: absolute; left: .25em; top: .35em; display: flex; flex-direction: column; align-items: center; line-height: 1; z-index: 1; }
.pc-ovr b { font-family: var(--display); font-weight: 400; font-size: 2.5em; }
.pc-ovr small { font-weight: 700; font-size: 1em; letter-spacing: .05em; margin-top: .1em; }
.pc-num { position: absolute; right: .3em; top: .45em; font-family: var(--display); font-size: 1.05em; opacity: .5; }
.pc-face { position: absolute; right: .6em; bottom: 0; width: 5.9em; height: 5.9em; }
.pc-face svg { width: 100%; height: 100%; display: block; }
.pc-name { width: 100%; flex: none; text-align: center; font-family: var(--display); font-size: 1.05em; line-height: 1.5; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid rgba(0,0,0,.18); }
.pc-stats { width: 86%; display: grid; grid-template-columns: 1fr 1fr; column-gap: .9em; row-gap: .1em; margin-top: .2em; }
.pc-stats span { display: flex; align-items: baseline; gap: .3em; line-height: 1.2; }
.pc-stats b { font-family: var(--display); font-weight: 400; font-size: 1.05em; min-width: 1.3em; }
.pc-stats i { font-style: normal; font-weight: 700; font-size: .85em; opacity: .8; }
.pcard.mini { font-size: 5.6px; padding-top: .5em; }
.pcard.mini .pc-stats, .pcard.mini .pc-num { display: none; }
.pcard.mini .pc-top { height: 8.2em; }
.pcard.mini .pc-face { width: 7.4em; height: 7.4em; right: .2em; }
.pcard.mini .pc-ovr b { font-size: 3em; }
.pcard.mini .pc-ovr small { font-size: 1.5em; }
.pcard.mini .pc-name { font-size: 1.85em; line-height: 1.55; }
.t-bronze { --bg1: #e6ae78; --bg2: #8a5528; --fg: #2a1406; }
.t-silver { --bg1: #f4f7fa; --bg2: #9aa7b4; --fg: #1d242c; }
.t-gold { --bg1: #ffe9a8; --bg2: #d2a03b; --fg: #2b1d00; }
.t-rare { --bg1: #ffd54a; --bg2: #9a6a0a; --fg: #1c1200; background: radial-gradient(circle at 70% 18%, rgba(255,255,255,.55), transparent 40%), linear-gradient(165deg, var(--bg1), var(--bg2)); }
.t-icon { --bg1: #fffaf0; --bg2: #cdbf95; --fg: #3a2c0a; }
.t-star { --bg1: #2a0f52; --bg2: #0b0420; --fg: #ffe27a;
  background: radial-gradient(circle at 30% 12%, rgba(180,92,255,.75), transparent 45%), radial-gradient(circle at 80% 92%, rgba(62,232,255,.45), transparent 45%), linear-gradient(165deg, var(--bg1), var(--bg2)); }
.t-star .pc-ovr b { text-shadow: 0 0 .35em rgba(255,210,63,.8); }
.t-star .pc-name { border-top-color: rgba(255,210,63,.35); }

/* ================= squad page ================= */
#page-squad { grid-template-columns: 1.25fr 1fr; }
.pitch { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2);
  background: repeating-linear-gradient(90deg, #1f7a35 0 9%, #23863a 9% 18%); box-shadow: inset 0 0 60px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.4); }
.pitch::before { content: ''; position: absolute; inset: 6%; border: 2px solid rgba(255,255,255,.4); border-radius: 4px;
  background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.4) calc(50% - 1px), rgba(255,255,255,.4) calc(50% + 1px), transparent calc(50% + 1px)); }
.pitch::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.4); border-radius: 50%; }
.slot { position: absolute; transform: translate(-50%, -50%); z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s; }
.slot .pcard { filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.slot .pos-tag { font-weight: 700; font-size: 10px; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.55); letter-spacing: 1px; }
.slot.sel { transform: translate(-50%, -50%) scale(1.12); z-index: 2; }
.slot.sel .pcard { filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 2px #fff); }
.slot.swap-target .pcard { animation: wiggle .9s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: translateY(-3px); } }
.squad-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.squad-detail { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); overflow: hidden; }
.squad-detail .pcard { font-size: 8.6px; }
.sd-info { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; gap: 4px; }
.sd-info h3 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-info .sub { color: var(--muted); font-weight: 700; font-size: 13px; }
.bars { display: grid; gap: 1px; }
.bars div { display: grid; grid-template-columns: 28px 1fr 22px; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bars i { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.bars i::after { content: ''; display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bars b { color: #fff; text-align: right; }
.train-btn { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 11px; font-family: var(--display); font-size: 13px; letter-spacing: .5px; color: #1a1200; background: linear-gradient(180deg, #ffe45c, #ffb800); }
.train-btn .ico { width: 15px; height: 15px; }
.train-btn[disabled] { filter: grayscale(1) brightness(.6); }
.train-btn small { font-family: var(--ui); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.lv { display: flex; gap: 3px; }
.lv i { width: 10px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); }
.lv i.on { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.bench-head { display: flex; align-items: baseline; gap: 8px; }
.bench-head b { font-family: var(--display); letter-spacing: 1px; font-size: 13px; }
.bench-head small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.bench { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; touch-action: pan-x; -webkit-overflow-scrolling: touch; min-height: 82px; }
.bench .bench-card { position: relative; }
.bench .bench-card.sel .pcard { filter: drop-shadow(0 0 5px var(--cyan)); }
.empty-bench { color: var(--muted); font-size: 13px; align-self: center; }
.sd-empty { display: flex; flex-direction: column; justify-content: center; gap: 6px; color: var(--muted); font-size: 14px; }
.sd-empty b { font-family: var(--display); color: #fff; font-size: 17px; }

/* ================= shop ================= */
#page-shop { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.shop-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-filter { flex: 0 1 380px; }
.daily { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; background: linear-gradient(90deg, #5b2bd6, #b45cff); box-shadow: 0 6px 18px rgba(140,70,255,.35); }
.daily .ico { width: 18px; height: 18px; }
.daily[disabled] { background: var(--glass-2); box-shadow: none; color: var(--muted); }
.shop-grid { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px 8px; padding: 4px 2px 10px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shop-item .pcard { font-size: 9px; }
.buy { display: flex; align-items: center; justify-content: center; gap: 5px; width: 92px; padding: 5px 0; border-radius: 9px; font-family: var(--display); font-size: 13px; background: var(--glass-2); border: 1px solid rgba(255,210,63,.4); color: #ffe27a; }
.buy .ico { width: 15px; height: 15px; }
.buy.confirm { background: linear-gradient(180deg, #ffe45c, #ffb800); color: #1a1200; border: 0; }
.buy.owned { border-color: rgba(62,232,255,.4); color: var(--cyan); }
.buy[disabled] { opacity: .45; }

/* ================= toast + rewards ================= */
.toast { position: absolute; left: 50%; bottom: 46px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; background: rgba(8,16,40,.95); border: 1px solid var(--line-2); font-weight: 700; font-size: 15px; transition: opacity .25s, transform .25s; z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ico { width: 18px; height: 18px; color: var(--cyan); }
.rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rewards span { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,.07); color: #dbe5ff; }
.rewards .total { background: rgba(255,210,63,.15); color: #ffe27a; font-family: var(--display); font-size: 15px; }
.rewards .ico { width: 16px; height: 16px; }
@media (max-height: 380px) {
  .tabs button { padding: 6px 10px; font-size: 13px; }
  .tabs button span { display: none; }
  .tabs button.on span { display: inline; }
}

/* shoot button: shows the chosen shot type while swiping */
.b-shoot .shot-tag { position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%); font-style: normal; font: 700 10px var(--ui); letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; background: #ffe45c; color: #1a1200; display: none; white-space: nowrap; }
.b-shoot[data-shot] .shot-tag { display: block; }
.b-shoot[data-shot="up"] .shot-tag::after { content: 'CHIP'; }
.b-shoot[data-shot="down"] .shot-tag::after { content: 'LOW'; }
.b-shoot[data-shot="right"] .shot-tag::after { content: 'POWER'; }
.b-shoot[data-shot="left"] .shot-tag::after { content: 'FAKE'; }
#power[data-kind]::after { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); font: 700 11px var(--ui); color: #ffe45c; }
#power[data-kind="chip"]::after { content: 'CHIP'; }
#power[data-kind="low"]::after { content: 'LOW DRIVEN'; }
#power[data-kind="power"]::after { content: 'POWER SHOT'; color: #ff8a5c; }
#power[data-kind="power"] i { background: linear-gradient(90deg, #ffb347, #ff3b3b); }

/* ================= clubs / matchmaking ================= */
.crest-q { background: linear-gradient(160deg, #3a4b78, #1a2444); }
.crest-slot { display: grid; place-items: center; }
.crest-slot .club-crest { width: 48px; height: 48px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.crest-slot.big .club-crest { width: clamp(84px, 24vh, 130px); height: clamp(84px, 24vh, 130px); }
.sb-away i { box-shadow: 0 0 8px currentColor; }
#matchmaking { z-index: 40; background: #02040c; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.mm-bg { position: absolute; inset: 0; background: url('../assets/hero.jpg') center/cover; filter: blur(10px) brightness(.35) saturate(1.2); transform: scale(1.15); }
.mm-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(62,232,255,.12), transparent 60%); animation: mmPulse 1.6s ease-in-out infinite; }
@keyframes mmPulse { 50% { opacity: .3; } }
.mm-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mm-head b { font-family: var(--display); letter-spacing: 3px; font-size: clamp(16px, 4.6vh, 22px); }
.mm-head small { color: var(--muted); font-weight: 700; letter-spacing: 2px; font-size: 12px; text-transform: uppercase; }
.mm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); animation: pulse 1s infinite; }
#matchmaking.found .mm-dot { background: #39ff88; box-shadow: 0 0 14px #39ff88; animation: none; }
.mm-stage { position: relative; display: flex; align-items: center; gap: clamp(24px, 9vw, 110px); }
.mm-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 150px; }
.mm-side b { font-family: var(--display); font-size: clamp(18px, 5.5vh, 28px); white-space: nowrap; }
.mm-side small { font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.mm-vs { font-family: var(--display); font-style: italic; font-size: clamp(30px, 10vh, 54px); color: var(--gold); text-shadow: 0 0 26px rgba(255,210,63,.45); }
.mm-reel { width: clamp(84px, 24vh, 130px); height: clamp(84px, 24vh, 130px); display: grid; place-items: center; }
.mm-reel .club-crest { width: 100%; height: 100%; filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)); }
.mm-reel.spin .club-crest { animation: reel .09s linear; }
@keyframes reel { from { transform: translateY(-14px); opacity: .4; } }
#matchmaking.found .mm-reel .club-crest { animation: land .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes land { from { transform: scale(1.35); } }
.mm-cancel { position: relative; padding: 8px 26px; }

/* ================= goal: scorer card ================= */
#goal-card { position: absolute; right: calc(24px + var(--sr)); top: 50%; transform: translate(140%, -50%) rotate(8deg); transition: transform .5s cubic-bezier(.2,1.3,.4,1), opacity .3s; opacity: 0; }
#goal-card.show { transform: translate(0, -50%) rotate(-4deg); opacity: 1; }
#goal-card .pcard { font-size: clamp(10px, 3vh, 13px); filter: drop-shadow(0 0 18px rgba(255,210,63,.55)) drop-shadow(0 10px 20px rgba(0,0,0,.6)); }
#goal-card .gc-tag { margin-top: 6px; text-align: center; font-family: var(--display); letter-spacing: 2px; font-size: 13px; color: var(--gold); text-shadow: 0 2px 6px #000; }
#hud.replaying #goal-card { display: none; }

/* ================= squad: per-attribute training ================= */
.attr-list { display: grid; gap: 3px; overflow-y: auto; touch-action: pan-y; }
.attr { display: grid; grid-template-columns: 74px 1fr 24px 66px; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.attr i { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; position: relative; }
.attr i::after { content: ''; position: absolute; inset: 0; width: var(--v); background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.attr i u { position: absolute; top: 0; bottom: 0; left: var(--b); width: var(--u); background: var(--gold); z-index: 1; text-decoration: none; }
.attr b { color: #fff; text-align: right; font-size: 13.5px; }
.attr button { display: flex; align-items: center; justify-content: center; gap: 3px; height: 24px; border-radius: 7px; font-weight: 700; font-size: 12px; color: #1a1200; background: linear-gradient(180deg, #ffe45c, #ffb800); }
.attr button .ico { width: 12px; height: 12px; }
.attr button[disabled] { filter: grayscale(1) brightness(.55); }
.attr button.max { background: rgba(255,255,255,.08); color: var(--muted); }
.seg.seg5 button { font-size: 12.5px; padding: 6px 2px; }
#controls.celebrating { opacity: 0; pointer-events: none; transition: opacity .25s; }
#controls.celebrating * { pointer-events: none !important; }
.squad-detail .pcard { font-size: 7.6px; }
.attr-list { gap: 1px; }
.attr { grid-template-columns: 70px 1fr 22px 58px; font-size: 12px; }
.attr button { height: 20px; font-size: 11.5px; }
.sd-info h3 { font-size: 16px; }
.sd-info .sub { font-size: 12px; }

/* formation picker + out-of-position tags */
.form-pick { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 11px; background: var(--glass); border: 1px solid var(--line); }
.form-pick button { flex: 1; }
.form-pick button { padding: 3px 7px; border-radius: 7px; font-weight: 700; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.form-pick button.on { background: linear-gradient(180deg, #3b7bff, #1f4fd6); color: #fff; }
.slot .pos-tag.oop { background: #c3141c; }

/* ================= pre-match lineups ================= */
.pm-head { top: calc(8px + var(--st)); }
.pm-top { position: absolute; top: calc(26px + var(--st)); left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 6vw, 70px); }
.pm-club { display: flex; align-items: center; gap: 10px; animation: slideL .6s cubic-bezier(.2,.9,.3,1) both; }
.pm-club.away { animation-name: slideR; text-align: right; }
.pm-club b { display: block; font-family: var(--display); font-size: clamp(17px, 5vh, 26px); white-space: nowrap; }
.pm-club small { font-weight: 700; letter-spacing: 1.5px; font-size: 12px; color: var(--gold); }
.pm-club .crest { width: 44px; font-size: 21px; }
.pm-club .crest-slot .club-crest { width: 46px; height: 46px; }
.pm-vs b { font-size: clamp(26px, 8vh, 42px); }
.lineup-pitch { position: absolute; left: max(3vw, calc(50% - 450px)); right: max(3vw, calc(50% - 450px)); top: calc(84px + var(--st)); bottom: calc(66px + var(--sb));
  border-radius: 14px; border: 1px solid rgba(255,255,255,.18); overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(40,140,60,.55) 0 5%, rgba(34,120,52,.55) 5% 10%); box-shadow: inset 0 0 50px rgba(0,0,0,.5); animation: rise .5s ease .15s both; }
.lineup-pitch::before { content: ''; position: absolute; inset: 5% 2.5%; border: 2px solid rgba(255,255,255,.35); border-radius: 3px;
  background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.35) calc(50% - 1px), rgba(255,255,255,.35) calc(50% + 1px), transparent calc(50% + 1px)); }
.lineup-pitch::after { content: ''; position: absolute; left: 50%; top: 50%; height: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.35); border-radius: 50%; }
.lu { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 1; animation: luIn .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes luIn { from { opacity: 0; transform: translate(-50%, -30%) scale(.6); } }
.lu-face { position: relative; width: clamp(26px, 8.5vh, 40px); height: clamp(26px, 8.5vh, 40px); border-radius: 50%; overflow: hidden; background: #0b1530; border: 2px solid var(--ring, #3b7bff); box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.lu-face svg { width: 120%; height: 120%; margin: -6% 0 0 -10%; }
.lu-num { position: absolute; right: -6px; top: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; font: 700 10px/16px var(--ui); text-align: center; background: var(--ring, #3b7bff); color: var(--ringInk, #fff); }
.lu b { margin-top: 2px; font-weight: 700; font-size: clamp(9px, 2.6vh, 12px); white-space: nowrap; padding: 0 5px; border-radius: 4px; background: rgba(4,10,26,.78); }
.lu.star .lu-face { box-shadow: 0 0 0 2px #ffd23f, 0 0 12px rgba(255,210,63,.7); }
.pm-foot { bottom: calc(10px + var(--sb)); }
.pm-tip { margin-bottom: 6px; font-size: 13px; }
.pm-go { display: none; font-family: var(--display); letter-spacing: 3px; font-size: 14px; margin-bottom: 6px; animation: pulse 1.2s infinite; }
#prematch.ready .pm-go { display: block; }
#prematch.ready .pm-tip { display: none; }

/* ---------- Pro theme: flat surfaces, condensed sports type, one accent ---------- */
h1, h2, h3, .pc-name, .pc-ovr b { font-weight: 800; letter-spacing: .3px; }
[class*="title"], h1, h2 { font-style: italic; text-transform: uppercase; }
* { text-shadow: none !important; }
.slot.sel .pcard { filter: drop-shadow(0 0 0 2px var(--cyan)) drop-shadow(0 0 3px var(--cyan)); }
button:active { transform: scale(.97); }
/* squad: readable details, cards that don't pile up on phones */
.squad-detail { align-items: stretch; overflow: hidden; }
.sd-info { overflow-y: auto; justify-content: flex-start; padding-right: 2px; }
.sd-info h3 { line-height: 1.15; padding-top: 2px; flex: none; font-size: 22px; }
.pc-name { letter-spacing: 0; }
@media (max-height: 430px) {
  .slot .pcard.mini { font-size: 4.7px; }
  .sd-info h3 { font-size: 19px; }
}
.form-pick { flex-wrap: nowrap; }
.form-pick button { padding: 3px 2px; font-size: 11px; min-width: 0; }
.form-pick button.on { background: var(--cyan); color: #04120d; }
@media (max-height: 430px) { .slot .pcard.mini { font-size: 4.3px; } }
/* custom button layout (pause → Button layout) */
#buttons.custom { inset: 0; width: auto; height: auto; transform: none; }
#buttons.custom .btn { right: auto; bottom: auto; translate: -50% -50%; scale: var(--btn-scale); }
#layout-edit { position: fixed; inset: 0; z-index: 45; touch-action: none; background: rgba(4, 6, 12, .35); }
#layout-edit .le-bar { position: absolute; top: calc(10px + var(--st)); left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line-2); white-space: nowrap; }
#layout-edit .le-bar b { font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: .5px; }
#controls.editing { z-index: 44; }
#controls.editing .btn { outline: 2px dashed rgba(255, 255, 255, .8); outline-offset: 4px; }

/* ---------- FC Mobile-style home ---------- */
#menu .ticker { display: none; }
.topbar { margin-bottom: 8px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; background: linear-gradient(90deg, rgba(44,242,181,.16), rgba(14,17,26,.9) 60%); border: 1px solid var(--line-2); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.pf-crest .club-crest { display: block; }
.pf-txt b { display: block; font-family: var(--display); font-style: italic; font-size: 21px; line-height: 1; text-transform: uppercase; }
.pf-txt small { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; font-size: 12px; margin-top: 2px; }
.pf-ovr { color: #04120d; background: var(--cyan); padding: 0 6px; border-radius: 4px; font-weight: 800; }
.pf-ovr i { font-style: normal; }
#page-play { grid-template-columns: 1.45fr 1fr; }
.tile-hero { clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%); border-radius: 6px; padding-right: 40px; }
.tile-hero .tile-title { font-size: clamp(38px, 13vh, 72px); }
.tile-tag { background: var(--cyan); color: #04120d; border: 0; border-radius: 4px; letter-spacing: 1.5px; font-weight: 800; }
.tile-tag i { background: #04120d; box-shadow: none; }
.play-cta { position: absolute !important; right: 34px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 10px 30px 10px 26px; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 30px; color: #1a1200; background: linear-gradient(180deg, #ffe45c, #ffbf00); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); box-shadow: 0 10px 26px rgba(255,180,0,.45); animation: fab 2.2s ease-in-out infinite; }
.play-cta .ico { width: 24px; height: 24px; }
.hub-col { grid-template-rows: 1fr auto auto; }
.hub-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.tile-card { display: flex; flex-direction: column; align-items: center; padding: 8px 8px 6px; gap: 4px; min-height: 0; border-radius: 6px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); background: linear-gradient(160deg, rgba(31,107,255,.28), rgba(14,17,26,.94) 55%); }
.tile-store { background: linear-gradient(160deg, rgba(255,191,0,.25), rgba(14,17,26,.94) 55%); }
.tc-head { align-self: stretch; display: flex; justify-content: space-between; align-items: baseline; }
.tc-head b { font-family: var(--display); font-style: italic; font-size: 18px; letter-spacing: .5px; }
.tc-head small { color: var(--muted); font-weight: 700; font-size: 11px; }
.tc-card { flex: 1; min-height: 0; display: grid; place-items: center; }
.tc-card .pcard { font-size: 5.8px; }
.tile-card .tt-stars { display: none; }
.tile-quick, .tile-small { border-radius: 6px; }
/* bottom navigation bar */
.bottom-nav { order: 9; margin-top: 8px; align-self: center; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(10,12,18,.92); }
.bottom-nav button { flex-direction: column; gap: 1px; padding: 4px 26px; font-size: 12px; border-radius: 6px; }
.bottom-nav button .ico { width: 20px; height: 20px; }
.bottom-nav button.on { color: #04120d; background: var(--cyan); box-shadow: none; }
@media (max-height: 430px) {
  .tc-card .pcard { font-size: 4.6px; }
  .play-cta { font-size: 24px; padding: 7px 24px 7px 20px; }
  .bottom-nav button { padding: 3px 22px; }
}
#page-play #menu-controls { display: none; }
.hub-col { grid-template-rows: minmax(0, 1fr) auto; }
#page-play .tile-quick { padding: 8px 10px; gap: 6px; }
#page-play .q-row { display: flex; align-items: center; gap: 8px; }
#page-play .q-row label { flex: none; width: 74px; font-size: 10px; letter-spacing: 1px; }
#page-play .q-row .seg { flex: 1; }
#page-play .q-row .seg button { padding: 4px 2px; font-size: 12px; }
.tc-card .pcard { font-size: 9px; }
@media (max-height: 430px) { .tc-card .pcard { font-size: 7.4px; } }

/* ---------- extra card colours (editor) ---------- */
.t-toty { --bg1: #2b6dff; --bg2: #061a5c; --fg: #ffe27a; }
.t-ruby { --bg1: #ff3b55; --bg2: #5c0414; --fg: #fff3e0; }
.t-emerald { --bg1: #22d68a; --bg2: #04452a; --fg: #f2fff8; }
.t-black { --bg1: #3a3d46; --bg2: #0a0b0e; --fg: #f4f4f4; }

/* ---------- player editor ---------- */
.editor-btn { margin-left: auto; margin-right: 6px; }
.editor-card { width: min(920px, 94vw); max-height: 92vh; display: flex; flex-direction: column; }
.ed-body { display: flex; gap: 16px; min-height: 0; flex: 1; overflow: hidden; }
.ed-left { flex: none; width: 190px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.ed-left select { width: 100%; padding: 8px; border-radius: 6px; background: var(--glass-2); color: var(--text); border: 1px solid var(--line-2); font: 600 13px var(--ui); }
.ed-preview { display: grid; place-items: center; flex: 1; min-height: 0; }
.ed-preview .pcard { font-size: 10px; }
.ed-actions { display: flex; gap: 8px; }
.ed-actions .mbtn { flex: 1; }
.ed-form { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 6px; touch-action: pan-y; }
.ed-row { display: flex; align-items: center; gap: 10px; }
.ed-row > span { flex: none; width: 92px; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ed-row input { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; touch-action: auto; }
.ed-row input:not([type=range]) { padding: 7px 9px; border-radius: 6px; background: var(--glass-2); color: var(--text); border: 1px solid var(--line-2); font: 600 14px var(--ui); }
.ed-row input[type=range] { accent-color: var(--cyan); }
.ed-stat b { width: 34px; text-align: right; font-family: var(--display); font-size: 18px; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.chip { padding: 5px 9px; border-radius: 5px; font-weight: 700; font-size: 12px; background: var(--glass-2); border: 1px solid var(--line); color: var(--text); }
.chip.on { outline: 2px solid var(--cyan); outline-offset: 1px; }
.card-chip { background: linear-gradient(165deg, var(--bg1), var(--bg2)); color: var(--fg); border: 0; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.sw.on { outline: 3px solid var(--cyan); outline-offset: 2px; }
@media (max-height: 430px) { .ed-left { width: 150px; } .ed-preview .pcard { font-size: 8px; } .ed-form { gap: 4px; } }
.modal-head h2 small.build-no, .modal-head h2 small.cloud-st { font: 600 12px var(--ui); color: var(--muted); letter-spacing: 0; margin-left: 8px; font-style: normal; }
.shop-search, .shop-sort { min-width: 0; padding: 7px 10px; border-radius: 6px; background: var(--glass); color: var(--text); border: 1px solid var(--line-2); font: 600 13px var(--ui); user-select: text; -webkit-user-select: text; touch-action: auto; }
.shop-search { flex: 1; max-width: 220px; }
.shop-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); font-weight: 700; }
.bottom-nav button { transition: none; }
.shop-bar { flex-wrap: nowrap; }
.shop-bar .shop-filter { flex: none; }
.shop-search { flex: 1 1 140px; max-width: 240px; }
.shop-sort { flex: none; }
.editor-btn { margin-left: 0; }
/* a big bench must scroll sideways, never squeeze the pitch off the screen */
#page-squad { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.squad-side, .bench, .form-pick { min-width: 0; }
.page { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
#page-shop { grid-template-columns: minmax(0, 1fr); }
.bench .bench-card { flex: none; }
/* text boxes: iPhone zooms the page into any field under 16px, and needs text selection allowed */
input, select, textarea { font-size: 16px !important; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
/* kits */
.kits-btn { flex: none; margin-left: auto; align-self: center; display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 11px; background: var(--glass); border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 12px; }
.kits-btn .ico { width: 16px; height: 16px; }
.kit-preview { overflow: hidden; }
.kit-preview svg { height: 100%; max-height: 190px; width: auto; max-width: 100%; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
#kit-slots { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ed-row input[type=color] { flex: none; width: 46px; height: 32px; padding: 0 2px; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--line-2); }
.kit-colours { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.kit-colours .ed-row > span { width: 78px; }
/* referee cards */
#banner.card-yellow .b1, #banner.card-red .b1 { font-size: clamp(34px, 11vh, 80px); }
#banner.card-yellow .b1::before, #banner.card-red .b1::before { content: ''; display: inline-block; width: .5em; height: .7em; margin-right: .3em; border-radius: .06em; vertical-align: -.05em; transform: rotate(8deg); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
#banner.card-yellow .b1::before { background: #ffd21f; }
#banner.card-red .b1::before { background: #e3102c; }
#banner.card-red .b2 { background: #b30d24; }
/* celebration picker, right after you score */
.celeb-pick { position: fixed; left: 50%; bottom: calc(18px + var(--sb)); transform: translate(-50%, 20px); display: flex; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(6,12,32,.82); border: 1px solid var(--line-2); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 20; }
.celeb-pick.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.celeb-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 6px 5px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); color: var(--text); font: 700 10.5px var(--ui); }
.celeb-pick button i { font-style: normal; font-size: 22px; line-height: 1; }
.celeb-pick button.on { outline: 2px solid var(--cyan); background: rgba(69,224,255,.18); }
/* player of the match + ratings */
#ft-potm { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; text-align: left; background: linear-gradient(100deg, rgba(255,210,31,.18), rgba(255,210,31,.04)); border: 1px solid rgba(255,210,31,.45); }
#ft-potm:empty { display: none; }
.potm-face { width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.08); }
.potm-face svg { width: 100%; height: 100%; }
.potm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.potm-txt small { font: 800 10px var(--ui); letter-spacing: 1.5px; color: #ffd21f; }
.potm-txt b { font-family: var(--display); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.potm-txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.potm-rt { flex: none; font-family: var(--display); font-size: 22px; padding: 4px 9px; border-radius: 9px; background: #ffd21f; color: #1a1300; }
#ft-ratings { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
#ft-ratings .rt { flex: none; display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 8px 3px 3px; border-radius: 8px; background: rgba(255,255,255,.06); color: #dbe5ff; white-space: nowrap; }
#ft-ratings .rt b { font-family: var(--display); font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.12); }
#ft-ratings .rt.hi b { background: #19c37d; color: #03140c; }
#ft-ratings .rt.ok b { background: #8fd14f; color: #0d1a02; }
#ft-ratings .rt.lo b { background: #ff6b5a; color: #1d0300; }
#ft-ratings .rt.off { opacity: .55; text-decoration: line-through; }
/* landscape phones: two columns so the buttons never scroll away */
@media (orientation: landscape) and (max-height: 560px) {
  .result-card { width: min(880px, 96vw); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; align-items: center;
    grid-template-areas: "tag tag" "final stats" "msg stats" "potm stats" "rewards ratings" "row row"; }
  .result-card .rc-tag { grid-area: tag; justify-self: center; }
  .result-card .final { grid-area: final; }
  #ft-msg { grid-area: msg; }
  #ft-potm { grid-area: potm; }
  #ft-stats { grid-area: stats; gap: 5px; }
  #ft-ratings { grid-area: ratings; }
  .result-card .rewards { grid-area: rewards; }
  .result-card .row { grid-area: row; }
}
/* skill games */
.hub-modes { flex: none; }
.hub-modes .tile-small { padding: 8px 10px; gap: 9px; min-width: 0; }
.hub-modes .tile-small .ico { width: 26px; height: 26px; }
.hub-modes .tile-small b { font-size: 14px; white-space: nowrap; }
.hub-modes .tile-small small { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-modes .tile-small > div { min-width: 0; text-align: left; }
.tile-mode .ico { color: #ff9a3c; }
.drills-card { width: min(720px, 96vw); }
.drill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 4px 2px 6px; overflow-y: auto; }
.drill { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 14px; text-align: left; background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); border: 1px solid var(--line-2); color: var(--text); }
.drill:active { transform: scale(.98); }
.drill .ico { width: 30px; height: 30px; color: #ff9a3c; }
.drill b { font-family: var(--display); font-size: 16px; letter-spacing: .5px; }
.drill p { margin: 0; font-size: 12px; line-height: 1.3; color: var(--muted); font-weight: 600; flex: 1; }
.drill .best { font: 800 11px var(--ui); letter-spacing: 1px; color: #ffd21f; }
#drill-hud { display: none; position: absolute; top: calc(8px + var(--st)); left: 50%; transform: translateX(-50%); min-width: 150px; padding: 4px 14px 5px; border-radius: 12px; text-align: center; background: rgba(6, 12, 32, 0.88); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#drill-hud small { display: block; font: 800 10px var(--ui); letter-spacing: 1.5px; color: #ff9a3c; text-transform: uppercase; }
#drill-hud b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.05; }
#drill-hud span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
#hud.drilling #drill-hud { display: block; }
#hud.drilling #scorebar, #hud.drilling #radar { display: none; }
.drill-res-card { width: min(420px, 92vw); padding: 16px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.drill-res-card h2 { margin: 0; font-family: var(--display); letter-spacing: 1px; }
.dr-score { font-family: var(--display); font-size: 56px; line-height: 1; background: linear-gradient(180deg, #fff 30%, #ffd21f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dr-best { font-weight: 700; color: var(--muted); }
.dr-best.new { color: #19c37d; }
.drill-res-card .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.drill-res-card .mbtn { white-space: nowrap; }
/* season */
.tile-season .ico { color: #ffd21f; }
.season-card { width: min(940px, 97vw); max-height: 94vh; }
.modal-head h2 small#ssn-sub { font: 600 12px var(--ui); color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.ssn-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; min-height: 0; overflow: hidden; flex: 1; }
.ssn-table { overflow-y: auto; min-height: 0; border-radius: 12px; background: rgba(255,255,255,.03); touch-action: pan-y; }
.ssn-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-weight: 700; }
.ssn-table th { position: sticky; top: 0; background: #0d1838; color: var(--muted); font-size: 10.5px; letter-spacing: 1px; padding: 5px 4px; text-align: center; }
.ssn-table td { padding: 3px 4px; text-align: center; border-top: 1px solid rgba(255,255,255,.05); }
.ssn-table .tm { text-align: left; }
.ssn-table td.tm { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.ssn-table td.tm svg { flex: none; width: 18px; height: 18px; }
.ssn-table td.tm span { overflow: hidden; text-overflow: ellipsis; }
.ssn-table tr.me td { background: rgba(69,224,255,.12); color: #fff; }
.ssn-table tr:first-child td:first-child { color: #ffd21f; }
.ssn-side { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; touch-action: pan-y; }
.ssn-next { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; text-align: center; background: linear-gradient(160deg, rgba(29,92,255,.25), rgba(29,92,255,.06)); border: 1px solid rgba(79,134,255,.5); }
.ssn-next.champ { background: linear-gradient(160deg, rgba(255,210,31,.3), rgba(255,210,31,.06)); border-color: rgba(255,210,31,.6); }
.ssn-next small { font: 800 10.5px var(--ui); letter-spacing: 1.2px; color: var(--muted); }
.ssn-vs { display: flex; align-items: center; gap: 12px; font-family: var(--display); color: var(--muted); }
.ssn-vs svg { width: 34px; height: 34px; }
.ssn-opp { font-family: var(--display); font-size: 18px; letter-spacing: .5px; }
.ssn-box { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); display: grid; gap: 3px; }
.ssn-box > small { font: 800 10px var(--ui); letter-spacing: 1.4px; color: var(--muted); margin-bottom: 2px; }
.ssn-box .res { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; font-size: 12px; font-weight: 700; }
.ssn-box .res span:first-child { text-align: right; }
.ssn-box .res b { font-family: var(--display); min-width: 40px; text-align: center; }
.ssn-box .sc { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.ssn-box .sc i { font-style: normal; color: var(--muted); font-size: 10.5px; }
.ssn-box .me { color: var(--cyan); }
.ssn-start { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; text-align: center; }
.ssn-start p { max-width: 460px; margin: 0; color: var(--muted); font-weight: 600; }
.ssn-start .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ico.big { width: 44px; height: 44px; color: #ffd21f; }
.mbtn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 6px; }
.hub-modes { grid-template-columns: 1fr 1fr; }
/* cup */
.tile-cup .ico { color: #b48cff; }
.hub-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hub-modes .tile-small { flex-direction: column; align-items: flex-start; gap: 3px; padding: 7px 9px; }
.hub-modes .tile-small .ico { width: 22px; height: 22px; }
.cup-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; min-height: 0; overflow: hidden; flex: 1; }
.cup-bracket { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow-y: auto; min-height: 0; }
.cup-col { display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.cup-col > small { font: 800 10px var(--ui); letter-spacing: 1.3px; color: var(--muted); text-align: center; }
.tie { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; }
.tie span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tie span:first-child { justify-content: flex-start; }
.tie span:last-child { justify-content: flex-end; }
.tie svg { width: 16px; height: 16px; flex: none; }
.tie b { font-family: var(--display); font-size: 13px; text-align: center; white-space: nowrap; }
.tie b i { font-style: normal; font-size: 10px; color: var(--muted); }
.tie .me { color: var(--cyan); }
.tie .lose { opacity: .45; }
.tie .win { color: #fff; }
.tie .me.win { color: var(--cyan); }
.tie.tbd { display: block; text-align: center; color: var(--muted); font-weight: 600; opacity: .6; }
.hub-modes .tile-small b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hub-modes .tile-small > div { width: 100%; }
/* match facts */
.facts-panel { position: absolute; right: calc(14px + var(--sr)); top: calc(10px + var(--st)); bottom: calc(10px + var(--sb)); left: calc(min(380px, 60vw) + 28px + var(--sl)); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line-2); min-width: 0; animation: slideL .3s cubic-bezier(.2,.9,.3,1); }
.facts-panel.in-modal { position: static; animation: none; padding: 0; background: none; border: 0; flex: 1; min-height: 0; }
.facts-tabs, .facts-side { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); flex: none; }
.facts-tabs button, .facts-side button { flex: 1; padding: 6px 4px; border-radius: 7px; font-weight: 800; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts-tabs button.on, .facts-side button.on { background: var(--cyan); color: #04120d; }
.facts-body { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; gap: 5px; padding-right: 3px; }
.facts-head { display: flex; justify-content: center; align-items: center; gap: 14px; font-family: var(--display); font-size: 16px; flex: none; }
.facts-head b { font-size: 22px; }
.fh-h { color: #6f9bff; } .fh-a { color: #ff7a7a; }
.fr { display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.fr > span:first-child { text-align: right; }
.fr-mid small { display: block; text-align: center; font-size: 10.5px; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.fr-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.07); }
.fr-bar .h { background: #3d7bff; } .fr-bar .a { background: #ff4b4b; margin-left: auto; }
.pf-wrap { overflow: auto; min-height: 0; flex: 1; touch-action: pan-x pan-y; }
.pf { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pf th { position: sticky; top: 0; background: #0d1838; color: var(--muted); font-size: 10px; letter-spacing: .5px; padding: 5px 5px; z-index: 1; }
.pf td { padding: 4px 5px; text-align: center; border-top: 1px solid rgba(255,255,255,.05); }
.pf .nm { text-align: left; position: sticky; left: 0; background: #0d1838; }
.pf td.nm i { font-style: normal; color: var(--muted); display: inline-block; width: 20px; }
.pf td.nm small { color: var(--muted); font-size: 10px; margin-left: 5px; }
.pf tr.off td { opacity: .5; }
.pf .rt { display: inline-block; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.12); font-family: var(--display); }
.pf .rt.hi { background: #19c37d; color: #03140c; } .pf .rt.ok { background: #8fd14f; color: #0d1a02; } .pf .rt.lo { background: #ff6b5a; color: #1d0300; }
em.yc, em.rc { display: inline-block; width: 8px; height: 11px; border-radius: 1.5px; vertical-align: -1px; margin-left: 2px; }
em.yc { background: #ffd21f; } em.rc { background: #e3102c; }
.tl { display: flex; flex-direction: column; gap: 4px; }
.tl-row { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.tl-side:first-child { text-align: right; }
.tl-side b { display: block; } .tl-side small { color: var(--muted); font-size: 11px; font-weight: 600; }
.tl-min { text-align: center; font-family: var(--display); padding: 3px 0; border-radius: 8px; background: rgba(255,255,255,.06); }
.tl-min span { margin-left: 4px; font-family: var(--ui); }
.tl-empty { text-align: center; color: var(--muted); font-weight: 600; }
#pause { --pp-w: min(340px, 47vw); }
#pause .pause-panel { width: var(--pp-w); }
.facts-panel:not(.in-modal) { left: calc(var(--pp-w) + 24px + var(--sl)); padding: 10px; }
.fr { grid-template-columns: 50px 1fr 50px; }
.fr-mid small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-grid .mbtn { white-space: nowrap; font-size: 14px; }
.sd-top { display: flex; align-items: center; gap: 8px; }
.sd-top h3 { flex: 1; min-width: 0; }
.sd-edit { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 4px 10px; border-radius: 8px; background: rgba(69,224,255,.15); border: 1px solid rgba(69,224,255,.5); color: var(--cyan); font: 800 12px var(--ui); }
.sd-edit .ico { width: 14px; height: 14px; }
.ed-hint { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 9px; border-radius: 8px; background: rgba(69,224,255,.08); }
.ed-hint b { color: var(--text); }
.seg.seg-wrap { flex-wrap: wrap; } .seg.seg-wrap button { flex: 1 0 auto; }
/* after a goal the banner shrinks to a strip at the top so the celebration is in view */
#banner.dock { top: calc(4px + var(--st)); transform: scale(.4); transform-origin: 50% 0; }
#banner { transition: opacity .3s, transform .35s cubic-bezier(.2, 1.3, .4, 1), top .35s ease; }
#hud.celebrating #radar, #hud.celebrating #player-tag, #hud.celebrating #power { opacity: 0; transition: opacity .3s; }
#hud.celebrating #banner.dock { top: calc(6px + var(--st)); }
