/* Ostia Challenge. Colours: accent from ../styles/CONSTANTS.css */
:root { --bg: #eef0f3; --card: #fff; --ink: #1d2230; --muted: #667085; --line: #d9dde5; --r: #ff6b4a; --l: #4aa8ff; --gt: #2ee66b; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Lucida Grande", Helvetica, Arial, sans-serif; }
h1, h2, h3 { font-family: 'Gill Sans', 'Gill Sans MT', 'Calibri', 'Trebuchet MS', sans-serif; margin: 0 0 .4em; }
#app { width: 95%; max-width: 2200px; margin: 0 auto; padding: 18px 0 48px; }
#screen-landing, #screen-final, #screen-board { max-width: 1100px; margin-left: auto; margin-right: auto; }
#screen-board { max-width: 1500px; }
.lead { font-size: 1.15em; color: var(--muted); margin-top: 0; }
.smile { display: inline-block; animation: tilt 2.4s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(14deg); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.steps { padding-left: 1.2em; line-height: 1.6; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.row.small { margin: 8px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9em; color: var(--muted); }
input[type=text] { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 240px; color: var(--ink); }
.btn { font: inherit; font-size: .95em; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.r { border-color: var(--r); } .btn.l { border-color: var(--l); }
.btn.r.active { background: var(--r); color: #fff; } .btn.l.active { background: var(--l); color: #fff; }
.btn.r.done::after, .btn.l.done::after { content: " \2713"; }
.notice { font-size: .82em; color: var(--muted); } .notice.demo { color: #b45309; }
.cooldown { background: #fff4e0; border: 1px solid #f0c36a; border-radius: 8px; padding: 10px 12px; color: #7a4b00; }
.error { color: #b42318; background: #fee4e2; border-radius: 8px; padding: 10px 12px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chip { font-size: .6em; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: #fff; vertical-align: middle; }
.chip.special { background: #8a5cf6; }
.progress { flex: 1 1 200px; max-width: 360px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.viewer-wrap { position: relative; }
.viewer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vw-pane { background: #0c0e13; border-radius: 10px; padding: 8px; color: #cbd2e0; }
.vw-title { font-size: .8em; margin-bottom: 4px; }
.vw-axial .vw-title { color: #f2c14e; } .vw-sagittal .vw-title { color: #4bd0e0; }
.vw-canvas-wrap { position: relative; aspect-ratio: 1 / 1; }
.vw-sagittal .vw-canvas-wrap { aspect-ratio: 224 / 160; }
.vw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; border-radius: 6px; outline: none; touch-action: pan-y; }
.viewer.placing .vw-canvas { cursor: crosshair; }
.viewer[data-mode=R] .vw-pane { box-shadow: 0 0 0 2px var(--r) inset; border-radius: 10px; }
.viewer[data-mode=L] .vw-pane { box-shadow: 0 0 0 2px var(--l) inset; border-radius: 10px; }
.vw-edges span { position: absolute; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.7); text-shadow: 0 0 3px #000; pointer-events: none; }
.vw-edges .e-t { top: 4px; left: 50%; } .vw-edges .e-b { bottom: 4px; left: 50%; }
.vw-edges .e-l { left: 6px; top: 50%; } .vw-edges .e-r { right: 6px; top: 50%; }
.vw-slider { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.vw-slider input { flex: 1; } .vw-idx { font-size: .75em; min-width: 62px; text-align: right; }
.orient { width: 120px; height: 190px; background: #0c0e13; border-radius: 10px; align-self: center; }
.side { display: flex; flex-direction: column; gap: 10px; }
.side .btn { width: 100%; text-align: left; }
.side .row .btn { width: auto; }
.btn small.mb { display: none; font-size: calc(1em - 2px); color: inherit; opacity: 1; margin-top: 2px; }   /* same colour as the button text: dark on the white button, white on the coloured (active) one */
.mouse-buttons .btn small.mb { display: block; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-size: .8em; line-height: 1.35; }
.zoom-hint { text-align: center; margin: 8px 0 0; font-size: .95em; color: var(--ink); }
.hint { font-size: .85em; color: var(--muted); margin: 0; }
.zoom { flex-direction: row; align-items: center; } .zoom input { width: 90px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82em; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.gt { width: 14px; height: 14px; background: var(--gt); border: 2px solid #0b5a24; animation: blink 0.62s ease-in-out infinite alternate; }
.legend i.md { animation: blink 1.8s ease-in-out infinite alternate; }
@keyframes blink { from { opacity: .25; } to { opacity: 1; } }
.thanks { font-size: 1.05em; line-height: 1.5; }
table.t { border-collapse: collapse; width: 100%; font-size: .82em; }
table.t th, table.t td { padding: 5px 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t thead th { color: var(--muted); font-weight: 600; }
table.t tr.you td { background: #eef6ff; font-weight: 700; } table.t tr.model td:first-child::before { content: "\25CF "; color: var(--c, #888); }
table.t .grp { text-align: center; border-bottom: 2px solid var(--line); }
.scroll { overflow-x: auto; }
a.nick { color: var(--accent); cursor: pointer; text-decoration: underline; }
.tag { font-size: .7em; padding: 1px 6px; border-radius: 99px; background: #e8ecf3; color: var(--muted); margin-left: 4px; }

@media (max-width: 860px) {
    .stage { grid-template-columns: 1fr; }
    .viewer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .smile, .legend i { animation: none; } }

.nick-warn { margin: 6px 0 0; padding: 7px 11px; font-size: .85em; font-weight: bold; color: #fff; background: #d92d20; border-radius: 8px; box-shadow: 0 2px 8px rgba(217, 45, 32, .35); animation: nick-pop .18s ease-out; }
@keyframes nick-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.board-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; } .seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.seg .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
table.t tr.mine td { background: #fff7e0; font-weight: 700; }
#board-filter a { color: var(--accent); cursor: pointer; text-decoration: underline; margin-left: 8px; }
