/* WebBBS web-experience mode.  The four colours of the rail match the four
   boxes of the terminal's Main System Menu. */
@font-face { font-family: "Bricolage"; src: url(fonts/BricolageGrotesque.ttf); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/AtkinsonHyperlegible-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/AtkinsonHyperlegible-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/AtkinsonHyperlegible-Italic.ttf); font-style: italic; font-display: swap; }

:root {
  --ink: #18233a; --ink-2: #4a5670; --ink-3: #6e7990;
  --paper: #eef1f5; --panel: #ffffff; --rule: #d3d9e3; --sel: #e3e9f6;
  --comms: #1e8a4e; --fun: #0b7a8a; --serv: #9b3a8a; --info: #2d57c8; --alert: #c23a2e; --gold: #a87b0c;
  --badge: #f2c94c; --rail: #18233a; --rail-text: #dfe5f0; --rail-dim: #8f9bb3;
  --field: #ffffff; --shadow: 0 10px 30px rgba(24,35,58,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6ebf3; --ink-2: #b4bdcc; --ink-3: #8b95a8;
    --paper: #10151f; --panel: #171e2b; --rule: #2a3445; --sel: #22304a;
    --comms: #3fb571; --fun: #2aa6b6; --serv: #c45fb2; --info: #6b8ff0; --alert: #e5604f; --gold: #d9a93a;
    --rail: #0b0f17; --field: #0f141d; --shadow: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e6ebf3; --ink-2: #b4bdcc; --ink-3: #8b95a8;
  --paper: #10151f; --panel: #171e2b; --rule: #2a3445; --sel: #22304a;
  --comms: #3fb571; --fun: #2aa6b6; --serv: #c45fb2; --info: #6b8ff0; --alert: #e5604f; --gold: #d9a93a;
  --rail: #0b0f17; --field: #0f141d; --shadow: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 "Atkinson", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display { font-family: "Bricolage", sans-serif; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
a { color: var(--info); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- sign in ---------- */
#signin { min-height: 100vh; background: #18233a; color: #fff; display: grid; place-items: center; padding: 32px 16px; }
#signin .wrap { width: min(1080px, 100%); display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: center; }
#signin .big { font: 800 64px/.92 "Bricolage"; font-stretch: 76%; letter-spacing: -.025em; overflow-wrap: anywhere; }
#signin .big small { display: block; font: 400 17px/1.5 "Atkinson"; color: #a9b4c9; margin-top: 16px; letter-spacing: 0; font-stretch: 100%; }
#signin form { margin-top: 30px; display: grid; gap: 10px; }
#signin input[type=text], #signin input[type=password] { background: #fff; color: #18233a; border: 0; border-radius: 8px; padding: 12px 14px; font-size: 16px; width: 100%; }
#signin .note { font-size: 14px; color: #a9b4c9; margin-top: 4px; }
#signin .note a { color: #9fc1ff; }
#signin .err { background: #5a1f1a; color: #ffd9d4; border-radius: 8px; padding: 10px 12px; font-size: 14.5px; }
#signin h2 { font-size: 22px; margin-bottom: 14px; color: #fff; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice { background: #22304b; border-radius: 12px; padding: 14px; border: 2px solid transparent; cursor: pointer; text-align: left; color: #fff; }
.choice[aria-pressed="true"] { border-color: #f2c94c; }
.choice .shot { height: 170px; border-radius: 7px; overflow: hidden; background: #000; }
.choice h3 { font-size: 20px; margin: 14px 2px 4px; }
.choice p { margin: 0 2px; color: #b9c3d6; font-size: 14.5px; line-height: 1.5; }
.mini { background: #eef1f5; height: 100%; display: grid; grid-template-columns: 64px 1fr; }
.mini .r { background: #18233a; padding-top: 4px; }
.mini .r i { display: block; height: 9px; margin: 9px 10px 0; border-radius: 3px; background: #3a4864; }
.mini .r i.c1 { background: #1e8a4e; } .mini .r i.c2 { background: #0b7a8a; } .mini .r i.c3 { background: #9b3a8a; } .mini .r i.c4 { background: #2d57c8; }
.mini .m { padding: 14px; } .mini .m b { display: block; height: 14px; width: 60%; background: #18233a; border-radius: 3px; }
.mini .m s { display: block; height: 30px; margin-top: 12px; background: #fff; border: 1px solid #d3d9e3; border-radius: 5px; }
.crt { height: 100%; padding: 12px 14px; font: 12px/1.45 Menlo, Consolas, monospace; color: #aaa; background: #000; }
.crt .b { color: #55f; } .crt .y { color: #ff5; } .crt .c { color: #5ff; } .crt .g { color: #5f5; } .crt .w { color: #fff; }
.remember { margin-top: 16px; font-size: 14px; color: #b9c3d6; display: flex; gap: 8px; align-items: center; }
.go { margin-top: 18px; background: #f2c94c; color: #18233a; border: 0; border-radius: 8px; padding: 12px 22px; font-weight: 700; font-size: 16px; cursor: pointer; }
.go:disabled { opacity: .6; cursor: default; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr) 260px; height: 100vh; height: 100dvh; }
.shell.wide { grid-template-columns: 252px minmax(0, 1fr); }
.shell.wide .side { display: none; }
.rail { background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 16px; overflow-y: auto; }
.brand { font-family: "Bricolage"; font-stretch: 78%; font-weight: 800; font-size: 30px; line-height: .95; color: #fff; padding: 0 8px; letter-spacing: -0.02em; overflow-wrap: anywhere; cursor: pointer; }
.brand small { display: block; font-family: "Atkinson"; font-stretch: 100%; font-weight: 400; font-size: 13px; letter-spacing: 0; color: #9aa6bd; margin-top: 6px; }
.group { display: flex; flex-direction: column; gap: 2px; }
.group h4 { margin: 0 0 4px 8px; font: 700 12.5px/1 "Atkinson"; color: var(--c); letter-spacing: .02em; filter: brightness(1.55); }
.navi { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--rail-text); font-size: 15px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.navi:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.navi .key { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; font: 800 13px/1 "Bricolage"; color: #fff; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0,0,0,.28); flex: none; }
.navi .count { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #18233a; background: var(--badge); border-radius: 9px; padding: 1px 7px; }
.navi.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.navi.on .key { outline: 2px solid #fff; outline-offset: 1px; }
.navi.dim { opacity: .45; cursor: not-allowed; }
.navi.pagesys { margin-top: auto; font-family: inherit; }
.navi.pagesys .key { background: var(--gold); color: #18233a; }
.navi.pagesys + .foot { margin-top: 6px; }
.toast.syspage { border-left: 5px solid var(--gold); }
.toast.syspage small { color: var(--ink-3); }
.syspage-msg { margin: 6px 0 2px; font-style: italic; overflow-wrap: anywhere; }
.syspage-act { display: flex; gap: 8px; margin-top: 8px; }
.rail .foot { margin-top: auto; font-size: 12.5px; color: var(--rail-dim); padding: 0 8px; line-height: 1.6; }
.rail .foot b { color: var(--rail-text); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--rule); background: var(--panel); min-height: 58px; }
.crumbs { font-size: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumbs b { color: var(--ink); }
.search { margin-left: auto; width: 280px; border: 1px solid var(--rule); border-radius: 7px; padding: 7px 12px; font-size: 14px; background: var(--paper); min-width: 0; }
.modes { display: flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; font-size: 13.5px; flex: none; }
.modes button { padding: 6px 12px; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.modes button.on { background: var(--ink); color: var(--paper); font-weight: 700; cursor: default; }
.me { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0; flex: none; }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font: 800 13px/1 "Bricolage"; flex: none; }
.burger, .whobtn { display: none; }

.content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; min-height: 0; }
#content:focus { outline: none; }
.content.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.head { display: flex; align-items: flex-end; gap: 16px; border-left: 6px solid var(--c, var(--ink)); padding: 2px 0 2px 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-size: 32px; line-height: 1.05; overflow-wrap: anywhere; }
.head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.head .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 7px; padding: 9px 16px; font-weight: 700; font-size: 14.5px; color: #fff; background: var(--c, var(--info)); cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.small { padding: 5px 11px; font-size: 13.5px; }
.btn.danger { background: var(--alert); }
.sub { font-size: 19px; margin: 0 0 10px; }

/* who's online */
.side { border-left: 1px solid var(--rule); background: var(--panel); padding: 20px 16px; overflow-y: auto; }
.side h3 { font-size: 16px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.side h3 span { font-family: "Atkinson"; font-weight: 400; color: var(--ink-3); font-size: 14px; }
.who { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--rule); font-size: 14px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; border-radius: 0; }
.who:hover { background: var(--sel); }
.who b { display: block; }
.who small { color: var(--ink-3); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.who .ch { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.pager { margin-top: 16px; display: grid; gap: 6px; }
.pager input, .pager select { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; font-size: 14px; background: var(--field); width: 100%; }
.side .tip { margin-top: 22px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.kbd { display: inline-block; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; font-weight: 700; background: var(--paper); color: var(--ink); }

/* lists */
.list { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; }
.row { display: grid; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
a.row, button.row { cursor: pointer; }
a.row:hover, button.row:hover { background: var(--sel); text-decoration: none; }
.row:first-child { border-top: 0; }
.row.hdr { font-size: 13px; color: var(--ink-3); background: var(--paper); padding: 8px 16px; }
.row .t { overflow-wrap: anywhere; }
.row.new .t { font-weight: 700; }
.row .one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--info)); display: inline-block; }
.tag { font-size: 12.5px; padding: 2px 8px; border-radius: 10px; background: var(--sel); color: var(--ink-2); white-space: nowrap; }
.tag.new { background: var(--badge); color: #18233a; font-weight: 700; }
.empty { padding: 28px 18px; color: var(--ink-3); text-align: center; }

/* home */
.since { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; margin-bottom: 28px; }
.news { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-left: 1px solid var(--rule); color: var(--ink); font-size: 14.5px; line-height: 1.35; }
.news:first-child { border-left: 0; }
.news:hover { background: var(--sel); text-decoration: none; }
.news .big { font: 800 40px/1 "Bricolage"; color: var(--c); font-stretch: 80%; }
.cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 26px; }
.prose { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 16px 20px; }
.ansi { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 0; }
pre.ansi.mono { font: 14px/1.45 Menlo, Consolas, "DejaVu Sans Mono", monospace; white-space: pre; overflow-x: auto; }

/* forums */
.fgrid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.flist { display: flex; flex-direction: column; gap: 2px; }
.f { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; color: var(--ink); font-size: 15px; }
.f:hover { background: var(--sel); text-decoration: none; }
.f.on { background: var(--panel); box-shadow: inset 3px 0 0 var(--comms); }
.f b { overflow: hidden; text-overflow: ellipsis; }
.thread h2 { font-size: 24px; overflow-wrap: anywhere; }
.msg { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 16px 20px; margin-bottom: 12px; }
.msg.unread { box-shadow: inset 3px 0 0 var(--badge); }
.mh { display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.3; flex-wrap: wrap; }
.mh .num { margin-left: auto; color: var(--ink-3); font-size: 13px; }
.mb { max-width: 72ch; margin-top: 10px; }
.mb blockquote, .quote { margin: 4px 0; padding: 2px 12px; border-left: 3px solid var(--rule); color: var(--ink-2); font-style: italic; }
.ma { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; }
.att { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 7px; font-size: 14px; background: var(--paper); }

/* forms */
.form { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 18px 20px; display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.form label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.form input[type=text], .form input[type=password], .form input[type=number], .form input[type=date], .form textarea, .form select {
  border: 1px solid var(--rule); border-radius: 7px; padding: 9px 12px; font-size: 15px; background: var(--field); font-weight: 400; color: var(--ink); width: 100%; }
.form textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
.form .bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form .bar .right { margin-left: auto; display: flex; gap: 10px; }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .hint { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.err { color: var(--alert); font-size: 14.5px; }
.ok { color: var(--comms); font-size: 14.5px; }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--panel); border: 1px solid var(--rule); border-radius: 7px; box-shadow: var(--shadow); }
.suggest li { padding: 6px 12px; cursor: pointer; font-weight: 400; color: var(--ink); }
.suggest li:hover, .suggest li.on { background: var(--sel); }

/* mail */
.mgrid { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--rule); background: var(--panel); border-radius: 7px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
.mrow { grid-template-columns: 30px minmax(0, 1fr) auto; }
.mrow.on { background: var(--sel); }

/* teleconference */
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; flex: 1; min-height: 0; }
.chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; min-height: 0; }
.log { flex: 1; overflow-y: auto; padding: 12px 16px; min-height: 260px; }
.tl { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 15px; }
.tl .tm { color: var(--ink-3); font-size: 12px; width: 44px; flex: none; padding-top: 3px; }
.tl.sys, .tl.act { color: var(--ink-2); }
.tl.act span b { color: var(--serv); }
.tl.sys { font-size: 14px; }
.tl.whisper span { color: var(--fun); font-style: italic; }
.tl.mine b { color: var(--info); }
.tl .body { min-width: 0; overflow-wrap: anywhere; }
.say { display: flex; gap: 8px; border-top: 1px solid var(--rule); padding: 10px; }
.say input { flex: 1; border: 1px solid var(--rule); border-radius: 7px; padding: 9px 12px; background: var(--field); min-width: 0; }
.chans { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.chans button { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--rule); background: var(--panel); border-radius: 7px; padding: 8px 10px; font-size: 14px; cursor: pointer; text-align: left; }
.chans button.on { border-color: var(--comms); box-shadow: inset 3px 0 0 var(--comms); font-weight: 700; }
.acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.acts button { border: 1px solid var(--rule); background: var(--panel); border-radius: 12px; padding: 2px 9px; font-size: 12.5px; cursor: pointer; }

/* files */
.lgrid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.frow { grid-template-columns: minmax(0, 1fr) 90px 110px auto; }
.filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; font-size: 14px; background: var(--field); }
.filters input { flex: 1; min-width: 160px; }

/* games / cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); cursor: pointer; text-align: left; font-size: 15px; }
.card:hover { border-color: var(--c, var(--fun)); text-decoration: none; box-shadow: var(--shadow); }
.card .key { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; font: 800 17px/1 "Bricolage"; color: #fff; background: var(--c, var(--fun)); }
.card h3 { font-size: 18px; }
.card p { margin: 0; color: var(--ink-3); font-size: 14px; }
.card.dim { opacity: .5; cursor: not-allowed; }

/* terminal panel */
.termhead { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.termhead b { font-family: "Bricolage"; font-size: 18px; }
.termhead .muted { font-size: 13.5px; }
.termhead .right { margin-left: auto; display: flex; gap: 8px; }
.termframe { flex: 1; border: 0; width: 100%; background: #0b0d12; min-height: 0; }

/* polls */
.q { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 18px 20px; }
.q h3 { font-size: 19px; margin-bottom: 12px; }
.q .opts { display: grid; gap: 8px; }
.q .opts label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 7px; cursor: pointer; font-weight: 400; color: var(--ink); }
.q .opts label:has(input:checked) { border-color: var(--fun); background: var(--sel); }
.q input[type=text], .q input[type=number], .q input[type=date], .q textarea { border: 1px solid var(--rule); border-radius: 7px; padding: 9px 12px; width: 100%; background: var(--field); }
.q textarea { min-height: 140px; }
.progress { height: 6px; background: var(--rule); border-radius: 3px; margin: 0 0 16px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--fun); }
.barrow { display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 14.5px; padding: 4px 0; }
.barrow .b { height: 14px; background: var(--sel); border-radius: 4px; overflow: hidden; }
.barrow .b i { display: block; height: 100%; background: var(--fun); }

/* key/value tables */
.kv { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; }
.kv div { padding: 9px 16px; border-top: 1px solid var(--rule); font-size: 15px; overflow-wrap: anywhere; }
.kv div:nth-child(-n+2) { border-top: 0; }
.kv div:nth-child(odd) { color: var(--ink-3); background: var(--paper); }

/* toasts and dialogs */
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); border-radius: 9px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; animation: up .18s ease-out; }
.toast.alert { background: var(--alert); color: #fff; }
.toast .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 0 0 8px; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
#dialog { position: fixed; inset: 0; background: rgba(10,15,25,.5); display: grid; place-items: center; z-index: 60; padding: 16px; }
#dialog .box { background: var(--panel); color: var(--ink); border-radius: 12px; padding: 22px 24px; width: min(440px, 100%); box-shadow: var(--shadow); }
#dialog h3 { font-size: 20px; margin-bottom: 8px; }
#dialog .bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.loading { padding: 40px; color: var(--ink-3); text-align: center; }
.bye { min-height: 100vh; display: grid; place-items: center; background: #18233a; color: #fff; text-align: center; padding: 24px; }
.bye h1 { font-size: 40px; margin-bottom: 8px; }
.bye p { color: #b9c3d6; }

/* ---------- narrower screens ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .side { display: none; }
  .whobtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 5px 10px; font-size: 13.5px; cursor: pointer; flex: none; }
  .shell.showwho .side { display: block; position: fixed; right: 0; top: 58px; bottom: 0; width: 280px; z-index: 30; box-shadow: var(--shadow); }
  .search { width: 200px; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #signin .wrap { grid-template-columns: 1fr; gap: 32px; }
  #signin .big { font-size: 48px; }
  .choices { grid-template-columns: 1fr; }
  .choice .shot { height: 110px; }
  .shell, .shell.wide { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }
  .rail { position: fixed; inset: 0 30% 0 0; z-index: 40; transform: translateX(-102%); transition: transform .2s; max-width: 300px; }
  .shell.showrail .rail { transform: none; box-shadow: var(--shadow); }
  .burger { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--rule); background: var(--panel); cursor: pointer; flex: none; }
  .top { padding: 10px 12px; gap: 8px; }
  .search, .crumbs { display: none; }
  .top .spacer { flex: 1; }
  .me .name { display: none; }
  .content { padding: 18px 16px 30px; }
  .head h1 { font-size: 26px; }
  .since { grid-template-columns: 1fr 1fr; }
  .news:nth-child(3) { border-left: 0; }
  .news:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .fgrid, .lgrid, .mgrid, .tgrid { grid-template-columns: minmax(0, 1fr); }
  .fgrid .flist, .lgrid .flist { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .fgrid .f, .lgrid .f { flex: none; border: 1px solid var(--rule); }
  .mgrid.reading .mlist { display: none; }
  .mgrid:not(.reading) .mread { display: none; }
  .tgrid .tside { display: none; }
  .frow { grid-template-columns: minmax(0, 1fr) auto; }
  .frow .hide-s { display: none; }
  .form .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv div:nth-child(odd) { padding-bottom: 0; border-top: 1px solid var(--rule); background: none; font-size: 13px; }
  .kv div:nth-child(even) { border-top: 0; }
  .barrow { grid-template-columns: 1fr 60px; }
  .barrow .b { grid-column: 1 / -1; grid-row: 2; }
  .tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border-top: 1px solid var(--rule); padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); text-align: center; font-size: 11.5px; color: var(--ink-2); z-index: 20; }
  .tabbar button { background: none; border: 0; color: inherit; cursor: pointer; position: relative; padding: 0; }
  .tabbar i { display: block; margin: 0 auto 3px; width: 26px; height: 26px; border-radius: 6px; font: 800 13px/26px "Bricolage"; font-style: normal; color: #fff; background: var(--c); }
  .tabbar .on { color: var(--ink); font-weight: 700; }
  .tabbar .count { position: absolute; top: -4px; left: 55%; font-size: 11px; font-weight: 700; color: #18233a; background: var(--badge); border-radius: 8px; padding: 0 5px; }
  #toasts { bottom: 78px; right: 16px; }
}
@media (min-width: 861px) { .tabbar { display: none; } }

/* ================================================================ native games */
.game .head { margin-bottom: 16px; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.glob-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.gstart { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; display: grid; gap: 12px; justify-items: start; }
.gchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--rule); background: var(--paper); border-radius: 16px; padding: 4px 12px; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip:hover, .chip.on { border-color: var(--fun); background: var(--sel); }
.ghelp summary { cursor: pointer; font-weight: 700; }
.ghelp pre { margin: 10px 0 0; font: 14px/1.5 Menlo, Consolas, "DejaVu Sans Mono", monospace; white-space: pre-wrap; }
.gscores .row { font-size: 14.5px; }
.gscores .num { text-align: right; font-variant-numeric: tabular-nums; }
.gplay { display: grid; gap: 12px; }
.garea { outline: none; min-width: 0; }
.gprompt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 0; }
.gprompt:empty { display: none; }
.gprompt .ptext { font-weight: 700; white-space: pre-wrap; }
.gprompt input { flex: 1; min-width: 160px; border: 1px solid var(--rule); border-radius: 7px; padding: 8px 12px; background: var(--field); }
.glog { background: #0b0d12; color: #c9cfdc; border-radius: 9px; padding: 12px 14px; font: 14px/1.45 Menlo, Consolas, "DejaVu Sans Mono", monospace; max-height: 340px; overflow-y: auto; white-space: pre-wrap; }
.glog .ansi { font-family: inherit; }
.gmsg { font-weight: 700; min-height: 1.5em; }
.gmsg.good { color: var(--comms); }
.gmsg.bad { color: var(--alert); }
.gctrl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gstats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-variant-numeric: tabular-nums; }
.gstats span { display: grid; line-height: 1.2; }
.gstats small { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.gstats b { font-size: 17px; }
.gstats .good b { color: var(--comms); }
.gstats .bad b { color: var(--alert); }
.gcanvas { display: block; border-radius: 10px; max-width: 100%; touch-action: none; }
.gtouch { display: none; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.gtouch button { min-width: 64px; min-height: 52px; border: 1px solid var(--rule); background: var(--panel); border-radius: 10px; font-weight: 700; font-size: 16px; touch-action: none; user-select: none; -webkit-user-select: none; }
.gtouch button:active { background: var(--sel); }
@media (pointer: coarse) { .gtouch { display: flex; } }
.ld-wrap, .fr-wrap, .sc-wrap { display: grid; gap: 10px; }

/* hangman */
.hm { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 28px; align-items: start; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; }
.hm-gallows svg { width: 100%; height: auto; }
.hm-main { display: grid; gap: 12px; }
.hm-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-tile { width: 40px; height: 48px; border-radius: 7px; background: var(--info); display: grid; place-items: center; font: 800 24px/1 "Bricolage"; color: #fff; }
.hm-tile.open { background: var(--paper); color: var(--ink); border: 2px solid var(--rule); }
.hm-tile.missed { background: var(--alert); color: #fff; border: 0; }
.hm-meter { display: flex; gap: 4px; }
.hm-meter i { width: 22px; height: 8px; border-radius: 3px; background: var(--rule); }
.hm-meter i.on { background: var(--alert); }
.hm-keys { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; max-width: 600px; }
.hm-key { aspect-ratio: 1; border: 1px solid var(--rule); background: var(--paper); border-radius: 7px; font: 700 16px/1 "Bricolage"; cursor: pointer; color: var(--ink); }
.hm-key:hover:not(:disabled) { border-color: var(--fun); }
.hm-key.hit { background: var(--comms); color: #fff; border-color: var(--comms); }
.hm-key.miss { background: transparent; color: var(--alert); text-decoration: line-through; opacity: .6; }
.hm-key:disabled { cursor: default; }

/* playing cards */
.bj-felt { background: radial-gradient(ellipse at 50% 30%, #1f8a4f, #11592f); border-radius: 18px; padding: 18px 22px; color: #eaf6ee; display: grid; gap: 10px; box-shadow: inset 0 0 0 6px #0c3f22; }
.bj-label { font-weight: 700; letter-spacing: .04em; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.bj-label span { font-weight: 400; color: #ffe08a; }
.bj-label .chipbet { color: #cfe9d7; font-size: 14px; }
.bj-rule { text-align: center; color: #ffe08a; font: 700 13px/1 "Atkinson"; letter-spacing: .12em; text-transform: uppercase; opacity: .85; margin: 6px 0; }
.bj-cards { display: flex; gap: 0; min-height: 112px; flex-wrap: wrap; }
.bj-cards .pcard + .pcard { margin-left: -28px; }
.bj-hands { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.bj-hand { padding: 8px; border-radius: 12px; }
.bj-hand.active { box-shadow: 0 0 0 2px #ffe08a; }
.bj-out { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 6px; font-weight: 800; background: #b6362a; }
.bj-out.good { background: #f2c94c; color: #18233a; }
.bj-out:not(.good):not(.bad) { background: #dfe5f0; color: #18233a; }
.pcard { position: relative; width: 78px; height: 110px; border-radius: 9px; background: #fff; color: #18233a; box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 1px solid #c9d0db; font: 700 16px/1 "Bricolage"; flex: none; }
.pcard.red { color: #c23a2e; }
.pcard .tl { position: absolute; left: 7px; top: 7px; text-align: center; }
.pcard .br { position: absolute; right: 7px; bottom: 7px; text-align: center; transform: rotate(180deg); }
.pcard .mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; }
.pcard.back { background: repeating-linear-gradient(45deg, #2d57c8 0 6px, #2448a8 6px 12px); border: 4px solid #fff; }
.pcard.small { width: 54px; height: 76px; font-size: 13px; }
.pcard.small .mid { font-size: 22px; }
.betin { width: 110px; border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; background: var(--field); font-size: 16px; }

/* dice */
.ya { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ya-dice { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.ya-slot { display: grid; justify-items: center; gap: 4px; }
.ya-slot small { font-weight: 700; color: var(--ink-3); font-size: 12px; }
.die { width: 72px; height: 72px; border-radius: 14px; background: #fff; border: 2px solid #c9d0db; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 10px; gap: 2px; cursor: pointer; box-shadow: 0 3px 0 #c9d0db; }
.die i { border-radius: 50%; }
.die i.pip { background: #18233a; margin: 3px; }
.die.held { background: #f2c94c; border-color: #a87b0c; box-shadow: 0 3px 0 #a87b0c; }
.rolling .die:not(.held) { animation: shake .14s linear infinite; }
@keyframes shake { 50% { transform: rotate(8deg) translateY(-2px); } }
.ya-rolls { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.ya-rolls i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--fun); }
.ya-rolls i.on { background: var(--fun); }
.ya-row { grid-template-columns: 28px minmax(0, 1fr) 50px; padding: 7px 12px; font-size: 14.5px; }
button.ya-row { cursor: pointer; }
button.ya-row:disabled { cursor: default; color: var(--ink); }
.ya-row b { text-align: right; font-variant-numeric: tabular-nums; }
.ya-row.filled { color: var(--ink-3); }
.ya-row.filled b { color: var(--ink); }
.ya-row.good b { color: var(--comms); }
.ya-row.sub { color: var(--ink-3); font-size: 13.5px; background: var(--paper); }
.ya-row.total { font-weight: 800; font-size: 16px; }

/* scorched earth */
.sc-tanks { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-tank { border: 1px solid var(--rule); border-left: 5px solid var(--tc); background: var(--panel); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: auto 80px auto; gap: 8px; align-items: center; font-size: 14px; }
.sc-tank.on { box-shadow: 0 0 0 2px var(--tc); }
.sc-tank.dead { opacity: .45; }
.sc-tank .hp { height: 8px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.sc-tank .hp i { display: block; height: 100%; background: var(--tc); }

@media (max-width: 860px) {
  .glob-grid, .hm, .ya { grid-template-columns: minmax(0, 1fr); }
  .hm-gallows { max-width: 200px; }
  .hm-keys { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .pcard { width: 60px; height: 86px; font-size: 14px; }
  .pcard .mid { font-size: 26px; }
  .bj-cards .pcard + .pcard { margin-left: -20px; }
  .bj-cards { min-height: 88px; }
  .die { width: 54px; height: 54px; padding: 7px; }
}

/* shared game panels */
.gpanels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.gpanel { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.gpanel h3 { font-size: 17px; }
.gpanel p { margin: 0; }
.gform { display: grid; gap: 10px; }
.gform small { display: block; color: var(--ink-3); font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.gform input[type=text] { border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; width: 100%; background: var(--field); }
.chip input { accent-color: var(--fun); }
.kv.small div { padding: 5px 10px; font-size: 13.5px; }
.ll-log { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; max-height: 220px; overflow-y: auto; color: var(--ink-2); }
.ll-log div:last-child { color: var(--ink); font-weight: 700; }
.ll-prompt { font-weight: 700; }
.gold { color: var(--gold); font-weight: 700; } .radio { color: var(--serv); } .bad { color: var(--alert); }

/* pente */
.pe { display: grid; grid-template-columns: minmax(0, 600px) minmax(240px, 1fr); gap: 22px; align-items: start; }
.pe-wrap svg { width: 100%; height: auto; display: block; }
.pe-l { font: 700 12px "Atkinson"; fill: #5b3b17; text-anchor: middle; }
.pe-x { font: 800 18px "Atkinson"; fill: #c23a2e; text-anchor: middle; }
.pe-hit { fill: transparent; cursor: pointer; }
.pe-hit:hover { fill: rgba(255,255,255,.45); }
.pe-side { display: grid; gap: 10px; }
.pe-p.on { box-shadow: inset 3px 0 0 var(--fun); background: var(--sel); }
.pe-p.out { opacity: .5; }
.pe-stone { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #0005; }
.pe-caps { display: flex; gap: 3px; }
.pe-caps i { width: 8px; height: 14px; border-radius: 2px; background: var(--rule); }
.pe-caps i.on { background: var(--alert); }
.pe-chat { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 8px 12px; font-size: 14px; max-height: 170px; overflow-y: auto; min-height: 60px; }
.pe-side input { border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; background: var(--field); }

/* landlord */
.ll { display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 1fr); gap: 20px; align-items: start; }
.ll-board { display: grid; grid-template-columns: 1.4fr repeat(9, 1fr) 1.4fr; grid-template-rows: 1.4fr repeat(9, 1fr) 1.4fr; aspect-ratio: 1; gap: 2px; background: #1f6b3f; padding: 4px; border-radius: 12px; }
.ll-sq { position: relative; background: #eef5ec; color: #18233a; border: 0; border-radius: 3px; padding: 2px; font-size: 10.5px; line-height: 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; min-width: 0; }
.ll-sq.focus { outline: 3px solid #f2c94c; z-index: 1; }
.ll-sq.mort { opacity: .55; }
.ll-sq small { color: #4a5670; font-size: 9.5px; }
.ll-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.ll-band { position: absolute; left: 0; right: 0; top: 0; height: 18%; }
.ll-band.wide { position: static; display: block; height: 10px; border-radius: 4px; }
.ll-own { position: absolute; right: 2px; bottom: 2px; width: 8px; height: 8px; border-radius: 50%; }
.ll-h { position: absolute; left: 2px; bottom: 1px; color: #1e8a4e; font-size: 10px; }
.ll-toks { display: flex; gap: 1px; flex-wrap: wrap; justify-content: center; }
.ll-tok { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: #fff; font: 800 10px/1 "Atkinson"; box-shadow: 0 0 0 1px #fff; }
.ll-tok.big { width: 24px; height: 24px; font-size: 13px; }
.ll-center { grid-row: 2 / 11; grid-column: 2 / 11; background: #f6faf5; border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 8px; color: #18233a; min-height: 0; overflow: hidden; }
.ll-center .ll-log { flex: 1; max-height: none; background: #fff; color: #4a5670; border-color: #d3d9e3; }
.ll-center .ll-log div:last-child { color: #18233a; }
.ll-title { font: 800 26px/1 "Bricolage"; letter-spacing: .2em; text-align: center; color: #1e8a4e; }
.ll-dice { display: flex; gap: 10px; justify-content: center; }
.ll-dice .die { width: 44px; height: 44px; padding: 5px; cursor: default; }
.ll-info { margin-top: 12px; }

/* life */
.lf { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.lf-road { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-bottom: 12px; }
.lf-sp { position: relative; aspect-ratio: 1.15; border-radius: 8px; background: var(--panel); border: 2px solid var(--k); display: grid; place-items: center; font: 800 14px/1 "Bricolage"; color: var(--k); }
.lf-sp.stop { box-shadow: 0 0 0 2px var(--gold); }
.lf-toks { position: absolute; bottom: -4px; display: flex; gap: 1px; }
.lf-tok { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; font: 800 10px/1 "Atkinson"; box-shadow: 0 0 0 1px #fff; }
.lf-wheel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.lf-wheel span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 2px solid var(--rule); font: 800 18px/1 "Bricolage"; }
.lf-wheel span.on { background: var(--serv); color: #fff; border-color: var(--serv); }
.lf .gctrl { margin: 8px 0 12px; }

/* taipan */
.tp { display: grid; gap: 14px; }
.tp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.tp-head h2 { font-size: 24px; }
.tp-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.tp-goods .row { grid-template-columns: 1.2fr 1fr 1fr 1fr; font-variant-numeric: tabular-nums; }
.tp-sea { background: linear-gradient(#0e3a6b, #08213f); color: #e8f1ff; border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.tp-title { font: 800 22px/1 "Bricolage"; color: #ffb347; }
.tp-ships { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tp-ship { font-size: 40px; text-align: center; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.06); }
.tp-ship.gone { opacity: .25; }
.tp-ship.hit { background: rgba(255,179,71,.35); }
.tp-report { font-weight: 700; color: #ffd75e; }
.tp-sea .gstats small { color: #9fb4d6; }

/* trek */
.tr { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr) minmax(0, 300px); gap: 20px; align-items: start; }
.tr-h { margin-bottom: 6px; }
.tr-sector { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: #05070d; padding: 6px; border-radius: 10px; }
.tr-c { aspect-ratio: 1; border: 0; border-radius: 4px; background: #11182a; color: #8b95a8; font: 700 15px/1 "Atkinson"; cursor: pointer; }
.tr-c:hover { background: #1b2540; }
.tr-c.sel { outline: 2px solid #f2c94c; }
.tr-c.me { color: #4fd3e3; background: #12324a; }
.tr-c.k-R { color: #ff6b5e; } .tr-c.k-B { color: #55e07f; } .tr-c.k-\* { color: #ffd75e; } .tr-c.k-S { color: #e07ad0; }
.tr-galaxy { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: #05070d; padding: 6px; border-radius: 10px; font: 12px/1 Menlo, Consolas, monospace; }
.tr-g { aspect-ratio: 1.2; display: grid; place-items: center; background: #11182a; color: #6e7990; border-radius: 3px; }
.tr-g.red { color: #ff6b5e; } .tr-g.base { color: #55e07f; } .tr-g.fleet { background: #3a1f45; } .tr-g.me { background: #2aa6b6; color: #05070d; font-weight: 700; }
.tr-cmds { display: grid; gap: 6px; margin: 10px 0; }
.tr-cmd { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.tr-cmd b { font-size: 14px; }
.tr-cmd:has(input:only-of-type) { grid-template-columns: 74px minmax(0, 1fr) auto; }
.tr-in, .tr-free { border: 1px solid var(--rule); border-radius: 7px; padding: 6px 8px; background: var(--field); min-width: 0; width: 100%; }
.tr-log { margin-top: 14px; font-family: Menlo, Consolas, monospace; font-size: 13px; }

/* dungeon */
.dn { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.dn-left { display: grid; gap: 10px; }
.dn-room { font-size: 15px; }
.dn-log { background: #0b0d12; color: #c9cfdc; border-radius: 9px; padding: 8px 12px; font-size: 13.5px; height: 150px; overflow-y: auto; }
.dn-right { display: grid; gap: 12px; }
.dn-svg { width: 100%; height: auto; display: block; }
.dn-pad .btn { min-width: 48px; font-size: 18px; }
.dn-say { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; background: var(--field); }

@media (max-width: 1100px) {
  .pe, .ll, .lf, .tr, .dn, .tp-grid { grid-template-columns: minmax(0, 1fr); }
  .tr > div:first-child { max-width: 420px; }
}
@media (max-width: 860px) {
  .ll-sq { font-size: 8px; } .ll-sq small { display: none; }
  .lf-road { grid-template-columns: repeat(12, 1fr); gap: 2px; } .lf-sp { font-size: 10px; border-width: 1px; }
  .tp-ship { font-size: 26px; }
}

/* ---------------------------------------------------------------- sign-up */
#signup { min-height: 100vh; background: #18233a; color: #fff; padding: 40px 16px 64px; }
.su-wrap { width: min(820px, 100%); margin: 0 auto; }
.su-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
#signup .big { font: 800 52px/.95 "Bricolage"; font-stretch: 76%; letter-spacing: -.025em; overflow-wrap: anywhere; }
#signup .big small { display: block; font: 400 16px/1.5 "Atkinson"; color: #a9b4c9; margin-top: 14px; letter-spacing: 0; font-stretch: 100%; max-width: 520px; }
.su-back { background: none; border: 1px solid #3b4a68; color: #cfd8e8; border-radius: 8px; padding: 9px 14px; cursor: pointer; font-size: 14.5px; }
.su-back:hover { border-color: #9fc1ff; color: #fff; }
#su-form { margin-top: 28px; display: grid; gap: 18px; }
.su-card { background: #fff; color: #18233a; border-radius: 12px; padding: 22px 24px; }
.su-card h2 { font: 700 20px/1.2 "Bricolage"; margin: 0 0 4px; }
.su-card > p.muted { margin: 0 0 14px; color: #5b6578; font-size: 14.5px; }
.su-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.su-f { display: grid; gap: 5px; align-content: start; }
.su-f.wide { grid-column: 1 / -1; }
.su-f label { font-weight: 700; font-size: 14px; }
.su-f label i { font-weight: 400; font-style: normal; color: #6b7487; }
.su-f input, .su-f select { border: 1px solid #c9d1de; border-radius: 8px; padding: 10px 12px; font-size: 16px; width: 100%; background: #fff; color: #18233a; }
.su-f input:focus, .su-f select:focus { outline: 2px solid #2f6fdf; outline-offset: 0; border-color: #2f6fdf; }
.su-f.bad input, .su-f.bad select { border-color: #c4372b; background: #fff6f5; }
.su-f .su-msg { font-size: 13.5px; color: #6b7487; min-height: 0; }
.su-f.bad .su-msg { color: #b3261e; }
.su-f.good .su-msg { color: #1e7d45; }
.su-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.su-seg label { font-weight: 400; border: 1px solid #c9d1de; border-radius: 8px; padding: 8px 14px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.su-seg label:has(input:checked) { border-color: #2f6fdf; background: #eaf1ff; }
.su-seg input { width: auto; }
.su-disc { background: #0b1220; color: #d7deea; border-radius: 8px; padding: 14px 16px; font: 13.5px/1.45 "Mono", ui-monospace, monospace; white-space: pre-wrap; max-height: 300px; overflow: auto; margin-bottom: 14px; }
.su-warn { background: #fff7db; border: 1px solid #f2c94c; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.su-err { background: #5a1f1a; color: #ffd9d4; border-radius: 8px; padding: 12px 14px; font-size: 15px; }
.su-closed { background: #fff; color: #18233a; border-radius: 12px; padding: 24px; }
.su-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.su-actions .go { margin-top: 0; }
.su-actions span { color: #a9b4c9; font-size: 14px; }
.su-strength { height: 6px; border-radius: 3px; background: #e3e8f0; overflow: hidden; }
.su-strength i { display: block; height: 100%; width: 0; background: #c4372b; transition: width .2s, background .2s; }
@media (max-width: 640px) { .su-grid { grid-template-columns: 1fr; } #signup .big { font-size: 40px; } .su-card { padding: 18px 16px; } }

/* ---------------------------------------------------------------- private chat */
.chatreq { align-items: center; }
.chatreq .av { flex: none; }
.cr-btns { display: flex; gap: 8px; margin-top: 8px; }
.chatreq .btn.ghost { color: var(--paper); border-color: rgba(255,255,255,.35); }
.chatpanel { position: fixed; right: 18px; bottom: 18px; width: min(360px, calc(100vw - 32px)); height: min(460px, calc(100vh - 120px)); z-index: 45;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; animation: up .18s ease-out; }
.chatpanel.min { height: auto; grid-template-rows: auto; width: min(280px, calc(100vw - 32px)); }
.chatpanel header { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--comms); color: #fff; cursor: default; }
.chatpanel.min header { cursor: pointer; }
.chatpanel header > div { flex: 1; min-width: 0; display: grid; }
.chatpanel header b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatpanel header small { font-size: 12.5px; opacity: .85; }
.cp-ic { background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; }
.cp-ic:hover { background: rgba(255,255,255,.18); }
.cp-unread { background: var(--badge); color: #18233a; border-radius: 10px; padding: 1px 8px; font-size: 12.5px; font-weight: 700; }
.cp-log { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); }
.cp-line { display: flex; }
.cp-line span { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px 12px 12px 4px; padding: 7px 11px; max-width: 85%; overflow-wrap: anywhere; font-size: 14.5px; white-space: pre-wrap; }
.cp-line.me { justify-content: flex-end; }
.cp-line.me span { background: var(--comms); color: #fff; border-color: transparent; border-radius: 12px 12px 4px 12px; }
.cp-line.typing span { color: var(--ink-2); border-style: dashed; font-style: italic; }
.cp-caret { display: inline-block; width: 2px; height: 1em; background: currentColor; margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cp-sys { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 2px 8px; }
.cp-foot { padding: 10px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; }
.cp-foot input { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px; font-size: 15px; background: var(--field); color: var(--ink); }
@media (max-width: 760px) { .chatpanel { bottom: 74px; right: 12px; } }
body.chatting #toasts { right: 392px; }
@media (max-width: 760px) { body.chatting #toasts { right: 16px; bottom: auto; top: 70px; } }

/* ---------------------------------------------------------------- operators' tools and Sysop console */
.op-sec { margin-top: 16px; }
.op-h3 { font: 700 15px/1.3 "Atkinson"; margin: 6px 0 2px; color: var(--ink); }
.op-table .row { min-height: 48px; }
.op-table .row > span { min-width: 0; overflow-wrap: anywhere; }
.op-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.op-pending { background: color-mix(in srgb, var(--badge) 14%, transparent); }
.op-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.op-bulk > .muted { min-width: 80px; font-size: 14px; }
.op-dest { display: inline-flex; gap: 6px; align-items: center; border-left: 1px solid var(--rule); padding-left: 8px; }
.op-dest select { border: 1px solid var(--rule); border-radius: 7px; padding: 5px 8px; background: var(--field); color: var(--ink); }
.op-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; }
.op-checks.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.op-checks label { font-weight: 400 !important; color: var(--ink) !important; display: flex !important; gap: 8px; align-items: center; }
.op-menu { display: grid; gap: 6px; }
.op-item { display: grid; gap: 2px; text-align: left; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--ink); padding: 10px 12px; cursor: pointer; font-size: 15px; }
.op-item span { color: var(--ink-3); font-size: 13.5px; }
.op-item:hover { border-color: var(--comms); }
.op-item.danger b { color: var(--alert); }
.op-q { border: 1px solid var(--rule); border-radius: 9px; padding: 12px 14px; display: grid; gap: 10px; background: var(--paper); }
.op-q.bad { border-color: var(--alert); }
.op-qs { display: grid; gap: 12px; }
.op-qh { display: flex; gap: 6px; align-items: center; }
.op-qh .spacer, .op-who .spacer, .filters .spacer { flex: 1; }
.op-choices { display: grid; gap: 6px; }
.op-choice { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 70px auto; gap: 6px; align-items: center; }
.op-choice input { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 9px; background: var(--field); color: var(--ink); font-size: 14.5px; width: 100%; }
.op-savebar { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 12px 0; margin-top: 16px; background: linear-gradient(transparent, var(--paper) 30%); }
.form label.inline input[type=number] { width: 80px; border: 1px solid var(--rule); border-radius: 7px; padding: 5px 8px; background: var(--field); color: var(--ink); }
.op-alert { background: color-mix(in srgb, var(--alert) 12%, var(--panel)); border: 1px solid var(--alert); border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; font-size: 14.5px; }
.op-who { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.op-who h2 { font-size: 24px; margin: 0; }
.op-who p { margin: 2px 0 0; }
.op-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.op-tile { background: var(--paper); border-radius: 8px; padding: 12px; display: grid; gap: 2px; }
.op-tile b { font: 800 24px/1 "Bricolage"; color: var(--alert); font-variant-numeric: tabular-nums; }
.op-tile span { font-size: 13px; color: var(--ink-3); }
.op-modstats { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.op-barwrap { display: flex; gap: 8px; align-items: center; }
.op-bar { display: block; height: 10px; border-radius: 3px; background: var(--alert); min-width: 2px; }
.op-auditlist { max-height: none; }
.op-audit { display: grid; grid-template-columns: 70px 170px minmax(140px, 1fr) minmax(0, 2fr); gap: 10px; padding: 8px 14px; border-top: 1px solid var(--rule); font-size: 14px; align-items: baseline; }
.op-audit:first-child { border-top: 0; }
.op-audit > span:last-child { overflow-wrap: anywhere; color: var(--ink-2); }
.op-cfg { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 160px; align-items: start; }
.op-cfg input, .op-cfg select { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 9px; background: var(--field); color: var(--ink); font-size: 14.5px; width: 100%; }
.op-cfg.op-dirty { background: color-mix(in srgb, var(--badge) 16%, transparent); }
.mono { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; }
.op-menus { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.op-tree { background: var(--panel); border: 1px solid var(--rule); border-radius: 9px; padding: 10px; max-height: 75vh; overflow: auto; position: sticky; top: 0; }
.op-tree h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 12px 8px 4px; }
.op-tree .bar { display: flex; gap: 6px; }
.op-tree .bar input { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 7px; padding: 5px 8px; background: var(--field); color: var(--ink); }
.op-node { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.op-node:hover { background: var(--sel); text-decoration: none; }
.op-node.on { background: var(--ink); color: var(--paper); }
.op-node b { font-family: Menlo, Consolas, monospace; font-size: 13px; }
.op-node span { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-node.on span { color: inherit; opacity: .8; }
.op-node.t-module b { color: var(--comms); }
.op-node.t-file b { color: var(--serv); }
.op-node.on b { color: inherit; }
.op-node.off { opacity: .5; text-decoration: line-through; }
.op-sels { display: grid; gap: 6px; margin-bottom: 8px; }
.op-sel { display: grid; grid-template-columns: 46px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr) 80px auto auto; gap: 6px; align-items: center; }
.op-sel.hdr { font-size: 12.5px; color: var(--ink-3); grid-template-columns: 46px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr) 80px 76px; }
.op-sel input, .op-sel select { border: 1px solid var(--rule); border-radius: 7px; padding: 6px 8px; background: var(--field); color: var(--ink); font-size: 14px; width: 100%; min-width: 0; }
.op-sel .op-k { text-align: center; text-transform: uppercase; font-weight: 700; }
.op-textarea { min-height: 420px !important; font-size: 13.5px !important; white-space: pre; }
.op-preview, .op-type { background: #0b1220; color: #d7deea; border-radius: 8px; padding: 12px 14px; overflow: auto; max-height: 60vh; font-size: 13px; line-height: 1.4; margin: 0; white-space: pre; }
.op-path { font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#dialog .box.wide { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.op-classform .grid2 { gap: 10px 14px; }
@media (max-width: 900px) {
  .op-menus { grid-template-columns: 1fr; }
  .op-tree { position: static; max-height: 300px; }
  .op-sel, .op-sel.hdr { grid-template-columns: 40px 1fr 1fr; }
  .op-sel.hdr span:nth-child(n+4) { display: none; }
  .op-audit { grid-template-columns: 1fr; gap: 2px; }
  .op-cfg { grid-template-columns: 1fr; }
}
.op-sec h2.sub { margin: 0; }
.op-sec .grid2, .op-classform .grid2, .op-editor .grid2 { align-items: start; }
.op-sec > p { margin: 0; }

/* ---------------------------------------------------------------- multi-player tables and in-game chat */
.gmulti { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); }
.gmulti h3 { margin: 0 0 4px; font-size: 17px; }
.gmulti p { margin: 0 0 10px; }
.gtables { margin-top: 10px; }
.gtables .row { grid-template-columns: minmax(0, 1fr) auto; }
.gwait { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 20px 22px; max-width: 760px; }
.gwait h2 { margin: 0 0 4px; }
.gseats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.gseat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 9px; background: var(--paper); }
.gseat small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.gseat.free { border-style: dashed; color: var(--ink-3); }
.gseat .av.empty { background: transparent; border: 1px dashed var(--ink-3); color: var(--ink-3); }
.gchat { margin-top: 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-width: 1100px; }
.gchat-head { padding: 9px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gchat-log { max-height: 170px; min-height: 60px; overflow-y: auto; padding: 8px 14px; display: grid; gap: 3px; align-content: start; font-size: 14.5px; }
.gchat-line b { color: var(--fun); }
.gchat-line.me b { color: var(--comms); }
.gchat-sys { color: var(--ink-3); font-size: 13px; font-style: italic; }
.gchat-in { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--rule); }
.gchat-in input { flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; background: var(--field); color: var(--ink); font-size: 14.5px; }
.gmp { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.gmp-p { border: 1px solid var(--rule); border-radius: 16px; padding: 3px 10px; font-size: 13.5px; background: var(--panel); }
.gmp-p.turn { border-color: var(--fun); background: color-mix(in srgb, var(--fun) 14%, var(--panel)); }
.gmp-p.me b { color: var(--fun); }
.gmp-p.out { opacity: .55; }
.bj-seats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.25); }
.bj-seat { min-width: 160px; }
.bj-seat.turn .bj-label { color: #ffe08a; }
.pcard.small { transform: scale(.72); transform-origin: top left; margin-right: -18px; margin-bottom: -22px; }
.tp-race { margin-top: 12px; }
.tp-race .row { grid-template-columns: minmax(0, 1fr) auto; }
.sc-msg.turn { font-weight: 700; color: var(--fun); }

/* ---------------------------------------------------------------- the Graffiti Wall */
.gw { display: grid; gap: 20px; }
.gw .head { margin-bottom: 2px; }
.gw-wall {
  position: relative; container-type: inline-size; aspect-ratio: 80 / 36; border-radius: 6px; overflow: hidden;
  background-color: #8a2a1c;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0,0,0,.28), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='40'%3E%3Crect width='96' height='40' fill='%23c9bfae'/%3E%3Cg fill='%23a8402c'%3E%3Crect x='1' y='1' width='46' height='18' rx='1'/%3E%3Crect x='49' y='1' width='46' height='18' rx='1'/%3E%3Crect x='-23' y='21' width='46' height='18' rx='1'/%3E%3Crect x='25' y='21' width='46' height='18' rx='1'/%3E%3Crect x='73' y='21' width='46' height='18' rx='1'/%3E%3C/g%3E%3Cg fill='%23000' opacity='.12'%3E%3Crect x='1' y='15' width='46' height='4'/%3E%3Crect x='49' y='15' width='46' height='4'/%3E%3Crect x='-23' y='35' width='46' height='4'/%3E%3Crect x='25' y='35' width='46' height='4'/%3E%3Crect x='73' y='35' width='46' height='4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 9cqw auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 0 -18px 40px rgba(0,0,0,.25), var(--shadow);
}
.gw-tag {
  position: absolute; white-space: nowrap; transform: translateY(-50%) rotate(var(--tilt, 0deg)); transform-origin: left center;
  font-family: "Bricolage", sans-serif; font-weight: 800; font-stretch: 78%; font-size: 2.25cqw; line-height: 1; letter-spacing: .01em;
  text-shadow: 0 0 .06em currentColor, 0 0 .35em color-mix(in srgb, currentColor 45%, transparent), .04em .05em 0 rgba(0,0,0,.35);
}
.gw-tag.dark { text-shadow: 0 0 .25em rgba(0,0,0,.6), .03em .04em 0 rgba(255,255,255,.12); }
.gw-tag.fresh { animation: gw-spray .9s ease-out both; }
@keyframes gw-spray { from { opacity: 0; filter: blur(6px); } 60% { opacity: 1; filter: blur(1px); } to { filter: none; } }
.gw-clean { position: absolute; inset: 0; display: grid; place-items: center; color: #f5f3ea; font: 800 3.4cqw/1 "Bricolage", sans-serif; font-stretch: 80%; opacity: .85; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.gw-form { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; }
.gw-form h2, .gw-all h2 { font-size: 20px; }
.gw-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gw-row input { flex: 1 1 260px; min-width: 0; }
.gw-meta { justify-content: space-between; }
.gw-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.gw-sw { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; border: 1px solid var(--rule); background: var(--field); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.gw-sw > span { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.gw-sw.rnd > span { background: conic-gradient(#ffd93a, #6dfa6d, #46e6f2, #7b95ff, #ff5ad8, #ffd93a); color: #121212; }
.gw-sw[aria-checked="true"] { border-color: var(--fun); box-shadow: 0 0 0 2px color-mix(in srgb, var(--fun) 35%, transparent); background: var(--sel); }
.gw-sw:focus-visible { outline: 2px solid var(--fun); outline-offset: 2px; }
.gw-count { font-variant-numeric: tabular-nums; font-size: 14px; }
.gw-preview { container-type: inline-size; padding: 14px 16px; border-radius: 8px; background: #a8402c; color: #f5f3ea; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 800 26px/1.1 "Bricolage", sans-serif; font-stretch: 78%; text-shadow: 0 0 .06em currentColor, 0 0 .35em color-mix(in srgb, currentColor 45%, transparent); }
.gw-preview.empty { opacity: .55; }
.gw-preview.random::after { content: '  · random colour'; font: 400 14px/1 "Atkinson", sans-serif; text-shadow: none; opacity: .8; }
.gw-preview.dark { text-shadow: 0 0 .25em rgba(0,0,0,.5); }
.gw-blocked { margin: 0; color: var(--alert); font-weight: 700; }
.gw-allhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.gw-item { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center; }
.gw-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.gw-text { font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 640px) { .gw-wall { aspect-ratio: 80 / 64; } .gw-tag { font-size: 3.6cqw; } .gw-item { grid-template-columns: 14px 1fr; } .gw-item small, .gw-item .btn { grid-column: 2; justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .gw-tag.fresh { animation: none; } }

.whomore { margin: 6px 0 0; width: 100%; }
.whoall { max-height: min(60vh, 520px); overflow-y: auto; display: grid; gap: 2px; }

/* ---------------------------------------------------------------- Lantern Quest */
.qs-wrap { display: grid; gap: 10px; }
.qs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.qs-room { font-size: 24px; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.qs-main { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; align-items: start; }
.qs-cv { min-width: 0; }
.qs-cv canvas { display: block; width: 100%; border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.35); background: #050507; image-rendering: auto; }
.qs-side { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; }
.qs-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-top: 6px; }
.qs-side h3:first-child { margin-top: 0; }
.qs-carry { display: flex; align-items: center; gap: 8px; min-height: 34px; text-transform: capitalize; font-weight: 700; }
.qs-icon { width: 32px; height: 32px; background: #2a2620; border-radius: 6px; }
.qs-shrine { display: flex; gap: 8px; }
.qs-pedestal { width: 34px; height: 34px; border-radius: 8px; border: 2px dashed var(--rule); display: grid; place-items: center; }
.qs-pedestal.on { border: 2px solid var(--gold); }
.qs-pedestal .qs-icon { width: 28px; height: 28px; background: none; }
.qs-beasts, .qs-party { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.qs-beasts li { font-weight: 700; color: var(--c); }
.qs-beasts li::before { content: "◆ "; }
.qs-beasts li.gone { color: var(--ink-3); text-decoration: line-through; font-weight: 400; }
.qs-party li { border-left: 4px solid var(--c); padding-left: 8px; display: grid; }
.qs-party small { color: var(--ink-3); }
.qs-map { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 18px); gap: 3px; width: 150px; }
.qs-cell { border-radius: 3px; background: transparent; border: 1px dashed var(--rule); }
.qs-cell.seen { background: var(--c); border: 0; opacity: .75; }
.qs-cell.here { outline: 2px solid var(--ink); outline-offset: 1px; opacity: 1; }
.qs-msg { min-height: 1.4em; font-weight: 700; }
.qs-news { min-height: 1.3em; color: var(--ink-2); font-size: 14px; }
.qs-levels { display: grid; gap: 14px; max-width: 760px; }
.qs-lv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qs-lvb { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.qs-lvb b { font: 800 20px/1.1 "Bricolage", sans-serif; color: var(--fun); }
.qs-lvb span { color: var(--ink-2); font-size: 14px; }
.qs-lvb:hover, .qs-lvb:focus-visible { border-color: var(--fun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fun) 25%, transparent); outline: none; }
@media (max-width: 860px) { .qs-main { grid-template-columns: 1fr; } .qs-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qs-lv { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Comet Crusher, Spam Attack */
.cc-wrap, .sa-wrap, .bb-wrap { display: grid; gap: 10px; max-width: 1000px; }
.cc-cv canvas, .sa-cv canvas, .bb-cv canvas { display: block; width: 100%; border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.cc-msg, .sa-msg, .bb-msg { min-height: 1.4em; font-weight: 700; }

.pe-over { border: 2px solid var(--fun); border-radius: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--fun) 8%, var(--panel)); display: grid; gap: 8px; }
.pe-over h3 { font-size: 20px; }
.pe-over p { margin: 0; font-weight: 700; }
.pe-over .gctrl { margin: 0; }

/* ---------------------------------------------------------------- Wordsmith */
.ws { display: grid; grid-template-columns: minmax(0, 640px) minmax(240px, 1fr); gap: 20px; align-items: start; }
.ws-board { display: grid; grid-template-columns: 18px repeat(15, 1fr); gap: 2px; background: #2c3a52; padding: 6px; border-radius: 12px; }
.ws-lab { font-size: 10px; color: #9aa6bd; display: flex; align-items: center; justify-content: center; }
.ws-sq { aspect-ratio: 1; border: 0; border-radius: 4px; padding: 0; background: #d9d2bf; color: #fff; font: 700 clamp(7px, 1.3vw, 11px)/1 var(--font, system-ui); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; min-width: 0; }
.ws-sq.ws-tw { background: #c8423a; }
.ws-sq.ws-dw { background: #e58fa0; }
.ws-sq.ws-tl { background: #2f74c0; }
.ws-sq.ws-dl { background: #8cc4ea; color: #183450; }
.ws-sq.tile { background: linear-gradient(#f6e7b8, #e9d394); color: #2a2213; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.ws-sq.tile b { font-size: clamp(11px, 2.2vw, 19px); }
.ws-sq.tile small { position: absolute; right: 2px; bottom: 1px; font-size: clamp(6px, .9vw, 9px); font-weight: 600; }
.ws-sq.tile.last { background: linear-gradient(#ffe9a6, #f2c85a); box-shadow: 0 0 0 2px #f08c1c inset; }
.ws-sq.tile.mine { background: linear-gradient(#fff6d6, #f4df9e); box-shadow: 0 0 0 2px #2e9e57 inset; }
.ws-sq.cur { outline: 3px solid #2e9e57; outline-offset: -1px; z-index: 1; }
.ws-sq.cur::after { position: absolute; color: #2e9e57; font-size: 11px; text-shadow: 0 0 2px #fff; }
.ws-sq.cur.ac::after { content: '→'; right: -2px; top: -4px; }
.ws-sq.cur.dn::after { content: '↓'; bottom: -6px; left: 40%; }
.ws-under { display: grid; gap: 10px; margin-top: 12px; }
.ws-rack { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-tile { width: 44px; height: 44px; border: 0; border-radius: 6px; background: linear-gradient(#f6e7b8, #e9d394); color: #2a2213; position: relative; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.ws-tile b { font-size: 22px; }
.ws-tile small { position: absolute; right: 4px; bottom: 2px; font-size: 10px; font-weight: 600; }
.ws-tile.used { opacity: .25; }
.ws-tile.pick { box-shadow: 0 0 0 3px #2e9e57; transform: translateY(-3px); }
.ws-tile:disabled { cursor: default; }
.ws-side { display: grid; gap: 12px; }
.ws-score { font-size: 20px; }
.ws-key { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; color: var(--muted); }
.ws-key .ws-sq { display: inline-flex; width: 26px; height: 22px; aspect-ratio: auto; cursor: default; font-size: 10px; }
.ws-log { max-height: 260px; overflow: auto; font-size: 13px; display: grid; gap: 4px; }
.ws-log div:first-child { font-weight: 600; }
@media (max-width: 820px) { .ws { grid-template-columns: 1fr; } .ws-board { padding: 3px; gap: 1px; grid-template-columns: 12px repeat(15, 1fr); } .ws-tile { width: 38px; height: 38px; } }
.gchips .btn.ghost.on { background: var(--c, var(--fun)); color: #fff; border-color: transparent; }

/* ---------------------------------------------------------------- Backgammon */
.bg { display: grid; grid-template-columns: minmax(0, 700px) minmax(240px, 1fr); gap: 20px; align-items: start; }
.bg-main { display: grid; gap: 12px; }
.bg-board { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.bg-frame { fill: #5b3a21; }
.bg-felt { fill: #2f6b4f; }
.bg-bar { fill: #4a2e19; }
.bg-pt polygon { transition: fill .15s; }
.bg-pt.a polygon { fill: #e8d7b0; }
.bg-pt.b polygon { fill: #b6452f; }
.bg-pt.from { cursor: pointer; }
.bg-pt.from:hover polygon, .bg-pt.sel polygon { filter: brightness(1.15); }
.bg-pt.target { cursor: pointer; }
.bg-pt.target polygon { fill: #59d68b; }
.bg-hit { fill: transparent; }
.bg-num { font: 600 9px var(--font, system-ui); fill: #d9c7a0; text-anchor: middle; }
.bg-num.last { fill: #ffd34d; font-weight: 800; }
.bg-ck { stroke-width: 2; }
.bg-ck.w { fill: #f6f2e8; stroke: #8c8170; }
.bg-ck.r { fill: #c93a2f; stroke: #6f1a13; }
.bg-ck.lift { stroke: #59d68b; stroke-width: 4; }
.bg-count { font: 800 13px var(--font, system-ui); text-anchor: middle; pointer-events: none; }
.bg-count.w { fill: #3a3326; }
.bg-count.r { fill: #fff; }
.bg-barck.from { cursor: pointer; }
.bg-tray rect { fill: #3b2414; }
.bg-tray.target { cursor: pointer; }
.bg-tray.target rect.mine { fill: #2e9e57; }
.bg-offck.w { fill: #f6f2e8; }
.bg-offck.r { fill: #c93a2f; }
.bg-traylab { font: 700 10px var(--font, system-ui); fill: #e9dcc0; text-anchor: middle; pointer-events: none; }
.bg-die rect { fill: #fffdf6; stroke: #2b2b2b; stroke-width: 1.5; }
.bg-die circle { fill: #1f1f1f; }
.bg-die.used { opacity: .35; }
.bg-players .row { align-items: center; }
.bg-chip { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 2px solid #8c8170; }
.bg-chip.w { background: #f6f2e8; }
.bg-chip.r { background: #c93a2f; border-color: #6f1a13; }
.bg-pips { text-align: right; white-space: nowrap; }
@media (max-width: 860px) { .bg { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Crossword */
.cw { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: 24px; align-items: start; }
.cw-main { display: grid; gap: 12px; }
.cw-grid { display: grid; gap: 2px; padding: 2px; max-width: 560px; }
.cw-x { background: transparent; }
.cw-sq { position: relative; border: 0; padding: 0; background: #fff; color: #17202f; aspect-ratio: 1; min-width: 0; font: 700 clamp(13px, 2.6vw, 24px)/1 inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px #39445a; border-radius: 2px; }
.cw-sq small { position: absolute; left: 2px; top: 1px; font-size: clamp(7px, 1vw, 10px); font-weight: 600; color: #4a5670; }
.cw-sq.word { background: #cfe7f5; }
.cw-sq.cur { background: #f6cf55; }
.cw-sq.wrong { color: #c23a2e; text-decoration: line-through; }
.cw-sq.shown { color: #2d57c8; }
.cw-cur { font-size: 17px; padding: 10px 14px; border-radius: 10px; background: #cfe7f5; color: #17202f; }
.cw-clock { font-variant-numeric: tabular-nums; }
.cw-side { display: grid; gap: 14px; max-height: 80vh; overflow: auto; }
.cw-clues { display: grid; gap: 2px; }
.cw-clue { text-align: left; border: 0; background: none; color: inherit; font: inherit; font-size: 15px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.cw-clue b { display: inline-block; min-width: 1.6em; }
.cw-clue:hover { background: var(--sel); }
.cw-clue.on { background: #cfe7f5; color: #17202f; }
.cw-clue.full { opacity: .55; }
.cw-kb { display: none; gap: 4px; }
.cw-kb div { display: flex; gap: 4px; justify-content: center; }
.cw-kb button { flex: 1; max-width: 38px; height: 40px; border: 0; border-radius: 6px; background: var(--sel); color: var(--ink); font-weight: 700; }
.cw-kb button.wide { max-width: 52px; flex: 1.4; }
@media (max-width: 820px), (pointer: coarse) { .cw-kb { display: grid; } }
@media (max-width: 820px) { .cw { grid-template-columns: 1fr; } .cw-side { max-height: none; } }
.ws-ctrl .gctrl { flex-wrap: wrap; }
.cw-sq.bot { color: #9b3a8a; }
.cw-race { display: flex; gap: 10px; }
.cw-race span { flex: 1; padding: 10px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--rule); }
.cw-race span b { font-size: 22px; margin-right: 4px; }
.cw-race span.bot b { color: #9b3a8a; }

/* ---------------------------------------------------------------- Iron Keep */
.kp-wrap { display: grid; gap: 10px; }
.kp-main { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: start; }
.kp-cv canvas { border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.kp-map { display: grid; gap: 4px; aspect-ratio: 1; }
.kp-room { border-radius: 4px; background: #2a2d35; border: 1px solid #3a3e48; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.kp-room.seen { background: #4a4f5b; }
.kp-room.me { background: #c99a2e; }
.kp-room.friend { background: #2f7f8c; }
.kp-room.gate { background: #3f8f4a; }
.kp-items { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.kp-item { padding: 6px 10px; border-radius: 8px; background: var(--sel); }
.kp-item.plans { background: #f6cf55; color: #17202f; font-weight: 700; }
@media (max-width: 820px) { .kp-main { grid-template-columns: 1fr; } .kp-map { max-width: 220px; } }

/* ---------------------------------------------------------------- Rotor Rescue */
.rr-wrap { display: grid; gap: 10px; }
.rr-cv canvas { border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.kp-map { aspect-ratio: auto; grid-auto-rows: 28px; }
.kp-room.down { background: #2f6f8c; }
.kp-levels { display: flex; gap: 4px; margin-bottom: 8px; }
.kp-levels span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 3px 0; border-radius: 4px; background: #2a2d35; color: #8b93a5; }
.kp-levels span.on { background: #c99a2e; color: #17202f; }
.kp-levels span.done { background: #3f8f4a; color: #fff; }
