/* MyScape / 5-Strata — shared ocean instrument theme.
   Loaded after feature styles. Keep spatial canvases and interaction layouts intact. */
@font-face {
  font-family: "Ocean Display";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2");
  font-style: normal; font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Ocean Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-style: normal; font-weight: 400 700; font-display: swap;
}
:root, body.landing {
  color-scheme: dark;
  --ocean: #12a5d4; --foam: #5fd3f0; --abyss: #04080d;
  --trench: #0a1826; --shelf: #0a3d52; --mist: #a8e8f8; --pale: #cbf0fb;
  --bg: #04080d; --bg-deep: #07131d; --darkest: #02070b;
  --card: #0a1826; --card-2: #0d2230; --card-3: #123044;
  --accent: #5fd3f0; --accent-deep: #12a5d4; --cta-text: #041018;
  --text: #e3f8fe; --text-2: #a8cbd8; --text-3: #86adbd;
  --border: rgba(18,165,212,.30); --line: rgba(18,165,212,.25);
  --bar: #102c3b; --rank: #0a3d52; --search: #061019;
  --placeholder: #86adbd; --strike: #86adbd;
  --gold: #a8e8f8; --gold-2: #5fd3f0; --gold-deep: #0a3d52;
  --btn2-a: #102c3b; --btn2-b: #102c3b; --btn2-text: #e3f8fe;
  --positive: #73dfb4; --mixed: #f4c878; --negative: #ff8f8f;
  --glow: rgba(18,165,212,.18); --mono: "Ocean Mono", ui-monospace, monospace;
  /* Legacy landing tokens: content remains legible without changing its markup. */
  --paper: #07131d; --paper-2: #0a1826; --paper-3: #102c3b;
  --ink: #e3f8fe; --ink-2: #a8cbd8; --ink-3: #86adbd;
  --night: #04080d; --night-2: #0a1826; --night-3: #102c3b;
  --bone: #e3f8fe; --lime: #5fd3f0; --mark: #5fd3f0;
  --cobalt: #12a5d4; --coral: #0a3d52;
  --rule: rgba(18,165,212,.30); --rule-soft: rgba(18,165,212,.25); --rule-dark: rgba(18,165,212,.25);
  --shadow: 0 24px 70px rgba(0,0,0,.38), inset 0 0 40px rgba(18,165,212,.035);
  --shadow-sm: 0 10px 30px rgba(0,0,0,.24); --shadow-xs: 0 4px 16px rgba(0,0,0,.20);
  --pl-bg: #04080d; --pl-panel: #0a1826; --pl-panel-2: #0d2230;
  --pl-line: rgba(18,165,212,.25); --pl-line-strong: rgba(18,165,212,.40);
  --pl-text: #e3f8fe; --pl-title: #e3f8fe; --pl-muted: #a8cbd8;
  --pl-dim: #86adbd; --pl-accent: #5fd3f0; --pl-mono: var(--mono);
}
html { background: var(--abyss); color-scheme: dark; }
body:not(.map-body), body.landing, .places-body {
  background: radial-gradient(1100px 720px at 50% -12%, rgba(18,165,212,.20), transparent 68%),
              radial-gradient(760px 520px at 88% 108%, rgba(95,211,240,.07), transparent 70%), var(--abyss);
  color: var(--text);
  font-family: "Ocean Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
::selection { background: var(--foam); color: #041018; }
:where(a, button, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--foam); outline-offset: 3px;
}
::-webkit-scrollbar-thumb { background: #245269; border-radius: 4px; }
::-webkit-scrollbar-track { background: var(--abyss); }

/* Controls: crisp, luminous, and legible at rest as well as on hover. */
.btn-green, .btn-blue, .btn-dark, .oauth-btn, .pl-btn, .mini-btn {
  border: 1px solid var(--border); border-radius: 2px; box-shadow: none;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-green, .pl-btn.primary { background: var(--ocean); border-color: var(--ocean); color: #041018; }
.btn-green:hover, .pl-btn.primary:hover { background: var(--foam); border-color: var(--foam); color: #041018; box-shadow: none; }
.btn-blue, .btn-dark, .oauth-btn, .mini-btn, .pl-btn.ghost { background: rgba(18,165,212,.07); color: var(--pale); }
.btn-blue:hover, .btn-dark:hover, .oauth-btn:hover, .mini-btn:hover, .pl-btn.ghost:hover {
  background: rgba(18,165,212,.17); color: #fff; border-color: var(--foam);
}
:is(.form-input, .lib-search, .lib-sort, .comm-search, .task-add input, .task-assign,
 .pchat-input input, .chat-input-row input, .lobby-panel input, .dump-modal input, .dump-modal textarea) {
  background: #061019; color: var(--text); border: 1px solid var(--border); border-radius: 2px;
}
:is(.form-input, .lib-search, .lib-sort, .comm-search, .task-add input, .task-assign,
 .pchat-input input, .chat-input-row input, .lobby-panel input, .dump-modal input, .dump-modal textarea):focus {
  border-color: var(--ocean); box-shadow: 0 0 0 3px var(--glow);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
select option { background: var(--trench); color: var(--text); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--ocean); }

/* Layered surfaces rather than the old paper and hard-offset shadows. */
.game-card, .top-row, .block:not(.btn-green):not(.btn-blue):not(.btn-dark), .buy-box,
.lib-card, .cart-item, .cart-summary, .empty-state, .thread, .stat, .auth-panel,
.profile-card, .stat-tile, .section-block, .fr-row, .proj-card, .proj-head,
.kanban-col, .task-card, .pchat, .chat-layout, .lobby-panel, .mythos-rail,
.mythos-reader, .call-card, .call-window, .hover-panel, .price-block {
  background: linear-gradient(180deg, rgba(10,24,38,.96), rgba(5,13,21,.98));
  border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm);
  color: var(--text);
}
.game-card:hover, .lib-card:hover, .proj-card:hover, .top-row:hover {
  background: #0d2230; border-color: rgba(95,211,240,.5);
  box-shadow: 0 20px 50px rgba(0,0,0,.38); 
}
.kanban-col { background: rgba(6,16,25,.75); }
.task-card { background: #0d2230; box-shadow: none; }
.section-head, .pchat-head, .pchat-input, .chat-pane-head, .chat-input-row,
.auth-tabs, .comm-tabs, .sum-total, .buy-meta, .side-sep, .dd-head { border-color: var(--line); }
.proj-desc, .proj-desc-full, .profile-bio, .about-text p, .about-copy p { color: var(--text-2); }
.proj-tag, .atlas-chip, .level-badge, .card-disc, .rank {
  background: rgba(18,165,212,.14); color: var(--mist); border: 1px solid var(--border); border-radius: 2px;
}
.proj-fill, .exp-fill { background: linear-gradient(90deg, var(--ocean), var(--foam)); }
.ghost-banner { background: rgba(18,165,212,.08); border: 1px solid var(--border); border-radius: 3px; color: var(--mist); }
.kit-card { border-radius: 3px; }
.kit-card.sel { background: rgba(18,165,212,.16); border-color: var(--foam); }
.chat-item.active { background: rgba(18,165,212,.14); box-shadow: inset 3px 0 var(--ocean); }
.pchat-msg .bubble, .chat-msg .bubble { background: #123044; color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.pchat-msg.me .bubble, .chat-msg.me .bubble { background: #0a3d52; color: #e3f8fe; border-color: rgba(95,211,240,.35); }
.modal-bg, .dump-modal-bg, .pl-sheet-bg, .pl-modal-bg { background: rgba(2,7,11,.8); }
.modal, .dump-modal, .pl-sheet-panel, .pl-modal, .dropdown, .search-dd {
  background: #0a1826; color: var(--text); border: 1px solid var(--border);
  border-radius: 3px; box-shadow: var(--shadow);
}
.modal-check { background: var(--ocean); color: #041018; }
.toast { background: #0a1826; color: var(--pale); border: 1px solid var(--border); }

/* Hero, editorial headings and footer follow the landing's luminous axis. */
.hero-band, .about-hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(18,165,212,.14), transparent 68%);
  border-bottom: 1px solid var(--line);
}
.hb-eyebrow, .pl-eyebrow, .about-tag { color: var(--foam); font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.hb-title, .about-h1 { color: var(--text); font-family: "Ocean Display", sans-serif; letter-spacing: -.04em; }
.hb-title .accent, .pl-hero h1 .acc { color: var(--foam); }
.hb-sub, .hb-label, .about-copy { color: var(--text-2); }
.hb-num, .stat-num { color: var(--foam); }
.site-footer { background: #030b11; border-top: 1px solid var(--line); }
.footer-col h4, .footer-brand a { color: var(--foam); }
.footer-col a, .footer-brand p, .footer-bottom { color: var(--text-2); }
.footer-bottom { background: #02070b; border-color: var(--line); }

/* Mythos: dark reading surfaces, including generated Markdown. */
.mythos-body .reader-head { background: #0d2230; border-color: var(--line); }
.mythos-body .doc-item.active { background: rgba(18,165,212,.16); border-color: var(--border); }
.mythos-body .doc-item.active .dt { color: var(--pale); }
.mythos-body .markdown { color: var(--text-2); overflow-wrap: anywhere; }
.mythos-body .markdown em { color: var(--mist); }
.mythos-body .markdown pre, .mythos-body .markdown code { background: #061019; color: var(--pale); border-color: var(--line); }
.mythos-body .markdown pre code { background: transparent; color: var(--pale); }
.mythos-body .markdown blockquote { background: rgba(18,165,212,.09); color: var(--mist); border-color: var(--ocean); }
.mythos-body .markdown tr:nth-child(even) td { background: rgba(18,165,212,.05); }

/* Places retains its own artwork and sheet layout. */
.pl-card, .hp-card { background: #0a1826; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm); }
.pl-card:hover, .pl-card:focus-visible, .hp-card:hover { border-color: rgba(95,211,240,.5); box-shadow: var(--shadow); }
.pl-chip, .pl-search, .pl-sort select, .pl-field input, .pl-field textarea, .pl-field select {
  background-color: #061019; color: var(--text); border-color: var(--border); border-radius: 2px;
}
.pl-chip.on { background: rgba(18,165,212,.2); color: var(--pale); border-color: var(--ocean); }
.pl-sheet-panel, .pl-modal { background: #0a1826; }

/* Map is a full-viewport canvas: theme the shell only, never the canvas. */
.map-body { background: var(--abyss); }
.map-stage { background: radial-gradient(1100px 780px at 50% 46%, rgba(10,61,82,.5), transparent 68%), #04080d; }
.map-body .hud, .map-body .keys-sheet { background: rgba(6,19,29,.92); border-color: var(--border); box-shadow: var(--shadow-sm); }
.map-body .hud { border-radius: 4px; }

/* Home / atlas still uses landing.css's legacy class names. */
body.landing .bc-highlight { background: none; color: var(--foam); padding: 0; }
body.landing .bc-kanban, body.landing .bc-col, body.landing .bc-kcard,
body.landing .run-card, body.landing .bc-cur-btn, body.landing .bc-table-frame,
body.landing .bc-ledger, body.landing .hp-empty {
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: #0a1826; color: var(--text);
}
body.landing .bc-col { background: #061019; }
body.landing .bc-btn, body.landing .bc-chip, body.landing .ln-more, body.landing .ln-eyebrow,
body.landing .bc-move, body.landing .bc-add-form input {
  border: 1px solid var(--border); background: #0a1826; color: var(--pale); box-shadow: none;
}
body.landing .bc-btn.lime, body.landing .bc-btn.cobalt, body.landing .ln-more,
body.landing .bc-cur-btn[aria-pressed="true"] { background: var(--ocean); color: #041018; border-color: var(--ocean); }
body.landing .bc-cur-btn[aria-pressed="true"] span { color: #041018; }
body.landing .bc-btn:hover, body.landing .bc-chip:hover, body.landing .bc-move:hover { background: var(--foam); color: #041018; box-shadow: none; transform: none; }
body.landing .run-card:hover { background: #0d2230; box-shadow: var(--shadow); transform: translateY(-2px); }
body.landing .run-index, body.landing .run-by { background: rgba(18,165,212,.16); color: var(--mist); border: 1px solid var(--border); }
body.landing .ln, body.landing .bc-kanban-head, body.landing .bc-col-head,
body.landing .bc-table th, body.landing .bc-table td { border-color: var(--line); }
body.landing .bc-table caption { background: #0a3d52; color: var(--pale); border-color: var(--line); }
body.landing .bc-cta { background: linear-gradient(120deg, #0a3d52, #0a1826); border: 1px solid var(--line); box-shadow: var(--shadow); }
body.landing .bc-ledger p { color: var(--text-2); }

@media (max-width: 720px) {
  .pl-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .task-add input, .pchat-input input, .chat-input-row input, .fr-search { min-width: 0; }
  .chat-pane { min-height: 340px; }
  .mythos-body .markdown table { display: block; max-width: 100%; overflow-x: auto; }
  .map-body .hud-workspace { top: 130px; }
  .map-body .hud-inspector { max-height: 35vh; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card, .lib-card, .proj-card, .pl-card, .hp-card, body.landing .run-card { transition: none; }
  .game-card:hover, .lib-card:hover, .proj-card:hover, .pl-card:hover, .hp-card:hover, body.landing .run-card:hover { transform: none; }
}
@media (forced-colors: active) {
  .game-card, .proj-card, .pl-card, .modal, .mythos-reader, .hud { border: 1px solid CanvasText; box-shadow: none; }
}
