:root { color-scheme: dark; font-family: Arial, sans-serif; color: #f3eaff; background: #120c2b; }
* { box-sizing: border-box; }
body { margin: 0; padding: 48px 24px; background: radial-gradient(ellipse at 50% 0, #33114c 0, #120c2b 65%); min-height: 100vh; }
.game-shell { max-width: 1200px; margin: auto; }
.game-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow, .track-label { font-size: 11px; letter-spacing: 2px; color: #bba5dd; }
.eyebrow { margin: 0 0 10px; }
h1 { font-size: clamp(28px, 4vw, 46px); font-style: italic; letter-spacing: -2px; margin: 0; }
h1 span { color: #ff5acb; text-shadow: 0 0 20px #e535b755; }
.track-label { border: 1px solid #73469c; padding: 12px; border-radius: 5px; }
.track { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid #73469c; background: #171345; box-shadow: 0 0 35px #7b2fff25; }
canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.game-hud { position: absolute; right: 20px; top: 18px; width: 310px; max-width: calc(100% - 16px); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px; border: 1px solid #ffffff26; border-radius: 8px; background: #190e3ee8; pointer-events: none; color: #f3eaff; }
.boost-meter { min-width: 0; border-left: 1px solid #ffffff35; padding-left: 14px; }
.health-hud { position: absolute; left: 20px; top: 18px; width: 195px; max-width: calc(100% - 16px); padding: 10px 12px; border: 1px solid #ffffff26; border-radius: 8px; background: #190e3ee8; color: #f3eaff; pointer-events: none; }
#healthBar { display: block; width: 100%; height: 10px; border: 0; border-radius: 5px; overflow: hidden; background: #352050; accent-color: #57eff2; }
#healthBar::-webkit-progress-bar { background: #352050; }
#healthBar::-webkit-progress-value { background: #57eff2; }
#healthBar::-moz-progress-bar { background: #57eff2; }
.game-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: #120a2be6; text-align: center; }
.game-over[hidden] { display: none; }
.game-over h2 { margin: 10px 0; font-size: clamp(24px, 4vw, 44px); }
.game-over p { font-size: 13px; }
#restartButton { background: #ff5acb; color: #1a123e; font-weight: bold; }
.speedometer { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; font-variant-numeric: tabular-nums; }
.boost-label { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; margin: 8px 0 6px; }
.boost-meter small { display: block; font-size: 8px; letter-spacing: 0.5px; margin-top: 5px; color: #b5d8dc; }
#boostBar { display: block; width: 100%; height: 10px; border: 0; border-radius: 5px; overflow: hidden; background: #352050; accent-color: #ff5acb; }
#boostBar::-webkit-progress-bar { background: #352050; border-radius: 5px; }
#boostBar::-webkit-progress-value { background: #ff5acb; border-radius: 5px; }
#boostBar::-moz-progress-bar { background: #ff5acb; border-radius: 5px; }
.speedometer span { font-size: clamp(24px, 4vw, 42px); font-weight: bold; }
.speedometer small { font-size: 10px; letter-spacing: 2px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.inventory { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; width: min(360px, calc(100% - 112px)); margin: 0; padding: 8px 10px; background: #1b0c3de8; border: 1px solid #9d56ddaa; border-radius: 10px; pointer-events: none; }
.inventory-heading { display: flex; justify-content: space-between; align-items: center; color: #e1d4ff; font-size: 9px; letter-spacing: 2px; margin-bottom: 6px; }
.inventory-heading small { font-size: 10px; letter-spacing: 1px; }
.inventory-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 0 0 9px; margin: 0; list-style: none; }
.gun-durability { position: absolute; bottom: -8px; left: 0; width: 100%; height: 4px; border: 0; border-radius: 2px; overflow: hidden; background: #3f2260; accent-color: #ff5acb; }
.gun-durability::-webkit-progress-bar { background: #3f2260; }
.gun-durability::-webkit-progress-value { background: #ff5acb; }
.gun-durability::-moz-progress-bar { background: #ff5acb; }
.inventory-slots li { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; background: #120c2b; border: 1px solid #693b8e; border-radius: 6px; }
.inventory-slots span { position: absolute; top: 5px; left: 6px; color: #d4adf2; font-size: 9px; }
.inventory-slots img { width: 78%; height: 78%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 3px #38def088); }
.inventory-slots img[hidden] { display: none; }
.inventory-slots li.selected { border-color: #58efff; box-shadow: inset 0 0 0 1px #58efff, 0 0 10px #27dcff30; background: #47225e; }
.pickup-prompt { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; padding: 8px 12px; border: 1px solid #ff5acb; border-radius: 5px; background: #1d0c40e8; color: #ffc2ef; font-size: 11px; white-space: nowrap; pointer-events: none; }
.fullscreen-button { position: absolute; bottom: 12px; right: 12px; z-index: 6; padding: 10px 12px; background: #1d0c40e8; font-size: 12px; }
.track:is(:fullscreen, :-webkit-full-screen, .fullscreen-fallback) { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; border: 0; border-radius: 0; margin: 0; z-index: 1000; }
.track:is(:fullscreen, :-webkit-full-screen, .fullscreen-fallback) canvas { width: 100%; height: 100%; }
body.ocean-fullscreen { overflow: hidden; }
.game-over { z-index: 4; }
.fullscreen-touch-controls { display: none; }
.controls p { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #d4bfe7; }
kbd { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid #78509b; border-bottom-width: 3px; border-radius: 5px; font: bold 14px Arial, sans-serif; color: white; }
.separator { margin: 0 8px; color: #536468; }
button { font: inherit; cursor: pointer; border: 1px solid #78509b; border-radius: 6px; color: #f6e9ff; background: #311c49; padding: 11px 16px; }
button:hover { background: #4b2863; }
button:focus-visible { outline: 2px solid #ff5acb; outline-offset: 4px; }
#resetButton { font-size: 12px; }
.hint { font-size: 12px; color: #b7a2cd; margin-top: 0; }
.touch-controls { display: none; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
#boostButton { flex-basis: 100%; color: #ff5acb; }
.touch-controls button { flex: 1; min-width: 0; padding: 11px 8px; font-size: 12px; min-height: 56px; touch-action: none; user-select: none; -webkit-user-select: none; }
.touch-controls button:active { color: #140c2c; background: #ff5acb; }
@media (pointer: coarse), (max-width: 700px) { .touch-controls { display: flex; } }
@media (max-width: 600px) {
    body { padding: 24px 12px; }
    .track-label { display: none; }
    .game-header { margin-bottom: 20px; }
    .controls p { flex-wrap: wrap; gap: 6px; font-size: 11px; }
    .separator { margin: 0 2px; }
    kbd { width: 26px; height: 28px; }
    #resetButton { padding: 10px; }
    .game-hud { right: 8px; top: 8px; width: 270px; gap: 10px; padding: 8px; }
    .boost-meter { padding-left: 10px; }
    .health-hud { left: 8px; top: 96px; width: 175px; padding: 6px 8px; }
    .health-hud .boost-label { margin-top: 0; }
    .health-hud { top: 8px; width: 80px; }
    .health-hud .boost-label { flex-wrap: wrap; font-size: 8px; gap: 3px; }
    .game-hud { width: 180px; }
    .game-hud .speedometer { flex-direction: column; gap: 0; }
    .boost-meter small { font-size: 7px; }
    .inventory { bottom: 8px; padding: 6px; }
    .inventory-slots span { top: 2px; left: 3px; font-size: 8px; }
    .fullscreen-button { width: 36px; height: 36px; padding: 0; right: 8px; bottom: 8px; font-size: 0; }
    .fullscreen-button::before { content: '⛶'; font-size: 23px; }
}
@media (pointer: coarse) {
    .track:is(:fullscreen, :-webkit-full-screen, .fullscreen-fallback) .fullscreen-touch-controls { position: absolute; left: 12px; bottom: 110px; z-index: 3; display: grid; grid-template-columns: repeat(4, 42px); gap: 6px; }
    .fullscreen-touch-controls button { padding: 10px 0; min-height: 42px; touch-action: none; user-select: none; background: #210e46dd; }
    #fullscreen-boostButton { grid-column: 1 / -1; color: #ff5acb; }
}

.room-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 16px; color: #8fffd3; font-size: 12px; }
.room-controls input { width: 145px; border: 1px solid #6b52ad; background: #181234; color: #fff; border-radius: 6px; padding: 9px; font: inherit; }
.room-controls button { border: 1px solid #8fffd3; background: #211540; color: #8fffd3; border-radius: 6px; padding: 9px 14px; cursor: pointer; }
.room-controls small { flex-basis: 100%; text-align: center; color: #afa5d7; }
#networkStatus { font-size: 11px; text-align: right; }
