/* The public site's stage page (docs/plans/PUBLIC_SITE.md D2504, D2511): the Stage Editor's own page in its view-only mode, in the SMC Sideloader's
   and the admin app's look (tools/admin_web/page/app.css, smc-sideloader/app/lib/ui/theme): dusk violet, cream text, orange for what to look at or
   press, 8-bit frames with hard edges, SMC Pixel (our own pixel face, tools/make_pixel_font.py) for titles. It is laid over editor.css, whose rules
   stay the one home of the page's parts: this file changes their colours and frames, and lays the page out for a phone. The map keeps the editor's
   dark colours, which carry its meanings (floors, heights, rooms), and the difficulty keeps its own: Normal blue, Hard amber, Hell red. */
@font-face { font-family: "SMC Pixel"; src: url("pixel.ttf") format("truetype"); font-display: swap; }
:root[data-view="only"] {
  --rail: #150e1c;
  --rail-line: #2e2340;
  --rail-hover: #261c32;
  --rail-ink: #fbf1e6;
  --rail-soft: #c4b5d1;
  --panel: #1a1322;
  --panel-line: #2e2340;
  --hover: #261c32;
  --chosen: #2e2240;
  --table: #0e0a13;
  --float: rgba(26, 19, 34, .94);
  --float-hover: #261c32;
  --ink: #fbf1e6;
  --ink-soft: #c4b5d1;
  --notice: #33240f;
  --notice-ink: #ffd9b8;
  --select: #f7741f;
  --on-select: #1b0e06;
  --edge: #33264a;
  --edge-strong: #5a437e;
  --shadow: #09060e;
  --pixel: "SMC Pixel", "Bahnschrift", "Segoe UI", sans-serif;
  --body: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
[data-view="only"] body {
  background: conic-gradient(at 2px 2px, transparent 75%, rgba(255, 255, 255, .05) 0) 5px 5px / 12px 12px fixed, linear-gradient(#160f1d, #0d0912) fixed;
}
[data-view="only"] ::selection { background: rgba(247, 116, 31, .3); }
[data-view="only"] :focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }

/* The 8-bit frame: whole pixels round the edge and no rounded corners, then a hard drop where it stands out */
[data-view="only"] .switch button, [data-view="only"] .map-tools button, [data-view="only"] .limit, [data-view="only"] .bar button,
[data-view="only"] .tree-tools button, [data-view="only"] .panel-nav button, [data-view="only"] #panel .tools button, [data-view="only"] dialog,
[data-view="only"] .dialog-buttons button, [data-view="only"] .key {
  border: 0;
  border-radius: 0;
  box-shadow: 0 -2px 0 var(--edge), 0 2px 0 var(--edge), -2px 0 0 var(--edge), 2px 0 0 var(--edge);
}
[data-view="only"] .map-tools button, [data-view="only"] .limit, [data-view="only"] .key {
  box-shadow: 0 -2px 0 var(--edge), 0 2px 0 var(--edge), -2px 0 0 var(--edge), 2px 0 0 var(--edge), 4px 4px 0 2px var(--shadow);
}

/* The plate across the top: the site's name and the switches */
[data-view="only"] .rail { background: linear-gradient(#150e1c, #0f0a15); border-bottom: 2px solid var(--rail-line); }
[data-view="only"] .rail h1 { font: 20px/1.2 var(--pixel); color: var(--ink); text-shadow: 3px 3px 0 #ee6414; letter-spacing: 0; }
[data-view="only"] .switch { gap: 6px; }
[data-view="only"] .switch button { clip-path: none; margin-right: 0; background: var(--panel); color: var(--ink-soft); } /* (square 8-bit frames, not the editor's slants) */
[data-view="only"] .switch button:hover { background: var(--hover); color: var(--ink); }
[data-view="only"] .switch button.on { --edge: var(--select); background: rgba(247, 116, 31, .16); color: var(--ink); }
[data-view="only"] .switch button.on.d-normal { --edge: var(--normal); background: rgba(42, 168, 224, .18); }
[data-view="only"] .switch button.on.d-hard { --edge: var(--hard); background: rgba(240, 160, 32, .18); color: var(--ink); }
[data-view="only"] .switch button.on.d-hell { --edge: var(--hell); background: rgba(239, 81, 72, .18); color: var(--ink); }
[data-view="only"] .meets b { color: var(--select); }

/* The bar: which layouts these are, and what's new */
[data-view="only"] .bar { background: rgba(21, 14, 28, .92); border-bottom: 2px solid var(--panel-line); }
[data-view="only"] .site-line { margin: 0; font: 15px/1.35 var(--body); color: var(--ink-soft); }
[data-view="only"] .site-line b { font: 15px/1 var(--pixel); color: var(--ink); font-weight: 400; }
[data-view="only"] .bar button { padding: 6px 12px; background: var(--panel); color: var(--ink); }
[data-view="only"] .bar button:hover { background: var(--hover); }
[data-view="only"] #news-open { --edge: var(--select); margin-left: auto; color: var(--ink); background: rgba(247, 116, 31, .12); }
[data-view="only"] .bar button[aria-expanded="true"] { --edge: var(--select); background: rgba(247, 116, 31, .16); }
[data-view="only"] .differs { color: var(--notice-ink); }

/* The list on the left and the details on the right */
[data-view="only"] .tree, [data-view="only"] #panel { background: var(--panel); }
[data-view="only"] .tree-head { background: var(--panel); }
[data-view="only"] .tree h2, [data-view="only"] #panel h2 { font: 17px/1.3 var(--pixel); color: var(--ink); }
[data-view="only"] #panel h3 { font: 600 15px/1.25 var(--body); color: var(--select); text-transform: uppercase; letter-spacing: .06em; }
[data-view="only"] .tree-tools button, [data-view="only"] .panel-nav button { background: var(--panel); color: var(--ink); }
[data-view="only"] .tree .row.on { background: rgba(247, 116, 31, .2); color: var(--ink); }

/* What a box or a choice holds, shown as words: nothing on this page takes a change */
[data-view="only"] #panel input:disabled, [data-view="only"] #panel select:disabled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  field-sizing: content;
  width: auto;
  min-width: 1ch;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  opacity: 1;
  font-weight: 700;
  text-align: left;
}
[data-view="only"] #panel select:disabled { max-width: none; }
[data-view="only"] #panel input:disabled::-webkit-inner-spin-button, [data-view="only"] #panel input:disabled::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
[data-view="only"] #panel .picker-now:disabled, [data-view="only"] #panel .toggle:disabled { opacity: 1; cursor: default; }
[data-view="only"] #panel .picker-now:disabled .caret { display: none; }

/* What's new */
[data-view="only"] dialog { max-width: min(680px, calc(100vw - 24px)); padding: 18px 20px; color: var(--ink); background: var(--panel); }
[data-view="only"] dialog::backdrop { background: rgba(9, 6, 14, .7); }
[data-view="only"] dialog h2 { margin: 0 0 6px; font: 18px/1.3 var(--pixel); }
[data-view="only"] .news-list { max-height: min(60vh, 560px); overflow: auto; }
[data-view="only"] .news-list h3 { margin: 16px 0 4px; font: 15px/1.3 var(--pixel); color: var(--select); }
[data-view="only"] .news-list h3:first-child { margin-top: 4px; }
[data-view="only"] .news-list h4 { margin: 8px 0 2px; font: 600 14px/1.3 var(--body); color: var(--ink); }
[data-view="only"] .news-list ul { margin: 0 0 4px; padding-left: 18px; color: var(--ink-soft); font: 14px/1.45 var(--body); }
[data-view="only"] .dialog-buttons button.primary { --edge: var(--select); background: var(--select); color: var(--on-select); font-weight: 600; }

/* A phone, or any window too narrow for the editor's three columns and its rail's one line, measured at 1080 px (editor.css, where the editor
   stacks its columns): here the page fills the screen with no scrolling, the map takes what the header leaves, the list is a drawer from the
   left and the details a sheet from below */
.phone { display: none; }
@media (max-width: 1080px) {
  [data-view="only"] body { height: 100vh; height: 100dvh; min-height: 0; }
  [data-view="only"] .table { height: auto; }
  [data-view="only"] .phone { display: inline-flex; }
  [data-view="only"] .rail { gap: 6px 10px; padding: 8px 10px; }
  [data-view="only"] .rail h1 { width: 100%; font-size: 15px; }
  [data-view="only"] .switch-label { display: none; }
  [data-view="only"] .switch { gap: 4px; }
  [data-view="only"] .switch button { padding: 6px 10px; font-size: 15px; }
  /* Difficulty and Floors/Heights share a row at 390 px, Solo/Duo/Squad the next: two rows of switches, not three */
  [data-view="only"] .rail > h1 { order: 0; }
  [data-view="only"] .rail > .switch-group:has(#difficulty) { order: 1; }
  [data-view="only"] .rail > .switch-group:has(#mode) { order: 2; }
  [data-view="only"] .rail > .switch-group:has(#team) { order: 3; }
  [data-view="only"] .rail > .meets { order: 4; margin-left: 0; font-size: 13px; }
  [data-view="only"] .bar { gap: 6px; padding: 6px 10px; }
  [data-view="only"] .site-line { width: 100%; font-size: 12px; }
  [data-view="only"] .site-line b { font-size: 12px; }
  [data-view="only"] #news-open { margin-left: 0; }
  [data-view="only"] .desk { grid-template-columns: minmax(0, 1fr); }
  [data-view="only"] .resizer { display: none; }
  [data-view="only"] .tree {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); max-height: none;
    border-right: 2px solid var(--edge-strong); transform: translateX(-104%); transition: transform .16s steps(4);
  }
  [data-view="only"] #panel {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 46vh; overflow: auto; padding-bottom: 24px;
    border-top: 2px solid var(--edge-strong); transform: translateY(104%); transition: transform .16s steps(4);
  }
  [data-view="only"] body.tree-open .tree, [data-view="only"] body.panel-open #panel { transform: none; }
  [data-view="only"] body.tree-open .table::after { content: ""; position: absolute; inset: 0; z-index: 5; background: rgba(9, 6, 14, .6); }
  [data-view="only"] .key { bottom: 30px; font-size: 13px; }
  [data-view="only"] .where { font-size: 12px; }
}
@media (pointer: coarse) {
  [data-view="only"] .switch button, [data-view="only"] .map-tools button, [data-view="only"] .bar button, [data-view="only"] .tree .row,
  [data-view="only"] .tree-tools button, [data-view="only"] .panel-nav button, [data-view="only"] #panel .tools button,
  [data-view="only"] .dialog-buttons button { min-height: 44px; }
  [data-view="only"] .panel-nav button { min-width: 44px; }
  [data-view="only"] .eye, [data-view="only"] .fold { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-view="only"] .tree, [data-view="only"] #panel { transition: none; }
}
