@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-800.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(../fonts/inter-400.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(../fonts/inter-600.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(../fonts/inter-700.woff2) format('woff2'); }

:root {
  --bg: #0b1626; --bg2: #0f1d31; --panel: #12233a; --card: #172b46; --card2: #1d3557; --line: rgba(255,255,255,.08);
  --ink: #eef3fa; --muted: #8ea4c2; --orange: #ff7a2f; --red: #ff5d3a; --teal: #22d3b6; --sun: #ffcf3f; --blue: #3a7bd5;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif; --body: 'Inter', system-ui, -apple-system, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
#app { height: 100dvh; display: flex; flex-direction: column; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico .f { fill: currentColor; stroke: none; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; }
h1 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; margin: 0; line-height: 1; }
.tag { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.seg { display: flex; background: var(--card); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }

/* layout */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 44%) minmax(0, 1fr); }
.court { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 22px 20px 20px;
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(255,122,47,.16), transparent 70%),
    radial-gradient(circle at 50% 38%, rgba(58,123,213,.22), transparent 60%),
    linear-gradient(180deg, #0e2140, #0b1626);
  border-right: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.court::before { /* painted court lines */
  content: ''; position: absolute; inset: auto -10% -38% -10%; height: 70%; border: 3px solid rgba(34,211,182,.18); border-radius: 50% 50% 0 0; pointer-events: none; }
.court::after { content: ''; position: absolute; left: 50%; bottom: -2px; width: 34%; height: 30%; transform: translateX(-50%); border: 3px solid rgba(34,211,182,.18); border-bottom: 0; pointer-events: none; }
.scoreboard { text-align: center; z-index: 1; }
.cash-label { font-family: var(--display); text-transform: uppercase; letter-spacing: .25em; font-size: 13px; color: var(--muted); }
.cash { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6.4vw, 72px); line-height: 1; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 4px 30px rgba(255,122,47,.35); }
.rates { display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.rates b { color: var(--sun); font-weight: 700; font-variant-numeric: tabular-nums; }
.rates .dot { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 28px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card); }
.chip .ico { width: 14px; height: 14px; }
.chip.hype { background: rgba(255,122,47,.18); color: var(--orange); }
.chip.frenzy { background: rgba(255,207,63,.2); color: var(--sun); animation: pulse 1s infinite; }
.chip.rings { background: rgba(34,211,182,.15); color: var(--teal); }

.stage { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.hoop { width: min(170px, 40%); height: auto; margin-bottom: -6px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.net { transform-origin: 100px 100px; }
.net.swish { animation: swish .35s ease-out; }
@keyframes swish { 0% { transform: scaleY(1); } 35% { transform: scaleY(1.22) scaleX(.9); } 70% { transform: scaleY(.94); } 100% { transform: scaleY(1); } }
.ball { width: clamp(150px, 26vh, 230px); aspect-ratio: 1; border-radius: 50%; margin-top: 14px; transition: transform .08s; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }
.ball svg { animation: idle 2.6s ease-in-out infinite; }
.ball svg { width: 100%; height: 100%; display: block; }
.ball:hover { transform: scale(1.03); }
.ball.pop { animation: pop .22s ease-out; }
@keyframes pop { 0% { transform: scale(.88, .84); } 60% { transform: scale(1.06, 1.04); } 100% { transform: scale(1); } }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.shadow { width: 120px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(6px); margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; height: 18px; transition: opacity .6s; }
.hint.gone { opacity: 0; }

.hype { z-index: 2; display: flex; align-items: center; gap: 12px; width: min(380px, 100%); padding: 12px 16px; border-radius: var(--r); text-align: left;
  background: linear-gradient(135deg, #ff7a2f, #ff4d6d); box-shadow: 0 10px 30px rgba(255,93,58,.35), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .1s; }
.hype:active { transform: scale(.97); }
.hype b { display: block; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .03em; text-transform: uppercase; }
.hype small { display: block; font-size: 12px; opacity: .9; }
.hype-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.ad-tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 4px; background: rgba(0,0,0,.25); letter-spacing: .1em; }
.hype.active { background: linear-gradient(135deg, #1d3557, #23406a); box-shadow: inset 0 0 0 2px var(--orange); }

/* fx */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.float { position: absolute; font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; text-shadow: 0 2px 0 #c2480f, 0 6px 16px rgba(0,0,0,.5); animation: floatUp 1s ease-out forwards; white-space: nowrap; transform: translate(-50%, -50%); }
.float.gold { color: var(--sun); font-size: 32px; text-shadow: 0 2px 0 #8a5d00, 0 6px 16px rgba(0,0,0,.5); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: spark .6s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

.golden { position: fixed; z-index: 30; width: 64px; height: 64px; border-radius: 50%; filter: drop-shadow(0 0 18px rgba(255,207,63,.9)); animation: goldSpin 3s linear infinite, goldIn .4s ease-out; }
.golden svg { width: 100%; height: 100%; }
@keyframes goldSpin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes goldIn { from { scale: 0; } to { scale: 1; } }

/* panel */
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 12px 14px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-color: var(--orange); }
.badge { position: absolute; top: 8px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: none; }
.badge.on { display: block; animation: pulse 1.4s infinite; }
.count { font-style: normal; font-size: 12px; font-family: var(--body); margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--card); }
@keyframes pulse { 50% { opacity: .5; } }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.tab { display: none; } .tab.active { display: block; }

.qty { display: flex; gap: 6px; margin-bottom: 12px; }
.qty button { flex: 1; padding: 8px 0; border-radius: 10px; background: var(--card); font-weight: 700; color: var(--muted); }
.qty button.on { background: var(--ink); color: var(--bg); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--card); text-align: left; overflow: hidden; transition: transform .08s, background .2s; }
.row:not(.cant):hover { background: var(--card2); }
.row:active { transform: scale(.985); }
.row .tile { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.row .tile .ico { width: 28px; height: 28px; }
.row .name { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .02em; line-height: 1.1; }
.row .desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.row .meta { font-size: 12px; color: var(--teal); margin-top: 4px; font-weight: 600; }
.row .right { text-align: right; }
.row .own { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; color: rgba(255,255,255,.9); }
.row .price { display: inline-block; margin-top: 4px; padding: 5px 10px; border-radius: 8px; background: var(--sun); color: #231a00; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.cant .price { background: rgba(255,255,255,.08); color: var(--muted); }
.row.cant .tile { filter: saturate(.5) brightness(.8); }
.row .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--sun); opacity: .5; transition: width .2s; }
.row.mystery { opacity: .55; pointer-events: none; }
.row.mystery .name { letter-spacing: .3em; }
.row.bought { animation: bought .3s; }
@keyframes bought { 40% { background: #2a4a75; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.upg { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--card); text-align: left; align-items: start; transition: transform .08s; }
.upg:active { transform: scale(.98); }
.upg .tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.upg .name { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.1; }
.upg .desc { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.upg .price { display: inline-block; padding: 4px 9px; border-radius: 7px; background: var(--sun); color: #231a00; font-weight: 700; font-size: 12px; }
.upg.cant { opacity: .6; } .upg.cant .price { background: rgba(255,255,255,.08); color: var(--muted); }
.empty, .note { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 40px 20px; }

.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tro { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--card); font-size: 13px; font-weight: 600; }
.tro .medal { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--sun) 50%, #b87d00); color: #4a3300; }
.tro .medal .ico { width: 20px; height: 20px; }
.tro.locked { color: var(--muted); } .tro.locked .medal { background: rgba(255,255,255,.06); color: var(--muted); }

.champ { text-align: center; padding: 10px 6px; }
.ringbox { display: flex; justify-content: center; gap: 12px; margin: 6px 0 18px; }
.ringstat { background: var(--card); border-radius: var(--r); padding: 12px 18px; min-width: 100px; }
.ringstat b { display: block; font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--teal); line-height: 1; }
.ringstat span { font-size: 12px; color: var(--muted); }
.champ h2 { font-family: var(--display); font-weight: 800; font-size: 30px; text-transform: uppercase; margin: 6px 0; letter-spacing: .03em; }
.champ p { color: var(--muted); max-width: 460px; margin: 0 auto 14px; line-height: 1.5; font-size: 14px; }
.progress { height: 12px; background: var(--card); border-radius: 99px; overflow: hidden; max-width: 460px; margin: 8px auto 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--sun)); border-radius: 99px; transition: width .3s; }
.big-btn { display: inline-block; margin-top: 14px; padding: 14px 26px; border-radius: var(--r); font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .04em; background: linear-gradient(135deg, var(--teal), #1a9d8a); color: #04221d; box-shadow: 0 10px 26px rgba(34,211,182,.3); }
.big-btn:disabled { background: var(--card); color: var(--muted); box-shadow: none; cursor: default; }
.big-btn.gold { background: linear-gradient(135deg, var(--sun), var(--orange)); color: #2b1300; }

.settings { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.set-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); padding: 12px 14px; border-radius: 12px; }
.set-row .seg { background: var(--bg2); }
.stats { background: var(--card); border-radius: 12px; padding: 12px 14px; }
.stats h3 { margin: 0 0 8px; font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; }
.stats div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; border-top: 1px solid var(--line); }
.stats div span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.link-btn { padding: 12px; border-radius: 12px; background: var(--card); font-weight: 600; }
.link-btn.danger { color: #ff8a8a; background: rgba(255,93,58,.08); }

/* toasts / modal / confetti */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 12px; background: #1f3a5f; color: var(--ink); border: 1px solid rgba(255,207,63,.35); font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: toastIn .3s ease-out, toastOut .4s 2.6s forwards; max-width: 90vw; }
.toast .ico { width: 20px; height: 20px; color: var(--sun); flex: none; }
.toast small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,10,20,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; text-align: center; animation: toastIn .25s; }
.modal-card h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 28px; margin: 0 0 8px; }
.modal-card p { color: var(--muted); line-height: 1.5; margin: 0 0 6px; }
.modal-card .amt { font-family: var(--display); font-weight: 800; font-size: 46px; color: var(--sun); margin: 6px 0 10px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.modal-actions button { padding: 13px; border-radius: 12px; font-weight: 700; background: var(--card); }
.modal-actions .primary { background: var(--sun); color: #231a00; }
.modal-actions .ad { background: linear-gradient(135deg, #ff7a2f, #ff4d6d); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

/* mobile */
@media (max-width: 820px) {
  .top { padding: 8px 12px; } .tag { display: none; } h1 { font-size: 21px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: center; } .toast { padding: 8px 12px; font-size: 13px; }
  .court { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px 12px; }
  .court .stage { flex-direction: row; gap: 10px; min-height: 0; }
  .hoop { width: 92px; margin: 0; }
  .ball { width: 128px; margin: 0; }
  .shadow, .hint { display: none; }
  .cash { font-size: 44px; }
  .chips { min-height: 0; margin: 4px 0; }
  .hype { padding: 9px 12px; margin-top: 8px; } .hype b { font-size: 16px; } .hype-ico { width: 30px; height: 30px; }
  .tabs { padding: 4px 6px 0; } .tabs button { padding: 10px 9px; font-size: 15px; }
  .tab-body { padding: 10px; }
  .row { grid-template-columns: 44px 1fr auto; gap: 10px; padding: 9px 10px; } .row .tile { width: 44px; height: 44px; }
  .row .desc { display: none; } .row .own { font-size: 24px; }
  .grid { grid-template-columns: 1fr 1fr; } .upg { grid-template-columns: 1fr; } .upg .tile { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) { .ball svg { animation: none; } }
.modal-card .amt .ico { width: 44px; height: 44px; vertical-align: -6px; stroke-width: 2.2; }
