/* Forecast Channel (web) — black page, letterboxed canvas, channel-styled first-run setup. */
:root {
  --bg: #000;
  --sky-top: #33aaee;
  --sky-mid: #0a52c7;
  --sky-bottom: #01208a;
  --text: #fff;
  --text-dim: rgba(255, 255, 255, 0.78);
  --panel: rgba(255, 255, 255, 0.12);
  --panel-line: rgba(255, 255, 255, 0.35);
  --button: linear-gradient(#ffffff, #dcdcdc);
  --button-text: #1b1b1b;
  --error: #ffd2d2;
  --round: "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Varela Round", "Nunito", system-ui, sans-serif;
}

html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* The canvas is positioned/sized by main.js to the letterbox rect (608:1322 mobile, 16:9 desktop). */
#screen {
  position: fixed; left: 0; top: 0; display: block; background: #000;
  touch-action: none; image-rendering: auto;
}

/* First-run setup */
#setup {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-bottom) 100%);
  font-family: var(--round); overflow: auto;
}
#setup[hidden] { display: none; }
#setup .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
#setup h1 { margin: 0 0 4px; font-size: 30px; font-weight: 700; letter-spacing: 0.01em; text-shadow: 0 2px 6px rgba(0, 20, 80, 0.45); }
#setup .lead { margin: 0 0 6px; color: var(--text-dim); line-height: 1.45; font-size: 15px; }
#setup .file {
  display: grid; grid-template-columns: 1fr; gap: 2px; padding: 14px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--panel-line); cursor: pointer; position: relative;
}
#setup .file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#setup .label { font-size: 17px; font-weight: 700; }
#setup .hint { font-size: 13px; color: var(--text-dim); }
#setup .chosen { font-size: 13px; margin-top: 6px; word-break: break-all; }
#setup .error { min-height: 1.2em; margin: 0; color: var(--error); font-size: 14px; }
#setup button, #replace-files {
  font: inherit; font-family: var(--round); font-size: 18px; font-weight: 700; color: var(--button-text);
  background: var(--button); border: 1px solid #b9b9b9; border-radius: 999px; padding: 12px 18px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
#setup button:disabled { opacity: 0.5; cursor: default; }
#setup button:focus-visible, #setup .file:focus-within { outline: 3px solid #fff; outline-offset: 2px; }

#replace-files {
  position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 12px; padding: 6px 12px; opacity: 0.55; z-index: 5;
}
#replace-files[hidden] { display: none; }

/* Development/error overlay */
#overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, 0.82); z-index: 10;
}
#overlay[hidden] { display: none; }
#overlay pre {
  max-width: 720px; white-space: pre-wrap; color: #fff; font: 13px/1.5 ui-monospace, Menlo, monospace;
  background: #1b2433; border: 1px solid #3a4a66; border-radius: 10px; padding: 16px;
}

