/* Latin letters and digits only; everything else falls back to the system font (tools/font builds it) */
@font-face { font-family: "Pixel Island"; src: url("../../../assets/fonts/pixel.woff2") format("woff2"); font-display: block; }
:root {
  --navy: #142050; --navy-2: #233a85; --ink: var(--navy);
  --blue: #3a7cf0; --blue-hi: #6aa8ff; --blue-lo: #1f4fb8;
  --sky-top: #2f6fe4; --sky-bottom: #bfe6ff;
  --yellow: #ffd23a; --yellow-hi: #fff3a0; --yellow-lo: #e2950f;
  --red: #ff4d4d; --green: #49c95b;
  --cream: #ffffff; --cream-2: #e9f2ff; --well: #d6e6ff;
  --text: #ffffff; --text-soft: #dbe8ff; --card-text: #142050; --card-soft: #4c5f95;
  /* outlines drawn with eight text shadows, so every font gets them */
  --ol: 2px 0 var(--navy), -2px 0 var(--navy), 0 2px var(--navy), 0 -2px var(--navy), 2px 2px var(--navy), -2px 2px var(--navy), 2px -2px var(--navy), -2px -2px var(--navy);
  --ol3: 3px 0 var(--navy), -3px 0 var(--navy), 0 3px var(--navy), 0 -3px var(--navy), 2px 2px var(--navy), -2px 2px var(--navy), 2px -2px var(--navy), -2px -2px var(--navy), 3px 1px var(--navy), -3px 1px var(--navy), 1px 3px var(--navy), -1px 3px var(--navy);
  --pixel: "Pixel Island", system-ui, sans-serif;
  --bounce: cubic-bezier(.34, 1.7, .5, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; height: 100dvh; margin: 0; background: #0c1638; color: var(--text); overflow: hidden; overscroll-behavior: none; }
body {
  font: 700 14px/1.45 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei", "Noto Sans KR", "Noto Sans SC", sans-serif;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.switching #hud, .switching #side, .switching #skill { visibility: hidden; }
.switching #screen { pointer-events: none; }
#stage { position: fixed; inset: 0; overflow: hidden; }
canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.ico { display: inline-grid; flex: none; }
.ico svg { display: block; width: 18px; height: 18px; }

/* Sizes are whole multiples of the font's 9-pixel em, so every font pixel covers whole screen pixels. */
.logo { --px: 4px; margin: 0; font: 36px/1 var(--pixel); text-align: center; color: transparent;
  background-image: linear-gradient(#fff6c8 0 34%, #ffd84a 34% 62%, #ff9d3a 62%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(var(--px) 0 0 var(--ink)) drop-shadow(calc(-1 * var(--px)) 0 0 var(--ink)) drop-shadow(0 var(--px) 0 var(--ink)) drop-shadow(0 calc(-1 * var(--px)) 0 var(--ink)) drop-shadow(0 var(--px) 0 var(--ink)) drop-shadow(0 6px 0 rgba(12, 22, 56, .45)); }
@media (min-width: 440px) { .logo { --px: 5px; font-size: 45px; } }
@media (min-width: 720px) { .panel.title .logo { --px: 6px; font-size: 54px; } }
@media (prefers-reduced-motion: no-preference) { .panel.title .logo, #boot .logo { animation: float 2.4s ease-in-out infinite; } }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- buttons: chunky glossy pills that press down ---------- */
button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 10px 22px 12px; font: inherit; font-weight: 900; font-size: 16px; line-height: 1.2; color: var(--navy);
  background: linear-gradient(#ffffff 0 45%, var(--cream-2) 55%, #cfe0fb); border: 3px solid var(--navy); border-radius: 999px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .9), inset 0 -4px 0 rgba(20, 32, 80, .14), 0 5px 0 var(--navy); cursor: pointer; touch-action: manipulation; transition: transform .08s; }
button:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .9), inset 0 -2px 0 rgba(20, 32, 80, .14), 0 1px 0 var(--navy); }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, .credit:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
button.primary { background: linear-gradient(var(--yellow-hi) 0 40%, var(--yellow) 55%, #ffbf1f); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .7), inset 0 -4px 0 var(--yellow-lo), 0 5px 0 var(--navy); }
button.primary:active { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 var(--yellow-lo), 0 1px 0 var(--navy); }
button.quiet { color: #fff; background: rgba(20, 32, 80, .35); border-color: rgba(255, 255, 255, .75); box-shadow: 0 4px 0 rgba(12, 22, 56, .45); text-shadow: 0 2px 0 var(--navy); }
.icon-btn { width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0 0 2px; border-radius: 50%; }
.icon-btn .ico svg { width: 20px; height: 20px; }
/* menus move a bouncing pointer to the chosen button and give it a little wobble */
:is(.menu, .panel.pause, .panel.lang, .panel.over, .panel.report) button:is(:hover, :focus-visible, :not(:hover) > :focus)::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 22px; margin-top: -11px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 11' shape-rendering='crispEdges'%3E%3Cpath fill='%23142050' d='M0 0h3v1h2v1h2v1h2v5h-2v1h-2v1h-2v1h-3z'/%3E%3Cpath fill='%23ff5252' d='M1 1h2v1h2v1h2v1h1v3h-1v1h-2v1h-2v1h-2z'/%3E%3Cpath fill='%23ffb0a8' d='M1 1h2v1h-2z'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (prefers-reduced-motion: no-preference) {
  :is(.menu, .panel.pause, .panel.lang, .panel.over, .panel.report) button:is(:hover, :focus-visible, :not(:hover) > :focus)::before { animation: point .5s ease-in-out infinite alternate; }
  :is(.menu, .panel.pause, .panel.lang, .panel.over, .panel.report) button:is(:hover, :focus-visible, :not(:hover) > :focus) { animation: wobble .4s var(--bounce); }
}
@keyframes point { to { translate: 5px 0; } }
@keyframes wobble { 0% { scale: 1; } 35% { scale: 1.06 .94; } 65% { scale: .98 1.03; } 100% { scale: 1; } }
.buttons { display: grid; gap: 12px; }
.buttons.pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 360px) { .buttons.pair { grid-template-columns: 1fr; } }
