:root {
  --bg: #010a13; --bg2: #0a1428; --panel: rgba(9, 20, 40, .82); --line: rgba(200, 170, 110, .2); --line2: rgba(200, 170, 110, .45);
  --gold: #c8aa6e; --gold2: #f0e6d2; --gold3: #785a28; --teal: #0ac8b9; --teal2: #0397ab;
  --text: #f0e6d2; --muted: #a09b8c; --dim: #5b5a56;
  --a: #4ea4ff; --b: #ff5a66; --good: #3fd38b; --bad: #ff5a66; --elite: #b48cff; --goldc: #e8c45a;
  --display: "Cinzel", Georgia, serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--body); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
::selection { background: rgba(10, 200, 185, .35); }

/* ---------- Animated background ---------- */
#bg { position: fixed; inset: -12%; z-index: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  transform: rotate(-8deg); opacity: .3; transition: opacity .8s, filter .8s; pointer-events: none; }
body:not([data-view="home"]) #bg { opacity: .08; filter: blur(3px) saturate(.5); }
.bg-row { display: flex; gap: 18px; width: max-content; animation: slide 150s linear infinite; }
.bg-row.r1 { animation-duration: 180s; animation-direction: reverse; }
.bg-row.r2 { animation-duration: 165s; }
.bg-card { width: 170px; height: 230px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  border: 1px solid var(--gold3); background: linear-gradient(160deg, #13284a, #0a1428); text-align: center; }
.bg-card.gold { background: linear-gradient(160deg, #3d3214, #14110a); }
.bg-card.elite { background: linear-gradient(160deg, #2e1f4d, #110c20); border-color: #5a3d8f; }
.bg-card b { font-family: var(--display); font-size: 36px; color: var(--gold2); }
.bg-card .av { width: 64px; height: 64px; font-size: 24px; }
.bg-card span { font-family: var(--display); font-weight: 700; font-size: 16px; }
.bg-card em { font-style: normal; font-size: 11px; color: var(--muted); }
@keyframes slide { to { transform: translateX(-50%); } }
#veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(1, 10, 19, .25), rgba(1, 10, 19, .92) 70%), linear-gradient(180deg, rgba(1, 10, 19, .3), var(--bg) 96%); }
#app { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 28px 16px 80px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: .03em; margin: 0; color: var(--gold2); }
.kicker { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.good { color: var(--good); } .bad { color: var(--bad); }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: clamp(28px, 4vw, 42px); margin-top: 6px; }
.page-head p { margin: 8px 0 0; max-width: 640px; }
.page-head.center p { margin-inline: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.btn-row.center { justify-content: center; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border: 1px solid var(--gold3);
  background: linear-gradient(180deg, #1e2328, #12171d); color: var(--gold2); font-weight: 600; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; cursor: pointer; transition: .2s; border-radius: 2px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold); color: #fff; box-shadow: 0 0 18px -4px rgba(200, 170, 110, .6); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #0e3a4a, #082733); border-color: var(--teal2); color: #cdfaf6; box-shadow: inset 0 0 14px rgba(10, 200, 185, .25); }
.btn.primary:hover:not(:disabled) { border-color: var(--teal); box-shadow: inset 0 0 18px rgba(10, 200, 185, .4), 0 0 24px -2px rgba(10, 200, 185, .55); }
.btn.big { padding: 15px 34px; font-size: 14px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--gold2); box-shadow: none; border-color: var(--line); }
.btn.tiny { padding: 5px 10px; font-size: 10px; }
input { background: rgba(1, 10, 19, .78); border: 1px solid var(--line2); color: var(--gold2); padding: 12px 14px; font: inherit; font-size: 16px; border-radius: 2px; outline: none; transition: .2s; width: 100%; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 170, 110, .15); }
input::placeholder { color: var(--dim); }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.seg { display: flex; border: 1px solid var(--line2); background: rgba(1, 10, 19, .5); }
.seg button { flex: 1; padding: 9px 8px; background: transparent; border: 0; border-right: 1px solid var(--line); color: var(--muted); cursor: pointer; font-weight: 600; font-size: 12px; transition: .15s; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: linear-gradient(180deg, rgba(200, 170, 110, .28), rgba(200, 170, 110, .08)); color: var(--gold2); }
.seg button:hover:not(.on) { color: var(--gold2); background: rgba(200, 170, 110, .06); }
.chip { font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 3px 7px; border: 1px solid var(--line2); color: var(--gold); text-transform: uppercase; white-space: nowrap; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); padding: 18px; backdrop-filter: blur(8px); position: relative; }
.panel::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold3), transparent); }
.panel-h { display: block; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--teal); border-radius: 50%; animation: spin .9s linear infinite; display: inline-block; flex: none; }
.spinner.big { width: 44px; height: 44px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0; }
.center-w { justify-content: center; margin: 40px 0; }
.badge { display: inline-block; align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; padding: 4px 9px; color: #04161a; background: linear-gradient(180deg, #3ff0e2, #0aa79a); }
.badge.red { color: #fff; background: linear-gradient(180deg, #ff7a84, #c2303c); }
.note { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: #0f1d36; border: 1px solid var(--gold3); color: var(--gold2); padding: 11px 18px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: pop .3s; transition: .4s; max-width: 100%; }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Home ---------- */
.home { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4vh; }
.hero .kicker { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero .kicker span { width: 46px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hero .kicker span:last-child { transform: scaleX(-1); }
.logo { font-family: var(--display); font-weight: 900; font-size: clamp(64px, 12vw, 136px); line-height: .9; margin: 18px 0 12px; letter-spacing: .06em;
  background: linear-gradient(180deg, #fff6e0 10%, #e8cf96 45%, #a8823f 85%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 30px rgba(200, 170, 110, .35)); }
.logo em { font-style: normal; display: block; font-size: .36em; letter-spacing: .62em; margin-right: -.62em; margin-top: 8px;
  background: linear-gradient(180deg, #8ffcf2, #0ac8b9 50%, #03708a); -webkit-background-clip: text; background-clip: text; }
.tagline { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.6; }
.name-field { width: min(340px, 100%); margin: 26px auto 0; }
.modes { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; width: 100%; max-width: 1000px; margin: 40px auto 0; text-align: left; }
.mode { position: relative; display: flex; gap: 16px; align-items: center; padding: 18px 20px; text-align: left;
  background: linear-gradient(180deg, rgba(16, 30, 56, .86), rgba(6, 14, 28, .94)); border: 1px solid var(--line);
  cursor: pointer; transition: .25s; overflow: hidden; backdrop-filter: blur(6px); }
.mode::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 0%, rgba(10, 200, 185, .16), transparent 60%); opacity: 0; transition: .3s; pointer-events: none; }
.mode:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 18px 40px -16px #000, 0 0 30px -8px rgba(200, 170, 110, .4); }
.mode:hover::after { opacity: 1; }
.mode h3 { font-size: 18px; }
.mode p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.mode-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 1px solid var(--line2); color: var(--gold); transform: rotate(45deg); margin: 0 6px; }
.mode-ic svg { width: 22px; height: 22px; transform: rotate(-45deg); }
.mode-stack { display: flex; flex-direction: column; gap: 14px; }
.mode-stack .mode { flex: 1; }
.join-mode { cursor: default; }
.join-mode:hover { transform: none; }
.join-mode.invited { border-color: var(--teal2); box-shadow: 0 0 30px -10px var(--teal); }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .32em; font-weight: 700; text-align: center; padding: 10px; }
.featured { flex-direction: column; align-items: stretch; justify-content: flex-end; min-height: 380px; padding: 0; cursor: default; }
.featured:hover { transform: none; }
.feat-art { position: absolute; inset: 0; transition: transform .8s; }
.featured:hover .feat-art { transform: scale(1.04); }
.featured::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(1, 10, 19, .05) 10%, rgba(1, 10, 19, .85) 55%, #010a13); }
.art-pitch { position: absolute; inset: -10% 10% 30%; background: repeating-linear-gradient(180deg, #17402c 0 10%, #133824 10% 20%); border: 2px solid rgba(240, 230, 210, .3); transform: perspective(600px) rotateX(38deg); }
.art-pitch i { position: absolute; width: 14px; height: 14px; transform: translate(-50%, -50%) rotate(45deg); background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.ap-h { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(240, 230, 210, .3); }
.ap-c { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; border: 2px solid rgba(240, 230, 210, .3); border-radius: 50%; transform: translate(-50%, -50%); }
.feat-body { position: relative; z-index: 2; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.feat-body h3 { font-size: 34px; }
.feat-body p { max-width: 440px; color: #cfc8b4; margin: 0; }
.feat-set { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.feat-body .btn { align-self: flex-start; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1000px; width: 100%; margin: 56px auto 0; text-align: left; }
.step { padding-top: 16px; border-top: 1px solid var(--line); }
.step b { font-family: var(--display); color: var(--gold3); font-size: 26px; }
.step h4 { font-size: 17px; margin: 4px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
footer { margin-top: 48px; color: var(--dim); font-size: 12px; }

/* ---------- Formation ---------- */
.forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.form-card { background: linear-gradient(180deg, rgba(16, 30, 56, .86), rgba(6, 14, 28, .94)); border: 1px solid var(--line); padding: 12px; cursor: pointer; transition: .25s;
  display: flex; flex-direction: column; gap: 10px; align-items: center; animation: pop .4s backwards; }
.form-card:hover, .form-card.on { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 18px 40px -16px #000, 0 0 30px -8px rgba(200, 170, 110, .45); }
.form-card b { font-family: var(--display); font-size: 26px; color: var(--gold2); }
.mini { position: relative; width: 100%; aspect-ratio: 3/4; background: repeating-linear-gradient(180deg, #17402c 0 10%, #133824 10% 20%); border: 1px solid rgba(240, 230, 210, .25); }
.mini i { position: absolute; width: 11px; height: 11px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 8px rgba(200, 170, 110, .7); }

/* ---------- Pitch ---------- */
.pitch { position: relative; width: 100%; aspect-ratio: 4/5; background: repeating-linear-gradient(180deg, #17402c 0 10%, #133824 10% 20%);
  border: 1px solid var(--gold3); box-shadow: inset 0 0 60px rgba(0, 0, 0, .55); overflow: hidden; }
.pitch.small { aspect-ratio: 4/4.4; }
.pm i { position: absolute; border: 2px solid rgba(240, 230, 210, .16); }
.pm .half { left: 0; right: 0; top: 50%; border-width: 2px 0 0; }
.pm .circle { left: 50%; top: 50%; width: 24%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.pm .box { left: 28%; right: 28%; height: 14%; }
.pm .b1 { top: -2px; border-top: 0; } .pm .b2 { bottom: -2px; border-bottom: 0; }
.pitch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pitch line { stroke-width: 2.5; vector-effect: non-scaling-stroke; }
line.empty { stroke: rgba(240, 230, 210, .07); } line.none { stroke: rgba(255, 90, 102, .35); }
line.nat { stroke: var(--goldc); } line.club { stroke: var(--good); }
.slot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; width: 92px; }
.slot.empty { width: 46px; height: 46px; border: 1px dashed rgba(240, 230, 210, .45); background: rgba(1, 10, 19, .55); justify-content: center; color: var(--gold2);
  font-weight: 700; font-size: 11px; cursor: default; transform: translate(-50%, -50%) rotate(45deg); }
.slot.empty span { transform: rotate(-45deg); }
.slot.empty[onclick] { cursor: pointer; }
.slot.empty[onclick]:hover { border-color: var(--teal); }
.slot.empty.cur { border: 1px solid var(--teal); background: rgba(10, 200, 185, .22); animation: pulse 1.5s infinite; color: #cdfaf6; }
@keyframes pulse { 50% { box-shadow: 0 0 22px -2px var(--teal); } }
.slot.fresh { animation: drop .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes drop { from { transform: translate(-50%, -120%) scale(1.4); opacity: 0; } }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 15px; color: #fff;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 55% 50%), hsl(var(--h) 55% 22%)); border: 2px solid var(--gold3); flex: none; text-shadow: 0 1px 2px #000; }
.av.big { width: 64px; height: 64px; font-size: 22px; }
.slot.gold .av { border-color: var(--goldc); } .slot.elite .av { border-color: var(--elite); box-shadow: 0 0 12px var(--elite); }
.sl-ovr { position: absolute; top: -4px; left: 18px; background: var(--bg); color: var(--gold2); border: 1px solid var(--gold3); font-size: 10px; font-weight: 800; padding: 0 4px; }
.sl-name { background: rgba(1, 10, 19, .85); border: 1px solid var(--line); padding: 1px 6px; font-size: 11px; font-weight: 700; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.sl-sub { font-size: 10px; color: rgba(240, 230, 210, .85); text-shadow: 0 1px 2px #000; white-space: nowrap; }
.chem { color: var(--teal); font-size: 8px; letter-spacing: 1px; }
.rt { font-style: normal; font-weight: 800; background: #2a3442; padding: 0 5px; }
.rt.hi { background: #1b7a4a; } .rt.lo { background: #8f2a33; }
.pitch.small .slot { width: 76px; }
.pitch.small .av { width: 30px; height: 30px; font-size: 11px; }
.pitch.small .sl-name { font-size: 10px; max-width: 76px; }
.pitch.small .sl-ovr { left: 12px; }
.pitch.small .slot.empty { width: 34px; height: 34px; font-size: 9px; }

/* ---------- Draft ---------- */
.draft-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.draft-top h2 { font-size: clamp(30px, 5vw, 46px); margin-top: 4px; }
.draft-top h2 span { font-size: .5em; }
.meters { display: flex; gap: 8px; }
.meter { background: var(--panel); border: 1px solid var(--line); padding: 6px 14px; text-align: center; min-width: 84px; }
.meter span { display: block; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.meter b { font-family: var(--display); font-size: 24px; color: var(--gold2); }
.meter small { font-size: 12px; color: var(--muted); }
.draft-grid { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 26px; align-items: start; }
.draft-side h3 { font-size: 22px; }
.pcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; perspective: 1200px; }
.pcard { position: relative; text-align: left; padding: 16px; cursor: pointer; border: 1px solid var(--gold3); display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  background: linear-gradient(160deg, #13284a, #0a1428); transition: transform .3s, box-shadow .3s, border-color .3s, opacity .3s;
  animation: cardIn .55s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d); }
.pcard::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 85% 0%, rgba(200, 170, 110, .18), transparent 55%); }
.pcard.gold { background: linear-gradient(160deg, #3a2f12, #12100a); border-color: #8f6f2c; }
.pcard.elite { background: linear-gradient(160deg, #2a1c48, #0e0a1c); border-color: #6a4aa8; }
.pcard.elite::before { background: radial-gradient(circle at 85% 0%, rgba(180, 140, 255, .3), transparent 55%); }
.pcard:hover { transform: translateY(-8px); border-color: var(--gold); box-shadow: 0 24px 50px -18px #000, 0 0 0 1px var(--gold), 0 0 40px -8px rgba(200, 170, 110, .5); }
.pcard.chosen { transform: translateY(-12px) scale(1.03); border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal), 0 0 60px rgba(10, 200, 185, .55); }
.pcard.faded { opacity: .2; transform: scale(.95); }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) rotateY(-16deg); } }
.key { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(1, 10, 19, .7); border: 1px solid var(--gold3); }
.pc-top { display: flex; align-items: center; gap: 14px; }
.pc-ovr { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pc-ovr b { font-family: var(--display); font-size: 42px; font-weight: 900; color: var(--gold2); }
.pc-ovr span { font-weight: 700; font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.pcard.gold .pc-ovr b { color: var(--goldc); } .pcard.elite .pc-ovr b { color: #d6c0ff; }
.pcard h3 { font-size: 22px; line-height: 1.1; }
.pc-meta, .pc-pos, .pc-links { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.pc-pos span { font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border: 1px solid var(--line); color: var(--muted); }
.pc-pos .match { border-color: var(--teal2); color: var(--teal); background: rgba(10, 200, 185, .1); }
.pc-pos .warn { border-color: rgba(255, 90, 102, .45); color: #ffb3b9; background: rgba(255, 90, 102, .12); }
.lk { font-size: 11px; font-weight: 600; padding: 3px 8px; }
.lk.club { color: #9ff5c9; background: rgba(63, 211, 139, .14); border: 1px solid rgba(63, 211, 139, .45); }
.lk.nat { color: #ffe1a0; background: rgba(232, 196, 90, .12); border: 1px solid rgba(232, 196, 90, .4); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.st { display: grid; grid-template-columns: 30px 1fr 20px; gap: 6px; align-items: center; font-size: 11px; }
.st span { color: var(--muted); font-weight: 600; }
.st i { height: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.st i b { display: block; height: 100%; background: linear-gradient(90deg, var(--teal2), var(--gold)); }
.st em { font-style: normal; font-weight: 700; text-align: right; color: var(--gold2); }

/* ---------- Duel ---------- */
.duel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 18px; }
.dh-p { display: flex; flex-direction: column; gap: 2px; }
.dh-p span { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.dh-p b { font-family: var(--display); font-size: clamp(16px, 2.4vw, 24px); color: var(--a); }
.dh-p.b { text-align: right; } .dh-p.b b { color: var(--b); }
.dh-p.me b::after { content: " (you)"; font-family: var(--body); font-size: 12px; color: var(--muted); }
.dh-mid { text-align: center; }
.dh-mid h2 { font-size: clamp(24px, 4vw, 38px); margin-top: 4px; }
.series { font-family: var(--display); font-size: 22px; color: var(--teal); margin-top: 2px; }
.turn-strip { display: flex; gap: 3px; justify-content: center; margin: -4px 0 20px; flex-wrap: wrap; }
.turn-strip i { width: 18px; height: 6px; background: rgba(255, 255, 255, .08); }
.turn-strip i.m { box-shadow: inset 0 0 0 1px rgba(78, 164, 255, .5); } .turn-strip i.o { box-shadow: inset 0 0 0 1px rgba(255, 90, 102, .5); }
.turn-strip i.m.done { background: var(--a); } .turn-strip i.o.done { background: var(--b); }
.turn-strip i.now { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.duel-draft { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.6fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.duel-draft .meters { margin-bottom: 8px; }
.duel-draft .meter { padding: 3px 10px; min-width: 70px; } .duel-draft .meter b { font-size: 18px; }
.duel-draft .pcards { grid-template-columns: 1fr 1fr; }
.their-turn { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; min-height: 340px; border: 1px dashed var(--line); background: rgba(1, 10, 19, .4); padding: 20px; }
.their-turn h3 { font-size: 20px; }
.lobby-card { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.code-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.code-big { font-family: var(--display); font-size: 48px; font-weight: 900; letter-spacing: .32em; color: var(--gold2); padding: 4px 6px 4px 20px; border: 1px dashed var(--gold3); background: rgba(1, 10, 19, .5); line-height: 1.2; }
.lobby-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.lp { border: 1px solid var(--line2); padding: 14px; background: rgba(1, 10, 19, .5); display: flex; flex-direction: column; gap: 4px; text-align: center; }
.lp.empty { border-style: dashed; color: var(--dim); }
.lp-side { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lp b { font-family: var(--display); font-size: 18px; }
.vs { font-family: var(--display); color: var(--gold); font-weight: 900; font-size: 20px; }
.games { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.gm { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: .2s; }
.gm:hover { border-color: var(--gold); }
.gm span { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.gm b { font-family: var(--display); font-size: 22px; }
.gm em { font-style: normal; font-size: 11px; color: var(--muted); }
.gm i { font-style: normal; font-size: 10px; color: var(--teal); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Bracket ---------- */
.bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 190px; flex: 1; }
.bcol .kicker { margin-bottom: 4px; }
.bm { background: var(--panel); border: 1px solid var(--line); font-size: 14px; transition: .2s; }
.bm.played { cursor: pointer; } .bm.played:hover { border-color: var(--gold); }
.bm > div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; }
.bm > div + div { border-top: 1px solid var(--line); }
.bm .me span { color: var(--teal); font-weight: 700; }
.bm .lost { opacity: .45; } .bm .won b { color: var(--gold2); }
.bm.tbd { color: var(--dim); }
.squad-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 24px; text-align: left; }

/* ---------- Tactics ---------- */
.scout { margin-bottom: 16px; }
.tactics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tac { position: relative; text-align: left; background: linear-gradient(180deg, rgba(16, 30, 56, .86), rgba(6, 14, 28, .94)); border: 1px solid var(--line); padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: .25s; }
.tac:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-3px); }
.tac:disabled { cursor: default; opacity: .55; }
.tac.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), 0 0 30px -6px rgba(10, 200, 185, .55); opacity: 1; }
.tac h3 { font-size: 19px; }
.tac p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.fit { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.fit i { height: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fit i b { display: block; height: 100%; background: linear-gradient(90deg, var(--teal2), var(--gold)); }
.fit em { font-style: normal; font-weight: 700; color: var(--gold2); }

/* ---------- Match ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 10px 0 14px; }
.sb-team { display: flex; flex-direction: column; gap: 6px; }
.sb-team.a { align-items: flex-end; text-align: right; } .sb-team.b { align-items: flex-start; }
.sb-side { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.sb-team h3 { font-size: clamp(20px, 3.2vw, 32px); }
.sb-team.a h3 { color: var(--a); } .sb-team.b h3 { color: var(--b); }
.tchip { font-size: 10px; font-weight: 700; padding: 3px 8px; border: 1px solid var(--line2); color: var(--gold); text-transform: uppercase; letter-spacing: .12em; }
.sb-mid { text-align: center; padding: 8px 22px; border: 1px solid var(--gold3); background: rgba(1, 10, 19, .7); }
.sb-score { font-family: var(--display); font-size: 64px; font-weight: 900; line-height: 1; display: flex; gap: 14px; justify-content: center; color: var(--gold2); }
.sb-score i { color: var(--gold3); font-style: normal; }
.sb-score span { display: inline-block; }
.pop { animation: goalpop .7s; }
@keyframes goalpop { 30% { transform: scale(1.6); color: var(--teal); text-shadow: 0 0 30px var(--teal); } }
.sb-clock { font-weight: 700; color: var(--teal); letter-spacing: .1em; }
.sb-pens { font-size: 12px; color: var(--muted); min-height: 1em; }
.wp { max-width: 640px; margin: 0 auto 20px; }
.wp-bar { height: 6px; background: var(--b); overflow: hidden; }
.wp-bar i { display: block; height: 100%; background: var(--a); transition: width .6s; }
.wp-l { display: flex; justify-content: space-between; font-size: 12px; margin-top: 5px; font-weight: 700; }
.match-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 14px; align-items: start; }
.feed-wrap { display: flex; flex-direction: column; }
.feed { height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.feed-empty { color: var(--dim); text-align: center; margin: auto; }
.fe { display: grid; grid-template-columns: 38px 1fr; gap: 8px; font-size: 14px; padding: 8px 10px; background: rgba(255, 255, 255, .025); border-left: 2px solid var(--line); animation: pop .3s; line-height: 1.45; }
.fe p { margin: 0; }
.fe-t { color: var(--gold); font-weight: 700; font-size: 12px; padding-top: 2px; }
.fe.s-a { border-left-color: var(--a); } .fe.s-b { border-left-color: var(--b); }
.fe.goal { background: linear-gradient(90deg, rgba(10, 200, 185, .16), transparent); font-weight: 600; }
.fe.ht { background: rgba(200, 170, 110, .1); font-weight: 700; color: var(--gold2); border-left-color: var(--gold); }
.fe b { color: var(--teal); }
.match-actions { display: flex; justify-content: center; margin-top: 20px; }
.stats-panel { max-width: 580px; margin: 20px auto 0; }
.srow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.srow span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; text-align: center; }
.srow > :first-child { text-align: right; } .srow b { font-size: 17px; color: var(--gold2); }
.mvp { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.mvp b { font-family: var(--display); font-size: 18px; }
.banner { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(1, 6, 12, .7); backdrop-filter: blur(3px); cursor: pointer; animation: fade .3s; }
.banner.out { opacity: 0; transition: opacity .5s; }
.banner-in { text-align: center; }
.banner h2 { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 11vw, 120px); letter-spacing: .06em; animation: slam .55s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
.banner.victory h2 { background: linear-gradient(180deg, #fff6e0, #e8cf96 45%, #a8823f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 40px rgba(200, 170, 110, .55)); }
.banner.defeat h2 { color: #c9434d; text-shadow: 0 0 40px rgba(255, 90, 102, .4); }
.banner .line { height: 1px; width: 320px; max-width: 80vw; margin: 10px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.banner p { font-family: var(--display); font-size: 30px; font-weight: 700; margin: 6px 0; color: var(--gold2); }
.banner small { color: var(--muted); }

/* ---------- End ---------- */
.end { padding-top: 5vh; }
.end h2.big { font-size: clamp(36px, 6vw, 64px); margin: 8px 0; }
.trophy { font-size: 100px; animation: bob 2s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(200, 170, 110, .6)); }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }
.end-pitch { max-width: 420px; margin: 28px auto 0; }

@media (max-width: 1000px) {
  .duel-draft { grid-template-columns: 1fr 1fr; }
  .duel-draft .dd-mid { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 900px) {
  .draft-grid, .match-grid, .modes { grid-template-columns: 1fr; }
  .match-grid .feed-wrap { order: -1; }
  .feed { height: 320px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .pcards, .duel-draft .pcards { grid-template-columns: 1fr; }
  .duel-draft { grid-template-columns: 1fr; }
  .sb-score { font-size: 44px; }
  .sb-mid { padding: 6px 12px; }
  .code-big { font-size: 34px; }
  .lobby-players { grid-template-columns: 1fr; }
  .slot { width: 70px; } .av { width: 30px; height: 30px; font-size: 11px; } .sl-name { font-size: 10px; max-width: 70px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
