/* 네온 에어하키 */
:root {
  --bg: #04060d; --panel: rgba(10, 15, 30, .94); --line: rgba(125, 211, 252, .18);
  --text: #f1f5f9; --mute: #94a3b8; --cyan: #38bdf8; --pink: #f43f5e; --yellow: #fde047; --green: #34d399;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }
body.playing #cv { cursor: none; }

.back-btn { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); z-index: 50; color: var(--cyan); text-decoration: none; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 9px; background: rgba(2, 8, 20, .75); border: 1px solid rgba(56, 189, 248, .3); }
.back-btn:hover { background: rgba(56, 189, 248, .2); }
body.playing .back-btn { opacity: .5; }

.hud { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); left: 130px; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 8px; pointer-events: none; }
.chips { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.chip { font-size: .82rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: rgba(2, 8, 18, .75); border: 1px solid rgba(255, 255, 255, .12); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.vs { color: #fecdd3; border-color: rgba(244, 63, 94, .35); min-width: 0; }
.chip.speed { color: var(--yellow); border-color: rgba(253, 224, 71, .3); flex: none; }
.chip.speed.hot { color: #fff; background: rgba(245, 158, 11, .45); }
.icon-btn { pointer-events: auto; width: 36px; height: 36px; border-radius: 10px; background: rgba(2, 8, 18, .75); border: 1px solid rgba(255, 255, 255, .15); font-size: 1rem; flex-shrink: 0; }

.screen { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top)) 14px 20px; overflow-y: auto; touch-action: pan-y; background: radial-gradient(circle at 30% 20%, rgba(14, 116, 144, .35), transparent 55%), radial-gradient(circle at 75% 85%, rgba(190, 18, 60, .28), transparent 55%), rgba(2, 4, 10, .94); }
.screen.dim { background: rgba(2, 4, 10, .72); backdrop-filter: blur(4px); }
.panel { width: min(420px, 100%); margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(56, 189, 248, .08); }
.panel.wide { width: min(640px, 100%); }
h2 { font-size: 1.45rem; margin-bottom: 10px; background: linear-gradient(135deg, #7dd3fc, #f0abfc, #fda4af); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub-h { font-size: .9rem; text-align: left; margin: 14px 0 6px; color: #cbd5e1; }
.eyebrow { font-size: .75rem; letter-spacing: .15em; color: var(--cyan); font-weight: 800; }
.logo span { font-size: 3.4rem; display: inline-block; animation: wig 2.4s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(56, 189, 248, .6)); }
.logo h1 { font-size: clamp(1.4rem, 6vw, 2.1rem); font-weight: 900; letter-spacing: .03em; background: linear-gradient(135deg, #38bdf8, #a78bfa, #f43f5e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo p { color: var(--mute); margin-top: 2px; }
@keyframes wig { 50% { transform: rotate(-10deg) translateY(-6px); } }
.menu { display: flex; flex-direction: column; gap: 10px; margin: 18px auto 14px; width: min(360px, 100%); }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn { padding: 11px 18px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .15); font-weight: 700; transition: transform .12s, background .2s; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #0ea5e9, #8b5cf6); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(14, 165, 233, .35); }
.btn.daily { border-color: rgba(253, 224, 71, .45); background: rgba(253, 224, 71, .08); }
.btn.daily.done { border-color: var(--green); background: rgba(52, 211, 153, .1); }
.btn.big { padding: 14px 18px; font-size: 1.05rem; }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn small { display: block; font-size: .78rem; font-weight: 600; opacity: .85; margin-top: 2px; }
.btns { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.btns.col { flex-direction: column; }
.how { text-align: left; font-size: .82rem; color: var(--mute); line-height: 1.6; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.how p + p { margin-top: 6px; }
.how b { color: var(--text); margin-right: 4px; }
.how b.hl { color: var(--yellow); margin: 0; }
.tip { color: var(--mute); font-size: .86rem; line-height: 1.55; }
#setupTip, #setupTableDesc { margin-top: 8px; }

/* 리그 목록 */
.opp-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 480px) { .opp-list { grid-template-columns: 1fr; } }
.opp-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); text-align: left; }
.opp-card:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.opp-card:disabled { opacity: .38; cursor: not-allowed; }
.opp-card .em { font-size: 2rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .35); flex: none; }
.opp-card .tx { min-width: 0; flex: 1; }
.opp-card b { display: block; font-size: .98rem; }
.opp-card small { display: block; font-size: .76rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-card .st { color: var(--yellow); font-size: .85rem; letter-spacing: 1px; flex: none; }
.opp-card .st .off { color: #334155; }
.opp-card.next { border-color: rgba(56, 189, 248, .55); box-shadow: 0 0 14px rgba(56, 189, 248, .2); }

/* VS 화면 */
.vs-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 6px; }
.vs-me, .vs-opp { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vs-me i { width: 56px; height: 56px; border-radius: 50%; border: 6px solid; box-shadow: 0 0 18px currentColor; display: block; }
.vs-opp span { font-size: 3rem; line-height: 56px; filter: drop-shadow(0 0 12px rgba(244, 63, 94, .5)); }
.vs-x { font-weight: 900; font-size: 1.4rem; color: var(--mute); }
.opp-title { color: var(--pink); font-weight: 800; font-size: .85rem; }
.quote { color: #cbd5e1; font-size: .92rem; margin: 8px 0 10px; font-style: italic; }
.rule-box { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rule-box div { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 7px 10px; font-size: .84rem; }
.rule-box b { margin-right: 6px; }
.rule-box span { color: var(--mute); }
.goal-line { font-size: 1.1rem; font-weight: 800; color: var(--yellow); margin: 10px 0 4px; }

/* 설정 */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.chip-grid.three { grid-template-columns: repeat(3, 1fr); }
.pick { padding: 8px 6px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.on { border-color: var(--cyan); background: rgba(56, 189, 248, .16); box-shadow: 0 0 12px rgba(56, 189, 248, .25); }
.pick:disabled { opacity: .35; cursor: not-allowed; }

/* 결과 */
.res-score { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.res-score .me { color: var(--cyan); } .res-score .op { color: var(--pink); }
.stars { font-size: 2.4rem; letter-spacing: 6px; margin: 0 0 10px; }
.stars i { font-style: normal; color: #1e293b; display: inline-block; }
.stars i.on { color: var(--yellow); text-shadow: 0 0 18px rgba(253, 224, 71, .7); animation: pop .45s backwards; }
.stars i.on:nth-child(2) { animation-delay: .15s; } .stars i.on:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0) rotate(-90deg); } }
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.res-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 480px) { .res-grid.four { grid-template-columns: repeat(2, 1fr); } }
.res-grid div { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 8px; }
.res-grid span { display: block; font-size: .75rem; color: var(--mute); }
.res-grid b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.res-new { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.res-new span { padding: 4px 10px; border-radius: 99px; background: rgba(253, 224, 71, .12); border: 1px solid rgba(253, 224, 71, .45); color: var(--yellow); font-size: .8rem; font-weight: 700; animation: pop .45s backwards; }
.res-new span.unl { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .5); color: #bae6fd; }

/* 업적·스킨 */
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; text-align: left; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .08); opacity: .5; }
.ach.got { opacity: 1; border-color: rgba(253, 224, 71, .4); }
.ach .ai { font-size: 1.5rem; width: 32px; text-align: center; flex: none; }
.ach b { display: block; font-size: .9rem; }
.ach small { display: block; font-size: .75rem; color: var(--mute); line-height: 1.4; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.skin-card { padding: 10px 8px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); text-align: center; }
.skin-card:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.skin-card.on { border-color: var(--cyan); box-shadow: 0 0 14px rgba(56, 189, 248, .35); }
.skin-card i { display: block; width: 44px; height: 44px; margin: 2px auto 8px; border-radius: 50%; border: 6px solid; box-shadow: 0 0 12px currentColor; }
.skin-card i.rainbow { border-color: transparent; background: conic-gradient(#f43f5e, #f59e0b, #a3e635, #22d3ee, #a78bfa, #f43f5e) border-box; -webkit-mask: radial-gradient(circle, transparent 13px, #000 14px); mask: radial-gradient(circle, transparent 13px, #000 14px); }
.skin-card b { display: block; font-size: .9rem; }
.skin-card span { display: block; font-size: .75rem; color: var(--mute); margin-top: 2px; }
.skin-card.on span { color: var(--cyan); }
.skin-card:disabled { opacity: .45; cursor: not-allowed; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }
