:root {
  --bg: #0e1a22;
  --panel: rgba(16, 26, 34, 0.86);
  --edge: #3d5566;
  --text: #f1ede2;
  --dim: #9fb0b9;
  --accent: #f0b429;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: Silkscreen, ui-monospace, monospace; -webkit-font-smoothing: none; }
canvas#map { position: fixed; inset: 0; display: block; cursor: grab; touch-action: none; image-rendering: pixelated; }
canvas#map.dragging { cursor: grabbing; }

.title { position: fixed; left: 20px; top: 16px; pointer-events: none; text-shadow: 2px 2px 0 #0e1a22, -1px -1px 0 #0e1a22; }
.title h1 { margin: 0; font-size: 40px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.title p { margin: 6px 0 0; font-size: 12px; color: var(--accent); }

.panel { background: var(--panel); border: 2px solid var(--edge); box-shadow: 4px 4px 0 rgba(0,0,0,0.35); }
.controls { position: fixed; left: 16px; bottom: 16px; padding: 10px 12px; width: 230px; }
.clock { font-size: 22px; display: flex; align-items: baseline; gap: 6px; }
.clock .tz { font-size: 11px; color: var(--dim); }
#clock-icon { color: var(--accent); }
#clock-slider { width: 100%; margin: 8px 0; accent-color: var(--accent); }
.btns { display: flex; gap: 6px; }
button { font: inherit; font-size: 12px; color: var(--text); background: #22343f; border: 2px solid var(--edge); padding: 4px 8px; cursor: pointer; flex: 1; }
button:hover { background: #2c4352; }
button.on { background: var(--accent); color: #1a1a1a; border-color: #ffd36b; }
.opts { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--dim); }
.opts label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

.info { position: fixed; padding: 8px 10px; min-width: 180px; max-width: 240px; pointer-events: none; }
.info-name { font-size: 13px; color: var(--accent); margin-bottom: 4px; word-break: break-word; }
.info-row { font-size: 11px; }
.dim { color: var(--dim); }

.attrib { position: fixed; right: 8px; bottom: 6px; font-family: system-ui, sans-serif; font-size: 11px; color: var(--dim);
  background: rgba(14,26,34,0.7); padding: 2px 6px; }
.attrib a { color: #cfe3ef; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); transition: opacity .6s; z-index: 10; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .box { text-align: center; font-size: 13px; color: var(--dim); }
.spin { width: 24px; height: 24px; margin: 0 auto 12px; background: var(--accent); animation: spin 1s steps(4) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .title h1 { font-size: 28px; }
  .controls { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .attrib { bottom: auto; top: 6px; }
}
.thai { font-family: 'Noto Sans Thai', system-ui, sans-serif; font-weight: 600; }

.btns.view { margin-top: 8px; align-items: stretch; gap: 4px; }
.btns.view button { padding: 4px 2px; min-width: 0; }
#btn-rot-l, #btn-rot-r { font-family: system-ui, sans-serif; font-size: 15px; line-height: 1; }
#btn-me.busy { animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.compass-wrap { width: 24px; flex: none; display: grid; place-items: center; position: relative; color: var(--dim); }
.compass-wrap b { position: absolute; font-size: 8px; font-weight: 400; color: var(--text); pointer-events: none; }
#compass { display: block; font-family: system-ui, sans-serif; font-size: 18px; color: #ff4081; transition: transform .3s; }
#loading.soft { background: rgba(14, 26, 34, 0.55); transition: none; }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); padding: 8px 12px; font-size: 12px; z-index: 5; }
