:root, .dark { --background: #111a24; --foreground: #f4f8ff; --primary: #cee89c; --primary-foreground: #152622; --card: #202c37; --card-foreground: #f4f8ff; --border: #3b4958; --ring: #cee89c; --radius: 1rem; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--foreground); background: var(--background); }
button { font: inherit; border: none; outline: none; }
.desktop { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; background: radial-gradient(ellipse at 50% 38%, #293b4c 0, #182430 42%, #101720 100%); }
.phone { width: min(408px, calc((100dvh - 100px) / 2)); aspect-ratio: 1 / 2; padding: 8px; border-radius: 43px; background: #0b1119; box-shadow: 0 0 0 1px #4a5663, 0 0 0 4px #202c38, 0 30px 75px #0008; }
.screen { width: 100%; height: 100%; position: relative; overflow: hidden; border-radius: 35px; background: #6c83e7; isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none; }
.landscape { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.game-header { position: absolute; top: 5%; left: 7%; right: 7%; display: flex; align-items: center; justify-content: space-between; color: #fff; text-shadow: 0 1px 8px #384da94d; gap: 12px; }
.title { display: flex; align-items: center; gap: 9px; }
h1 { font-size: 18px; font-weight: 700; letter-spacing: -.7px; margin: 0; }
.title-dot { width: 8px; height: 8px; background: #d6eeab; box-shadow: 0 0 0 3px #ffffff25; border-radius: 2px; }
.world-label { font-size: 12px; letter-spacing: 1.7px; font-weight: 700; opacity: .8; }
/* --- Stage Bar --- */
.stage-bar { position: absolute; top: 11%; left: 7%; right: 7%; height: 30px; z-index: 2; }
.stage-track { position: absolute; top: 50%; left: 0; right: 0; height: 3px; background: #ffffff20; border-radius: 2px; transform: translateY(-50%); }
.stage-fill { height: 100%; background: linear-gradient(90deg, #cee89c, #a8d86a); border-radius: 2px; }
.stage-walker { position: absolute; left: 0; top: -3px; height: 9px; width: 9px; border-radius: 50%; background: #f5ffd9; box-shadow: 0 0 10px #cee89ccc, 0 0 4px #fff; transform: translateX(-50%); z-index: 3; }
.stage-node { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.stage-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; transition: all 0.3s ease; }
.stage-node.locked .stage-icon { background: #2a3a4a; border: 2px solid #4a5a6a; box-shadow: 0 1px 4px #0004; }
.stage-node.unlocked .stage-icon { background: #cee89c; border: 2px solid #a8d86a; box-shadow: 0 0 8px #cee89c66; }
.stage-node.active .stage-icon { background: #f5ffd9; border-color: #e8ffb0; box-shadow: 0 0 12px #cee89caa, 0 0 20px #cee89c44; animation: stagePulse 1.5s ease-in-out infinite; }
.stage-icon svg { width: 12px; height: 12px; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.stage-node.locked .stage-icon svg { stroke: #8899aa; }
.stage-node.unlocked .stage-icon svg { stroke: #1a2e22; }
.stage-node.active .stage-icon svg { stroke: #1a2e22; }
.stage-label { position: absolute; top: 100%; margin-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: #fff8; line-height: 1; }
.stage-node.active .stage-label { color: #f5ffd9; }
.stage-node.unlocked .stage-label { color: #cee89c; }
@keyframes stagePulse { 0%, 100% { box-shadow: 0 0 8px #cee89c66; } 50% { box-shadow: 0 0 16px #cee89ccc, 0 0 28px #cee89c44; } }
.controls { position: absolute; bottom: 6%; left: 8%; right: 8%; }
.controls p { margin: 0 0 17px; color: #fff5d9; font-size: 14px; letter-spacing: .5px; text-align: center; text-shadow: 0 1px 4px #291600; }
.direction-buttons { display: flex; gap: 18px; justify-content: space-between; }
.direction-buttons button { display: grid; place-items: center; width: 100px; height: 76px; max-width: 36%; border: 1px solid #eaf8ff5c; border-bottom: 5px solid #122333; border-radius: 20px; color: #eef9ff; background: #223446e8; box-shadow: 0 6px 14px #291c2760, inset 0 1px 0 #ffffff15; touch-action: none; -webkit-touch-callout: none; cursor: pointer; transition: background 100ms, transform 100ms; }
.direction-buttons button[aria-pressed='true'] { background: #cde49b; color: #203729; transform: translateY(3px); border-bottom-width: 2px; border-color: #aec77a; }
.direction-buttons button:focus-visible { outline: 3px solid white; outline-offset: 4px; }
.direction-buttons button:disabled { opacity: .4; }
.direction-buttons svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.watermark { position: absolute; bottom: 4%; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: 0.5px; color: #ffffff; opacity: 0.25; z-index: 10; pointer-events: none; }
.home-indicator { position: absolute; bottom: 1.8%; left: 37%; width: 26%; height: 4px; border-radius: 3px; background: #fff9; }
.desktop-hint { font-size: 14px; color: #c2ceda; margin: 0; }
.desktop-hint span { color: #7f91a2; margin-left: 15px; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; padding: 32px; text-align: center; background: #6c83e7; font-size: 16px; }
@media (max-height: 550px) {
  .desktop { gap: 10px; }
  .phone { width: calc((100dvh - 50px) / 2); padding: 4px; border-radius: 24px; }
  .screen { border-radius: 20px; }
  .world-label, .title-dot, .controls p { display: none; }
  .stage-bar { top: 11%; height: 24px; }
  .stage-icon { width: 18px; height: 18px; }
  .stage-label { font-size: 7px; }
  h1 { font-size: 14px; }
  .direction-buttons button { height: 48px; border-radius: 12px; }
  .desktop-hint { font-size: 12px; }
}
@media (max-width: 600px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
  .desktop { width: 100%; height: 100dvh; min-height: 0; gap: 0; background: #6c83e7; }
  .phone { width: 100%; height: 100%; aspect-ratio: auto; flex: 1; padding: 0; border-radius: 0; box-shadow: none; }
  .screen { border-radius: 0; }
  .game-header { top: max(5%, calc(env(safe-area-inset-top) + 16px)); }
  .stage-bar { top: max(11%, calc(env(safe-area-inset-top) + 54px)); }
  .controls { bottom: max(6%, calc(env(safe-area-inset-bottom) + 20px)); }
  .desktop-hint, .home-indicator { display: none; }
}
