/* LEARN — mavi/beyaz. Beyaz zemin, lacivert yazı, canlı mavi vurgu; karanlık temada lacivert zemin. */
:root {
  --bg: #ffffff; --panel: #f2f6fc; --line: #d6e0f0; --fg: #0d2247; --muted: #5b6b8a;
  --blue: #1e5eff; --blue-fg: #ffffff; --ink: #1e5eff; --warn: #e5513d;
  --display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b1a3a; --panel: #12264f; --line: #27417a; --fg: #eef3ff; --muted: #9fb0d6;
  --blue: #5c8cff; --blue-fg: #061233; --ink: #8db0ff; --warn: #ff7b68; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0b1a3a; --panel: #12264f; --line: #27417a; --fg: #eef3ff; --muted: #9fb0d6;
  --blue: #5c8cff; --blue-fg: #061233; --ink: #8db0ff; --warn: #ff7b68; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding-block: 20px 40px; min-height: 100%; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: 0.18em; text-decoration: none; color: var(--fg); }
.logo span { color: var(--blue); }
.tag { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
h1 { font-family: var(--display); font-size: clamp(26px, 5vw, 38px); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; max-width: 60ch; }
.muted { color: var(--muted); }
button { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 10px 16px; border-radius: 8px; cursor: pointer; }
button:hover { border-color: var(--blue); }
button:focus-visible, input:focus-visible, .drop:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button.primary { background: var(--blue); color: var(--blue-fg); border-color: var(--blue); }
button[disabled] { opacity: 0.5; cursor: default; }
button.small { padding: 6px 10px; font-size: 13px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; background: var(--panel); transition: border-color .15s; }
.drop.over { border-color: var(--blue); }
.drop strong { font-family: var(--display); font-size: 18px; }
.preview { max-width: 100%; max-height: 320px; border-radius: 8px; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rule { border-top: 2px solid var(--blue); padding-top: 10px; font-size: 14px; }
.rule b { display: block; font-family: var(--mono); font-size: 12px; color: var(--blue); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.timer { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 16px; color: var(--blue); }
.timer.low { color: var(--warn); }
.pill { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--blue); border-color: var(--blue); }
.board { position: relative; width: 100%; background: var(--panel); border-radius: 10px; overflow: hidden; touch-action: none; }
.board img { display: block; width: 100%; max-height: 70vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.board canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); padding: 0; cursor: pointer; }
.swatch.on { border-color: var(--fg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 100px; max-height: 40vh; overflow-y: auto; }
.msg { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.msg .who { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg.me .who { color: var(--blue); }
.msg .text { min-width: 0; overflow-wrap: anywhere; }
.msg .at { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 8px; }
form.compose { display: flex; gap: 8px; }
form.compose input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.note { font-size: 13px; color: var(--muted); }
.toast { font-family: var(--mono); font-size: 13px; color: var(--blue); }
.empty { border: 1px solid var(--line); border-radius: 10px; padding: 32px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.linkbox { font: 12px var(--mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); width: 100%; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
