/* Layout: full-screen 3D canvas, floating HUD chips top-left, review list docked right. */
:root {
  --sky: #e9eef2;          /* page ground behind the canvas */
  --ink: #1f1f22;
  --sub: #6b6b72;
  --line: #e3e0da;
  --paper: #fbfaf7;
  --paper-glass: rgba(251, 250, 247, .92);
  --field: #ffffff;
  --hover: #f1eee8;
  --gold: #b48a2c;
  --muted-score: #b9b5ad;
  --on-ink: #ffffff;
  --veil: rgba(233, 238, 242, .55);
  --shadow: 0 10px 40px rgba(0, 0, 0, .12);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #0f1318; --ink: #ecebe7; --sub: #a3a29c; --line: #34363b; --paper: #1b1d21;
    --paper-glass: rgba(27, 29, 33, .9); --field: #24272c; --hover: #2a2d33; --gold: #d8b25a;
    --muted-score: #6f7077; --on-ink: #16171a; --veil: rgba(10, 12, 16, .55); --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #0f1318; --ink: #ecebe7; --sub: #a3a29c; --line: #34363b; --paper: #1b1d21;
  --paper-glass: rgba(27, 29, 33, .9); --field: #24272c; --hover: #2a2d33; --gold: #d8b25a;
  --muted-score: #6f7077; --on-ink: #16171a; --veil: rgba(10, 12, 16, .55); --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--ink); font-family: var(--font); }
canvas { display: block; }
.hud { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px));
  display: flex; gap: 8px; align-items: center; z-index: 5; flex-wrap: wrap; max-width: calc(100vw - 32px); }
.chip { background: var(--paper-glass); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px;
  backdrop-filter: blur(6px); font-variant-numeric: tabular-nums; }
.chip b { font-weight: 700; }
button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; }
button:hover { border-color: var(--sub); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
button:disabled { opacity: .55; cursor: default; }
input[type=text], textarea { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  background: var(--field); color: var(--ink); }
#crosshair { position: fixed; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 4; pointer-events: none; display: none; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, .6); }
#crosshair::before { left: 6px; top: 0; width: 2px; height: 14px; }
#crosshair::after { top: 6px; left: 0; height: 2px; width: 14px; }
#tip { position: fixed; left: 50%; top: calc(50% + 22px); transform: translateX(-50%); z-index: 4; pointer-events: none;
  background: rgba(31, 31, 34, .85); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; display: none; white-space: nowrap; }
#start { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; background: var(--veil); backdrop-filter: blur(3px);
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
#start .panel { width: min(540px, 100%); padding: 28px; }
#start h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; text-wrap: balance; }
#start p { margin: 0 0 18px; color: var(--sub); line-height: 1.55; font-size: 14px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0 0 20px; }
.keys kbd { font: 12px ui-monospace, monospace; background: var(--field); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#side { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(380px, calc(100vw - 32px)); z-index: 6; display: none;
  flex-direction: column; overflow: hidden; }
#side header { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
#side h2 { margin: 0; font-size: 18px; }
#side .muted { color: var(--sub); font-size: 12px; margin-top: 4px; }
#list { overflow-y: auto; flex: 1; padding: 6px 10px; }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.item > div { min-width: 0; }
.item:hover, .item.sel { background: var(--hover); }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 12px; display: grid;
  place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.item .nm { font-size: 14px; font-weight: 600; line-height: 1.3; }
.item .cd { font-size: 12px; color: var(--sub); }
.score { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.score.none { color: var(--muted-score); font-weight: 500; }
#comment { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
#comment textarea { width: 100%; height: 72px; resize: vertical; }
#comment .lbl { font-size: 13px; font-weight: 600; }
#exportBox { width: 100%; height: 90px; font: 12px ui-monospace, monospace; display: none; }
#exportMsg { font-size: 12px; color: var(--sub); min-height: 1em; }
@media (max-width: 720px) { #side { top: auto; height: 55vh; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
