/* Sorcery & Sin: crimson velvet, gold filigree and violet magic, from the company banner. */
:root {
  --night: #12040c;
  --velvet: #2a0716;
  --panel: rgba(46, 10, 30, 0.86);
  --panel2: rgba(70, 16, 44, 0.7);
  --line: rgba(232, 184, 92, 0.3);
  --gold: #e8b85c;
  --gold2: #ffe3a3;
  --rose: #ff3d8b;
  --emerald: #3ee08f;
  --text: #f6e9ef;
  --muted: #c4a3b4;
  --bad: #ff6b6b;
  --serif: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--night); }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.45 var(--sans);
  color: var(--text);
  background: radial-gradient(ellipse at 15% -10%, #5a0c2e 0%, transparent 55%),
              radial-gradient(ellipse at 100% 0%, #3a0d4a 0%, transparent 45%),
              linear-gradient(180deg, var(--velvet), var(--night) 65%);
  background-attachment: fixed;
}
#app { max-width: 1180px; margin: 0 auto; padding: 0 14px 40px; }
a { color: var(--gold); }
a:hover { color: var(--gold2); }
h1, h2, h3 { font-family: var(--serif); letter-spacing: .04em; margin: 0 0 8px; }
h2 { font-size: 1.15rem; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; }
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--muted); font-family: var(--serif); }

.crest { display: block; width: 100%; max-height: 380px; object-fit: cover; object-position: center 35%; border-radius: 0 0 16px 16px; border: 1px solid var(--line); border-top: 0; box-shadow: 0 10px 40px rgba(255, 61, 139, .18); }
.crest.big { max-height: none; border-radius: 16px; border-top: 1px solid var(--line); margin-top: 18px; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 999px; padding: 7px 14px; font: 600 .95rem var(--serif); cursor: pointer; }
.tab:hover { color: var(--gold2); }
.tab.on { color: var(--gold2); border-color: var(--line); background: var(--panel2); }
.who { margin-left: auto; color: var(--muted); font-size: .9rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; backdrop-filter: blur(4px); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

input, select, button { font: inherit; }
input[type=text], input[type=password], input[type=search], input[type=number] {
  background: rgba(10, 2, 8, .55); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0;
}
input:focus { outline: 2px solid var(--rose); outline-offset: 1px; }
.btn { background: linear-gradient(180deg, #f0c76e, #c9922f); color: #2a0716; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--line); }
.err { color: var(--bad); }

.search { position: relative; }
.search input { width: 100%; font-size: 1.05rem; padding: 12px 14px; }
.sugg { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; background: #2a0716; border: 1px solid var(--line); border-radius: 10px; max-height: 320px; overflow: auto; }
.sugg button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; background: none; border: 0; color: var(--text); padding: 8px 12px; cursor: pointer; }
.sugg button:hover, .sugg button.hi { background: var(--panel2); }
.sugg img { width: 38px; height: 19px; object-fit: contain; }

.best { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font: 700 1.25rem var(--serif); color: var(--gold2); }
.stat span { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 8px; border-bottom: 1px solid rgba(232, 184, 92, .14); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cheap td { background: rgba(62, 224, 143, .08); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.live { color: var(--emerald); border-color: rgba(62, 224, 143, .5); }
.tag.w3b { color: var(--rose); border-color: rgba(255, 61, 139, .5); }
.tag.mkt { color: var(--gold); }
.good { color: var(--emerald); }
.over { color: var(--bad); }
.wrap { overflow-x: auto; }
.progress { height: 4px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold)); transition: width .2s; }

.login { max-width: 640px; margin: 0 auto; }
.login input { width: 100%; }
.tos td, .tos th { font-size: .85rem; }

#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #3a0a22; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.on { opacity: 1; }
footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }

/* ---- In-Flight Entertainment (games.js, shared with the War Room) in Sorcery & Sin's colours */
.games-slot .small { font-size: .85rem; }
.games-slot .card h2 { font-size: 1.1rem; }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold2); background: rgba(232, 184, 92, .1); white-space: nowrap; }
.banner { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; border: 1px solid; }
.banner.warn { border-color: rgba(245, 165, 36, .5); background: rgba(245, 165, 36, .1); }
.banner.bad { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .12); }
.banner.info { border-color: rgba(62, 224, 143, .45); background: rgba(62, 224, 143, .08); }
button.b { background: linear-gradient(180deg, #f0c76e, #c9922f); color: #2a0716; border: 1px solid #c9922f; border-radius: 9px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
button.b:hover { filter: brightness(1.08); }
button.b:disabled { opacity: .5; cursor: default; filter: none; }
button.b.alt { color: var(--gold); background: transparent; border-color: var(--line); }
button.b.alt:hover { background: rgba(232, 184, 92, .1); }
button.b.sm { padding: 3px 9px; font-size: .8rem; }
.gx-head { margin-bottom: 10px; }
.gx-head h2 { margin-bottom: 2px; }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-bottom: 12px; }
.gx-grid.solo { grid-template-columns: minmax(0, 560px); }
.gx-card { display: flex; flex-direction: column; }
.gx-card-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.gx-card-h h2 { margin: 0; }
.gx-how { font-size: .78rem; }
.gx-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.gx-sub { margin: 10px 0 4px; font-size: .85rem; color: var(--gold); }
.gx-rooms .gx-room { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.gx-board { width: 100%; border-collapse: collapse; font-size: .82rem; }
.gx-board td { padding: 3px 4px; border-bottom: 1px solid rgba(232, 184, 92, .1); }
.gx-board td.rk { color: var(--gold); width: 1.5em; }
.gx-board td.v { color: var(--gold2); font-weight: 600; white-space: nowrap; }
.gx-board td.n { color: var(--muted); text-align: right; white-space: nowrap; }
.gx-lobby { margin-bottom: 14px; border-color: var(--gold); }
.gx-players { list-style: none; padding: 0; margin: 6px 0 10px; }
.gx-players li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.gx-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px currentColor; }
.gx-result { padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(232, 184, 92, .06); }
.gx-stage { display: flex; flex-direction: column; gap: 8px; }
.gx-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gx-bar b { font-family: var(--serif); color: var(--gold); letter-spacing: .06em; }
.gx-canvas { width: 100%; max-width: 960px; aspect-ratio: 960 / 600; border: 1px solid var(--gold); border-radius: 10px; background: #0a0820; touch-action: none; cursor: crosshair; outline: none; box-shadow: 0 0 24px rgba(255, 61, 139, .25); }
.gx-cmd { margin-top: 6px; }
.gx-foot { margin-top: 4px; }

/* ---- Hyperspace Run (arcade.js, shared with the War Room): its panel at the side, in Sorcery & Sin's colours */
.arcade { position: fixed; right: 14px; top: 76px; z-index: 45; width: 264px; max-height: calc(100vh - 90px); overflow-y: auto;
  background: rgba(36, 6, 22, .97); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 12px 10px;
  box-shadow: 0 0 24px rgba(255, 61, 139, .35); font-size: 12px; }
.arcade .arc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.arcade .arc-title { flex: 1; font-family: var(--serif); color: var(--gold); letter-spacing: .12em; font-weight: 700; font-size: 13px; }
.arcade .arc-top .b { padding: 0 8px; min-width: 26px; line-height: 22px; }
.arcade .arc-hud { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.arcade .arc-hud .r { display: flex; align-items: baseline; gap: 6px; }
.arcade .arc-hud .k { font-size: 10px; letter-spacing: .08em; }
.arcade .arc-hud .sc { color: var(--gold2); font-size: 15px; margin-right: auto; }
.arcade .arc-hud .cr { color: var(--gold); }
.arcade .arc-hud .sh { color: #7cc4ff; letter-spacing: 1px; margin-right: auto; }
.arcade .arc-hud .sp { color: var(--text); }
.arcade .arc-hud .fx { display: block; min-height: 14px; color: var(--emerald); }
.arcade .arc-stage { position: relative; width: 240px; height: 360px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.arcade canvas { display: block; width: 240px; height: 360px; touch-action: none; cursor: crosshair; }
.arcade .arc-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center; background: rgba(20, 3, 12, .8); }
.arcade .arc-ov[hidden] { display: none; }
.arcade .ov-t { font-family: var(--serif); color: var(--gold); font-size: 17px; letter-spacing: .1em; font-weight: 700; }
.arcade .ov-s { color: var(--muted); font-size: 11px; }
.arcade .ov-msg { font-style: italic; color: var(--text); margin: 0; }
.arcade .ov-score { font-family: var(--mono); font-size: 26px; color: var(--gold2); }
.arcade .ov-best { color: var(--emerald); font-weight: 700; }
.arcade .arc-ov p { margin: 0; color: var(--text); }
.arcade .arc-board { margin-top: 10px; }
.arcade .arc-h { font-family: var(--serif); color: var(--gold); font-size: 12px; margin-bottom: 6px; }
.arcade .arc-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.arcade .arc-tabs .b { flex: 1; padding: 2px 4px; font-size: 11px; }
.arcade .arc-lb { list-style: none; margin: 0; padding: 0; }
.arcade .arc-lb li { display: flex; gap: 6px; padding: 3px 4px; border-bottom: 1px solid rgba(232, 184, 92, .12); }
.arcade .arc-lb li.me { background: rgba(255, 61, 139, .18); border-radius: 4px; }
.arcade .arc-lb li.empty { color: var(--muted); border: 0; }
.arcade .arc-lb .m { width: 20px; text-align: center; }
.arcade .arc-lb .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arcade .arc-lb .v { font-family: var(--mono); color: var(--gold2); }
.arcade .arc-you { margin-top: 6px; color: var(--muted); font-size: 11px; }
.arcade .arc-foot:not(:empty) { margin-top: 8px; }
.arcade .arc-foot .b { width: 100%; font-size: 11px; }
.arcade.min { width: 200px; }
.arcade.min > :not(.arc-top) { display: none; }
.arcade.min .arc-top { margin-bottom: 0; }
@media (min-width: 761px) and (max-width: 1859px) { body.arcade-on #app { margin-right: 290px; } }
