:root {
  --bg: #0b0f24; --ink: #f4f6ff; --mut: #a9b0d6; --lime: #c6ff3a; --coral: #ff5a36; --sky: #7dd3ff; --amber: #ffb35a;
  --glass: rgba(14, 18, 44, .72); --line: rgba(255, 255, 255, .12); --r: 18px;
  --fh: 'Baloo 2', system-ui, sans-serif; --fb: 'Be Vietnam Pro', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--fb); }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 6, 20, .55)); transition: opacity .4s; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
small { font-size: .78em; color: var(--mut); font-weight: 500; }
.muted { color: var(--mut); font-size: .92rem; }

/* ===== Screens ===== */
.screen { position: fixed; inset: 0; display: none; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px 16px; z-index: 5; }
.screen.active { display: flex; flex-direction: column; align-items: center; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
#menu { background: linear-gradient(180deg, rgba(11, 15, 36, .1), rgba(11, 15, 36, .55) 70%, rgba(11, 15, 36, .85)); }
.topbar { width: 100%; max-width: 1100px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.profile { display: flex; gap: 10px; align-items: center; background: var(--glass); backdrop-filter: blur(10px); padding: 6px 14px 6px 6px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; }
.profile b { display: block; font-size: .95rem; }
.ava { width: 38px; height: 38px; border-radius: 50%; background: var(--coral); border: 3px solid #fff3; position: relative; overflow: hidden; }
.ava::after { content: ''; position: absolute; left: 50%; top: 22%; width: 46%; height: 46%; transform: translateX(-50%); border-radius: 50%; background: var(--skin, #e8b48a); }
.coins { display: flex; align-items: center; gap: 8px; background: var(--glass); backdrop-filter: blur(10px); padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); font-family: var(--fh); font-size: 1.15rem; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6a8, #ffc21a 55%, #c68400); box-shadow: 0 0 10px #ffc21a88; }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 760px; padding: 20px 0; }
.logo { display: flex; align-items: center; gap: 14px; }
.logo h1 { font-family: var(--fh); font-weight: 800; font-size: clamp(3rem, 11vw, 6.2rem); line-height: .9; margin: 0; letter-spacing: -1px; text-shadow: 0 6px 0 #0006, 0 0 40px #c6ff3a44; }
.logo h1 em { font-style: normal; color: var(--lime); margin-left: .18em; }
.ballico { width: clamp(52px, 10vw, 84px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #f4ff9a, var(--lime) 50%, #7fb800); position: relative; box-shadow: 0 8px 30px #c6ff3a55, inset -6px -8px 0 #0002; animation: bob 2.4s ease-in-out infinite; }
.ballico::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #0b0f24 0 6%, transparent 7%) 0 0 / 33% 33%; opacity: .55; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(25deg); } }
.tag { color: #dfe4ff; text-align: center; margin: 10px 0 26px; font-size: clamp(.9rem, 2.4vw, 1.08rem); text-shadow: 0 2px 8px #000a; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.big { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: var(--r); background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); transition: transform .15s, border-color .15s, background .15s; }
.big:hover { transform: translateY(-3px); border-color: #ffffff44; }
.big:active { transform: scale(.98); }
.big i { font-style: normal; font-size: 1.9rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: #ffffff10; flex: none; }
.big span { font-family: var(--fh); font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.big small { display: block; font-family: var(--fb); font-size: .8rem; margin-top: 3px; }
.big.primary { background: linear-gradient(135deg, #c6ff3a, #6fe08a); color: #0b1a10; border: 0; box-shadow: 0 10px 30px #c6ff3a40; }
.big.primary small { color: #1d3b17; }
.big.primary i { background: #0b1a1022; }
.menu-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.chip { padding: 10px 18px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); font-weight: 600; font-size: .92rem; transition: background .15s; }
.chip:hover { background: rgba(40, 46, 90, .8); }
.chip.danger { color: #ff8a8a; border-color: #ff6a6a55; }
.foot { color: #ffffff66; font-size: .78rem; padding-bottom: env(safe-area-inset-bottom); }

/* ===== Panels ===== */
.panel { width: 100%; max-width: 620px; margin: auto; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 24px; padding: 20px 22px 24px; box-shadow: 0 30px 80px #0008; }
.panel.wide { max-width: 980px; }
.panel.small { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.phead h2, .panel h2 { font-family: var(--fh); font-size: 1.9rem; margin: 0; flex: 1; }
.back { width: 40px; height: 40px; border-radius: 12px; background: #ffffff12; font-size: 1.2rem; }
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 600; font-size: .85rem; color: var(--mut); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.row > label { margin: 0; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .98rem; }
.seg { display: flex; background: #00000030; border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 70px; padding: 10px 10px; border-radius: 10px; font-weight: 600; font-size: .9rem; color: var(--mut); transition: all .15s; }
.seg button.on { background: var(--lime); color: #0b1a10; box-shadow: 0 4px 14px #c6ff3a40; }
input[type=range] { width: 180px; accent-color: var(--lime); }
input:not([type]) , input[type=text] { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #00000040; color: var(--ink); font: 600 1rem var(--fb); outline: none; }
input:focus { border-color: var(--lime); }
.cta { width: 100%; padding: 15px; border-radius: 16px; background: linear-gradient(135deg, #c6ff3a, #6fe08a); color: #0b1a10; font-family: var(--fh); font-size: 1.35rem; font-weight: 800; margin-top: 8px; box-shadow: 0 10px 30px #c6ff3a40; transition: transform .12s; }
.cta:active { transform: scale(.98); }

.courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.court { position: relative; border-radius: 14px; padding: 10px; min-height: 92px; text-align: left; border: 2px solid transparent; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.court::before { content: ''; position: absolute; inset: 0; background: var(--g); z-index: -1; }
.court::after { content: ''; position: absolute; left: 22%; right: 22%; top: 18%; height: 36%; border: 2px solid #ffffffaa; border-radius: 3px; background: var(--c); transform: perspective(120px) rotateX(40deg); z-index: -1; }
.court b { font-family: var(--fh); font-size: 1rem; text-shadow: 0 1px 4px #000; line-height: 1.1; }
.court small { color: #ffffffcc; text-shadow: 0 1px 4px #000; }
.court.on { border-color: var(--lime); box-shadow: 0 0 0 3px #c6ff3a33; }
.court.locked { filter: saturate(.4) brightness(.75); }
.court .price { position: absolute; top: 8px; right: 8px; background: #000a; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; color: #ffd84a; }

/* ===== Career ===== */
.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.opp { position: relative; border-radius: 18px; padding: 30px 14px 14px; background: #ffffff0a; border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: 6px; transition: transform .15s; }
.opp:not(.locked):hover { transform: translateY(-3px); }
.opp .top { display: flex; gap: 10px; align-items: center; }
.opp .no { font-family: var(--fh); font-size: 1.6rem; color: #ffffff33; width: 26px; }
.opp .face { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff3; position: relative; overflow: hidden; flex: none; }
.opp .face::after { content: ''; position: absolute; left: 50%; top: 20%; width: 48%; height: 48%; transform: translateX(-50%); border-radius: 50%; background: var(--skin); }
.opp b { font-family: var(--fh); font-size: 1.1rem; line-height: 1.1; }
.opp .styl { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #ffffff14; width: fit-content; }
.opp p { margin: 0; font-size: .82rem; color: var(--mut); }
.opp .bar { height: 6px; border-radius: 6px; background: #ffffff14; overflow: hidden; }
.opp .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--coral)); }
.opp.done { border-color: #c6ff3a66; }
.opp.done::after { content: "✓ Đã hạ"; position: absolute; top: 8px; right: 10px; font-size: .72rem; font-weight: 700; color: var(--lime); }
.opp.cur { border-color: var(--amber); box-shadow: 0 0 0 3px #ffb35a33; background: #ffb35a12; }
.opp.cur::after { content: "Thách đấu ▶"; position: absolute; top: 8px; right: 10px; font-size: .72rem; font-weight: 700; color: var(--amber); }
.opp.locked { opacity: .45; cursor: not-allowed; }
.opp.locked::after { content: "🔒"; position: absolute; top: 6px; right: 12px; }

/* ===== Practice ===== */
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pcard { text-align: left; padding: 18px; border-radius: 18px; background: #ffffff0a; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s; }
.pcard:hover { transform: translateY(-3px); border-color: var(--lime); }
.pcard i { font-style: normal; font-size: 2.2rem; }
.pcard b { font-family: var(--fh); font-size: 1.3rem; }
.pcard p { margin: 0; color: var(--mut); font-size: .88rem; }
.pcard span { margin-top: 6px; font-weight: 600; color: var(--lime); }

/* ===== Locker ===== */
.locker { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.figure { position: relative; height: 340px; border-radius: 20px; background: radial-gradient(circle at 50% 85%, #ffffff18, transparent 60%), linear-gradient(#1a2150, #0f1433); }
.figure > * { position: absolute; left: 50%; transform: translateX(-50%); }
.f-head { top: 52px; width: 62px; height: 66px; border-radius: 50%; background: var(--skin); }
.f-head i { position: absolute; top: 30px; width: 7px; height: 9px; border-radius: 50%; background: #111; } .f-head i:first-child { left: 17px; } .f-head i:last-child { right: 17px; }
.f-hat { top: 40px; width: 70px; height: 34px; border-radius: 40px 40px 6px 6px; background: var(--hat); z-index: 2; }
.figure[data-hat=none] .f-hat { display: none; }
.figure[data-hat=visor] .f-hat { height: 12px; top: 58px; border-radius: 6px; }
.figure[data-hat=band] .f-hat { height: 10px; top: 60px; border-radius: 6px; width: 64px; }
.figure[data-hat=non] .f-hat { top: 18px; width: 150px; height: 46px; border-radius: 0; background: linear-gradient(#efe3b0, #d8c486); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.figure[data-hat=cap] .f-hat::after { content: ''; position: absolute; bottom: -2px; left: 40px; width: 50px; height: 10px; border-radius: 0 10px 10px 0; background: var(--hat); }
.f-body { top: 120px; width: 96px; height: 100px; border-radius: 34px 34px 16px 16px; background: var(--shirt); }
.f-shorts { top: 210px; width: 90px; height: 44px; border-radius: 6px 6px 14px 14px; background: var(--shorts); }
.f-legs { top: 250px; width: 70px; height: 70px; display: flex; justify-content: space-between; }
.f-legs i { width: 22px; height: 68px; border-radius: 0 0 10px 10px; background: var(--skin); border-bottom: 12px solid #f4f4f4; }
.f-paddle { top: 150px; left: calc(50% + 78px) !important; width: 56px; height: 72px; border-radius: 26px 26px 20px 20px; background: var(--paddle); box-shadow: inset 0 0 0 4px #0003; transform: rotate(18deg) !important; }
.f-paddle::after { content: ''; position: absolute; left: 22px; bottom: -34px; width: 12px; height: 36px; border-radius: 4px; background: #222; }
.sw { display: flex; gap: 8px; flex-wrap: wrap; }
.sw button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 2px #0003; }
.sw button.on { border-color: #fff; transform: scale(1.1); }

/* ===== Guide ===== */
.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.guide h3 { font-family: var(--fh); font-size: 1.25rem; margin: 10px 0 6px; color: var(--lime); }
.guide ul { margin: 0; padding-left: 18px; line-height: 1.7; font-size: .92rem; }
.keys { list-style: none; padding: 0 !important; }
kbd { display: inline-block; min-width: 26px; padding: 1px 7px; margin-right: 3px; border-radius: 6px; background: #ffffff1a; border-bottom: 2px solid #0006; font: 700 .8rem var(--fb); text-align: center; }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.score { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; border-radius: 16px; overflow: hidden; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: 0 10px 30px #0006; }
.score .side { display: flex; align-items: center; gap: 10px; padding: 6px 14px; position: relative; }
.score .side b { font-family: var(--fh); font-size: 2rem; line-height: 1; min-width: 32px; text-align: center; }
.score .a b { color: var(--amber); } .score .b b { color: var(--sky); }
.score .nm { font-weight: 700; font-size: .78rem; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dfe4ff; }
.score .call { display: grid; place-items: center; padding: 0 14px; font-family: var(--fh); font-weight: 800; font-size: 1.2rem; background: #00000040; color: var(--lime); min-width: 76px; }
.srv { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); opacity: 0; transition: opacity .2s; }
.srv.on { opacity: 1; }
.timer, .streak { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; padding: 6px 18px; display: flex; gap: 16px; align-items: center; font-weight: 600; }
.timer b, .streak b { font-family: var(--fh); font-size: 1.9rem; color: var(--lime); line-height: 1; }
.timer > b { color: #fff; min-width: 46px; }
.hbtns { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; pointer-events: auto; }
.hbtns button { width: 44px; height: 44px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 1.1rem; backdrop-filter: blur(10px); }
.status { position: absolute; left: 14px; top: max(12px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stam { width: 140px; height: 9px; border-radius: 9px; background: #0007; border: 1px solid var(--line); overflow: hidden; }
.stam i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd25a, var(--lime)); transition: width .1s; }
.hint { display: none; padding: 6px 12px; border-radius: 10px; font-size: .82rem; font-weight: 600; background: #ff5a3699; backdrop-filter: blur(6px); }
.hint.show { display: block; animation: pop .25s; }
.hint.wait { background: #2d6bff99; }
.hint.spin { background: #b48cffaa; }
.htag { position: absolute; transform: translate(-50%, -100%); font-family: var(--fh); font-weight: 800; font-size: 1.05rem; padding: 2px 10px; border-radius: 99px; background: #000a; display: none; white-space: nowrap; letter-spacing: .04em; }
.htag.show { display: block; }
.htag.lo { color: #7dd3ff; } .htag.ok { color: var(--lime); } .htag.mid { color: var(--amber); } .htag.hi { color: #ff4f6a; animation: pulse .4s infinite alternate; }
.htag.reach { box-shadow: 0 0 0 2px #fff; }
@keyframes pulse { to { transform: translate(-50%, -100%) scale(1.15); } }
.shotpop { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); font-family: var(--fh); font-weight: 800; font-size: 1.6rem; opacity: 0; text-shadow: 0 3px 10px #000a; }
.shotpop.go { animation: shotpop .8s ease-out; }
@keyframes shotpop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1); } }
.banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); text-align: center; opacity: 0; pointer-events: none; }
.banner b { display: block; font-family: var(--fh); font-weight: 800; font-size: clamp(2.2rem, 8vw, 4.4rem); line-height: 1; text-shadow: 0 6px 0 #0007, 0 0 30px currentColor; white-space: nowrap; }
.banner span { display: inline-block; margin-top: 8px; padding: 5px 14px; border-radius: 99px; background: #000a; font-weight: 600; font-size: .95rem; }
.banner.good b { color: var(--lime); } .banner.bad b { color: #ff6b74; }
.banner.go { animation: banner 1.8s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.serveHint { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: #000a; font-weight: 600; font-size: .92rem; display: none; text-align: center; }
.serveHint.show { display: block; animation: pop .3s; }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }
.status .hint.show { animation: none; }
#toast { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 20; padding: 8px 16px; border-radius: 12px; background: #000c; font-weight: 600; font-size: .9rem; opacity: 0; transition: opacity .25s; pointer-events: none; }
#toast.show { opacity: 1; }

/* ===== Touch ===== */
#touch { display: none; }
.touchdev #touch { display: block; }
.joy { position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 150px; height: 150px; border-radius: 50%; background: #ffffff10; border: 2px solid #ffffff30; pointer-events: auto; backdrop-filter: blur(4px); }
.knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: #ffffff40; border: 2px solid #ffffff80; }
.tbtns { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); width: 220px; height: 190px; pointer-events: none; }
.tb { position: absolute; pointer-events: auto; border-radius: 50%; font-family: var(--fh); font-weight: 800; font-size: 1rem; color: #fff; text-shadow: 0 1px 3px #0008; border: 2px solid #ffffff60; backdrop-filter: blur(4px); }
.tb.on, .tb:active { transform: scale(.92); filter: brightness(1.3); }
.tb.power { right: 0; bottom: 18px; width: 92px; height: 92px; background: #ff5a36aa; }
.tb.soft { right: 104px; bottom: 0; width: 84px; height: 84px; background: #2fbf71aa; }
.tb.lob { right: 22px; bottom: 120px; width: 66px; height: 66px; background: #3f8bffaa; font-size: .85rem; }
.tb.spinb { right: 112px; bottom: 100px; width: 52px; height: 52px; background: #b48cff88; font-size: 1.3rem; }
.tb.spinb.on { background: #b48cff; }
.tb.sprint { left: max(185px, calc(env(safe-area-inset-left) + 175px)); bottom: max(30px, env(safe-area-inset-bottom)); width: 56px; height: 56px; background: #ffd25a88; font-size: 1.3rem; }
.touchdev .status { top: auto; bottom: 190px; }
.touchdev .serveHint { bottom: auto; top: max(68px, calc(env(safe-area-inset-top) + 60px)); font-size: .8rem; max-width: 70vw; }

/* ===== Overlays ===== */
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: #05061477; backdrop-filter: blur(4px); animation: fadeIn .3s; }
.endp .res { font-family: var(--fh); font-weight: 800; font-size: 2.8rem; line-height: 1; }
.endp .res.win { color: var(--lime); text-shadow: 0 0 30px #c6ff3a66; } .endp .res.lose { color: #ff8a8a; }
.endscore { font-family: var(--fh); font-size: 2.2rem; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.stats div { background: #ffffff0c; border-radius: 12px; padding: 8px 4px; }
.stats b { display: block; font-family: var(--fh); font-size: 1.4rem; line-height: 1.1; }
.stats small { font-size: .72rem; }
.reward { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.reward span { padding: 6px 14px; border-radius: 99px; background: #ffffff12; }
.ebtns { display: flex; flex-direction: column; gap: 8px; }
#loading { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.ballico.spin { width: 70px; animation: bob 1s ease-in-out infinite; }

@media (max-width: 720px) {
  .menu-grid { grid-template-columns: 1fr; gap: 10px; }
  .big { padding: 12px 14px; } .big i { width: 44px; height: 44px; font-size: 1.5rem; }
  .locker, .guide { grid-template-columns: 1fr; }
  .figure { height: 300px; max-width: 280px; margin: 0 auto; width: 100%; }
  .score .nm { display: none; }
  .score .side b { font-size: 1.6rem; }
}
@media (max-height: 520px) {
  .hero { padding: 6px 0; } .tag { margin: 4px 0 12px; }
  .logo h1 { font-size: 3rem; } .ballico { width: 48px; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .big { padding: 10px 12px; } .big small { display: none; }
  .joy { width: 130px; height: 130px; }
  .touchdev .status { bottom: auto; top: 10px; }
  .overlay { align-items: flex-start; overflow-y: auto; }
  .panel.small { max-width: 640px; padding: 14px 18px; gap: 6px; }
  .endp .res { font-size: 1.9rem; } .endscore { font-size: 1.5rem; }
  .stats { grid-template-columns: repeat(6, 1fr); } .stats b { font-size: 1.1rem; }
  .ebtns { flex-direction: row; } .ebtns > * { flex: 1; margin: 0; }
  .ebtns .cta { font-size: 1.1rem; padding: 10px; }
}
