/* StonkScape 2009-Scape portal — desktop chrome around the CheerpJ game stage.
   Look: classic 2009-era game-site layout (centered gold-hairline column on a
   mossy cobblestone ground, tan section headers with a plaque title, dark panel
   bodies with tan 12px Arial text). Rebuilt in CSS; no third-party image assets.

   Mobile (pointer:coarse) keeps the original full-screen shell: everything here
   is scoped so that body.mobile falls back to the v4–v6 fixed-position layout. */

:root {
  color-scheme: dark;
  --bg: #000;
  --gold: #d09d00;          /* frame lines, links */
  --gold-bright: #e8d800;   /* nav text */
  --brand: #ffd800;         /* brand yellow */
  --panel: #2c2419;         /* section body */
  --panel-2: #392d1d;       /* rows, hovers */
  --panel-3: #433824;       /* item frames */
  --tan: #dfc89d;           /* body text */
  --tan-2: #f0cd87;         /* news titles */
  --tan-3: #bd9c5a;         /* section header bar */
  --plaque: #e9d7a8;
  --plaque-ink: #30291f;
  --feature: #d9c48f;       /* feature row background */
  --feature-ink: #2c2419;
  --white: #fff;
  --green: #4fbf0c;
  --red: #e05a4f;
  --muted: #b9a67f;
  --font-body: Arial, Helvetica, FreeSans, sans-serif;
  --font-title: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", Times, serif;
  --font-mono: "Courier New", Courier, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg) center top / 256px 256px repeat; color: var(--tan);
  font: 12px/1.45 var(--font-body); padding: 0 16px; overflow: auto; touch-action: manipulation;
}
a { color: var(--gold); }
a:hover { color: var(--brand); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- Column ---------- */
.contain {
  width: 100%; max-width: 1840px; margin: 0 auto; background: #000; min-height: 100%;
  border-left: 1px solid var(--gold); border-right: 1px solid var(--gold);
  box-shadow: inset 1px 0 0 #000, inset -1px 0 0 #000, 0 0 0 1px #000, 0 0 30px rgba(0,0,0,.8);
  display: flex; flex-direction: column;
}
.banner {
  height: 128px; position: relative; overflow: hidden; border-bottom: 1px solid var(--gold);
  background: radial-gradient(ellipse at 50% 120%, #241c10 0%, #14100b 65%, #0a0805 100%);
  display: flex; align-items: center; justify-content: center;
}
.banner .brand { height: 96px; width: auto; image-rendering: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.8)); user-select: none; }
.banner .side { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 22px; z-index: 1; }
.banner .side.l { left: 0; }
.banner .side.r { right: 0; align-items: flex-end; text-align: right; }
.banner .side .k { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--tan); }
.banner .side .v { font-family: var(--font-title); font-weight: 700; font-size: 22px; color: var(--brand); text-shadow: 1px 1px 0 #000, 0 0 14px rgba(255,216,0,.35); line-height: 1.1; }
.banner .side .v small { font-size: 12px; color: var(--tan); font-family: var(--font-body); font-weight: 400; }
.banner .side .v.green { color: var(--green); }
.banner .side .v.red { color: var(--red); }
.strip { background: #000; border-bottom: 1px solid var(--gold); padding: 3px 10px; text-align: center; font-size: 12px; color: var(--white); }
.strip b { color: var(--brand); }

/* ---------- Beveled nav ---------- */
.nav { display: flex; align-items: stretch; background: #000; border-bottom: 1px solid var(--gold); padding: 3px 5px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; }
.nav li { flex: 1; }
.nav a, .nav button.tab {
  display: block; width: 100%; height: 21px; line-height: 21px; text-align: center; text-decoration: none;
  font-weight: 700; font-size: 12px; color: var(--gold-bright); border: 1px solid #000; border-radius: 2px 2px 0 0;
  background: linear-gradient(#3b3b3b, #171717 55%, #000);
  box-shadow: inset 0 1px 0 #555, inset 0 -1px 0 #000; text-shadow: 1px 1px 0 #000; cursor: pointer; padding: 0;
}
.nav a:hover, .nav button.tab:hover { color: var(--brand); background: linear-gradient(#4a4a4a, #202020 55%, #000); }
.nav .on a, .nav .on button.tab { color: #000; text-shadow: 1px 1px 0 #fff3a0; background: linear-gradient(#ffe45c, #f5c518 50%, var(--gold)); box-shadow: inset 0 1px 0 #fff6c2, inset 0 -1px 0 #7a5a00; }
.nav .util { display: flex; align-items: center; gap: 8px; padding-left: 10px; margin-left: 4px; border-left: 1px solid #333; }
.world { display: flex; gap: 3px; }
.world button { white-space: nowrap; height: 21px; padding: 0 9px; font-weight: 700; font-size: 11px; color: var(--tan); background: linear-gradient(#3b3b3b, #171717 55%, #000); border: 1px solid #000; border-radius: 2px; box-shadow: inset 0 1px 0 #555; }
.world button.on { color: var(--green); }
.world button:disabled { color: #7a6a4a; cursor: default; }
.world button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #666; margin-right: 5px; }
.world button.on .dot { background: var(--green); box-shadow: 0 0 5px var(--green); }

/* ---------- Buttons ---------- */
.btn { display: inline-block; height: 24px; line-height: 22px; padding: 0 12px; border-radius: 2px; font-weight: 700; font-size: 12px; text-align: center;
  background: linear-gradient(#4a4a4a, #202020 55%, #000); border: 1px solid #000; color: var(--gold-bright); box-shadow: inset 0 1px 0 #666; text-shadow: 1px 1px 0 #000; text-decoration: none; }
.btn:hover { color: var(--brand); }
.btn.primary { background: linear-gradient(#ffe45c, #f5c518 50%, var(--gold)); border-color: #5a4200; color: #000; text-shadow: 1px 1px 0 #fff3a0; box-shadow: inset 0 1px 0 #fff6c2, 0 1px 0 #000; }
.btn.small { height: 20px; line-height: 18px; padding: 0 8px; font-size: 11px; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.active { color: var(--brand); }

/* ---------- Main grid ---------- */
.main { flex: 1 1 auto; min-height: 0; padding: 8px; display: grid; grid-template-columns: 340px minmax(0, 1fr) 420px; gap: 8px; align-items: start; }
.col { min-height: 0; display: flex; flex-direction: column; gap: 8px; }

/* Section: tan header bar with knotwork + plaque, dark body */
.section { border: 1px solid var(--gold); box-shadow: inset 0 0 0 1px #000; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.sectionHeader {
  height: 28px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 8px;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.18) 0 3px, transparent 3px 8px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.18) 0 3px, transparent 3px 8px),
    linear-gradient(#cfb377, var(--tan-3) 55%, #9c7f43);
  border-bottom: 1px solid #000; box-shadow: inset 0 1px 0 #e6d3a3, inset 0 -1px 0 #7a5f2a;
}
.sectionHeader .plaque {
  font-family: var(--font-title); font-weight: 700; font-size: 13px; color: var(--plaque-ink); letter-spacing: .3px; line-height: 20px;
  background: linear-gradient(#f3e4bd, var(--plaque) 60%, #d6c08a); border: 1px solid #5a4a2a; padding: 0 16px; border-radius: 10px;
  box-shadow: inset 0 1px 0 #fff8e0, 0 1px 0 rgba(0,0,0,.4); text-shadow: 0 1px 0 #fff5d6; white-space: nowrap;
}
.sectionHeader .plaque::before, .sectionHeader .plaque::after { content: "\25C6"; font-size: 7px; color: #8a6a24; vertical-align: 2px; margin: 0 6px; }
.sectionHeader .hl, .sectionHeader .hr { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--plaque-ink); }
.sectionHeader .hl { left: 8px; } .sectionHeader .hr { right: 8px; }
.sectionBody { padding: 5px; overflow: auto; min-height: 0; flex: 1 1 auto; color: var(--tan); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; padding: 1px 5px; border: 1px solid; white-space: nowrap; font-weight: 700; }
.pill.live { color: var(--green); border-color: #2d6a28; background: #143a12; }
.pill.soon { color: #9a8a6a; border-color: #4a3f2c; background: #1b160f; }
.pill.warn { color: #ffb757; border-color: #7a4a10; background: #2c1c08; }
.pill.gold { color: var(--brand); border-color: #7a5a00; background: #2a2000; }

.row { display: flex; align-items: center; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.note { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 0 2px; }
.note b { color: var(--tan); font-weight: 400; }
.box { background: var(--panel-2); border: 1px solid #000; box-shadow: inset 0 0 0 1px #5a4a2a; padding: 6px 8px; }
.box.red { box-shadow: inset 0 0 0 1px #7a2a24; background: #35180f; }
.box b { color: var(--white); }
.input { width: 100%; background: #f6efd8; border: 1px solid #000; box-shadow: inset 1px 1px 0 #8a7a55; color: #222; padding: 3px 6px; height: 22px; }
.sub { font-size: 11px; font-weight: 700; color: var(--white); background: linear-gradient(90deg, var(--panel-3), transparent); padding: 3px 6px; margin: 8px 0 4px; border-left: 2px solid var(--gold); }
.sub:first-child { margin-top: 0; }
.seg { display: flex; gap: 2px; }
.seg button { flex: 1; height: 21px; font-weight: 700; font-size: 11px; color: var(--gold-bright); background: linear-gradient(#3b3b3b, #171717 55%, #000); border: 1px solid #000; box-shadow: inset 0 1px 0 #555; text-shadow: 1px 1px 0 #000; }
.seg button.on { color: #000; text-shadow: 1px 1px 0 #fff3a0; background: linear-gradient(#ffe45c, #f5c518 50%, var(--gold)); box-shadow: inset 0 1px 0 #fff6c2; }
.coin { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-weight: 700; font-size: 9px; color: #2a1d0a; border: 1px solid #000; }
.coin.scape { background: radial-gradient(circle at 35% 30%, #fff1b0, var(--brand) 50%, #9a7200); }
.coin.gp { background: radial-gradient(circle at 35% 30%, #c8ffd2, var(--green) 50%, #1f6a18); }
.coin.sol { background: radial-gradient(circle at 35% 30%, #e6d8ff, #b98cff 50%, #5a2fc6); color: #fff; }
.coin.gold { background: radial-gradient(circle at 35% 30%, #fff8dd, #f0c24a 50%, #9a6a10); }

/* Feature rows (icon frame + white title + tan description) */
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 0 6px; margin-bottom: 4px; }
.feature .ico { width: 44px; height: 44px; background: var(--panel-3); border: 1px solid #000; box-shadow: inset 0 0 0 1px #6b5a3a; display: grid; place-items: center; grid-row: 1 / span 2; }
.feature .ico svg { width: 26px; height: 26px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature .t { font-weight: 700; color: var(--white); padding: 0 5px; line-height: 16px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.feature .d { background: linear-gradient(#e6d3a0, var(--feature)); color: var(--feature-ink); padding: 3px 6px; line-height: 1.35; border: 1px solid #000; box-shadow: inset 0 1px 0 #f3e6c2; }
.feature .d a { color: #392d1d; font-weight: 700; }
.feature .d .p { float: right; font-weight: 700; color: #392d1d; margin-left: 8px; }

/* ---------- Center: game slot ---------- */
.center { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.stage-panel { background: var(--panel); border: 1px solid var(--gold); box-shadow: inset 0 0 0 1px #000; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* The slot is sized by portal.js/fitStage to the Java game window (~789x532) and
   clips the rest of the 1024x768 virtual desktop. No transforms, ever: CheerpJ
   maps clicks in untransformed page coordinates. */
#stagewrap { position: relative; width: 789px; height: 532px; max-width: 100%; overflow: hidden; background: #000;
  border: 3px solid #8a6a24; box-shadow: inset 0 0 0 1px #3a2f16, 0 0 0 1px #000, 0 0 22px rgba(231,196,106,.25); display: block; }
#stage { position: absolute; left: 0; top: 0; width: 1024px; height: 768px; background: #000; -webkit-user-select: none; user-select: none; }
#frame { display: none; }
#landing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; z-index: 30;
  background:
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(233,101,28,.28), transparent 70%),
    radial-gradient(ellipse 40% 50% at 12% 55%, rgba(255,160,60,.18), transparent 70%),
    radial-gradient(ellipse 40% 50% at 88% 55%, rgba(255,160,60,.18), transparent 70%),
    linear-gradient(#1a1022 0%, #0e0a12 45%, #1c1710 46%, #0d0b08 100%); }
#landing .scroll { width: min(420px, 90%); padding: 18px 22px; background: linear-gradient(#efe1b8, #dcc891); color: var(--plaque-ink); border: 2px solid #8a6a24; box-shadow: 0 8px 30px rgba(0,0,0,.6), inset 0 0 0 1px #f8ecc8; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#landing h1 { margin: 0; font-family: var(--font-title); font-size: 22px; color: #3a2408; }
#landing p { margin: 0; max-width: 380px; color: #5a4a2c; font-size: 12px; line-height: 1.5; }
#start { height: 34px; line-height: 32px; padding: 0 34px; font-size: 15px; }
#landing .fine { font-size: 11px; color: #7a6a4a; }
#landing .fine a { color: #5a4a2c; }
#landerr { color: #a33; max-width: 380px; }
.playbar { display: flex; gap: 6px; align-items: center; width: 100%; }
.playbar .meta { margin-left: auto; font-size: 11px; color: var(--muted); }
.playbar .meta b { color: var(--tan); font-weight: 400; }
#toolbar { display: none; }
#stagePanel:fullscreen { justify-content: center; background: #000; border: 0; box-shadow: none; }
#stagePanel:fullscreen .playbar { display: none; }
#kb { position: fixed; top: -40px; left: 0; width: 10px; height: 10px; opacity: .01; font-size: 16px; border: 0; padding: 0; background: transparent; color: transparent; }
#rotate { display: none; }
/* Diagnostics drawer (shared by both layouts) */
#diag { position: fixed; left: 0; right: 0; bottom: 0; max-height: 45%; overflow: auto; background: rgba(12,14,17,.97); border-top: 1px solid var(--gold); padding: 10px; z-index: 50; display: none; -webkit-user-select: text; user-select: text; }
#diag pre { white-space: pre-wrap; font-size: 11px; margin: 6px 0; color: #bcc; font-family: var(--font-mono); }
#diag button { margin-right: 8px; }

.ticker { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--gold); box-shadow: inset 0 0 0 1px #000; padding: 4px 8px; overflow: hidden; }
.ticker .lbl { font-family: var(--font-title); font-weight: 700; font-size: 12px; color: var(--brand); white-space: nowrap; }
.ticker .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tan); }
.ticker .msg b { color: var(--white); }
.ticker .meta { margin-left: auto; display: flex; gap: 12px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.ticker .meta b { color: var(--green); font-weight: 400; }

/* ---------- Right dock ---------- */
.dock { display: flex; flex-direction: column; min-height: 0; }
.dock .nav { border: 1px solid var(--gold); border-bottom: 0; padding: 3px 3px 0; }
.dock .section { height: 700px; }
.tabpane { display: none; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.tabpane.on { display: flex; }
/* Embedded portal pages (stonkscape.com/link?embed=1, /burn) and the wiki */
.embed { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.embed iframe { flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: #0f0d0b; }
.embed .foot { padding: 4px 8px; font-size: 10.5px; color: var(--muted); border-top: 1px solid #000; background: var(--panel-2); display: flex; gap: 8px; align-items: center; }
.embed .foot .spacer { flex: 1; }
.embed .foot a { white-space: nowrap; }
.wiki .addr { display: flex; gap: 5px; align-items: center; padding: 5px; background: var(--panel-2); border-bottom: 1px solid #000; }
.wiki .addr .url { flex: 1; font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: #000; border: 1px solid #5a4a2a; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiki .addr .url b { color: var(--tan); font-weight: 400; }
.wiki .addr form { display: flex; gap: 4px; }
.wiki .addr input { width: 140px; }
.wiki .quick { display: flex; gap: 3px; flex-wrap: wrap; padding: 5px; border-bottom: 1px solid #000; }
.wiki .quick button { border: 1px solid #000; background: var(--panel-3); color: var(--gold-bright); font-size: 11px; font-weight: 700; padding: 2px 7px; box-shadow: inset 0 0 0 1px #6b5a3a; }
.wiki .quick button:hover { color: var(--brand); }
.wiki iframe { background: #f6f1e4; }

/* ---------- Leaderboard ---------- */
.lbsection { height: 700px; }
.pot { text-align: center; padding: 6px 0 8px; border-bottom: 1px solid #000; box-shadow: 0 1px 0 #5a4a2a; margin-bottom: 6px; }
.pot .lbl { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.pot .fig { font-family: var(--font-title); font-weight: 700; font-size: 34px; color: var(--brand); line-height: 1.1; text-shadow: 2px 2px 0 #000, 0 0 18px rgba(255,216,0,.35); }
.pot .fig small { font-size: 14px; color: var(--tan); }
.pot .usd { font-size: 11px; color: var(--muted); }
.pot .cd { margin-top: 5px; display: inline-flex; gap: 10px; font-family: var(--font-title); font-weight: 700; font-size: 14px; color: var(--white); background: #000; border: 1px solid #5a4a2a; padding: 3px 12px; }
.pot .cd span small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 9px; letter-spacing: 1px; color: var(--muted); text-align: center; }
.splits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 6px; }
.splits div { background: linear-gradient(#e6d3a0, var(--feature)); border: 1px solid #000; box-shadow: inset 0 1px 0 #f3e6c2; text-align: center; padding: 3px 2px; color: var(--feature-ink); }
.splits .pl { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #5a4a2c; }
.splits .pc { font-family: var(--font-title); font-weight: 700; font-size: 15px; color: #2c2419; }
.splits .amt { font-size: 10px; color: #5a4a2c; }
table.lb { width: 100%; border-collapse: collapse; font-size: 12px; }
table.lb th { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--brand); text-align: left; padding: 3px 5px; border-bottom: 1px solid #5a4a2a; font-weight: 700; }
table.lb td { padding: 4px 5px; border-bottom: 1px solid #1a140d; vertical-align: middle; line-height: 16px; }
table.lb tr:nth-child(even) td { background: rgba(0,0,0,.18); }
table.lb tr.me td { background: var(--panel-3); }
table.lb tr.me td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
table.lb td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.lb .rank { font-weight: 700; color: var(--white); width: 26px; }
table.lb .rank.g1 { color: var(--brand); } table.lb .rank.g2 { color: #d0d0d0; } table.lb .rank.g3 { color: #d08a4a; }
table.lb .name { font-weight: 700; color: var(--white); }
table.lb .pay { color: var(--green); font-weight: 700; }
table.lb td.empty { text-align: center; color: var(--muted); padding: 14px 6px; }
.search { display: flex; gap: 4px; margin-bottom: 6px; }
.search input { flex: 1; }
.hs-card { background: linear-gradient(#e6d3a0, var(--feature)); border: 1px solid #000; box-shadow: inset 0 1px 0 #f3e6c2; padding: 8px; margin-bottom: 6px; color: var(--feature-ink); }
.hs-card .who { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hs-card .who b { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: #2c2419; }
.hs-card .who span { font-size: 11px; color: #5a4a2c; }
.hs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; margin-top: 6px; }
.hs-grid .k { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: #5a4a2c; }
.hs-grid .v { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: #2c2419; }
.hs-grid .v.green { color: #1f7a33; }
.hs-miss { font-size: 12px; color: #ffb7a8; background: #35180f; border: 1px solid #000; box-shadow: inset 0 0 0 1px #7a2a24; padding: 6px 8px; }
.src { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 11.5px; padding: 3px 2px; border-bottom: 1px solid #1a140d; }
.src .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--white); }

/* ---------- Updates ---------- */
.newsfilters { display: flex; gap: 2px; margin-bottom: 6px; }
.newsfilters button { flex: 1; height: 20px; font-size: 11px; font-weight: 700; color: var(--gold-bright); background: linear-gradient(#3b3b3b, #171717 55%, #000); border: 1px solid #000; box-shadow: inset 0 1px 0 #555; text-shadow: 1px 1px 0 #000; }
.newsfilters button.on { color: #000; text-shadow: 1px 1px 0 #fff3a0; background: linear-gradient(#ffe45c, #f5c518 50%, var(--gold)); box-shadow: inset 0 1px 0 #fff6c2; }
.post { margin-bottom: 5px; }
.post .newsTitle { display: flex; align-items: center; gap: 8px; height: 20px; padding: 0 6px; background: linear-gradient(90deg, var(--panel-3), #2c2419); border: 1px solid #000; box-shadow: inset 0 1px 0 #5a4a2a; }
.post .newsTitle b { color: var(--tan-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .newsTitle time { color: var(--brand); font-size: 11px; font-variant-numeric: tabular-nums; }
.post p { margin: 0; padding: 4px 6px 2px; line-height: 1.45; color: var(--tan); }
.post .more { padding: 0 6px 2px; font-size: 11px; }
.post .more a { font-weight: 700; text-decoration: none; }
.post.pinned .newsTitle { background: linear-gradient(90deg, #5a4200, #2c2419); }
.cat { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; padding: 0 5px; border: 1px solid; font-weight: 700; }
.cat.update { color: #9cc4ff; border-color: #2f4f7a; }
.cat.patch { color: var(--green); border-color: #2d6a28; }
.cat.event { color: #ff9a4a; border-color: #7a3a14; }
.cat.season { color: var(--brand); border-color: #7a5a00; }

.footer { border-top: 1px solid var(--gold); padding: 10px 12px 14px; text-align: center; font-size: 11px; color: var(--muted); }
.footer nav { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; font-weight: 700; }
.footer nav a { text-decoration: none; }

@media (max-width: 1500px) { .main { grid-template-columns: 300px minmax(0, 1fr) 380px; } }
@media (max-width: 1180px) {
  .main { grid-template-columns: 1fr; }
  .banner { height: 130px; } .banner .side { display: none; }
  .nav { flex-wrap: wrap; gap: 4px; }
  .nav .util { border-left: 0; padding-left: 0; margin-left: 0; width: 100%; justify-content: flex-end; }
  .dock .section, .lbsection { height: 560px; }
}

/* ---------- Mobile: the original full-screen shell, portal chrome hidden ---------- */
body.mobile { padding: 0; overflow: hidden; background: #0d0f12; -webkit-user-select: none; user-select: none; }
body.mobile .contain { border: 0; box-shadow: none; max-width: none; background: transparent; }
body.mobile .banner, body.mobile .strip, body.mobile #mainNav, body.mobile .col, body.mobile .ticker, body.mobile .footer, body.mobile .playbar { display: none !important; }
body.mobile .main { display: block; padding: 0; }
body.mobile .stage-panel { display: contents; }
body.mobile #landing { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 30%, #1d2229 0%, #0d0f12 70%); }
body.mobile #stagewrap { position: fixed; inset: 0; width: auto; height: auto; max-width: none; border: 0; box-shadow: none; overflow: hidden; z-index: 10; display: none; }
body.mobile #stage { transform-origin: top left; }
body.mobile.scaleup #stage canvas { image-rendering: pixelated; }
body.mobile #frame { position: fixed; pointer-events: none; z-index: 35; display: none; border: 3px solid #8a6a24; border-radius: 3px;
  box-shadow: inset 0 0 0 1px #3a2f16, 0 0 0 2px #241c10, 0 0 0 9999px #0d0f12, 0 0 28px rgba(231,196,106,.35); }
body.mobile #toolbar { position: fixed; top: calc(6px*var(--uiScale,1)); left: calc(6px*var(--uiScale,1)); z-index: 40; display: none; gap: calc(6px*var(--uiScale,1)); }
body.mobile #toolbar button { width: calc(42px*var(--uiScale,1)); height: calc(42px*var(--uiScale,1)); border-radius: 8px; border: 1px solid #555; background: rgba(20,22,26,.75); color: #ddd; font-size: calc(19px*var(--uiScale,1)); padding: 0; }
body.mobile #toolbar button.active { border-color: #e7c46a; color: #e7c46a; }
body.mobile #kb { font-size: calc(16px*var(--uiScale,1)); }
body.mobile #rotate { position: fixed; inset: 0; background: rgba(10,11,13,.93); z-index: 60; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #e7c46a; font-size: calc(18px*var(--uiScale,1)); text-align: center; padding: 24px; cursor: pointer; }
body.mobile #rotate small { color: #889; font-size: calc(13px*var(--uiScale,1)); }

/* ---------- World chat (under the game canvas; desktop portal only) ---------- */
.chat { margin-top: 10px; display: flex; flex-direction: column; }
.chatLog { height: 210px; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: rgba(0,0,0,.35); }
.chatLog .m { font-size: 12.5px; line-height: 1.45; word-break: break-word; }
.chatLog .m .who { color: var(--brand); font-weight: 700; margin-right: 6px; }
.chatLog .m .when { color: var(--tan); font-size: 10px; margin-left: 6px; }
.chatLog .m a { color: var(--green); }
.chatLog .m img { display: block; max-height: 160px; max-width: 320px; margin-top: 4px; border: 1px solid var(--gold); border-radius: 3px; background: #000; }
.chatLog .sys { font-size: 11px; color: var(--tan); font-style: italic; }
.chatBar { display: flex; gap: 6px; padding: 7px 8px; border-top: 1px solid var(--gold); background: rgba(0,0,0,.45); }
.chatBar .input { height: 28px; }
.chatBar .name { width: 120px; flex: 0 0 auto; }
.chatBar .msg { flex: 1; }
.chatBar .btn { height: 28px; }
#chatState.off { background: #5a2020; color: #f0c0c0; }
body.mobile .chat { display: none; }

/* ---------- Wiki Hopium ---------- */
.hopiumLog { height: 340px; }
.hopiumLog .m { margin-bottom: 2px; }
.hopiumLog .m.sys { color: var(--tan); font-style: italic; }
.tabpane.wiki .chatBar { border-top: 1px solid var(--gold); }

/* ---------- Bridge: accepted-token buttons ---------- */
.tokens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.token { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; background: var(--panel-2); border: 1px solid #000; box-shadow: inset 0 0 0 1px #5a4a2a; color: var(--tan); font: 700 12px var(--font-body); cursor: pointer; }
.token img { width: 56px; height: 56px; object-fit: contain; }
.token:hover, .token.on { box-shadow: inset 0 0 0 1px var(--gold); color: var(--white); background: var(--panel-3); }
.token.more { cursor: default; color: var(--muted); font-weight: 400; }
.token.more:hover { box-shadow: inset 0 0 0 1px #5a4a2a; background: var(--panel-2); color: var(--muted); }
.token .plus { display: grid; place-items: center; width: 56px; height: 56px; border: 1px dashed #5a4a2a; border-radius: 50%; font-size: 26px; }
.bridgeNote { text-align: center; }
.bridgeRules { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.bridgeRules li { background: var(--panel-2); border-left: 2px solid var(--gold); padding: 7px 10px; font-size: 13px; color: var(--tan); }
.bridgeRules b { color: var(--brand); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); text-decoration: underline; cursor: pointer; }
