@font-face { font-family: 'Anton'; src: url(../assets/fonts/Anton-Regular.ttf) format('truetype'); font-display: block; }
@font-face { font-family: 'Barlow Condensed'; src: url(../assets/fonts/BarlowCondensed-Medium.ttf); font-weight: 500; }
@font-face { font-family: 'Barlow Condensed'; src: url(../assets/fonts/BarlowCondensed-SemiBold.ttf); font-weight: 600; }
@font-face { font-family: 'Barlow Condensed'; src: url(../assets/fonts/BarlowCondensed-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'Barlow Condensed'; src: url(../assets/fonts/BarlowCondensed-ExtraBoldItalic.ttf); font-weight: 800; font-style: italic; }
@font-face { font-family: 'Barlow Condensed'; src: url(../assets/fonts/BarlowCondensed-BlackItalic.ttf); font-weight: 900; font-style: italic; }
:root { --red:#e31b23; --red2:#ff2a3a; --ink:#0a0a0c; --panel:rgba(12,12,16,.86); --line:rgba(255,255,255,.12); --txt:#f2f2f4; --mut:#9aa0ab; --gold:#ffd84a; --green:#22c55e; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--txt); font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; font-weight: 600; user-select: none; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 60% 50%, transparent 45%, rgba(0,0,0,.55)); }
button { font: inherit; color: inherit; }
.sq { color: #fff; font-family: Anton, Impact, sans-serif; letter-spacing: .02em; }
.bx { color: var(--red); font-family: Anton, Impact, sans-serif; margin-left: .18em; letter-spacing: .02em; }
/* top bar */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 22px; z-index: 20; background: linear-gradient(180deg, rgba(0,0,0,.75), transparent); pointer-events: none; }
#topbar .brand { font-size: 26px; display: flex; align-items: baseline; }
#topbar .hoops { margin-left: 10px; font-weight: 900; font-style: italic; font-size: 18px; color: var(--mut); letter-spacing: .12em; }
#crumb { font-weight: 800; font-style: italic; letter-spacing: .08em; color: #fff; opacity: .85; font-size: 18px; border-left: 3px solid var(--red); padding-left: 12px; }
#crumb:empty { display: none; }
.badge { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 4px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-size: 15px; letter-spacing: .03em; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge.on { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.55); }
.badge.on.ps { background: rgba(0,112,209,.22); border-color: #2f7fe0; }
.badge.on.xbox { background: rgba(16,124,16,.25); border-color: #3cb43c; }
/* screens */
.screen { position: fixed; inset: 0; z-index: 10; display: none; padding: 70px 28px 24px; }
.screen.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.focusable { outline: none; cursor: pointer; }
.focused { box-shadow: 0 0 0 3px #fff, 0 0 24px rgba(227,27,35,.85) !important; z-index: 2; }
/* title */
.title-wrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; background: radial-gradient(circle at 50% 55%, rgba(0,0,0,.7), rgba(0,0,0,.25) 70%); }
.hero-ball { width: min(30vh, 260px); border-radius: 50%; box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 6px rgba(255,255,255,.04); animation: spinb 9s linear infinite; clip-path: circle(41.5% at 50% 50%); }
@keyframes spinb { 0% { transform: rotate(-8deg) } 50% { transform: rotate(8deg) } 100% { transform: rotate(-8deg) } }
.logo-big { font-size: clamp(56px, 11vw, 140px); margin: 0; line-height: .95; display: flex; text-shadow: 0 6px 30px rgba(0,0,0,.85), 0 0 2px #000; }
.logo-sub { font-weight: 900; font-style: italic; letter-spacing: .5em; font-size: clamp(16px, 2.6vw, 30px); color: #fff; opacity: .85; margin-bottom: 22px; }
.press-start { background: transparent; border: 0; font-weight: 900; font-style: italic; font-size: 26px; letter-spacing: .14em; padding: 12px 26px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45 } }
.hint { color: var(--mut); max-width: 640px; font-weight: 500; font-size: 16px; }
.hint.small { font-size: 14px; }
/* glyphs */
.glyph { display: inline-flex; align-items: center; justify-content: center; min-width: 1.45em; height: 1.45em; padding: 0 .3em; border-radius: 1em; font-family: Arial, sans-serif; font-weight: 700; font-size: .8em; background: #2b2d33; color: #fff; border: 1px solid rgba(255,255,255,.35); vertical-align: middle; margin: 0 .15em; font-style: normal; letter-spacing: 0; }
.glyph.kb { border-radius: 4px; background: #e8e8ea; color: #111; font-size: .68em; }
.glyph.xa { background: #3cb43c; } .glyph.xb { background: #d6262b; } .glyph.xx { background: #1f6fe0; } .glyph.xy { background: #e0b400; color: #111; }
.glyph.pc { color: #8fb7ff; background: #111; } .glyph.po { color: #ff5e6a; background: #111; } .glyph.ps { color: #ff8fd1; background: #111; } .glyph.pt { color: #46d6a0; background: #111; }
/* main */
.main-grid { height: 100%; display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 30px; align-items: center; }
.tiles { display: flex; flex-direction: column; gap: 10px; }
.tile { text-align: left; border: 0; background: var(--panel); border-left: 6px solid #333; padding: 14px 20px; display: grid; transform: skewX(-6deg); transition: transform .12s, background .12s, border-color .12s; backdrop-filter: blur(6px); }
.tile > * { transform: skewX(6deg); }
.tile small { color: var(--mut); letter-spacing: .2em; font-size: 13px; }
.tile b { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: 34px; letter-spacing: .02em; line-height: 1.1; }
.tile em { font-style: normal; color: #c9ccd3; font-weight: 500; font-size: 15px; }
.tile.big b { font-size: 46px; }
.tile.focused, .tile:hover { background: linear-gradient(90deg, var(--red), #8d0f15); border-left-color: #fff; transform: skewX(-6deg) translateX(10px); }
.tile.focused small, .tile.focused em { color: #fff; }
.active-card { justify-self: end; align-self: end; width: min(380px, 40vw); background: var(--panel); border-top: 4px solid var(--red); padding: 16px 20px; margin-bottom: 20px; }
.pcard .nm { font-family: Anton, Impact; font-size: 34px; line-height: 1; }
.pcard .meta { color: var(--mut); font-size: 16px; margin-top: 4px; }
.ovr { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--gold); font-family: Anton, Impact; font-size: 28px; line-height: 1; color: #fff; background: #111; }
.ovr small { font-family: 'Barlow Condensed'; font-size: 11px; letter-spacing: .15em; color: var(--gold); }
/* panels / options */
.panel { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); display: flex; flex-direction: column; }
.creator { height: 100%; display: grid; grid-template-columns: minmax(340px, 470px) 1fr; gap: 20px; }
.creator .panel { height: 100%; min-height: 0; }
.tabs { display: flex; align-items: center; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.tablist { display: flex; flex: 1; gap: 4px; overflow: hidden; }
.tab { flex: 1; text-align: center; padding: 8px 4px; font-weight: 800; font-style: italic; letter-spacing: .06em; font-size: 16px; color: var(--mut); background: transparent; border: 0; border-bottom: 3px solid transparent; }
.tab.on { color: #fff; border-bottom-color: var(--red); background: rgba(227,27,35,.12); }
.opts { flex: 1; overflow-y: auto; padding: 8px 10px; scrollbar-width: thin; }
.opt { display: grid; grid-template-columns: 40% 1fr; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; margin: 3px 0; background: rgba(255,255,255,.04); border-left: 4px solid transparent; font-size: 17px; }
.opt.focused { background: rgba(227,27,35,.22); border-left-color: var(--red); box-shadow: none !important; outline: 2px solid rgba(255,255,255,.75); }
.opt label { color: #d6d8de; letter-spacing: .04em; text-transform: uppercase; font-size: 15px; }
.opt .val { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.opt .val .v { flex: 1; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr { background: rgba(255,255,255,.08); border: 0; width: 30px; height: 30px; border-radius: 3px; font-size: 14px; cursor: pointer; flex: none; }
.arr:hover { background: var(--red); }
.opt input[type=text], .opt input[type=number] { width: 100%; background: #0d0e12; border: 1px solid #333; color: #fff; padding: 8px 10px; font: inherit; font-size: 18px; }
.opt input[type=range] { width: 100%; accent-color: var(--red); }
.opt .sv { width: 64px; text-align: right; font-weight: 700; }
.sw-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; flex: 1; }
.sw { width: 22px; height: 22px; border-radius: 3px; border: 2px solid rgba(255,255,255,.25); cursor: pointer; }
.sw.on { border-color: #fff; transform: scale(1.18); box-shadow: 0 0 0 2px var(--red); }
.sec { margin: 14px 4px 4px; color: var(--red2); font-weight: 900; font-style: italic; letter-spacing: .14em; font-size: 14px; }
.budget { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(0,0,0,.35); margin: 4px 0 8px; font-size: 17px; }
.budget b { font-family: Anton; font-weight: 400; font-size: 26px; color: var(--gold); }
.attr-bar { height: 6px; background: #222; margin-top: 4px; grid-column: 1 / -1; }
.attr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
.panel-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.07); padding: 11px 16px; font-weight: 800; font-style: italic; letter-spacing: .07em; font-size: 17px; cursor: pointer; flex: 1; white-space: nowrap; }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn:hover { filter: brightness(1.2); }
.preview-info { align-self: start; justify-self: end; text-align: right; background: linear-gradient(270deg, rgba(0,0,0,.6), transparent); padding: 10px 16px; }
.preview-info .num { font-family: Anton; font-size: 64px; line-height: .9; color: var(--red); }
.preview-info .nm { font-family: Anton; font-size: 42px; line-height: 1; }
.preview-info .meta { color: #d9dbe0; font-size: 18px; }
.preview-info .row { display: flex; gap: 12px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.rotate-hint { position: fixed; bottom: 22px; right: 28px; color: var(--mut); font-size: 15px; }
.cc { display: inline-block; padding: 0 6px; margin-left: 4px; background: #fff; color: #111; border-radius: 3px; font-size: .75em; font-weight: 800; vertical-align: middle; }
/* roster */
.roster-wrap, .arena-wrap { height: 100%; display: flex; flex-direction: column; }
.roster-wrap h2, .ctrl-panel h2 { font-family: Anton; font-weight: 400; font-size: 40px; margin: 0 0 10px; letter-spacing: .02em; }
.roster { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-content: start; padding: 4px; }
.rcard { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--red); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rcard.active-p { border-top-color: var(--gold); }
.rcard .top { display: flex; gap: 12px; align-items: center; }
.rcard .acts { display: flex; gap: 6px; }
.rcard .acts .btn { padding: 8px; font-size: 15px; }
.rcard.new { align-items: center; justify-content: center; min-height: 160px; font-family: Anton; font-size: 30px; border-style: dashed; cursor: pointer; }
.footer-prompts { display: flex; gap: 22px; justify-content: flex-end; padding: 10px 6px 0; color: #d5d7dc; font-size: 16px; }
/* arenas */
.arena-wrap { justify-content: flex-end; }
.arena-info { margin-bottom: auto; max-width: 560px; background: linear-gradient(90deg, rgba(0,0,0,.7), transparent); padding: 14px 18px; border-left: 5px solid var(--red); }
.arena-info .k { color: var(--red2); font-weight: 900; font-style: italic; letter-spacing: .2em; }
.arena-info h2 { font-family: Anton; font-weight: 400; font-size: 54px; margin: 2px 0; line-height: 1; }
.arena-info p { color: #dcdee3; font-size: 18px; margin: 4px 0 0; font-weight: 500; }
.arena-cards { display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px; }
.acard { flex: 0 0 210px; height: 120px; border: 0; padding: 0; position: relative; background: #222; cursor: pointer; overflow: hidden; transform: skewX(-5deg); transition: transform .15s; }
.acard .sw2 { position: absolute; inset: 0; }
.acard span { position: absolute; left: 10px; bottom: 8px; right: 10px; text-align: left; font-family: Anton; font-size: 22px; line-height: 1; text-shadow: 0 2px 6px #000; transform: skewX(5deg); }
.acard small { position: absolute; left: 10px; top: 8px; font-size: 12px; letter-spacing: .15em; font-weight: 800; transform: skewX(5deg); text-shadow: 0 1px 3px #000; }
.acard.focused, .acard:hover { transform: skewX(-5deg) translateY(-8px); }
.acard.sel::after { content: '✓'; position: absolute; top: 6px; right: 10px; color: var(--gold); font-size: 20px; }
/* controller */
.ctrl-wrap { height: 100%; display: grid; grid-template-columns: minmax(340px, 520px) 1fr; gap: 20px; min-height: 0; }
.ctrl-panel { padding: 16px; min-height: 0; }
.ctrl-side { padding: 16px; overflow-y: auto; min-height: 0; }
.ctrl-side h3 { margin: 12px 0 6px; color: var(--red2); font-weight: 900; font-style: italic; letter-spacing: .14em; font-size: 15px; }
.mapping { width: 100%; border-collapse: collapse; font-size: 16px; }
.mapping td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.mapping td:first-child { color: var(--mut); }
.pad { padding: 8px 10px; background: rgba(255,255,255,.05); margin-bottom: 6px; border-left: 4px solid var(--green); font-size: 15px; }
.pad b { font-size: 17px; }
.pad.none { border-left-color: #555; color: var(--mut); }
#tester { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tbtns { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.tbtns span { min-width: 40px; padding: 4px 6px; text-align: center; background: #1b1c21; border: 1px solid #333; font-size: 13px; }
.tbtns span.on { background: var(--red); border-color: #fff; }
.stick { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #444; position: relative; background: #111; }
.stick i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--red); left: 26px; top: 26px; }
/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-left { position: absolute; top: 66px; left: 22px; background: var(--panel); border-left: 5px solid var(--red); padding: 10px 14px; min-width: 240px; }
.hud-left .nm { font-family: Anton; font-size: 24px; line-height: 1; }
.hud-left .meta { color: var(--mut); font-size: 14px; }
.hud-right { position: absolute; top: 66px; right: 22px; display: flex; gap: 2px; }
.hud-right div { background: var(--panel); padding: 6px 14px; text-align: center; min-width: 74px; }
.hud-right b { display: block; font-family: Anton; font-weight: 400; font-size: 30px; line-height: 1.05; }
.hud-right small { color: var(--mut); letter-spacing: .12em; font-size: 12px; }
.hud-right .pts { background: var(--red); } .hud-right .pts small { color: #fff; }
.feedback { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); font-family: Anton; font-size: clamp(36px, 7vw, 84px); letter-spacing: .03em; text-shadow: 0 4px 18px rgba(0,0,0,.7); opacity: 0; transition: opacity .2s; text-align: center; line-height: 1; white-space: nowrap; }
.feedback small { display: block; font-family: 'Barlow Condensed'; font-weight: 900; font-style: italic; font-size: .32em; letter-spacing: .2em; margin-top: 6px; }
.feedback.show { opacity: 1; animation: pop .35s ease; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.5); } }
.meter { position: absolute; width: 14px; height: 120px; border: 2px solid #fff; background: rgba(0,0,0,.55); display: none; border-radius: 3px; overflow: hidden; }
.meter .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #fff; }
.meter .win { position: absolute; left: 0; right: 0; background: rgba(34,197,94,.9); }
.meter.green .fill { background: var(--green); } .meter.miss .fill { background: var(--red); }
.hud-bottom { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px; background: rgba(0,0,0,.55); padding: 8px 16px; border-radius: 4px; font-size: 16px; white-space: nowrap; }
.pause-btn { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); pointer-events: auto; background: var(--panel); border: 1px solid var(--line); width: 44px; height: 38px; font-weight: 900; cursor: pointer; }
.timer { color: var(--gold); }
.swipe-trail { position: absolute; width: 4px; background: linear-gradient(transparent, #fff); transform-origin: bottom center; display: none; border-radius: 2px; }
/* modals */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal-card { background: #121318; border-top: 5px solid var(--red); padding: 22px; width: min(440px, 92vw); display: flex; flex-direction: column; gap: 8px; }
.modal-card h2 { font-family: Anton; font-weight: 400; font-size: 34px; margin: 0 0 6px; }
.modal-card p { color: #cfd2d8; font-weight: 500; font-size: 17px; margin: 0 0 8px; }
.modal-card .row { display: flex; gap: 8px; }
.list-card { max-height: 80vh; }
.list { overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.li { text-align: left; border: 0; background: rgba(255,255,255,.05); padding: 9px 12px; font-size: 17px; cursor: pointer; }
.li.sel { color: var(--gold); }
.li.focused { background: var(--red); box-shadow: none !important; }
/* toasts / loading */
#toasts { position: fixed; top: 66px; right: 22px; z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.toast { background: #111; border-left: 5px solid var(--green); padding: 10px 14px; font-size: 16px; box-shadow: 0 8px 26px rgba(0,0,0,.5); animation: tin .3s ease; max-width: 420px; }
.toast.warn { border-left-color: var(--red); }
@keyframes tin { from { transform: translateX(40px); opacity: 0; } }
#loading { position: fixed; inset: 0; z-index: 80; background: var(--ink); display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; font-size: 22px; letter-spacing: .1em; }
#loading.hide { display: none; }
#loadErr { color: var(--red2); font-size: 15px; max-width: 80vw; }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 5px solid #333; border-top-color: var(--red); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
/* responsive: phones */
@media (max-width: 820px) {
  .screen { padding: 60px 10px 10px; }
  #topbar { padding: 0 10px; height: 50px; } #topbar .hoops, #crumb { display: none; } .badge .txt { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .main-grid { grid-template-columns: 1fr; align-content: end; } .active-card { display: none; }
  .tile b { font-size: 26px; } .tile.big b { font-size: 32px; } .tile em { display: none; }
  .creator { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; } .creator .panel { grid-row: 2; } .preview-info { grid-row: 1; padding: 4px 8px; } .preview-info .nm { font-size: 26px; } .preview-info .num { font-size: 40px; } .rotate-hint { display: none; }
  .ctrl-wrap { grid-template-columns: 1fr; overflow-y: auto; }
  .hud-left { top: 56px; left: 8px; min-width: 0; } .hud-right { top: 56px; right: 8px; } .hud-right div { min-width: 52px; padding: 4px 8px; } .hud-right b { font-size: 22px; }
  .pause-btn { top: auto; bottom: 64px; left: auto; right: 12px; transform: none; }
  .hud-bottom { font-size: 13px; gap: 10px; }
}
