:root {
  --bg: #12161b; --panel: #1c232b; --panel2: #263039; --line: #3a4753; --text: #e8e2d4; --dim: #9aa5ad;
  --gold: #d9a441; --bad: #e0604c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif; user-select: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--gold); color: #1b1408; border-color: var(--gold); font-weight: 600; }

#lobby, #over { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, #25303a, #0d1014 75%); overflow: auto; }
#over { background: rgba(8, 10, 12, .78); }
[hidden] { display: none !important; }
.card { width: min(680px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; }
.card h1 { margin: 0 0 4px; font: 700 34px/1.1 var(--serif); color: var(--gold); letter-spacing: .5px; }
.card h2 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--dim); }
.tag { margin: 0; color: var(--dim); }
#factions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fac { text-align: left; padding: 10px 12px; border-left: 5px solid var(--c); }
.fac b { display: block; font-size: 16px; }
.fac small { display: block; color: var(--dim); }
.fac em { display: block; font-style: normal; font-size: 12px; margin-top: 4px; color: var(--text); }
.fac.on { border-color: var(--c); background: #303c47; box-shadow: 0 0 0 1px var(--c) inset; }
#menu { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.join { display: flex; gap: 6px; }
#code { width: 110px; font: 600 16px monospace; letter-spacing: 3px; text-transform: uppercase; text-align: center;
  background: #10151a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px; }
#wait { margin-top: 18px; text-align: center; }
#roomCode { font: 700 44px monospace; letter-spacing: 10px; color: var(--gold); margin: 4px 0 10px; user-select: text; }
#lobbyMsg { color: var(--bad); min-height: 1.4em; margin: 10px 0 0; }
details { margin-top: 8px; color: var(--dim); }
details summary { cursor: pointer; color: var(--text); }
details ul { margin: 8px 0 0; padding-left: 20px; }

#top { position: fixed; top: 0; left: 0; right: 0; height: 34px; display: flex; gap: 18px; align-items: center; padding: 0 12px;
  background: rgba(20, 26, 32, .92); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
#res span { margin-right: 14px; font-variant-numeric: tabular-nums; }
#era { color: var(--gold); font-weight: 600; }
#room { margin-left: auto; color: var(--dim); }
#toast { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px;
  align-items: center; pointer-events: none; }
#toast div { background: rgba(20, 26, 32, .92); border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; }
#bottom { position: fixed; left: 0; right: 0; bottom: 0; height: 192px; display: flex; gap: 10px; padding: 8px;
  background: rgba(20, 26, 32, .94); border-top: 1px solid var(--line); }
#mini { width: 176px; height: 176px; flex: none; background: #000; border: 1px solid var(--line); cursor: pointer; }
#info { flex: 1 1 240px; min-width: 0; overflow: hidden; }
#info h3 { margin: 0 0 2px; font-size: 16px; }
#info p { margin: 2px 0; color: var(--dim); }
#info .bar { height: 8px; width: 180px; max-width: 100%; background: #10151a; border-radius: 4px; overflow: hidden; margin: 4px 0; }
#info .bar i { display: block; height: 100%; background: #5fbf5a; }
#info .q { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
#info .q span { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
#actions { flex: 0 1 470px; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 54px; gap: 5px; align-content: start; }
#actions button { padding: 3px 4px; font-size: 12px; line-height: 1.2; position: relative; overflow: hidden; }
#actions button small { display: block; color: var(--dim); font-size: 11px; }
#actions button kbd { position: absolute; top: 1px; right: 4px; font: 10px monospace; color: var(--gold); }
@media (max-width: 760px) { #factions { grid-template-columns: 1fr; } #actions { grid-template-columns: repeat(4, 1fr); } #info { display: none; } }

/* sprite art in the UI */
.card { position: relative; }
#lang { position: absolute; top: 14px; right: 14px; padding: 4px 10px; font-size: 12px; }
.art { display: flex; align-items: flex-end; justify-content: center; gap: 14px; height: 120px; margin: -6px 0 10px;
  background: linear-gradient(#2c4a2a, #3e6a36); border-radius: 8px; overflow: hidden; padding: 0 12px; }
.art img { max-height: 112px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.art img:nth-child(3) { max-height: 84px; margin-bottom: 6px; }
.ri { height: 15px; vertical-align: -3px; margin-right: 3px; }
#res span { display: inline-flex; align-items: center; gap: 2px; }
#res .ri { height: 20px; margin-right: 4px; }
#actions { grid-auto-rows: 62px; }
#actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
#actions button .bi { height: 26px; max-width: 46px; object-fit: contain; }
#actions button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#bottom { height: 208px; }
#info { display: flex; gap: 12px; }
#info .pic { flex: none; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
  background: #10151a; border: 1px solid var(--line); border-radius: 6px; }
#info .pic img { max-width: 88px; max-height: 88px; }

/* ---- strategy-game HUD: carved wood and stone panels with brass trim ---- */
:root { --brass: #c9a24a; --brass2: #8a6a26; --wood1: #3b2a1a; --wood2: #241810; --stone1: #3a3d40; --stone2: #24272a; }
#top { height: 38px; background: linear-gradient(#4a3522, var(--wood2)); border-bottom: 2px solid var(--brass2);
  box-shadow: 0 1px 0 #000, inset 0 1px 0 rgba(255,220,150,.18); font-weight: 600; text-shadow: 0 1px 1px #000; }
#res span { background: rgba(0,0,0,.35); border: 1px solid rgba(201,162,74,.45); border-radius: 4px; padding: 2px 9px 2px 6px; margin-right: 6px; }
#era { font-family: var(--serif); letter-spacing: .4px; }
#toast { top: 50px; }
#toast div { background: rgba(36,24,16,.94); border: 1px solid var(--brass2); color: #f1e6cf; font-weight: 600; }
#bottom { height: 214px; gap: 12px; padding: 10px 12px; border-top: 3px solid var(--brass2);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px), linear-gradient(var(--stone1), var(--stone2));
  box-shadow: inset 0 2px 0 rgba(255,225,160,.22), 0 -2px 8px rgba(0,0,0,.6); }
#mini { border: 2px solid var(--brass2); outline: 1px solid #000; border-radius: 3px; box-shadow: inset 0 0 12px #000; }
#info { background: linear-gradient(#2c2018, #1c140e); border: 2px solid var(--brass2); outline: 1px solid #000; border-radius: 4px; padding: 10px 12px; }
#info h3 { font: 700 17px var(--serif); color: #f0d48a; }
#info p { color: #cfc4ad; }
#info .pic { background: radial-gradient(#4d6b3a, #24331c); border: 2px solid var(--brass2); outline: 1px solid #000; }
#info .bar { border: 1px solid #000; }
#info .q span { background: #3a2a1b; border-color: var(--brass2); color: #f1e6cf; }
#actions { background: linear-gradient(#2c2018, #1c140e); border: 2px solid var(--brass2); outline: 1px solid #000; border-radius: 4px; padding: 6px; }
#actions button { background: linear-gradient(#5a4129, #33241a); border: 1px solid #1a110a; border-radius: 4px; color: #f1e6cf;
  box-shadow: inset 0 1px 0 rgba(255,225,170,.28), inset 0 -2px 0 rgba(0,0,0,.35); }
#actions button:hover:not(:disabled) { background: linear-gradient(#73552f, #44301f); border-color: var(--brass); }
#actions button:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.6); }
#actions button:disabled { filter: grayscale(.7); }
#actions button small { color: #d7c9a8; }
#actions button kbd { color: var(--brass); font-weight: 700; }
.card { background: linear-gradient(#2e2219, #1b140e); border: 2px solid var(--brass2); box-shadow: 0 0 0 1px #000, 0 12px 40px rgba(0,0,0,.6); }
.card h1 { color: #f0d48a; text-shadow: 0 2px 0 #000; }
button { background: linear-gradient(#5a4129, #33241a); border-color: #1a110a; color: #f1e6cf; box-shadow: inset 0 1px 0 rgba(255,225,170,.25); }
button.primary { background: linear-gradient(#e6c060, #b8892c); color: #20160a; border-color: #5c4310; }
.fac { background: linear-gradient(#3a2b1f, #261b13); }
.fac.on { background: linear-gradient(#57402a, #3a2a1c); }
#code { background: #120d09; border-color: var(--brass2); }
#actions { grid-auto-rows: 66px; }
#actions button { font-size: 11.5px; }
#actions button small { white-space: nowrap; font-size: 10.5px; }
#actions button small .ri { height: 12px; margin-right: 1px; vertical-align: -2px; }

.uic { display: inline-block; background-repeat: no-repeat; flex: none; }
#info .pic img.big { max-width: 88px; max-height: 88px; }
#actions button img.bi, #actions button .uic.bi { height: 30px; }
#tools { display: inline-flex; gap: 6px; }
#top button { padding: 2px 9px; font-size: 12px; }
#room { margin-left: auto; }
#btnResign { margin-left: 4px; }
#diff { background: #120d09; color: #f1e6cf; border: 1px solid var(--brass2); border-radius: 6px; padding: 7px 6px; font: inherit; }
#top { gap: 10px; }
#res { flex: none; }
#era, #tools, #btnResign { flex: none; }
#hero { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#room { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* campaign */
#camp h2 { margin-top: 6px; }
.mis { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 9px 12px; border-left: 5px solid var(--c); }
.mis b { display: block; font: 700 16px var(--serif); color: #f0d48a; }
.mis small { color: #cfc4ad; }
.mis:disabled b { color: #9a8f7a; }
#camp .story p { color: #e6dcc6; font: 15px/1.6 var(--serif); margin: 8px 0; }
#camp .goals { margin: 10px 0 14px; padding: 8px 12px; background: rgba(0,0,0,.3); border: 1px solid var(--brass2); border-radius: 6px; }
#camp .goals div { margin: 3px 0; }
#camp .row { display: flex; gap: 10px; }
#obj { position: fixed; top: 48px; left: 10px; max-width: 300px; padding: 8px 12px; background: rgba(36,24,16,.9); border: 2px solid var(--brass2); outline: 1px solid #000; border-radius: 4px; color: #f1e6cf; }
#obj h4 { margin: 0 0 4px; font: 700 13px var(--serif); color: #f0d48a; letter-spacing: .5px; text-transform: uppercase; }
#obj div { margin: 2px 0; }
#obj .ok { color: #8fd98a; }
#over .card p { font: 15px/1.6 var(--serif); color: #e6dcc6; }

/* mission dialogue */
#say { position: fixed; left: 50%; bottom: 226px; transform: translateX(-50%); width: min(620px, calc(100% - 24px)); display: flex; gap: 12px; align-items: center;
  padding: 10px 14px; background: rgba(36,24,16,.95); border: 2px solid var(--brass2); outline: 1px solid #000; border-radius: 6px; color: #f1e6cf; pointer-events: none; }
#say .pic { flex: none; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: radial-gradient(#4d6b3a, #24331c); border: 2px solid var(--brass2); border-radius: 4px; overflow: hidden; }
#say .pic .big { transform: scale(.8); }
#say b { font: 700 14px var(--serif); }
#say p { margin: 3px 0 0; font: 15px/1.5 var(--serif); }

/* ---- large corner minimap and ornate game frames ---- */
#bottom { position: fixed; --mini: min(352px, 42vw, calc(100vh - 110px)); padding-left: calc(var(--mini) + 26px); }
#miniWrap { position: absolute; left: 10px; bottom: 10px; width: var(--mini); height: var(--mini); padding: 0; background: #07090b; }
#mini { display: block; width: 100%; height: 100%; border: 0; outline: 0; box-shadow: none; border-radius: 0; cursor: pointer; }
/* shared frame: dark iron outside, bevelled brass band, engraved inner line, studded corners */
.frame, #info, #actions, #obj, #say, .card {
  border: 4px solid transparent; outline: none; border-radius: 3px;
  border-image: linear-gradient(135deg, #f3d98a 0%, #b88a2e 18%, #6a4a14 40%, #d9b256 55%, #7a5718 78%, #f0d07a 100%) 1;
  box-shadow: 0 0 0 2px #120c06, 0 0 0 3px #4a3410, 0 6px 18px rgba(0,0,0,.65), inset 0 0 0 1px #1a1109, inset 0 0 0 2px rgba(255,226,150,.28), inset 0 0 22px rgba(0,0,0,.55);
}
.frame, #info, #actions { position: relative; }
#miniWrap { position: absolute; }
.frame::before, .frame::after, #info::before, #info::after, #actions::before, #actions::after {
  content: ''; position: absolute; width: 14px; height: 14px; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fff3c4, #d9b256 38%, #6a4a14 72%, #2a1c08);
  border: 1px solid #120c06; transform: rotate(45deg); box-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.frame::before, #info::before, #actions::before { top: -10px; left: -10px; }
.frame::after, #info::after, #actions::after { top: -10px; right: -10px; }
#bottom { border-top: 0; box-shadow: none;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)) , repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 2px 7px), linear-gradient(#3d4043, #1f2224); }
#bottom::before { content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 6px;
  background: linear-gradient(#f0d07a, #b88a2e 35%, #5a3f12 70%, #1a1109); box-shadow: 0 -1px 0 #000, 0 2px 4px rgba(0,0,0,.6); }
#top { border-bottom: 0; }
#top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; background: linear-gradient(#1a1109, #5a3f12 30%, #b88a2e 65%, #f0d07a); box-shadow: 0 2px 4px rgba(0,0,0,.6); }
#top { overflow: visible; }
#res span { border: 1px solid #8a6a26; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,226,150,.2); }
#say { bottom: 236px; }
@media (max-width: 900px) { #info { display: none; } }

/* ---- main menu: painted backdrop, menu column on the left, one panel on the right ---- */
#lobby { display: flex; align-items: stretch; justify-content: flex-start; gap: 28px; padding: 28px;
  background: linear-gradient(90deg, rgba(8,6,4,.92) 0, rgba(8,6,4,.72) 22%, rgba(8,6,4,.15) 55%, rgba(8,6,4,.35) 100%), url(../img/menu.jpg) center / cover no-repeat, #0d0a07; }
#nav { flex: none; width: 300px; display: flex; flex-direction: column; gap: 10px; padding-top: 6vh; }
#nav h1 { margin: 0; font: 700 46px/1 var(--serif); color: #f3d98a; letter-spacing: 1px; text-shadow: 0 2px 0 #000, 0 0 22px rgba(240,190,90,.35); }
#nav .tag { margin: 4px 0 18px; color: #d9cdb2; font: 14px/1.5 var(--serif); text-shadow: 0 1px 2px #000; }
.nb { text-align: left; padding: 13px 18px; font: 600 17px var(--serif); letter-spacing: .4px; color: #f1e6cf; border-radius: 2px;
  background: linear-gradient(90deg, rgba(74,53,34,.96), rgba(36,24,16,.86)); border: 1px solid #120c06; border-left: 5px solid #8a6a26;
  box-shadow: inset 0 1px 0 rgba(255,226,150,.22), 0 3px 8px rgba(0,0,0,.55); transition: transform .08s, border-color .08s; }
.nb:hover:not(:disabled) { transform: translateX(6px); border-left-color: #f0d07a; background: linear-gradient(90deg, rgba(110,80,44,.98), rgba(52,36,22,.9)); }
.nb.on { border-left-color: #f0d07a; background: linear-gradient(90deg, rgba(128,94,48,.98), rgba(60,42,24,.92)); color: #fff3c4; }
#lang { margin-top: 10px; font-size: 13px; padding: 8px 18px; width: auto; align-self: flex-start; position: static; }
#lobbyMsg { color: #ffb4a0; text-shadow: 0 1px 2px #000; }
#panel { flex: 0 1 760px; align-self: flex-start; max-height: calc(100vh - 56px); overflow: auto; padding: 20px 24px; background: linear-gradient(rgba(46,34,25,.96), rgba(27,20,14,.96)); color: #f1e6cf; }
#panel h2 { margin: 0 0 12px; font: 700 26px var(--serif); color: #f0d48a; text-transform: none; letter-spacing: .3px; display: flex; align-items: center; gap: 14px; }
#panel h3 { margin: 14px 0 6px; font: 700 15px var(--serif); color: #e9c66b; }
#panel p { color: #d9cdb2; }
.small { font-size: 12px; padding: 4px 10px; }
.slot { display: flex; align-items: center; gap: 12px; margin: 8px 0 6px; padding: 8px 12px; background: rgba(0,0,0,.35); border: 1px solid #8a6a26; border-radius: 3px; }
.slot .num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #8a6a26; color: #1b1408; font-weight: 700; }
.slot .who { font-weight: 600; min-width: 120px; }
.slot .sf { flex: 1; font: 700 15px var(--serif); }
.facs { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin: 6px 0; }
.facs .fac { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 8px 6px; border-left: 1px solid #1a110a; border-bottom: 4px solid var(--c); }
.facs .fac img { height: 58px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.facs .fac .q { height: 58px; display: grid; place-items: center; font: 700 40px var(--serif); color: #b9b2a3; }
.facs .fac b { font-size: 13px; }
.facs .fac.on { box-shadow: 0 0 0 2px var(--c) inset, inset 0 1px 0 rgba(255,225,170,.25); }
.finfo { margin: 4px 0 10px; font-size: 13px; }
.mapinfo { margin: 12px 0; padding: 8px 12px; background: rgba(0,0,0,.3); border-left: 3px solid #8a6a26; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.waitmsg { color: #e9c66b; font-style: italic; }
#chat { height: 96px; overflow: auto; margin-top: 10px; padding: 6px 10px; background: rgba(0,0,0,.4); border: 1px solid #8a6a26; border-radius: 3px 3px 0 0; font-size: 13px; }
#chatIn { width: 100%; padding: 7px 10px; background: #120d09; color: #f1e6cf; border: 1px solid #8a6a26; border-top: 0; border-radius: 0 0 3px 3px; font: inherit; }
.help { padding-left: 20px; } .help li { margin: 6px 0; color: #d9cdb2; }
#panel .mis { background: linear-gradient(#3a2b1f, #261b13); }
@media (max-width: 860px) { #lobby { flex-direction: column; padding: 14px; } #nav { width: auto; padding-top: 0; } #nav h1 { font-size: 34px; } .two { grid-template-columns: 1fr; } #panel { max-height: none; } }
/* minimap: wide 2:1 diamond, exactly as tall as the neighbouring panels */
#bottom { --mini: min(388px, 44vw); padding-left: calc(var(--mini) + 30px); }
#miniWrap { left: 12px; top: 10px; bottom: 10px; width: var(--mini); height: auto; }
/* bottom bar 15% lower than before (214px -> 182px); the minimap keeps its 2:1 shape */
#bottom { height: 182px; --mini: min(324px, 44vw); }
#actions { grid-auto-rows: 62px; }
#info .pic { width: 84px; height: 84px; }
#say { bottom: 204px; }

/* serif stack whose fonts all contain Vietnamese letters (Georgia does not, which broke the accents) */
:root { --serif: Cambria, "Palatino Linotype", "Book Antiqua", "Times New Roman", "Noto Serif", serif; }
/* lobby sized for large screens */
#lobby { gap: clamp(24px, 3vw, 56px); padding: clamp(18px, 2.4vw, 44px); }
#nav { width: clamp(320px, 27vw, 500px); gap: clamp(10px, 1vw, 16px); padding-top: 5vh; }
#nav h1 { font-size: clamp(46px, 4.6vw, 88px); }
#nav .tag { font-size: clamp(14px, 1.05vw, 19px); margin-bottom: clamp(14px, 1.6vw, 28px); }
.nb { padding: clamp(14px, 1.25vw, 24px) clamp(18px, 1.6vw, 30px); font-size: clamp(18px, 1.5vw, 28px); border-left-width: 7px; }
#lang { font-size: clamp(13px, .95vw, 17px); padding: 9px 20px; }
#panel { flex: 0 1 clamp(600px, 56vw, 1080px); padding: clamp(18px, 1.7vw, 34px); font-size: clamp(14px, 1.02vw, 18px); }
#panel h2 { font-size: clamp(24px, 2vw, 38px); }
#panel h3 { font-size: clamp(15px, 1.15vw, 21px); }
#panel button, #panel .btn, #panel select, #panel input { font-size: clamp(14px, 1.02vw, 18px); }
#panel button.primary, .big { padding: clamp(9px, .8vw, 15px) clamp(18px, 1.5vw, 30px); }
.facs { grid-template-columns: repeat(auto-fit, minmax(clamp(112px, 9vw, 170px), 1fr)); }
.facs .fac img, .facs .fac .q { height: clamp(58px, 5vw, 96px); }
.facs .fac b { font-size: clamp(13px, 1vw, 17px); }
/* account */
#acct { margin-top: clamp(8px, 1vw, 18px); padding: 12px 14px; background: rgba(20,14,9,.78); border: 1px solid #8a6a26; border-radius: 3px; }
#acct .me b { display: block; font: 700 clamp(16px, 1.2vw, 22px) var(--serif); color: #f0d48a; }
#acct .me small { color: #cfc4ad; }
#acct .row { margin-top: 8px; } #acct .me + .row { margin-top: 10px; }
#acct button, .btn { font-size: clamp(14px, 1vw, 18px); padding: 8px 16px; }
.btn { display: inline-block; text-decoration: none; color: #f1e6cf; background: linear-gradient(#5a4129, #33241a); border: 1px solid #1a110a; border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255,225,170,.25); cursor: pointer; }
.btn:hover { border-color: #c9a24a; }
#motd { margin: 0; padding: 9px 12px; background: rgba(120,60,20,.55); border-left: 4px solid #f0d07a; color: #fff3c4; font-size: clamp(13px, .95vw, 16px); }
.form { display: grid; gap: 12px; max-width: 460px; }
.form label { display: grid; gap: 4px; color: #e9c66b; font-weight: 600; }
.form input { padding: 10px 12px; background: #120d09; color: #f1e6cf; border: 1px solid #8a6a26; border-radius: 4px; font: inherit; }
.form input:focus { outline: 2px solid #f0d07a; outline-offset: 1px; }
.err { color: #ffb4a0; min-height: 1.3em; margin: 0; }
.hint { color: #b9ad94; font-size: .92em; }
.hint a { color: #f0d07a; }
.or { display: flex; align-items: center; gap: 12px; max-width: 460px; margin: 16px 0 12px; color: #b9ad94; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: #8a6a26; }
.social { display: block; max-width: 460px; margin: 8px 0; padding: 11px 16px; text-align: center; font-weight: 600; }
.social.g { background: #fff; color: #1f1f1f; border-color: #dadce0; box-shadow: none; }
.social.f { background: #1877f2; color: #fff; border-color: #1877f2; box-shadow: none; }

/* campaign: acts, stars, renown */
.actlbl { margin: 0 0 2px; color: #e9c66b; font: 600 13px var(--serif); letter-spacing: 1.5px; text-transform: uppercase; }
#panel h3.act { margin: 18px 0 4px; padding-bottom: 4px; border-bottom: 1px solid #8a6a26; letter-spacing: .6px; }
.mis b { display: flex; justify-content: space-between; gap: 12px; }
.stars { color: #f3d98a; letter-spacing: 2px; font-size: 1.05em; }
#over .stars { display: block; font-size: 34px; margin-bottom: 10px; text-shadow: 0 0 14px rgba(240,200,90,.5); }
.renown { color: #f0d48a !important; font-style: italic; }
.sofar { margin: 6px 0 10px; padding: 6px 12px; background: rgba(0,0,0,.28); border-left: 3px solid #8a6a26; }
.sofar summary { cursor: pointer; color: #e9c66b; font-weight: 600; }
#camp .goals b.b, .goals b.b { display: block; margin-top: 8px; color: #e9c66b; }
.goals { margin: 10px 0 14px; padding: 10px 14px; background: rgba(0,0,0,.3); border: 1px solid #8a6a26; border-radius: 4px; }
.goals div { margin: 3px 0; } .goals .opt, #obj .opt { color: #d9c690; }
.story p { color: #e6dcc6; font: 1.05em/1.65 var(--serif); margin: 9px 0; }
#obj h4.b { margin-top: 8px; }
#obj .opt.ok { color: #f3d98a; }

#panel { overflow-x: hidden; }

/* lobby fit: everything scales with the smaller of width and height, so the menu never needs to scroll,
   and the column is centred with equal space above and below */
#lobby { --pad: clamp(18px, 4.5vh, 52px); padding: var(--pad) clamp(22px, 3.4vw, 64px); gap: clamp(24px, 3vw, 60px); align-items: center; overflow: hidden; }
#nav { width: clamp(340px, 33vw, 620px); max-height: calc(100vh - 2 * var(--pad)); padding-top: 0; justify-content: center; gap: clamp(7px, 1.25vh, 14px); }
#nav h1 { font-size: clamp(34px, min(3.5vw, 7vh), 68px); white-space: nowrap; line-height: 1.05; }
#nav .tag { font-size: clamp(13px, min(.95vw, 1.9vh), 17px); line-height: 1.5; margin: clamp(4px, .8vh, 10px) 0 clamp(8px, 1.6vh, 20px); }
.nb { padding: clamp(9px, 1.55vh, 17px) clamp(16px, 1.4vw, 26px); font-size: clamp(16px, min(1.25vw, 2.5vh), 23px); border-left-width: 6px; }
#acct { margin-top: clamp(4px, .9vh, 12px); padding: clamp(8px, 1.2vh, 13px) 14px; }
#acct button, #acct .btn { font-size: clamp(13px, min(.95vw, 1.9vh), 16px); padding: clamp(5px, .9vh, 8px) 14px; }
#acct .me b { font-size: clamp(15px, min(1.1vw, 2.2vh), 20px); }
#lang { margin-top: clamp(2px, .6vh, 8px); font-size: clamp(12px, min(.85vw, 1.7vh), 15px); padding: clamp(5px, .9vh, 8px) 16px; }
#lobbyMsg { margin: 0; min-height: 0; }
#lobbyMsg:empty, #motd[hidden] { display: none; }
#panel { align-self: center; max-height: calc(100vh - 2 * var(--pad)); }
@media (max-width: 860px) { #lobby { overflow: auto; align-items: stretch; } #nav { width: auto; max-height: none; } #nav h1 { white-space: normal; } #panel { max-height: none; align-self: stretch; } }

/* account forms: the news opt-in tick box sits on one line */
.form label.chk { display: flex; gap: 10px; align-items: center; color: #f1e6cf; font-weight: 400; }
.form label.chk input { width: auto; }

/* lobby options row: language and sound side by side */
#opts { gap: 8px; align-self: flex-start; margin-top: clamp(2px, .6vh, 8px); }
#opts #lang, #opts #sound { margin-top: 0; width: auto; position: static; font-size: clamp(12px, min(.85vw, 1.7vh), 15px); padding: clamp(5px, .9vh, 8px) 16px; }
