@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Inter:wght@400;600;700&display=swap');

:root { font-family: Inter, system-ui, sans-serif; color: #eff6ff; background: #07111f; font-synthesis: none; }
* { box-sizing: border-box; }
html { min-height: 100%; overscroll-behavior: none; }
body { margin: 0; min-height: 100vh; min-height: 100svh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); background: radial-gradient(circle at 15% 10%, #17345e 0, transparent 34%), radial-gradient(circle at 85% 90%, #2a174c 0, transparent 32%), #07111f; color: #eff6ff; overscroll-behavior: none; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.dashboard-shell, .game-shell { position: relative; width: min(100% - 32px, 1040px); margin: 0 auto; padding: max(40px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom)); }
.game-shell { width: min(100% - 24px, 760px); text-align: center; }
.dashboard-header { display: flex; align-items: center; gap: 24px; padding: 30px; border: 1px solid rgba(255,255,255,.1); border-radius: 28px; background: linear-gradient(135deg, rgba(20,45,78,.88), rgba(21,22,54,.9)); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
#avatar { width: 108px; height: 108px; object-fit: cover; border-radius: 25px; border: 3px solid #67e8f9; box-shadow: 0 0 0 7px rgba(103,232,249,.12); }
.welcome { text-align: left; }
h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.1rem, 6vw, 4.1rem); letter-spacing: -.035em; background: linear-gradient(90deg, #fff, #67e8f9); color: transparent; background-clip: text; }
.lead { max-width: 620px; color: #b8c7dc; margin: 10px 0 0; line-height: 1.65; }
.featured { display: flex; justify-content: space-between; align-items: end; margin: 42px 2px 18px; text-align: left; }
.featured h2 { font-size: 1.8rem; }
.subtitle { margin: 7px 0 0; color: #9fb0c8; line-height: 1.5; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.game-card { position: relative; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 22px; border-radius: 22px; border: 1px solid rgba(255,255,255,.12); color: white; text-decoration: none; box-shadow: 0 18px 45px rgba(0,0,0,.23); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.game-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 15%, rgba(4,9,18,.92) 88%); }
.game-card > * { position: relative; }
.game-card:hover, .game-card:focus-visible { transform: translateY(-7px); border-color: #67e8f9; box-shadow: 0 25px 55px rgba(0,0,0,.35); outline: none; }
.game-card.caterpillar { background: radial-gradient(circle at 50% 26%, #86efac 0 8%, transparent 9%), linear-gradient(145deg, #166534, #052e16); }
.game-card.racer { background: linear-gradient(115deg, transparent 44%, rgba(255,255,255,.15) 45% 48%, transparent 49%), linear-gradient(145deg, #f97316, #7c2d12); }
.game-card.minion { background: radial-gradient(circle at 50% 25%, #fde047 0 13%, #2563eb 14% 22%, transparent 23%), linear-gradient(145deg, #1d4ed8, #172554); }
.game-card.target { background: radial-gradient(circle at 72% 27%, #f8fafc 0 6%, #ef4444 6.5% 12%, #2563eb 12.5% 17%, transparent 17.5%), linear-gradient(145deg, #334155, #07111f); }
.card-top { position: absolute; top: 18px; left: 18px; display: flex; gap: 7px; }
.tag { padding: 6px 9px; border-radius: 999px; background: rgba(5,10,20,.55); border: 1px solid rgba(255,255,255,.16); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.game-card h3 { font-size: 1.55rem; }
.game-card p { color: #cbd5e1; font-size: .9rem; line-height: 1.5; margin: 7px 0 14px; }
.play-label { color: #67e8f9; font-weight: 800; }
.dashboard-footer { color: #7789a2; text-align: center; margin-top: 30px; font-size: .88rem; }
.back-link { display: inline-flex; align-items: center; margin-bottom: 22px; color: #9fb0c8; text-decoration: none; font-weight: 700; }
.back-link:hover { color: #67e8f9; }
.game-shell > h1 { font-size: clamp(2rem, 7vw, 3.4rem); }
.game-toolbar { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.tool-btn { min-height: 38px; padding: 8px 12px; color: #bcd0e8; background: rgba(20,38,62,.8); border: 1px solid #304b69; box-shadow: none; font-size: .78rem; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px auto; max-width: 680px; padding: 10px; border: 1px solid rgba(103,232,249,.15); border-radius: 18px; background: linear-gradient(135deg, rgba(15,34,58,.94), rgba(10,23,41,.94)); box-shadow: inset 0 1px rgba(255,255,255,.04), 0 12px 30px rgba(0,0,0,.16); }
.score-group { display: grid; grid-template-columns: repeat(4, minmax(62px, 1fr)); gap: 7px; align-items: stretch; color: #8fa5bf; font-size: .67rem; text-transform: uppercase; letter-spacing: .07em; }
.score-group span { display: flex; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; padding: 6px 9px; border-radius: 11px; background: rgba(255,255,255,.045); }
.score-group strong { display: block; margin-top: 2px; color: #f8fdff; font-size: 1.14rem; letter-spacing: 0; text-shadow: 0 0 16px rgba(103,232,249,.35); }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.controls label { font-size: .78rem; color: #9fb0c8; }
input[type="text"] { width: 108px; border: 1px solid #334b69; border-radius: 9px; padding: 8px 10px; background: #0c192c; color: white; }
input[type="color"] { width: 36px; height: 34px; padding: 2px; border: 1px solid #334b69; border-radius: 9px; background: #0c192c; cursor: pointer; }
button { border: 0; border-radius: 11px; padding: 10px 16px; background: linear-gradient(135deg, #22d3ee, #3b82f6); color: #04101d; font-weight: 800; cursor: pointer; box-shadow: 0 8px 22px rgba(34,211,238,.18); transition: transform .15s, filter .15s; }
button:disabled { opacity: .42; cursor: not-allowed; }
.secondary-btn { color: #dbeafe; background: #203550; border: 1px solid #385474; box-shadow: none; }
button:hover { filter: brightness(1.12); transform: translateY(-1px); }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(103,232,249,.45); outline-offset: 2px; }
.canvas-wrapper { position: relative; width: 400px; max-width: 100%; margin: 0 auto; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden; }
canvas { display: block; width: 100%; background: #0b1525; touch-action: none; -webkit-user-select: none; user-select: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,10,20,.78); backdrop-filter: blur(5px); padding: 20px; color: white; }
.overlay-card { max-width: 310px; padding: 24px; border-radius: 20px; border: 1px solid rgba(255,255,255,.13); background: rgba(12,25,44,.92); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.overlay h2 { font-size: 1.8rem; }
.overlay p { color: #afbdd0; line-height: 1.55; }
.overlay-actions { margin-top: 15px; }
.touch-controls { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.touch-row { display: flex; gap: 8px; }
.dir-btn { min-width: 56px; min-height: 52px; padding: 0; border: 1px solid #46617f; background: #14263e; color: white; box-shadow: none; font-size: 1rem; touch-action: none; -webkit-user-select: none; user-select: none; }
.dir-btn:active { background: #284665; transform: scale(.97); }
.wide-dir { min-width: 112px; }
.joystick { position: relative; width: 118px; height: 118px; border-radius: 50%; border: 2px solid #46617f; background: radial-gradient(circle, #203b59 0 24%, #14263e 25% 58%, #0c192c 59%); box-shadow: inset 0 5px 16px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.24); touch-action: none; -webkit-user-select: none; user-select: none; }
.joystick::before { content: "◀        ▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #6f8aa8; font-size: .72rem; white-space: pre; pointer-events: none; }
.joystick-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(145deg, #67e8f9, #3b82f6); border: 3px solid #c9f7ff; box-shadow: 0 7px 16px rgba(0,0,0,.4); transform: translate(-50%, -50%); pointer-events: none; transition: transform .08s ease-out; }
.joystick.active .joystick-knob { transition: none; }
.joystick:focus-visible { outline: 3px solid rgba(103,232,249,.45); outline-offset: 4px; }
.joystick-label { margin-top: -2px; color: #91a4bd; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.game-tip { color: #71839b; font-size: .8rem; margin-top: 12px; }
.game-toast { position: fixed; z-index: 20; left: 50%; top: max(18px, env(safe-area-inset-top)); padding: 10px 16px; border-radius: 999px; color: #07111f; background: #fef08a; font-weight: 800; box-shadow: 0 12px 35px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, -18px); pointer-events: none; transition: .22s ease; }
.game-toast.show { opacity: 1; transform: translate(-50%, 0); }
.game-shell:fullscreen { width: 100%; max-width: none; overflow: auto; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: #07111f; }
.range-shell { width: min(100% - 24px, 900px); }
.loadout-panel { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; max-width: 680px; margin: 16px auto 0; padding: 12px; border: 1px solid #29435f; border-radius: 16px; background: rgba(12,25,44,.82); text-align: left; }
.loadout-panel label { display: grid; gap: 6px; color: #91a4bd; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
select { width: 100%; min-height: 44px; padding: 9px 34px 9px 11px; border: 1px solid #3b5877; border-radius: 10px; color: #eff6ff; background: #11253d; font: inherit; }
.range-hud { max-width: 820px; }
.range-hud .score-group { grid-template-columns: repeat(5, minmax(64px, 1fr)); }
.range-wrapper { width: 700px; }
.overlay-icon { display: block; margin-bottom: 8px; font-size: 2.5rem; }
@media (max-width: 700px) { .loadout-panel { grid-template-columns: 1fr; } .range-hud .score-group { grid-template-columns: repeat(5, 1fr); } .range-wrapper { width: calc(100vw - 24px); } }
@media (max-width: 760px) { .game-grid { grid-template-columns: 1fr; } .game-card { min-height: 210px; } .dashboard-header { align-items: flex-start; } }
@media (max-width: 560px) { .dashboard-shell { padding-top: 20px; } .dashboard-header { padding: 22px; flex-direction: column; } #avatar { width: 78px; height: 78px; } .featured { margin-top: 30px; } .hud { flex-direction: column; align-items: stretch; } .score-group, .controls { justify-content: center; } .score-group { width: 100%; } .canvas-wrapper { width: calc(100vw - 24px); } .dir-btn { min-width: 64px; min-height: 56px; } }
@media (hover: none) and (pointer: coarse) { button { min-height: 48px; } .touch-controls { display: flex; } .game-tip { font-size: .9rem; color: #91a4bd; } }
@media (orientation: landscape) and (max-height: 720px) { .game-shell { padding-top: max(12px, env(safe-area-inset-top)); } .game-shell > h1 { font-size: 2rem; } .game-shell > .subtitle, .game-tip { display: none; } .back-link { margin-bottom: 8px; } .hud { margin: 10px auto; } .canvas-wrapper { max-width: min(52vh, 400px); } .touch-controls { margin-top: 8px; } .joystick { width: 78px; height: 78px; } .joystick-knob { width: 38px; height: 38px; } .joystick-label, .wide-dir { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
