/* Codenrock blue and Monaco vs-dark surfaces match the pilot. */
:root{
  color-scheme:dark;
  --font-ui:"Segoe UI",Arial,sans-serif;
  --font-mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace;
  font-family:var(--font-ui);font-synthesis:none;
  color:var(--text);background:var(--canvas);
  --canvas:#181818;--surface:#1e1e1e;--chrome:#252526;--raised:#2d2d30;
  --text:#d4d4d4;--muted:#a6a6a6;--line:#3c3c3c;--input-line:#6b6b6b;
  --pair:#2857e8;--blue:#3b82f6;--accent:#3b82f6;--accent-hover:#2563eb;--on-accent:#ffffff;
  --action:#2563eb;--action-hover:#1d4ed8;--link:#60a5fa;
  --selection:#264f78;--inactive-selection:#3a3d41;
  --selected:#193451;--success:#4ecb71;--warning:#e5c07b;
  --warning-bg:#332b1d;--warning-line:#745b37;
  --error:#f48771;--shadow:#00000066;
  scrollbar-color:var(--input-line) var(--chrome);
}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{min-height:44px;border:1px solid var(--line);border-radius:9px;padding:10px 17px;background:var(--surface);color:inherit;cursor:pointer;font-weight:700;touch-action:manipulation}button:hover:not(:disabled){background:var(--raised)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}button:disabled{opacity:.45;cursor:default}.primary{background:var(--action);border-color:var(--action);color:var(--on-accent)}.primary:hover:not(:disabled){background:var(--action-hover);border-color:var(--action-hover)}.quiet{background:transparent}.icon-button{font-size:25px;min-width:46px;padding:3px 11px;line-height:1}.tablet{height:100dvh;min-height:420px;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto;padding:12px 20px 10px;gap:9px;overflow:hidden}.station-header{display:flex;align-items:center;gap:20px}.station-mark{background:var(--pair);color:white;padding:9px 16px;display:grid;grid-template-columns:auto auto;align-items:center;gap:10px;border-radius:6px;align-self:stretch;min-width:129px}.station-mark span{font-size:15px}.station-mark strong{font-size:48px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-3px}.heading{display:flex;align-items:center;gap:25px;flex:1}.brand{font-weight:900;font-size:20px;line-height:1.05;text-decoration:none;color:inherit}.heading p{display:flex;flex-direction:column;gap:4px;font-size:18px;font-weight:700;margin:0}#round{font-size:13px;color:var(--muted);font-weight:400}.header-clock{text-align:right;display:flex;gap:14px;align-items:center}.header-clock span{font-size:14px;max-width:140px;color:var(--muted)}.header-clock strong{font-variant-numeric:tabular-nums;font-size:35px;font-weight:900;letter-spacing:-1.5px}.game-tools{min-height:44px;display:flex;align-items:center;gap:18px}.game-tools p{margin:0;flex:1;color:var(--muted);font-size:14px}.tabs{display:flex;background:var(--chrome);padding:4px;border-radius:11px;gap:2px}.tabs button{min-height:44px;border-color:transparent;background:transparent;padding:7px 24px}.tabs button[aria-selected=true]{background:var(--action);color:var(--on-accent);border-color:var(--action)}.new-dot{height:8px;width:8px;border-radius:50%;display:inline-block;background:var(--warning);margin-left:5px}.game-stage{position:relative;border-radius:8px;overflow:hidden;background:var(--surface);border:1px solid var(--line);min-height:0}#game-holder{height:100%;width:100%}#game-holder iframe{color-scheme:light;height:100%;width:100%;border:0;display:block;background:#0a0e1a}.stage-message{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:12px;background:var(--surface);padding:24px}.stage-message h1{font-size:clamp(24px,3.2vw,40px);line-height:1.12;max-width:700px;margin:15px 0 0}.stage-message p{font-size:17px;color:var(--muted);line-height:1.5;max-width:600px;margin:0}.stage-message button{margin-top:8px}.waiting-symbol{width:160px;display:grid;grid-template-columns:repeat(4,1fr);gap:7px;position:relative;height:63px}.waiting-symbol span{height:19px;border-radius:5px;background:#88a5fb}.waiting-symbol span:nth-child(2){background:#f5c440}.waiting-symbol span:nth-child(3){background:#aa75c3}.waiting-symbol span:nth-child(4){background:#63b7ab}.waiting-symbol i{position:absolute;width:44px;height:8px;background:var(--pair);bottom:0;left:58px;border-radius:5px}.status-bar{display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,2.6fr);align-items:start;gap:18px;min-height:45px}.status-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px}.status-heading .icon-button{font-size:19px;flex:none}.connection{display:flex;align-items:center;gap:8px;min-width:0;color:var(--muted);font-size:13px}.status-dot{height:9px;width:9px;flex:none;border-radius:50%;background:var(--success)}.status-dot.warning{background:var(--warning)}.status-dot.offline{background:var(--error)}.footer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px}.footer-action{display:grid;gap:6px;min-width:0}.action-help{margin:0;color:var(--muted);font-size:12px;line-height:1.4}.footer-action button{width:100%}.footer-actions button{font-size:13px;padding:8px 13px}.footer-actions .icon-button{font-size:19px;min-width:44px}.runtime-error{position:absolute;left:20px;right:20px;bottom:20px;padding:16px 20px;background:var(--warning-bg);color:var(--warning);border:1px solid var(--warning-line);border-radius:10px}.runtime-error strong{font-size:19px}.runtime-error p{margin:7px 0 11px;line-height:1.4;max-width:700px}.runtime-error button{padding:5px 12px}dialog{width:min(690px,calc(100vw - 32px));max-height:85dvh;border:1px solid var(--input-line);border-radius:12px;color:var(--text);background:var(--surface);padding:27px;box-shadow:0 20px 70px var(--shadow)}dialog::backdrop{background:#00000099}.dialog-heading{display:flex;align-items:flex-start;gap:15px;justify-content:space-between}.dialog-heading h2{font-size:26px;line-height:1.2;margin:5px 0 12px}.dialog-heading button{flex-shrink:0}dialog p,dialog li{font-family:Arial,sans-serif;line-height:1.55;font-size:16px}.rules-list{padding-left:22px}.rules-list li{padding-left:4px;margin-bottom:12px}.small{font-size:13px!important;color:var(--muted)}dl{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}.diagnostic-error{color:var(--error);overflow-wrap:anywhere}[hidden]{display:none!important}@media(max-width:850px){.tablet{padding:8px 12px;gap:7px}.station-header{gap:12px}.station-mark{min-width:104px;padding:8px 12px;gap:7px}.station-mark strong{font-size:40px}.heading{gap:15px}.brand{font-size:17px}.heading p{font-size:16px}.header-clock{display:block}.header-clock span{font-size:11px;display:block;max-width:none}.header-clock strong{font-size:29px}.game-tools{gap:10px}.game-tools p{font-size:12px}.tabs button{padding:7px 16px}.footer-actions button{padding:6px 10px}.connection{font-size:11px}.status-bar{grid-template-columns:1fr;gap:5px}.footer-actions{gap:12px}}@media(max-width:570px){.tablet{grid-template-rows:auto auto auto minmax(0,1fr) auto;min-height:570px}.station-mark{min-width:85px;display:flex;flex-direction:column;gap:0;padding:4px 10px;border-radius:6px}.station-mark span{font-size:11px}.station-mark strong{font-size:35px}.heading{gap:8px;display:block}.brand{font-size:15px}.brand br{display:none}.heading p{font-size:14px;display:block;margin-top:6px}#round{font-size:11px;display:block}.station-header>.icon-button{display:none}.game-tools{flex-wrap:wrap}.game-tools p{order:3;width:100%;flex:auto}.game-tools #rules-button{margin-left:auto}.tabs{flex:1}.tabs button{flex:1}.status-bar{gap:5px}.connection{padding:3px}.footer-actions{gap:10px}.action-help{font-size:11px}.footer-actions button{min-height:54px}.status-heading{min-height:44px}.stage-message{padding:16px}.stage-message p{font-size:15px}.runtime-error{left:10px;right:10px;bottom:10px;padding:12px}.runtime-error strong{font-size:16px}.runtime-error p{font-size:13px}dialog{padding:20px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Role instructions are open before start and stay accessible during play. */
.role-guide{border:1px solid var(--line);border-radius:10px;background:var(--surface);flex-shrink:0;font-size:14px;line-height:1.45;max-height:34dvh;overflow:auto}
.role-guide summary{cursor:pointer;padding:11px 15px;min-height:44px;font-weight:700;color:var(--text)}
.role-guide ol{margin:0 18px 14px;padding-left:20px;display:grid;grid-template-columns:1fr 1fr;gap:10px 28px;color:var(--muted)}
@media(max-width:760px){.role-guide ol{grid-template-columns:1fr}.role-guide{font-size:13px;max-height:36dvh}}
/* The final ranking shares the stage with the submitted game. */
.game-ranking{height:100%;overflow:auto;padding:clamp(18px,3vw,32px);background:var(--surface)}
.game-ranking h1{font-size:clamp(25px,3vw,36px);margin:0 0 8px}
.game-ranking>p{color:var(--muted);line-height:1.45;margin:0 0 20px}
.game-ranking>.ranking-winner{color:var(--link);font-size:clamp(18px,2vw,24px);font-weight:600;margin:8px 0 12px}
.leaderboard-table{width:100%;border-collapse:collapse;text-align:left;font-variant-numeric:tabular-nums}
.leaderboard-table caption{text-align:left;font-size:14px;color:var(--muted);padding-bottom:10px}
.leaderboard-table th,.leaderboard-table td{padding:13px 14px;border-bottom:1px solid var(--line);font-size:17px}
.leaderboard-table thead th{font-size:13px;color:var(--muted);font-weight:400}
.leaderboard-table tbody td:first-child{font-size:22px;font-weight:900;width:16%}
.leaderboard-table .leaderboard-own{background:var(--selected)}
.leaderboard-table .leaderboard-own th{color:var(--text)}
.game-ranking>.ranking-explanation{font-size:13px;margin:16px 0}
@media(max-width:650px){.tabs button{padding:7px 12px}.game-tools{flex-wrap:wrap}.game-tools #navigator-hint{flex-basis:100%;order:3}.game-ranking{padding:18px 12px}.leaderboard-table th,.leaderboard-table td{padding:11px 8px;font-size:14px}.leaderboard-table tbody td:first-child{font-size:19px}}

.tablet.showing-ranking{grid-template-rows:auto auto minmax(0,1fr) auto}

/* Keep instructions in a readable UI font; use mono for controls and numbers. */
button,.brand,.station-mark,.heading p,.header-clock strong,.game-ranking h1,
.leaderboard-table tbody,.stage-message h1{font-family:var(--font-mono)}
.brand{font-size:18px;letter-spacing:-.7px}
.heading p{font-size:17px}
.header-clock strong{font-weight:600}
.leaderboard-table .leaderboard-own td:first-child{box-shadow:inset 3px 0 var(--accent);color:var(--text)}
a{color:var(--link)}
::selection{background:var(--selection);color:var(--text)}
@media(max-width:850px){.brand{font-size:16px}.heading p{font-size:15px}}
@media(max-width:570px){.brand{font-size:15px}.heading p{font-size:14px}}
