/* Dark Wizardry - core theme */
:root {
  --bg: #0c0a12;
  --bg-2: #14111d;
  --panel: #1a1626;
  --panel-2: #221d31;
  --border: #33294a;
  --text: #ddd6c6;
  --muted: #8f86a3;
  --accent: #a77bf3;
  --accent-2: #6d44c9;
  --gold: #d9b45a;
  --danger: #e0605e;
  --ok: #6fcf8f;
  --hp: #c44a4a;
  --mana: #4a74d4;
  --end: #e2b93b;
  --xp: #9b59d6;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse 120% 70% at top, #1d1530 0%, var(--bg) 70%) no-repeat;
  color: var(--text);
  font: 15px/1.5 system-ui, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
a:hover { color: #c7a8ff; }

/* ------------------------------------------------------------ buttons & forms */
.btn, button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: .55em 1.1em;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover, button:hover:not(:disabled) { border-color: var(--accent); background: #2b2440; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .3; cursor: default; }
.btn.primary, button.primary { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); border-color: #8a5ff0; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.subtle { background: transparent; color: var(--muted); }
.btn.small { padding: .3em .8em; font-size: .85em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
input[type=text], input:not([type]), input[type=password], input[type=email] {
  font: inherit;
  padding: .65em .8em;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
}
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(167, 123, 243, .2); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 0; }
legend { padding: 0 .5rem; font-family: var(--serif); color: var(--gold); font-size: 1.1rem; }

.error { color: #ffb4b0; background: rgba(224, 96, 94, .12); border: 1px solid rgba(224, 96, 94, .4); border-radius: 6px; padding: .6rem .9rem; margin: 0; }
ul.error { padding-left: 2rem; }
.notice { color: #cdf5d8; background: rgba(111, 207, 143, .1); border: 1px solid rgba(111, 207, 143, .35); border-radius: 6px; padding: .6rem .9rem; }
.noscript { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; }

/* ------------------------------------------------------------ cards (auth / character pages) */
.page { display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; min-height: 100%; }
.card {
  width: 100%;
  max-width: 720px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.card.narrow { max-width: 420px; }
.card.wide { max-width: 960px; }

.brand { text-align: center; margin-bottom: 1.5rem; }
.brand h1 { font-family: var(--serif); font-weight: normal; letter-spacing: .15em; text-transform: uppercase; margin: .2rem 0 0; font-size: 1.9rem; color: #efe6ff; text-shadow: 0 0 18px rgba(167, 123, 243, .55); }
.brand .tagline { margin: .2rem 0 0; color: var(--muted); font-style: italic; font-family: var(--serif); }
.brand .splash { display: block; width: 100%; height: auto; border-radius: 8px; margin: 0 auto .4rem; box-shadow: 0 0 30px rgba(167, 123, 243, .25); }
.brand .version { margin: .35rem 0 0; font: .75rem var(--mono); color: #5d5474; letter-spacing: .08em; }
.topbar-brand .version { font: .7rem var(--mono); color: var(--muted); letter-spacing: .05em; text-transform: none; margin-left: .4rem; }
.sigil { font-size: 2.2rem; color: var(--accent); text-shadow: 0 0 20px var(--accent); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.section-title { font-family: var(--serif); font-weight: normal; color: var(--gold); border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.alt { text-align: center; color: var(--muted); margin-top: 1.5rem; }
.row-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

.char-list { display: grid; gap: .75rem; }
.char-card { display: flex; justify-content: space-between; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1.1rem; }
.char-name { font-family: var(--serif); font-size: 1.25rem; color: #efe6ff; }
.char-meta { color: var(--muted); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.choice { position: relative; display: grid !important; gap: .2rem; font-weight: 400 !important; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #5a4785; }
.choice:has(input:checked) { border-color: var(--accent); background: #211a33; box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(167, 123, 243, .18); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-name { font-family: var(--serif); font-size: 1.1rem; color: #efe6ff; }
.choice-mods { font-family: var(--mono); font-size: .8rem; color: var(--gold); }
.choice-desc { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------ character creation */
.card.wide.create { max-width: 1080px; }
.create-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
.create-preview { position: sticky; top: 1rem; display: grid; gap: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.portrait-frame { aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: 1px solid #5a4785; background: #110e19; box-shadow: 0 0 24px rgba(167, 123, 243, .18); }
.portrait { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .18s ease; }
.portrait.fading { opacity: .25; }
.cp-title { margin: .2rem 0 0; font-family: var(--serif); font-weight: normal; font-size: 1.35rem; color: #efe6ff; text-align: center; }
.cp-sex { margin: 0; text-align: center; color: var(--muted); font-style: italic; font-family: var(--serif); }
.cp-attrs, .cp-pools { display: grid; gap: .3rem; margin: 0; }
.cp-attrs { grid-template-columns: repeat(5, 1fr); }
.cp-pools { grid-template-columns: repeat(3, 1fr); }
.cp-attrs > div, .cp-pools > div { text-align: center; padding: .35rem .2rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.cp-attrs dt, .cp-pools dt { font: .68rem var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.cp-attrs dd, .cp-pools dd { margin: 0; font: 1.05rem var(--mono); color: var(--gold); }
.cp-pools .hp dd { color: #e07a7a; }
.cp-pools .mana dd { color: #7f9ef0; }
.cp-pools .end dd { color: var(--end); }
.cp-pools .mana.none dd { color: var(--muted); }
.cp-desc { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.4; }
.create-steps { display: grid; gap: 1rem; min-width: 0; }
.create-steps fieldset { margin: 0; }
.compact-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.sex-grid { grid-template-columns: repeat(2, minmax(0, 170px)); gap: .5rem; }
.choice.compact { padding: .55rem .75rem; gap: .1rem; }
.choice.compact .choice-name { font-size: 1rem; }
.choice.compact .choice-mods { font-size: .72rem; }
@media (max-width: 780px) {
  .create-grid { grid-template-columns: 1fr; }
  .create-preview { position: static; grid-template-columns: 120px 1fr; }
  .create-preview .portrait-frame { grid-row: span 3; }
  .create-preview .cp-title, .create-preview .cp-sex { text-align: left; }
  .create-preview .cp-attrs, .create-preview .cp-pools, .create-preview .cp-desc { grid-column: 1 / -1; }
}

/* character list */
.char-card .char-who { display: flex; align-items: center; gap: .9rem; }
.char-thumb { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; border: 1px solid #5a4785; background: #110e19; }

/* ------------------------------------------------------------ game screen */
.game-page { overflow: hidden; }
.game {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "console side";
}
.topbar { grid-area: top; display: flex; justify-content: space-between; align-items: center; padding: .5rem 1rem; border-bottom: 1px solid var(--border); background: rgba(12, 10, 18, .85); }
.topbar-brand { font-family: var(--serif); letter-spacing: .12em; text-transform: uppercase; color: #efe6ff; }
.sigil-sm { color: var(--accent); }
.topbar-right { display: flex; gap: .5rem; align-items: center; }
.conn { font-size: .8rem; transition: color .3s; }
.conn.ok { color: var(--ok); }
.conn.down { color: var(--danger); }

.console { grid-area: console; display: flex; flex-direction: column; min-height: 0; padding: .75rem; gap: .5rem; }
.log {
  flex: 1;
  overflow-y: auto;
  background: rgba(8, 6, 13, .8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  font: 14.5px/1.55 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-color: #3b3054 transparent;
}
.line { margin: 0 0 .15rem; }
.t-room-image { margin: .9rem 0 .2rem; }
.t-room-image img { display: block; width: 100%; max-width: 900px; aspect-ratio: 8 / 3; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; background: #0d0b14; }
.t-room-image + .t-room-title { margin-top: .3rem; }
.t-room-title { color: #f1d98a; font-weight: bold; margin-top: .6rem; }
.t-room-desc { color: #c9c1b0; }
.t-exits { color: #6fc6c2; }
.t-entry { color: #e7c98f; font-style: italic; margin-top: .6rem; }
.t-reset { color: #b7a6e0; font-style: italic; }
.t-extra { color: #c9c1b0; }
.t-players { color: #e6a7f0; }
.t-mob { color: #e8c170; }
.t-mob-aggro { color: #ff6f61; }
.t-item { color: #b8d4e8; }
.t-regen { color: #9fe0b0; font-style: italic; }
#players button.mob { color: #e8c170; }
#players button.mob.aggro { color: #ff6f61; }
.t-echo { color: #6c6383; }
.t-say { color: #f0f0f0; }
.t-emote { color: #b9e6a0; font-style: italic; }
.t-shout { color: #ff9f6b; font-weight: bold; }
.t-tell { color: #ff7fd0; }
.t-group { color: #8fd8ff; }
.t-move { color: #9d93b8; }
.t-announce { color: var(--gold); font-style: italic; }
.t-system { color: var(--accent); font-style: italic; }
.t-error { color: var(--danger); }
/* Combat (docs/combat-system.md) */
.t-combat { color: #e6d2a8; }
/* Fight lines (v0.3-00150): your blows warm, blows on you red, misses grey, your defences green. */
.t-combat-hit { color: #eadfc4; }
.t-combat-hit-big { color: #ffe08a; font-weight: bold; }
.t-combat-miss, .t-combat-in-miss { color: #847b96; }
.t-combat-def { color: #8fd8a8; }
.t-combat-in { color: #ff9a8a; }
.t-combat-in-big { color: #ff6b5b; font-weight: bold; }
/* The severity word, grey (scratch) to blood red (MASSACRE); the damage number dimmed. */
.sev-0 { color: #a69db5; } .sev-1 { color: #c9c0d6; } .sev-2 { color: #f2ecd9; }
.sev-3 { color: #ffd98a; } .sev-4 { color: #ffb45e; } .sev-5 { color: #ff8c42; }
.sev-6 { color: #ff6a3d; font-weight: bold; } .sev-7 { color: #ff4040; font-weight: bold; }
.sev-8 { color: #ff2b2b; font-weight: bold; text-shadow: 0 0 6px rgba(255, 43, 43, .45); }
.line .dmg { color: #7d748f; font-weight: normal; }
.t-combat-room { color: #b9a98a; }
.t-combat-kill { color: #ffd76a; font-weight: bold; }
.t-combat-xp { color: #c79bff; }
.t-combat-death { color: #ff5f5f; font-weight: bold; }
.t-pk { color: #e0403c; font-weight: bold; }   /* the PK flag going up */
.t-skill-up { color: #7fe0c0; font-weight: bold; }
.t-achieve { color: var(--gold); font-weight: bold; border-left: 3px solid var(--gold); padding-left: 6px; }   /* v0.6-00216 */
.t-achieve-world { color: #e8c977; }   /* someone else's achievement, for the whole server (v0.7-00240) */
.t-effect-off { color: #b8a8e0; font-style: italic; }
.t-info, .t-who, .t-help { color: #b8c4e0; }

.cmd-form { display: flex; align-items: center; gap: .5rem; background: rgba(8, 6, 13, .8); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .35rem .35rem .8rem; }
.cmd-form:focus-within { border-color: var(--accent); }
.prompt { color: var(--accent); font: bold 1rem var(--mono); }
.cmd-form input { flex: 1; border: 0; background: transparent; font: 15px var(--mono); padding: .45rem 0; box-shadow: none !important; }

.sidebar { grid-area: side; overflow-y: auto; padding: .6rem .75rem .6rem 0; display: flex; flex-direction: column; gap: .55rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; }
.panel h3 { margin: 0 0 .5rem; font: .8rem/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.me-name { font-family: var(--serif); font-size: 1.3rem; color: #efe6ff; }
.me-meta { color: var(--muted); font-size: .85rem; margin-bottom: .3rem; }
.me-extra { display: flex; justify-content: flex-end; font: .85rem var(--mono); color: var(--gold); margin-top: .4rem; }

.bar { position: relative; height: 17px; background: #0d0b14; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; margin-top: .25rem; }
.bar span { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .4s ease; }
.bar.hp span { background: linear-gradient(90deg, #7d2525, var(--hp)); }
.bar.mana span { background: linear-gradient(90deg, #233d85, var(--mana)); }
.bar.end span { background: linear-gradient(90deg, #7a5d10, var(--end)); }
.bar.xp span { background: linear-gradient(90deg, #4b2275, var(--xp)); }
.foe { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; align-items: center; }
.foe-none { font-size: .82rem; color: var(--muted); font-style: italic; }
/* Combat frame: the fight, then the shortcut buttons (shortcut command) */
.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.foe:not([hidden]) + .shortcuts { margin-top: .45rem; }
.shortcuts .sc { padding: .25rem .2rem; font-size: .76rem; line-height: 1.1; min-height: 1.8rem; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; border-color: #6b3a3a; color: #f3d2c8; transition: opacity .15s; }
.shortcuts .sc:hover:not(:disabled) { border-color: #d4553f; background: #3a1d20; }
.shortcuts .sc.empty { border-style: dashed; border-color: var(--border); color: var(--muted); opacity: .6; font-size: 1rem; }
.shortcuts .sc.empty:hover { opacity: 1; background: transparent; border-color: var(--accent); }
.shortcuts.busy .sc:not(.empty):not(.locked) { opacity: .45; }
.shortcuts .sc.cooling { opacity: .45; }   /* this button's skill is cooling down (v0.7-00238) */
/* Buttons 5-8: Premium supporters. Locked for everyone else (shown, not usable). */
.shortcuts .sc.locked, .shortcuts .sc.locked:disabled { opacity: .35; border-style: dashed; border-color: rgba(217, 180, 90, .45); color: var(--gold); font-size: .85rem; cursor: not-allowed; }
.foe-label { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.foe-label b { color: #ff9a8a; font-weight: normal; }
.foe .bar { margin-top: 0; }
.bar.foe-bar span { background: linear-gradient(90deg, #6b1d1d, #d4553f); }
.foe-flee { font-size: .78rem; padding: .15rem .55rem; }
.bar.xp.full { border-color: var(--xp); animation: xp-full-glow 1.6s ease-in-out infinite; }
@keyframes xp-full-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(155, 89, 214, .45); }
  50%      { box-shadow: 0 0 14px 3px rgba(185, 120, 255, .9); }
}
@media (prefers-reduced-motion: reduce) {
  .bar.xp.full { animation: none; box-shadow: 0 0 8px rgba(155, 89, 214, .7); }
}
.bar em { position: relative; display: block; text-align: center; font: bold 11px/15px var(--mono); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }

.room-zone { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.room-zone.danger { color: var(--danger); }
.room-name { font: 1.05rem/1.3 var(--serif); color: #f1d98a; margin: .15rem 0 .45rem; }

.compass { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.compass button { padding: .45rem 0; font: bold .85rem var(--mono); }
.compass button:not(:disabled) { border-color: #4d3d70; color: #efe6ff; }
.compass .look { color: var(--accent) !important; }
.compass .vert { font-size: .75rem; }

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.players button { padding: .25rem .65rem; font-size: .9rem; color: #e6a7f0; }
.players .empty { color: var(--muted); font-style: italic; font-size: .9rem; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.actions button { padding: .25rem .2rem; font-size: .76rem; line-height: 1.1; min-height: 1.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .game { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "top" "console" "side"; }
  .sidebar { padding: 0 .75rem .75rem; max-height: 40vh; }
}

/* Map viewer (map, map realm, map area) */
.t-map .map-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
#map-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 2vh 2vw; background: rgba(5, 4, 10, .9); cursor: zoom-out; }
#map-overlay[hidden] { display: none; }
#map-overlay figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
#map-overlay img { max-width: 96vw; max-height: 84vh; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #0d0b14; }
#map-overlay figcaption { color: #efe6ff; font-weight: bold; letter-spacing: .03em; }
#map-overlay .map-hint { color: #9a8fb3; font-size: .8rem; }

/* ------------------------------------------------------------ Builder mode panel */
.game.building { grid-template-columns: minmax(320px, 1fr) 300px var(--panel-w, 560px); grid-template-areas: "top top top" "console side build"; }
.builder { grid-area: build; overflow-y: auto; border-left: 1px solid var(--border); background: rgba(20, 17, 29, .92); padding: .75rem; display: flex; flex-direction: column; gap: .6rem; font-size: .9rem; }
.builder[hidden] { display: none; }
.builder.busy { opacity: .6; pointer-events: none; }
.bhead { display: flex; align-items: center; gap: .5rem; }
.bhead strong { font-family: var(--serif); color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.bwhere { flex: 1; color: var(--muted); font-size: .8rem; }
.bwarn, .berror { margin: 0; padding: .45rem .6rem; border-radius: 6px; border: 1px solid #6b3a3a; background: #2a1618; color: #f0b9b8; }
.bsys { display: flex; gap: .3rem; margin-bottom: .45rem; }
.bsys button { flex: 1; padding: .45rem .6rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); background: transparent; }
.bsys button.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.linkish { background: none; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
.bsummary td input { width: 3.5em; }
.bsummary td.small { font-size: .8em; color: var(--muted); }
.bfx .bfxhit { display: inline-flex; align-items: center; gap: .25rem; margin-right: .6rem; white-space: nowrap; }
.builder .bfx .bfxhit input[type=text], .bfx .bfxhit input[type=text] { width: 3.2em; min-width: 0; padding: .1rem .3rem; }
.berror { margin: .4rem 0; padding: .45rem .65rem; border: 1px solid #c0392b; border-radius: 6px; background: rgba(192, 57, 43, .15); color: #ffb3a8; }
.bstats { display: flex; flex-wrap: wrap; gap: .45rem .9rem; align-items: flex-end; }
.bstat { display: inline-flex; flex-direction: column; gap: .15rem; font-size: .8em; color: var(--muted); }
.bstat.bcheck { flex-direction: row; align-items: center; gap: .3rem; padding-bottom: .3rem; }
.builder .bstat input:not([type=checkbox]), .bstat input:not([type=checkbox]) { width: 6.5em; min-width: 0; padding: .2rem .35rem; }
.bstat select { min-width: 7em; }
.bstatset .bdamage { display: block; margin-top: .35rem; }
.bhints { display: flex; flex-direction: column; gap: .1rem; }
.bhints small { display: block; }
.bdamage { color: #e0c070; }
.battrs { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.battr { display: inline-flex; flex-direction: column; gap: .15rem; font-size: .8em; color: var(--muted); }
.builder .battr input, .battr input { width: 4.2em; min-width: 0; padding: .2rem .35rem; }
.bsoon { color: var(--muted); font-style: italic; }
.btabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); }
.btabs button { border-radius: 6px 6px 0 0; border-bottom: 0; padding: .35rem .7rem; color: var(--muted); background: transparent; }
.btabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.bbody { display: flex; flex-direction: column; gap: .6rem; }
.bform { display: flex; flex-direction: column; gap: .5rem; }
.bf { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.bf > span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bf small, .muted { color: var(--muted); font-size: .78rem; }
.builder input, .builder select, .builder textarea { width: 100%; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-2); color: var(--text); font: inherit; }
.builder textarea { resize: vertical; font-family: var(--serif); line-height: 1.4; }
.builder input[type=checkbox] { width: auto; }
.builder input:disabled, .builder select:disabled, .builder textarea:disabled { opacity: .55; }
.brow { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.brow.tight .bf { flex: 1 1 6rem; }
.brow.tight input[name=to], .brow.tight input[name=room] { width: 6rem; flex: 0 0 auto; }
.bflags { display: flex; flex-wrap: wrap; gap: .25rem .8rem; padding: .5rem .6rem; }
.bflags legend { font-size: .75rem; color: var(--muted); font-family: inherit; text-transform: uppercase; letter-spacing: .05em; }
.bcheck { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.bactions { display: flex; gap: .4rem; flex-wrap: wrap; }
.builder button { padding: .35rem .7rem; }
.builder button.small { padding: .15rem .5rem; font-size: .8rem; }
.builder button.danger { border-color: #6b3a3a; color: #f0b9b8; }
.builder button.danger:hover { background: #3a1d20; border-color: var(--danger); }
.bexit { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; background: var(--panel); }
.bexit h4, .bbody h4 { margin: 0 0 .35rem; font-size: .9rem; display: flex; align-items: center; gap: .35rem; }
.bexit h4 button { margin-left: auto; }
.bmapwrap { overflow: auto; padding: .4rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }
.bmap { display: grid; gap: .9rem; }
.bslot { position: relative; }
.builder .bcell, .bcell { position: relative; width: 100%; height: 100%; padding: 0; font: .72rem var(--mono); border-radius: 6px; background: var(--panel-2); }
/* Map building: + (dig) and ⇄ (link) sit in the gap on a room's side. */
.builder .bgrow, .bgrow { position: absolute; z-index: 1; width: .9rem; min-width: 0; height: .9rem; padding: 0; display: grid; place-items: center;
  font: 700 .7rem/1 var(--mono); border-radius: 50%; opacity: .35; transition: opacity .12s; transform: none !important; }
.bslot:hover .bgrow, .bgrow:focus-visible { opacity: 1; }
.bgrow:hover { opacity: 1; }
.bgrow.d-north { left: calc(50% - .45rem); bottom: 100%; }
.bgrow.d-south { left: calc(50% - .45rem); top: 100%; }
.bgrow.d-east  { top: calc(50% - .45rem); left: 100%; }
.bgrow.d-west  { top: calc(50% - .45rem); right: 100%; }
.bdig { color: var(--accent); border: 1px dashed var(--accent); background: var(--bg-2); }
.blinkx { color: var(--gold); border: 1px solid var(--gold); background: var(--bg-2); opacity: .7; }
.bcell.here { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 180, 90, .35); }
.bcell i { position: absolute; top: 1px; right: 3px; font-style: normal; font-size: .65rem; color: var(--accent); }
.bcell.x-east::after, .bcell.x-south::before { content: ""; position: absolute; background: var(--muted); }
.bcell.x-east::after { right: -.95rem; top: 50%; width: .9rem; height: 2px; }
.bcell.x-south::before { bottom: -.95rem; left: 50%; width: 2px; height: .9rem; }
.blist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }

@media (max-width: 1200px) {
  .game.building { grid-template-columns: minmax(280px, 1fr) var(--panel-w, 560px); grid-template-rows: auto 1fr auto; grid-template-areas: "top top" "console build" "side side"; }
  .game.building .sidebar { max-height: 30vh; padding: 0 .75rem .75rem; flex-direction: row; flex-wrap: wrap; }
}

/* ------------------------------------------------------------ Builder / Admin quick buttons and Admin panel */
.actions .mode { border-color: rgba(217, 180, 90, .45); color: var(--gold); }
.actions .mode:hover { border-color: var(--gold); }
.actions .mode.on { background: rgba(217, 180, 90, .16); border-color: var(--gold); }
.game.adminning { grid-template-columns: minmax(320px, 1fr) 300px var(--panel-w, 560px); grid-template-areas: "top top top" "console side build"; }
#adminpanel { grid-area: build; }
.atable { width: 100%; border-collapse: collapse; font-size: .82rem; }
.atable th { text-align: left; font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .25rem .3rem; border-bottom: 1px solid var(--border); }
.atable td { padding: .3rem; border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; }
.tag { display: inline-block; margin-left: .3rem; padding: 0 .35rem; border: 1px solid var(--border); border-radius: 4px; font-size: .68rem; color: var(--gold); }
@media (max-width: 1200px) {
  .game.adminning { grid-template-columns: minmax(280px, 1fr) var(--panel-w, 560px); grid-template-rows: auto 1fr auto; grid-template-areas: "top top" "console build" "side side"; }
  .game.adminning .sidebar { max-height: 30vh; padding: 0 .75rem .75rem; flex-direction: row; flex-wrap: wrap; }
}

/* Drag handle on the left edge of the Builder/Admin panel: drag to resize, double-click to reset. */
.panel-resize { display: none; grid-area: build; justify-self: start; align-self: stretch; width: 8px; margin-left: -4px; cursor: col-resize; z-index: 5; touch-action: none; }
.game.building .panel-resize, .game.adminning .panel-resize { display: block; }
.panel-resize:hover, .panel-resize.dragging { background: linear-gradient(90deg, transparent 2px, var(--accent) 2px, var(--accent) 5px, transparent 5px); }
.game.resizing { cursor: col-resize; user-select: none; }

/* Builder Summary tab */
.bsummary .sorter { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.bsummary .sorter.on { color: var(--gold); }
.bsummary td.num { font-family: var(--mono); width: 6rem; color: var(--muted); }
.bsummary tr.go { cursor: pointer; }
.bsummary tr.go:hover td { background: rgba(255, 255, 255, .04); }
.bsummary tr.here td { color: var(--gold); }

/* Hearth button: full width, dimmed while recovering */
.actions .hearth, .actions .mode { grid-column: span 2; }
.actions .wide { grid-column: 1 / -1; }
.actions .speed { border-color: rgba(232, 200, 74, .4); color: #e8c84a; }
.actions .speed.on { background: rgba(232, 200, 74, .16); border-color: #e8c84a; font-weight: 600; }
.actions .hearth.cooling { opacity: .55; }

/* Admin panel: area file name and rename */
.atable .fname { font-size: .75rem; margin-top: .15rem; display: flex; align-items: center; gap: .3rem; }
.atable .fname input { width: 12rem; padding: .2rem .4rem; }
#adminpanel .atable td.muted { white-space: nowrap; }
.bsummary td.yes { color: #7fc98f; }
.bsummary td.no { color: #e08a7c; font-weight: 600; }
.bsumhead { justify-content: flex-end; margin-bottom: -.4rem; }

/* Coins under the bars: a little coin for each kind, with the amount carried */
.coins { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .15rem .55rem; font: .8rem var(--mono); }
.coin-amt { display: inline-flex; align-items: center; gap: .3rem; }
.coin-amt b { font-weight: 600; color: var(--text); }
.coin { position: relative; display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: none;
        box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35), inset -2px -2px 3px rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .6); }
.coin.copper   { background: radial-gradient(circle at 35% 30%, #f3b98a, #b8692f 55%, #6e3815); }
.coin.silver   { background: radial-gradient(circle at 35% 30%, #ffffff, #b9c0c8 55%, #6b737c); }
.coin.gold     { background: radial-gradient(circle at 35% 30%, #fff1a8, #e0b330 55%, #8a6512); }
.coin.platinum { background: radial-gradient(circle at 35% 30%, #f4fbff, #9fd0e6 50%, #3f6d84); }
.coin::after { position: absolute; inset: 0; display: grid; place-items: center; font: 700 9px/1 var(--serif); color: rgba(0, 0, 0, .55); text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.coin.copper::after { content: "C"; }
.coin.silver::after { content: "S"; }
.coin.gold::after { content: "G"; }
.coin.platinum::after { content: "P"; }
.actions .hearth.casting { border-color: var(--accent); color: var(--accent); }

/* "who" list: [level Class] [Realm] Name title */
.who-row { white-space: pre-wrap; }
.who-row .wb { color: #6b6380; }
.who-row .w-level { color: #ff6b6b; font-weight: 700; }
.who-row .w-realm { color: #d9b45a; }
.who-row .w-name { color: #f3eefc; font-weight: 700; }
.who-row .w-title { color: #c7a8f0; font-style: italic; }
.who-row .w-race { color: #9a93ad; }
.w-class.c-fighter   { color: #f0924a; }
.w-class.c-cleric    { color: #f5e6a3; }
.w-class.c-thief     { color: #8fcf6a; }
.w-class.c-mage      { color: #6fa8ff; }
.w-class.c-ranger    { color: #4fd1b0; }
.w-class.c-necromancer { color: #e08cf0; }
.who-row .w-tag { font-weight: 700; letter-spacing: .05em; }
.who-row .w-dm { color: #ff9e3d; }
.who-row .w-bd { color: #5fd0e8; }
.who-row .w-afk { color: #ff7aa8; }
.who-row .w-pk { color: #e0403c; font-weight: bold; }
.bsummary td.race { white-space: nowrap; }
.bar.xp, .bar.hp, .bar.mana, .bar.end { cursor: pointer; }

/* Admin panel: the Logs tab (v0.3-00154) */
.logfilters { flex-wrap: wrap; align-items: flex-end; gap: .4rem; }
.logfilters .bf { flex: 0 1 auto; }
.logfilters input[type="date"] { width: 9.5rem; }
.logtable td.logdetail { white-space: normal; word-break: break-word; }
.logtable td:first-child { white-space: nowrap; font-size: .75rem; }
.logtable .tag { margin-left: 0; white-space: nowrap; }
/* Achievements tab (v0.6-00216) */
.achtable td { vertical-align: top; }
.achtable tr.off { opacity: .55; }
.achtable .achtitle { color: var(--gold); font-size: .75rem; }
.achform { border: 1px solid var(--border); border-radius: 8px; padding: .6rem; margin: .5rem 0; background: var(--panel-2); }
.bf.check { flex-direction: row; align-items: center; gap: .4rem; }
.bf.check > span { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.logtag-death { color: #e06c6c; border-color: rgba(224, 108, 108, .5); }
.logtag-login, .logtag-logout { color: var(--muted); }
.logtag-create, .logtag-level, .logtag-remort { color: #7fc77f; border-color: rgba(127, 199, 127, .5); }
.logtag-staff { color: #c79ae6; border-color: rgba(199, 154, 230, .5); }
.logtag-give { color: var(--gold); }
.chatlog { max-height: 24rem; overflow: auto; margin: .3rem 0 0; padding: .5rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; font-size: .75rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }

/* Shops (v0.3-00155): buttons after a line, and the sidebar's Shop button */
.t-shop { color: #d8cfb8; }
.lbtn { font: 600 .72rem var(--sans, system-ui), sans-serif; padding: .05rem .5rem; margin-left: .25rem; border-radius: 4px;
  border: 1px solid rgba(217, 180, 90, .55); background: rgba(217, 180, 90, .1); color: var(--gold); cursor: pointer; vertical-align: 1px; }
.lbtn:hover { background: rgba(217, 180, 90, .25); }
a.lbtn { display: inline-block; text-decoration: none; }   /* link buttons (profile, v0.7-00233) */
#players li { display: flex; align-items: center; gap: .3rem; }
#players .shopbtn { flex: 0 0 auto; padding: 0 .45rem; font-size: .7rem; color: var(--gold); border-color: rgba(217, 180, 90, .55); }
#players .attackbtn { flex: 0 0 auto; margin-left: auto; padding: 0 .45rem; font-size: .7rem; color: #ff8a7a; border-color: rgba(255, 111, 97, .55); }
#players .attackbtn:hover { background: rgba(255, 111, 97, .15); }

/* Banks (v0.3-00156) */
.t-bank { color: #cfd8b8; }
.actions .bankbtn { grid-column: span 2; color: var(--gold); border-color: rgba(217, 180, 90, .55); }

/* Auction house (v0.4-00163) */
.t-auction { color: #d8d0c0; }
.logtag-auction { color: var(--gold); }

/* Coloured parts of a line (v0.3-00158): the server sends [style, text]; the browser shows k-<style>. */
.line .k-head { color: var(--gold); font-weight: 700; letter-spacing: .02em; }
.line .k-rule { color: #4a4060; }
.line .k-label { color: var(--muted); }
.line .k-val { color: var(--text); font-weight: 600; }
.line .k-dim { color: #6c6383; }
.line .k-gold { color: var(--gold); }
.line .k-good { color: var(--ok); }
.line .k-bad { color: var(--danger); }
.line .k-warn { color: #e8c170; }
.line .k-hp { color: #e07a7a; font-weight: 600; }
.line .k-mana { color: #7d9ff0; font-weight: 600; }
.line .k-end { color: #e8c75a; font-weight: 600; }
.line .k-xp { color: #c08ef0; font-weight: 600; }
.line .k-level { color: #ff6b6b; font-weight: 700; }
.line .k-fighter { color: #f0924a; }
.line .k-cleric { color: #f5e6a3; }
.line .k-thief { color: #8fcf6a; }
.line .k-mage { color: #6fa8ff; }
.line .k-ranger { color: #4fd1b0; }
.line .k-necromancer { color: #e08cf0; }
.line .k-cmd { color: #c9d2ea; }
/* Wrapped lines hang under their text column: the class lists (56 characters in) and help (11). */
.t-skill-row { padding-left: 56ch; text-indent: -56ch; color: #b8c4e0; }
.t-help { padding-left: 11ch; text-indent: -11ch; }

/* The player map (v0.3-00159): the sidebar minimap and the area map overlay */
.minimap { display: block; flex: 1 1 0; min-width: 0; width: auto; aspect-ratio: 1 / 1; max-height: 210px; margin: 0; padding: 6px; background: #100d18; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.minimap:hover { border-color: #4d3d70; }
.minimap svg { width: 100%; height: 100%; display: block; }
.minimap.empty { display: none; }
@keyframes mapPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.mdot { animation: mapPulse 1.6s ease-in-out infinite; }
.mhere { filter: drop-shadow(0 0 4px rgba(232, 201, 119, .7)); }
.mroom { cursor: pointer; outline: none; }
.mroom:hover rect, .mroom:focus-visible rect { stroke: var(--accent); stroke-width: 2; }

.mapview { position: fixed; inset: 0; z-index: 50; background: rgba(6, 4, 10, .78); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.mv-panel { width: min(1240px, 100%); height: min(860px, 100%); background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; padding: 1rem 1.2rem; gap: .8rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.mv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mv-head h2 { margin: 0; font: normal 1.6rem var(--serif); color: #efe6ff; }
.mv-kicker { margin: 0; font: .72rem system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mv-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mv-tools .muted { font-size: .82rem; }
.mv-floors { display: flex; gap: .25rem; }
.mv-floors button.on { border-color: var(--accent); color: var(--text); background: var(--panel-2); }
.mv-close { width: 2.4rem; height: 2.4rem; font-size: 1rem; }
.mv-body { flex: 1; min-height: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.mv-map { position: relative; flex: 999 1 520px; min-width: 0; min-height: 320px; background: #100d18; border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mv-svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
.mv-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: .8rem; min-width: 0; overflow-y: auto; }
.mv-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .86rem; line-height: 1.5; }
.mv-card h3 { margin: 0; font: .72rem system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mv-card p { margin: 0; }
.mv-card .muted { color: var(--muted); font-size: .8rem; }
.mv-target { font: 1.15rem var(--serif); color: #e8c977; }
.mv-actions { display: flex; gap: .5rem; }
.mv-actions button { min-height: 2.6rem; padding: 0 1rem; }
.mv-key { display: grid; grid-template-columns: 18px 1fr; gap: .4rem .5rem; align-items: center; color: #b8b0c8; }
.mv-key .k-you { width: 11px; height: 11px; border-radius: 50%; background: #e8c977; box-shadow: 0 0 6px rgba(232, 201, 119, .9); justify-self: center; }
.mv-key .k-mate { width: 8px; height: 8px; border-radius: 50%; background: #4fd1b0; justify-self: center; }
.mv-key .k-dark { width: 14px; height: 14px; border-radius: 3px; background: #0a0810; border: 1px solid #2a2240; }
.mv-key .k-faded { width: 14px; height: 14px; border-radius: 3px; background: #2f4a2a; opacity: .45; }
.mv-key .k-ud { font: 700 .7rem var(--mono); color: #c9a9ff; }

/* Racial traits on the creation page (v0.4-00166) */
.cp-traits { margin-top: .6rem; text-align: left; }
.cp-traits h4 { margin: 0 0 .3rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
.cp-traits ul { margin: 0; padding-left: 1rem; font-size: .8rem; line-height: 1.4; }
.cp-traits li { margin-bottom: .25rem; }
.cp-traits strong { color: var(--gold); }
.choice .choice-traits { display: block; font-size: .7rem; color: var(--gold); opacity: .85; margin-top: .1rem; }

/* On the ground (v0.5-00179): one item per row, name then its buttons */
.ground { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; max-height: 14rem; overflow-y: auto; }
.ground li { display: flex; align-items: center; gap: .3rem; }
.ground button.item { flex: 1 1 auto; min-width: 0; text-align: left; padding: .2rem .55rem; font-size: .88rem; color: #9fd3c7;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ground button.item.rot { color: #a89f8a; font-style: italic; }
.ground button.item.coins { color: var(--gold); }
.ground .groundbtn { flex: 0 0 auto; padding: 0 .45rem; font-size: .7rem; color: var(--gold); border-color: rgba(217, 180, 90, .55); }

/* Compact sidebar (v0.5-00180): coins beside the name, minimap and compass side by side */
.me-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.coin-amt[hidden] { display: none; }
.nav { display: flex; align-items: center; gap: .5rem; }
.nav .compass { flex: 1 1 0; min-width: 0; }
.room-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }

/* Folding frames (v0.5-00180): click a heading to fold the frame to its title */
.sidebar h3.fold { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.sidebar h3.fold::after { content: '\25BE'; font-size: .8rem; opacity: .7; }
.sidebar h3.fold:hover { color: var(--text); }
.panel.folded > :not(h3):not(.fold-keep) { display: none !important; }
.panel.folded h3.fold { margin: 0; }
.panel.folded h3.fold::after { content: '\25B8'; }
.panel.folded .room-name { margin-bottom: 0; }
.fold-btn { background: none; border: 0; padding: 0 .2rem; font-size: .8rem; line-height: 1; color: var(--muted); cursor: pointer; opacity: .7; }
.fold-btn:hover { color: var(--text); opacity: 1; background: none; }
.panel.folded .fold-btn { transform: rotate(-90deg); }

/* Tier colours (v0.5-00186, Vexen): common, uncommon, rare, epic, legendary. Recipe items now;
   anything else given a tier later uses the same five. */
.k-rar-common, .ground button.item.rar-common { color: #a3a3a3; }
.k-rar-uncommon, .ground button.item.rar-uncommon { color: #7ee07e; }
.k-rar-rare, .ground button.item.rar-rare { color: #4ea3ff; }
.k-rar-epic, .ground button.item.rar-epic { color: #b974ff; }
.k-rar-legendary, .ground button.item.rar-legendary { color: #ff9a3c; }

/* Coins in text (v0.5-00188): each coin's own colour, like the sidebar's coin icons */
.line .k-coin-platinum { color: #cfe3f2; }
.line .k-coin-gold { color: #f2c84b; }
.line .k-coin-silver { color: #c7c9cf; }
.line .k-coin-copper { color: #d98c56; }

/* Map buttons beside S (v0.5-00193): the realm map, and the world map (later) */
.compass .mapbtn { display: flex; align-items: center; justify-content: center; padding: .3rem 0; }
.compass .mapbtn svg { width: 1.15rem; height: 1.15rem; }
.compass .mapbtn:not(:disabled) { color: var(--gold); border-color: rgba(217, 180, 90, .45); }
.compass .mapbtn:disabled { opacity: .35; cursor: not-allowed; }

/* Premium (v0.5-00197): the gem in the top bar, the date beside it, the purchase window */
.premium-until { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.premium-until b { color: var(--gold); font-weight: 600; }
.premium-btn { display: inline-flex; align-items: center; justify-content: center; padding: .25em .45em; background: transparent; color: var(--gold); border-color: #5a4a2a; }
.premium-btn:hover:not(:disabled) { border-color: var(--gold); background: #2a2214; }
.premium-btn.on { background: #2a2214; border-color: var(--gold); box-shadow: 0 0 6px rgba(217, 180, 90, .35); }
.t-premium { color: var(--gold); font-weight: 600; }
.premium-overlay { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; background: rgba(5, 4, 10, .85); }
.premium-overlay[hidden] { display: none; }
.premium-overlay.busy { cursor: progress; }
.premium-overlay.busy .premium-box { opacity: .7; pointer-events: none; }
.premium-box { position: relative; width: min(30rem, 96vw); max-height: 94vh; overflow-y: auto; padding: 1.2rem 1.4rem; background: var(--panel); border: 1px solid #5a4a2a; border-radius: 8px; box-shadow: 0 0 30px rgba(0, 0, 0, .6); }
.premium-box h2 { margin: 0 0 .4rem; font-family: var(--serif); color: var(--gold); letter-spacing: .06em; }
.premium-close { position: absolute; top: .5rem; right: .6rem; padding: 0 .45em; font-size: 1.3rem; line-height: 1.3; background: transparent; border-color: transparent; color: var(--muted); }
.premium-status { margin: 0 0 .4rem; }
.premium-perks { margin: 0 0 .9rem; padding-left: 1.2rem; color: #c9c0d8; font-size: .9rem; }
.premium-perks li { margin: .15rem 0; }
.premium-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .8rem; }
.premium-pack { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .3rem; }
.premium-pack b { font-size: 1.25rem; color: #efe6ff; }
.premium-pack span { font-size: .8rem; color: var(--muted); }
.premium-pack.chosen { border-color: var(--gold); background: #2a2214; }
.premium-pack.chosen b { color: var(--gold); }
.premium-gift { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.premium-gift-name { display: block; width: 100%; margin-top: .4rem; }
.premium-gift-name[hidden] { display: none; }
.premium-note { font-size: .8rem; color: var(--muted); margin: .7rem 0; }
.premium-pay { display: flex; gap: .5rem; }
.premium-pay .btn { flex: 1; }
.premium-pay [hidden] { display: none; }
.premium-error { margin: .6rem 0 0; color: var(--danger); }

/* Discord link in the top bar (v0.5-00198; square, the Premium gem's size, v0.5-00199) */
.premium-btn, .discord-btn { box-sizing: border-box; width: 2rem; height: 2rem; padding: 0; }
.discord-btn { display: inline-flex; align-items: center; justify-content: center; color: #aab4ff; text-decoration: none; border: 1px solid #3a3f6e; border-radius: 4px; background: transparent; }
.discord-btn:hover { color: #fff; border-color: #5865f2; background: #23264a; }
.discord-btn img { display: block; width: 18px; height: 18px; object-fit: contain; }

/* The Builder / Admin frame (v0.5-00201): 12 staff buttons, gold like the mode buttons */
.staff-buttons .sc { border-color: rgba(217, 180, 90, .45); color: var(--gold); }
.staff-buttons .sc:hover:not(:disabled) { border-color: var(--gold); background: rgba(217, 180, 90, .12); }
.staff-modes { margin-bottom: .3rem; }

/* Fight summary (v0.5-00209): the card after a fight (Summary button, recap, or a fight of 30 s and more) */
.fight-sum { margin: .35rem 0 .5rem; padding: .5rem .65rem .4rem; max-width: 46rem; background: var(--panel-2);
  border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 6px; font-size: .82rem; line-height: 1.35; }
.fight-sum .fs-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; }
.fight-sum .fs-title { color: var(--gold); font-weight: 700; letter-spacing: .03em; }
.fight-sum .fs-time { color: var(--muted); font: .75rem var(--mono); }
.fight-sum .fs-table { border-collapse: collapse; width: 100%; }
.fight-sum .fs-table td, .fight-sum .fs-table th { padding: .05rem .4rem; text-align: left; vertical-align: top; }
.fight-sum .fs-table th { color: var(--muted); font: .68rem var(--mono); text-transform: uppercase; letter-spacing: .05em; font-weight: 400; }
.fight-sum .fs-table .n { text-align: right; font-family: var(--mono); white-space: nowrap; }
.fight-sum .fs-table th:not(:first-child) { text-align: right; }
.fight-sum .fs-group { margin-bottom: .35rem; }
.fight-sum .fs-group tr.me td { color: #ffe08a; }
.fight-sum details.fs-member { border-top: 1px solid var(--border); padding: .25rem 0 .2rem; }
.fight-sum details.fs-member > summary { cursor: pointer; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.fight-sum .fs-name { color: var(--text); font-weight: 600; }
.fight-sum details.me .fs-name { color: #ffe08a; }
.fight-sum .fs-brief { color: var(--muted); font-size: .76rem; }
.fight-sum .fs-sec { margin: .3rem 0 0 .9rem; }
.fight-sum .fs-sec-head { display: flex; gap: .6rem; color: #c9a9ff; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.fight-sum .fs-total { color: var(--text); font-family: var(--mono); text-transform: none; letter-spacing: 0; }
.fight-sum .fs-sec .fs-table { width: auto; }
.fight-sum .fs-src { color: var(--text); min-width: 12rem; padding-right: 1.2rem; }
.fight-sum .fs-sec .fs-table .n { min-width: 3.5rem; }
.fight-sum .fs-out { padding-left: .9rem; }
.fight-sum .fs-out { color: var(--muted); font-size: .74rem; }
.fight-sum .fs-spent { margin: .3rem 0 0 .9rem; color: var(--muted); font-size: .76rem; }

/* Examine (v0.7-00239): the item's description, set apart from its facts */
.line.t-item-desc { color: #bdb3d4; border-left: 2px solid #3a3150; padding-left: .7rem; margin: .2rem 0 .45rem .15rem; }

/* Player update notes (v0.7-00242): the news command and "the realm has been updated". */
.line.t-news-top { color: var(--gold); font-weight: bold; margin-top: .35rem; }
.line.t-news-head { color: var(--accent); margin-top: .4rem; }
.line .k-news-date { color: var(--accent); font-weight: bold; }
.line .k-news-title { color: var(--text); }
.line.t-news-item { color: #c9c1d9; padding-left: 1rem; }
