:root { color-scheme: light; font-family: Inter, "Segoe UI", sans-serif; background: #d9e6e9; }
* { box-sizing: border-box; }
html, body, main { margin: 0; width: 100%; height: 100%; overflow: hidden; }
main { position: fixed; inset: 0; }
#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#map:active { cursor: grabbing; }
#map:focus-visible { outline: 2px solid #2167a0; outline-offset: -2px; }
.modes { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left));
  display: inline-flex; padding: 3px; gap: 2px; background: #f9fbfa; border: 1px solid #a6b4b5;
  border-radius: 10px; box-shadow: 0 2px 8px #152d381f; }
button { font: inherit; cursor: pointer; }
.modes button { min-width: 45px; min-height: 36px; padding: 0 10px; background: transparent;
  color: #304c56; border: 0; border-radius: 7px; font-size: 14px; font-weight: 600; }
.modes button[aria-pressed=true] { background: #244954; color: white; }
button:focus-visible { outline: 2px solid #2065a0; outline-offset: 1px; }
#problem:not([hidden]) { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 10px 14px; color: #fff; background: #282d30; border-radius: 7px; max-width: min(90vw, 600px); }
#retry { margin-inline-start: 8px; }
@media (pointer: coarse) { .modes button { min-height: 44px; min-width: 48px; } }

#theme { border-inline-start: 1px solid #c6cfcf; border-radius: 0 7px 7px 0; }
#detail-note {
  position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); margin: 0; padding: 5px 10px; border-radius: 6px;
  max-width: calc(100% - 24px); color: #354449; background: #f6f8f3ed;
  font-size: 12px; text-align: center; pointer-events: none;
}
:root[data-theme="night"] { color-scheme: dark; background: #07131d; }
:root[data-theme="night"] .modes { background: #14252c; border-color: #43565a; box-shadow: none; }
:root[data-theme="night"] .modes button { color: #acc0c0; }
:root[data-theme="night"] .modes button[aria-pressed="true"] { color: #e3ece9; background: #36575d; }
:root[data-theme="night"] #theme { border-color: #43565a; }
:root[data-theme="night"] #detail-note { color: #afbfbe; background: #14252cee; }
