:root {
  --ink: #f3ead5;
  --muted: #c6b99f;
  --panel: #4d4437;
  --panel-dark: #2c261e;
  --panel-deep: #17130f;
  --panel-light: #706451;
  --parchment: #d7c7a5;
  --parchment-dark: #9f8c69;
  --line: #1b1712;
  --line-light: #9b8d73;
  --gold: #f1c75b;
  --gold-dark: #9c7425;
  --red: #b6312d;
  --green: #2c9b3d;
  --blue: #4b8bc1;
  --cyan: #65d7d0;
  --shadow: 0 10px 28px rgba(0, 0, 0, .56);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #0b0906; }
body {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  user-select: none;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

#game-shell {
  position: relative;
  width: min(100vw, 1440px);
  height: min(100vh, 920px);
  overflow: hidden;
  background: #050604;
  border: 2px solid #88785e;
  box-shadow: 0 0 0 2px #211b14, 0 0 0 4px #080604, 0 25px 90px #000;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #030503;
  cursor: crosshair;
}

.game-frame {
  border: 2px solid #211c15;
  background: linear-gradient(135deg, #625744, #40382d 52%, #2d271f);
  box-shadow:
    inset 0 0 0 1px #998970,
    inset 0 0 0 3px rgba(31, 25, 18, .58),
    var(--shadow);
}

#action-line {
  position: absolute;
  left: 18px;
  top: 98px;
  max-width: 58%;
  padding: 4px 7px;
  color: #fff2a1;
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 2px 2px #000, -1px -1px #000;
  pointer-events: none;
  z-index: 8;
}

#player-hud {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 18;
  width: 272px;
  min-height: 76px;
  padding: 9px;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 10px;
}
.hud-portrait {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #251c0c;
  background: radial-gradient(circle at 35% 30%, #f6da7b, #b0802a 72%);
  border: 2px ridge #d4bd7a;
  font-family: "Courier New", monospace;
  font-weight: 900;
  letter-spacing: -1px;
  box-shadow: inset 0 0 9px rgba(255, 255, 255, .2);
}
.hud-copy { min-width: 0; }
.hud-name-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
#hud-player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff1c5; }
.role-badge {
  color: #221807;
  background: linear-gradient(#f7dc77, #b98527);
  border: 1px solid #49320e;
  padding: 2px 5px;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .6px;
}
.hud-health-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  background: #5a1717;
  border: 2px inset #8b7354;
}
#hud-health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(#d94b42, #8d201e);
  transition: width .18s ease;
}
#hud-health-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  text-shadow: 1px 1px #000;
}

#minimap-panel {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 224px;
  height: 224px;
  z-index: 17;
  pointer-events: none;
}
#minimap {
  display: block;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px ridge #8e7b5d;
  box-shadow: 0 0 0 2px #1d1812, 0 8px 24px rgba(0,0,0,.58);
  image-rendering: pixelated;
  background: transparent;
}

#top-tabs {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 3px;
  z-index: 20;
  padding: 5px;
}
.tab-button {
  width: 54px;
  height: 52px;
  border: 1px solid #211b14;
  background: linear-gradient(#655a48, #3d352a);
  color: #dfd2b8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  transition: filter .1s ease, transform .1s ease;
  box-shadow: inset 0 0 0 1px rgba(185, 168, 137, .35);
}
.tab-button span { font-size: 18px; line-height: 1; filter: saturate(.72); }
.tab-button small { font-family: "Courier New", monospace; font-size: 8px; font-weight: 800; }
.tab-button:hover { filter: brightness(1.18); transform: translateY(-1px); color: white; }
.tab-button.active {
  color: #2b1e08;
  background: linear-gradient(#f0d377, #b9872d);
  box-shadow: inset 0 0 0 1px #ffe8a5;
}
.tab-button.admin-only:not(.active) { color: #ffe676; }

.panel-card { overflow: hidden; }
.panel-card > header {
  min-height: 40px;
  padding: 0 11px 0 13px;
  color: #f5df9a;
  font-family: "Courier New", monospace;
  font-weight: 900;
  background: linear-gradient(#554a3a, #332c23);
  border-bottom: 2px ridge #8c7c62;
  letter-spacing: .7px;
  display: flex;
  align-items: center;
}

#side-panel {
  position: absolute;
  z-index: 19;
  right: 12px;
  bottom: 79px;
  width: 362px;
  max-height: calc(100% - 330px);
}
#side-panel header { justify-content: space-between; }
#close-panel {
  width: 27px;
  height: 27px;
  border: 1px solid #211b14;
  color: #f1dfbd;
  background: #4b4032;
  font-family: Arial, sans-serif;
  font-size: 19px;
  line-height: 1;
}
#close-panel:hover { background: #6c5d48; }
#panel-content { padding: 11px; max-height: min(585px, calc(100vh - 355px)); overflow: auto; }

.inventory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.inventory-slot,
.equipment-item-button {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px inset #84745a;
  background:
    radial-gradient(circle at 50% 42%, rgba(116, 101, 78, .82), rgba(44, 37, 28, .95) 72%);
  display: grid;
  place-items: center;
  color: white;
  font-size: 28px;
  text-shadow: 1px 1px #000;
}
.inventory-slot:hover,
.equipment-item-button:hover { border-color: var(--gold); filter: brightness(1.17); }
.inventory-slot .qty { position: absolute; right: 4px; bottom: 2px; font-family: "Courier New", monospace; font-size: 11px; color: #ffff70; font-weight: 900; text-shadow: 1px 1px #000; }
.inventory-slot.empty { opacity: .72; }

.equipment-layout { display: grid; gap: 10px; }
.equipment-paperdoll {
  min-height: 286px;
  position: relative;
  border: 2px inset #82725a;
  background: radial-gradient(circle at 50% 42%, #655947, #2e281f 72%);
}
.equipment-slot {
  position: absolute;
  width: 78px;
  display: grid;
  gap: 3px;
  text-align: center;
}
.equipment-slot[data-slot="helmet"] { top: 11px; left: 50%; transform: translateX(-50%); }
.equipment-slot[data-slot="chestplate"] { top: 105px; left: 50%; transform: translateX(-50%); }
.equipment-slot[data-slot="leggings"] { top: 198px; left: 50%; transform: translateX(-50%); }
.equipment-slot[data-slot="weapon"] { top: 111px; left: 17px; }
.equipment-slot[data-slot="shield"] { top: 111px; right: 17px; }
.equipment-slot-label { font-family: "Courier New", monospace; font-size: 9px; color: #d6c7a9; }
.equipment-item-button { width: 66px; height: 66px; aspect-ratio: auto; margin: 0 auto; font-size: 27px; }
.equipment-item-button.empty { color: #8f8169; font-size: 20px; }
.equipment-summary { padding: 9px; border: 2px inset #82725a; background: #332c23; }
.equipment-summary h3 { margin: 0 0 7px; color: #f2d478; font-size: 14px; }
.equipment-stat-row { display: flex; justify-content: space-between; padding: 3px 0; font-family: "Courier New", monospace; font-size: 12px; }
.equipment-stat-row strong { color: #7de28b; }

.skill-list { display: grid; gap: 8px; }
.skill-card { padding: 8px 9px; border: 2px inset #84745a; background: linear-gradient(#4d4233, #332b22); }
.skill-header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.skill-name { color: #f0d483; font-weight: 800; }
.skill-level { color: #fff; font-family: "Courier New", monospace; font-weight: 900; }
.skill-xp-copy { margin-top: 4px; color: #cfc0a3; font-family: "Courier New", monospace; font-size: 10px; display: flex; justify-content: space-between; gap: 8px; }
.xp-track { margin-top: 6px; height: 12px; border: 2px inset #78684f; background: #1d1914; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(#e6c65c, #9e7424); min-width: 0; }

.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid #786b56; }
.setting-row button, .panel-button {
  border: 2px outset #786b55;
  padding: 6px 9px;
  background: linear-gradient(#675b47, #41382c);
  color: var(--ink);
}
.setting-row button:hover, .panel-button:hover { filter: brightness(1.18); }
.social-note, .admin-note { line-height: 1.55; color: #e0d4bc; }

#chat-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: min(740px, calc(100% - 420px));
  height: 188px;
  z-index: 12;
  overflow: visible;
}
#chat-panel > #chat-messages { border-radius: 1px 1px 0 0; }
#chat-messages {
  height: 124px;
  padding: 9px 11px 5px;
  overflow-y: auto;
  color: #efe4c4;
  background: rgba(35, 29, 22, .72);
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  text-shadow: 1px 1px #000;
  user-select: text;
}
.chat-line.public { color: #f8e8b1; }
.chat-line.system { color: #72e0d5; }
.chat-line.combat { color: #ffad72; }
#chat-form { height: 31px; display: flex; align-items: center; gap: 7px; padding: 3px 10px; border-top: 2px ridge #806f56; background: #322a21; }
.chat-chevron { color: var(--gold); font-size: 20px; }
#chat-input { flex: 1; min-width: 0; border: 0; outline: 0; color: #fff; background: transparent; font-family: "Courier New", monospace; user-select: text; }
#chat-tabs { display: grid; grid-template-columns: repeat(5, 1fr); height: 33px; border-top: 1px solid #1a1611; }
#chat-tabs button { border: 0; border-right: 1px solid #201a13; background: linear-gradient(#554a3b, #342c22); color: #d8cbb2; padding: 3px; font-family: "Courier New", monospace; font-size: 10px; }
#chat-tabs button:hover { filter: brightness(1.18); }
#chat-tabs button.active { color: #261b08; background: linear-gradient(#ecd070, #ae7e28); font-weight: 900; }
#chat-tabs #report-button { color: #ffb2a8; }

#context-menu {
  position: absolute;
  z-index: 260;
  min-width: 220px;
  display: none;
  padding: 4px;
  border: 2px solid #1a1510;
  background: #3e352a;
  box-shadow: inset 0 0 0 1px #8c7b61, 0 12px 30px rgba(0,0,0,.68);
}
#context-menu.open { display: block; }
#context-menu {
  max-height: min(72dvh, 620px);
  max-width: min(92vw, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.context-title { padding: 7px 8px; color: #f0ce68; border-bottom: 1px solid #7c6c53; font-weight: 800; }
.context-option { display: block; width: 100%; padding: 7px 9px; border: 0; text-align: left; color: white; background: transparent; }
.context-option:hover { color: #211807; background: #d1ae4f; }
.context-danger { color: #ff9c91; }

#item-tooltip {
  position: absolute;
  z-index: 140;
  width: 270px;
  padding: 9px;
  pointer-events: none;
  border: 2px solid #19140e;
  background: linear-gradient(#514634, #2a241c);
  box-shadow: inset 0 0 0 1px #9b8867, 0 12px 30px rgba(0,0,0,.65);
}
.item-tooltip-head { display: grid; grid-template-columns: 44px 1fr; gap: 9px; align-items: center; }
.item-tooltip-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 2px inset #87765a; background: #332b21; font-size: 27px; }
.item-tooltip-name { color: #f4d375; font-weight: 900; }
.item-tooltip-slot { margin-top: 2px; color: #bfb096; font-family: "Courier New", monospace; font-size: 9px; text-transform: uppercase; }
.item-tooltip-description { margin: 8px 0; color: #eadfc8; font-size: 12px; line-height: 1.38; }
.item-tooltip-stats { border-top: 1px solid #78684f; padding-top: 6px; display: grid; gap: 3px; }
.item-tooltip-stat { display: flex; justify-content: space-between; font-family: "Courier New", monospace; font-size: 11px; }
.item-tooltip-stat strong { color: #7de28b; }

#dialogue { position: absolute; z-index: 90; left: 50%; bottom: 218px; transform: translateX(-50%); width: min(590px, 90%); padding: 15px; }
#dialogue strong { color: var(--gold); }
#dialogue p { margin: 9px 0 16px; line-height: 1.5; }
#dialogue button { float: right; padding: 7px 14px; border: 2px outset #8b7757; background: #b68b38; color: #211807; font-weight: 800; }

#login-screen {
  position: absolute;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 28%, rgba(129, 105, 63, .33), transparent 34%),
    linear-gradient(160deg, #31291f, #0d0a07 72%);
}
#login-screen.hidden { display: none; }
.login-backdrop-grid {
  position: absolute;
  inset: 0;
  opacity: .09;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(700px) rotateX(56deg) scale(1.7) translateY(22%);
  transform-origin: center bottom;
}
.login-card { position: relative; width: min(760px, 94vw); padding: 23px; }
.login-brand { display: flex; justify-content: center; align-items: center; gap: 13px; text-align: left; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; color: #211806; background: radial-gradient(circle at 35% 30%, #f3da7c, #a87825 75%); border: 3px ridge #c6ad6a; font-family: "Courier New", monospace; font-size: 19px; font-weight: 900; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.login-brand span { display: block; color: #d9ccb5; font-family: "Courier New", monospace; font-size: 13px; font-weight: 800; letter-spacing: 5px; }
.login-brand strong { display: block; color: #f0cd68; font-size: clamp(28px, 5vw, 48px); line-height: .95; letter-spacing: 3px; text-shadow: 2px 2px #241707; }
.login-subtitle { margin: 13px 0 20px; color: #c9bda7; text-align: center; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; max-width: 390px; margin: 0 auto 18px; border: 2px inset #806f55; background: #302820; }
.auth-switch button { border: 0; padding: 9px; background: transparent; color: #c4b79f; font-weight: 800; }
.auth-switch button.active { color: #251a07; background: linear-gradient(#efd374, #a97827); }
.auth-form { display: grid; gap: 9px; max-width: 390px; margin: 0 auto; }
.auth-form label { color: #eadfc9; font-size: 12px; font-weight: 750; }
.auth-form input, .customizer-grid select {
  width: 100%;
  padding: 9px 10px;
  border: 2px inset #87755a;
  background: #2d261e;
  color: white;
  user-select: text;
}
.primary-button { margin-top: 4px; padding: 10px 14px; border: 2px outset #c6a958; background: linear-gradient(#efd373, #aa7a28); color: #241907; font-weight: 900; box-shadow: 0 7px 18px rgba(0,0,0,.35); }
.primary-button:hover { filter: brightness(1.1); }
.form-error { min-height: 1.1em; margin: 1px 0 0; color: #ff9d92; font-size: 12px; text-align: center; }
.login-help { margin: 17px 0 0; color: #ad9f88; font-size: 11px; text-align: center; }
.registration-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.1fr); gap: 18px; }
#register-form { max-width: none; }
.register-fields { display: grid; gap: 8px; align-content: start; }
.creator-card { padding: 9px; border: 2px inset #827158; background: #352d24; }
#register-preview { width: 100%; height: 195px; display: block; background: radial-gradient(circle at 50% 55%, #665846, #211c16 68%); image-rendering: pixelated; }
.customizer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.customizer-field { display: grid; gap: 4px; }
.customizer-field label { color: #c7b9a0; font-size: 10px; }
.customizer-grid select { padding: 7px; font-size: 11px; }
.first-admin-note { margin: 2px 0 0; color: #c9bda7; font-size: 11px; text-align: center; }

.character-editor { display: grid; gap: 10px; }
.character-preview-wrap { padding: 8px; border: 2px inset #806f56; background: #352d24; }
#panel-character-preview { width: 100%; height: 200px; display: block; background: radial-gradient(circle at 50% 60%, #655846, #211c16 68%); image-rendering: pixelated; }
.character-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.character-controls .customizer-field select { width: 100%; padding: 8px; border: 2px inset #806f56; background: #2c251d; color: white; }
.save-appearance { width: 100%; margin-top: 4px; }
.admin-panel { display: grid; gap: 10px; }
.admin-stat { display: flex; justify-content: space-between; padding: 8px 9px; border: 2px inset #827159; background: #352d24; }
.admin-stat strong { color: #f0cf6d; }
.admin-broadcast { display: grid; gap: 7px; }
.admin-broadcast input { padding: 9px; border: 2px inset #806e55; background: #282119; color: white; user-select: text; }

@media (max-width: 980px) {
  #player-hud { width: 230px; }
  #minimap-panel { transform: scale(.84); transform-origin: top right; }
  #top-tabs { transform: scale(.82); transform-origin: bottom right; }
  #side-panel { width: 320px; max-height: calc(100% - 280px); }
  #chat-panel { width: calc(100% - 350px); height: 170px; }
  #chat-messages { height: 106px; }
}

@media (max-width: 720px) {
  #game-shell { border: 0; }
  #player-hud { left: 7px; top: 7px; transform: scale(.78); transform-origin: top left; }
  #minimap-panel { right: 5px; top: 5px; transform: scale(.58); }
  #top-tabs { right: 5px; bottom: 5px; transform: scale(.62); }
  #action-line { left: 7px; top: 72px; font-size: 12px; }
  #side-panel { right: 7px; bottom: 55px; width: min(310px, calc(100% - 14px)); max-height: calc(100% - 210px); }
  #chat-panel { left: 7px; bottom: 7px; width: calc(100% - 250px); min-width: 300px; height: 145px; }
  #chat-messages { height: 83px; font-size: 10px; }
  .login-card { padding: 17px 13px; }
  .registration-layout { grid-template-columns: 1fr; }
  .creator-card { order: -1; }
  #register-preview { height: 155px; }
}

/* Procedural-world responsive UI refinements */
html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
body { display: block; }

#game-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  box-shadow: none;
}

#minimap-panel {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: manipulation;
}
#minimap { cursor: crosshair; }

#side-panel {
  width: min(430px, calc(100vw - 24px));
  max-height: calc(100vh - 168px);
  max-height: calc(100dvh - 168px);
}
#panel-content {
  padding: 14px;
  max-height: calc(100vh - 218px);
  max-height: calc(100dvh - 218px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #a88442 #2b241b;
}

.inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
}
.inventory-slot {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  font-size: clamp(25px, 2.2vw, 34px);
  touch-action: none;
}
.inventory-slot.dragging { opacity: .42; filter: saturate(.45); }
.inventory-slot.drag-over {
  border-color: #f4d778;
  box-shadow: inset 0 0 0 2px rgba(244, 215, 120, .72), 0 0 12px rgba(244, 215, 120, .35);
}

#chat-panel {
  width: min(760px, calc(100vw - 430px));
  max-width: calc(100vw - 24px);
}

#login-screen {
  overflow: hidden;
  padding: clamp(8px, 2vh, 22px);
}
.login-card {
  width: min(760px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.login-card::-webkit-scrollbar { display: none; }

#panel-content,
#chat-messages,
.auth-form,
.character-controls {
  scrollbar-width: thin;
  scrollbar-color: #a88442 #2b241b;
}
#panel-content::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar,
.auth-form::-webkit-scrollbar,
.character-controls::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
#panel-content::-webkit-scrollbar-track,
#chat-messages::-webkit-scrollbar-track,
.auth-form::-webkit-scrollbar-track,
.character-controls::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #211b14, #342b20, #211b14);
  border-left: 1px solid #17120d;
}
#panel-content::-webkit-scrollbar-thumb,
#chat-messages::-webkit-scrollbar-thumb,
.auth-form::-webkit-scrollbar-thumb,
.character-controls::-webkit-scrollbar-thumb {
  min-height: 32px;
  border: 2px solid #2a2219;
  border-radius: 2px;
  background: linear-gradient(90deg, #6b5430, #bd9548 48%, #6b5430);
  box-shadow: inset 0 0 0 1px #d1b46c;
}
#panel-content::-webkit-scrollbar-thumb:hover,
#chat-messages::-webkit-scrollbar-thumb:hover,
.auth-form::-webkit-scrollbar-thumb:hover,
.character-controls::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #7b6034, #d1ac57 48%, #7b6034);
}
#panel-content::-webkit-scrollbar-corner,
#chat-messages::-webkit-scrollbar-corner { background: #211b14; }

@media (max-height: 760px) and (min-width: 721px) {
  .login-card { padding: 15px 20px; }
  #register-preview { height: 145px; }
  .login-subtitle { margin: 7px 0 10px; }
  .auth-switch { margin-bottom: 10px; }
  .login-help { margin-top: 8px; }
  .auth-form { gap: 6px; }
  .auth-form input { padding-top: 7px; padding-bottom: 7px; }
}

@media (max-width: 980px) {
  #side-panel { width: min(370px, calc(100vw - 20px)); max-height: calc(100dvh - 155px); }
  #panel-content { max-height: calc(100dvh - 205px); }
  #chat-panel { width: min(650px, calc(100vw - 350px)); }
}

@media (max-width: 720px) {
  #side-panel {
    right: 7px;
    bottom: 174px;
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 300px);
  }
  #panel-content { max-height: calc(100dvh - 350px); }
  .inventory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .inventory-slot { min-height: 56px; }

  #chat-panel {
    left: 7px;
    bottom: 50px;
    width: calc(100vw - 14px);
    min-width: 0;
    height: 120px;
  }
  #chat-messages { height: 58px; }

  #login-screen { padding: 5px; }
  .login-card {
    width: calc(100vw - 10px);
    max-height: calc(100dvh - 10px);
    padding: 13px 11px;
    transform: none;
  }
  .brand-mark { width: 46px; height: 46px; font-size: 16px; }
  .login-brand { gap: 9px; }
  .login-brand span { font-size: 10px; letter-spacing: 3px; }
  .login-brand strong { font-size: clamp(27px, 9vw, 36px); letter-spacing: 2px; }
  .login-subtitle { margin: 8px 0 11px; font-size: 13px; }
  .auth-switch { margin-bottom: 11px; }
  .auth-switch button { padding: 8px 4px; font-size: 13px; }
  .auth-form { width: 100%; max-width: none; gap: 6px; }
  .auth-form input { padding: 7px 8px; }
  .primary-button { padding: 9px 12px; }
  .login-help { margin-top: 10px; font-size: 9px; line-height: 1.35; }

  .registration-layout { grid-template-columns: 1fr; gap: 9px; }
  .creator-card {
    order: 0;
    display: grid;
    grid-template-columns: minmax(92px, 32%) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    padding: 7px;
  }
  #register-preview { height: 138px; }
  .customizer-grid { margin-top: 0; gap: 5px 6px; }
  .customizer-field { gap: 2px; }
  .customizer-grid select { padding: 5px; font-size: 10px; }
  .first-admin-note { font-size: 9px; line-height: 1.3; }
}

@media (max-width: 430px) {
  #top-tabs { transform: scale(.57); }
  #player-hud { transform: scale(.72); }
  #minimap-panel { transform: scale(.52); }
  .tab-button { width: 51px; }
  .inventory-slot { min-height: 52px; }
  .equipment-paperdoll { min-height: 270px; }
}

@media (max-height: 650px) {
  .login-help { display: none; }
  .login-card { padding-top: 9px; padding-bottom: 9px; }
  .login-subtitle { margin-top: 5px; margin-bottom: 7px; }
  .auth-switch { margin-bottom: 7px; }
  #register-preview { height: 108px; }
  .creator-card { grid-template-columns: minmax(80px, 28%) minmax(0, 1fr); }
}

/* Steel progression, banking, and compact interface update */
#top-tabs {
  padding: 4px;
  gap: 2px;
}
.tab-button {
  width: 48px;
  height: 46px;
}
.tab-button span { font-size: 16px; }
.tab-button small { font-size: 7px; }

#side-panel {
  top: 246px;
  right: 12px;
  bottom: 70px;
  width: min(330px, calc(100vw - 24px));
  max-height: none;
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
}
#side-panel > header { min-height: 36px; }
#panel-content {
  min-height: 0;
  max-height: none;
  padding: 9px;
}
.inventory-grid { gap: 6px; }
.inventory-slot { min-height: 56px; font-size: 27px; }
.equipment-paperdoll { min-height: 250px; }
.equipment-slot { width: 68px; }
.equipment-item-button { width: 58px; height: 58px; font-size: 24px; }
.equipment-slot[data-slot="helmet"] { top: 8px; }
.equipment-slot[data-slot="chestplate"] { top: 86px; }
.equipment-slot[data-slot="leggings"] { top: 166px; }
.equipment-slot[data-slot="weapon"],
.equipment-slot[data-slot="shield"] { top: 91px; }
.skill-card { padding: 6px 7px; }
.skill-list { gap: 6px; }

.center-interface {
  position: absolute;
  z-index: 82;
  left: 50%;
  top: 50%;
  width: min(860px, calc(100vw - 42px));
  height: min(610px, calc(100dvh - 70px));
  transform: translate(-50%, -50%);
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(145deg, #5d513f, #3a3126 48%, #251f18);
}
.center-interface-header {
  min-height: 58px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px ridge #8d7a5c;
  background: linear-gradient(#594d3b, #332b21);
}
.center-interface-header > div:first-child { display: grid; gap: 1px; }
.center-interface-header strong { color: #f3db92; font-size: 20px; }
.interface-kicker {
  color: #baa985;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.interface-close {
  width: 31px;
  height: 31px;
  border: 2px outset #79684f;
  color: #f4e8cf;
  background: #4a3d2e;
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
}
.interface-close:hover { filter: brightness(1.2); }

.bank-header-actions,
.shop-wallet {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Courier New", monospace;
}
#bank-counter {
  min-width: 82px;
  padding: 6px 8px;
  color: #fff0a3;
  border: 2px inset #79684e;
  background: #211b14;
  font-weight: 900;
  text-align: center;
}
.bank-toolbar {
  min-height: 46px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #211b14;
  background: #30281f;
}
.bank-toolbar .panel-button { padding: 5px 8px; font-size: 12px; }
#bank-status {
  margin-left: auto;
  color: #d8c9aa;
  font-family: "Courier New", monospace;
  font-size: 10px;
  text-align: right;
}
.bank-layout {
  height: calc(100% - 106px);
  min-height: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 254px;
  gap: 10px;
}
.bank-vault-section,
.bank-inventory-section {
  min-height: 0;
  padding: 8px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 2px inset #7f6d52;
  background: rgba(40, 33, 25, .8);
}
.bank-vault-section h3,
.bank-inventory-section h3 {
  margin: 0;
  color: #efd27a;
  font-size: 14px;
}
.bank-vault-section p,
.bank-inventory-section p {
  margin: 4px 0 8px;
  color: #bcae94;
  font-size: 10px;
  line-height: 1.35;
}
.bank-grid {
  min-height: 0;
  padding: 6px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(44px, 1fr));
  grid-auto-rows: 50px;
  align-content: start;
  gap: 5px;
  border: 2px inset #5e503d;
  background: #211b15;
}
.bank-inventory-grid {
  min-height: 0;
  padding: 6px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 51px;
  align-content: start;
  gap: 5px;
  border: 2px inset #5e503d;
  background: #211b15;
}
.bank-slot,
.bank-inventory-slot {
  position: relative;
  min-width: 0;
  border: 2px inset #7d6b51;
  background: radial-gradient(circle at 50% 42%, #675a46, #31291f 76%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  text-shadow: 1px 1px #000;
}
.bank-slot:hover,
.bank-inventory-slot:hover { border-color: #efd477; filter: brightness(1.15); }
.bank-slot.empty,
.bank-inventory-slot.empty { opacity: .5; }
.bank-slot .qty,
.bank-inventory-slot .qty {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #fff36f;
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  text-shadow: 1px 1px #000;
}

.shop-interface {
  width: min(760px, calc(100vw - 42px));
  height: min(570px, calc(100dvh - 70px));
}
.shop-wallet span { color: #cbbb9d; font-size: 10px; }
.shop-wallet strong { color: #fff16e; }
.shop-content {
  height: calc(100% - 58px);
  min-height: 0;
  padding: 11px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 9px;
}
.steel-set-offer {
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 2px inset #8a7758;
  background: linear-gradient(110deg, #4b4030, #282119);
}
.steel-set-offer h3 { margin: 2px 0 3px; color: #eef5f6; }
.steel-set-offer p { margin: 0; max-width: 480px; color: #c5b79c; font-size: 11px; }
.steel-set-offer .primary-button { margin: 0; white-space: nowrap; }
.shop-stock {
  min-height: 0;
  padding-right: 4px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 7px;
}
.shop-item-card {
  min-width: 0;
  padding: 7px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 2px inset #7f6d52;
  background: linear-gradient(#4a4031, #30281f);
}
.shop-item-icon {
  width: 50px;
  height: 50px;
  border: 2px inset #827057;
  background: radial-gradient(circle, #6a5d48, #2e271e);
  color: white;
  font-size: 25px;
}
.shop-item-copy { min-width: 0; display: grid; gap: 2px; }
.shop-item-copy strong { color: #f0d588; font-size: 13px; }
.shop-item-copy span { color: #d7c9ac; font-family: "Courier New", monospace; font-size: 9px; }
.shop-item-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #91dca0; font-size: 9px; }
.shop-buy-button {
  padding: 6px 7px;
  border: 2px outset #8b7655;
  background: linear-gradient(#6d5c43, #433626);
  color: #fff0a5;
  font-size: 10px;
  font-weight: 900;
}
.shop-buy-button:disabled,
#shop-buy-set:disabled { cursor: not-allowed; opacity: .46; filter: grayscale(.5); }
.shop-status { min-height: 1.2em; margin: 0; color: #d9c9a8; font-size: 11px; text-align: center; }

.item-tooltip-requirements {
  margin-top: 7px;
  padding: 6px 7px;
  display: grid;
  gap: 2px;
  border: 1px solid #7e6843;
  background: #2b241b;
  font-family: "Courier New", monospace;
  font-size: 10px;
}
.item-tooltip-requirements strong { color: #efd579; }
.item-tooltip-requirements span { color: #f2e5c8; }

.bank-grid,
.bank-inventory-grid,
.shop-stock {
  scrollbar-width: thin;
  scrollbar-color: #a88442 #211b14;
}
.bank-grid::-webkit-scrollbar,
.bank-inventory-grid::-webkit-scrollbar,
.shop-stock::-webkit-scrollbar { width: 11px; height: 11px; }
.bank-grid::-webkit-scrollbar-track,
.bank-inventory-grid::-webkit-scrollbar-track,
.shop-stock::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #1c1711, #30271d, #1c1711);
  border-left: 1px solid #120f0b;
}
.bank-grid::-webkit-scrollbar-thumb,
.bank-inventory-grid::-webkit-scrollbar-thumb,
.shop-stock::-webkit-scrollbar-thumb {
  border: 2px solid #251e16;
  background: linear-gradient(90deg, #725932, #c29b4d 50%, #725932);
  box-shadow: inset 0 0 0 1px #d4b86f;
}

@media (max-width: 980px) {
  #side-panel {
    top: 208px;
    right: 8px;
    bottom: 62px;
    width: min(305px, calc(100vw - 16px));
  }
  .bank-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .bank-grid { grid-template-columns: repeat(7, minmax(42px, 1fr)); }
  .shop-stock { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  #side-panel {
    top: 142px;
    right: 6px;
    bottom: 172px;
    width: min(300px, calc(100vw - 12px));
    max-height: none;
  }
  #panel-content { max-height: none; }
  .center-interface {
    width: calc(100vw - 10px);
    height: calc(100dvh - 18px);
  }
  .center-interface-header { min-height: 50px; padding: 6px 8px; }
  .center-interface-header strong { font-size: 17px; }
  .bank-toolbar { flex-wrap: wrap; min-height: 72px; }
  #bank-status { width: 100%; margin-left: 0; text-align: left; }
  .bank-layout {
    height: calc(100% - 122px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.2fr) minmax(190px, .8fr);
  }
  .bank-grid { grid-template-columns: repeat(6, minmax(40px, 1fr)); grid-auto-rows: 46px; }
  .bank-inventory-grid { grid-auto-rows: 46px; }
  .steel-set-offer { align-items: stretch; flex-direction: column; }
  .steel-set-offer .primary-button { width: 100%; }
  .shop-content { height: calc(100% - 50px); }
  .shop-item-card { grid-template-columns: 48px minmax(0, 1fr) auto; }
}

@media (max-width: 430px) {
  #side-panel { width: calc(100vw - 12px); }
  .bank-grid { grid-template-columns: repeat(5, minmax(38px, 1fr)); }
  .shop-item-card { grid-template-columns: 44px minmax(0, 1fr); }
  .shop-item-icon { width: 43px; height: 43px; }
  .shop-buy-button { grid-column: 1 / -1; width: 100%; }
}

/* Forged Dragon, skill guides, item art, XP drops, and fullscreen map editor */
.item-icon-image {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .7));
}
.item-icon-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  pointer-events: none;
}
.item-tooltip-icon { position: relative; overflow: hidden; }
.item-tooltip-icon .item-icon-image { inset: 5%; width: 90%; height: 90%; }

#xp-drops {
  position: absolute;
  z-index: 32;
  top: 26px;
  right: 248px;
  width: 205px;
  display: grid;
  justify-items: end;
  gap: 3px;
  pointer-events: none;
  overflow: visible;
}
.xp-drop {
  min-width: 142px;
  max-width: 205px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #fff3a0;
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  text-shadow: 2px 2px #000, -1px -1px #000;
  background: linear-gradient(90deg, transparent, rgba(25, 20, 14, .68));
  animation: xpDropRise 2.15s ease-out forwards;
}
.xp-drop-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #f7d456;
  border: 1px solid rgba(238, 204, 112, .72);
  background: rgba(42, 34, 24, .82);
  border-radius: 50%;
}
@keyframes xpDropRise {
  0% { opacity: 0; transform: translateY(20px) scale(.92); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  72% { opacity: 1; transform: translateY(-22px); }
  100% { opacity: 0; transform: translateY(-58px); }
}

.skill-card {
  width: 100%;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.skill-card:hover,
.skill-card:focus-visible {
  border-color: #e5c66f;
  filter: brightness(1.13);
}
.skill-card::after {
  content: "Open guide";
  display: block;
  margin-top: 4px;
  color: #b9aa8d;
  font-family: "Courier New", monospace;
  font-size: 8px;
  text-align: right;
}
.skill-info-interface {
  width: min(720px, calc(100vw - 42px));
  height: min(600px, calc(100dvh - 70px));
}
.skill-info-content {
  height: calc(100% - 58px);
  padding: 14px;
  overflow: auto;
  user-select: text;
}
.skill-info-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #eadfc8;
  line-height: 1.5;
  border: 2px inset #7d6b50;
  background: rgba(36, 29, 22, .74);
}
.skill-info-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.skill-info-metric {
  min-width: 0;
  padding: 9px;
  display: grid;
  gap: 3px;
  border: 2px inset #827057;
  background: linear-gradient(#4a4031, #30281f);
}
.skill-info-metric span { color: #c5b79d; font-size: 11px; }
.skill-info-metric strong { color: #f2d475; font-family: "Courier New", monospace; font-size: 17px; }
.skill-info-metric small { color: #aebfa9; line-height: 1.35; }
.skill-info-table {
  display: grid;
  margin-bottom: 8px;
  border: 2px inset #78664d;
  background: #282119;
}
.skill-info-table-row {
  display: grid;
  grid-template-columns: 1.1fr 52px 1.4fr 78px;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-bottom: 1px solid #5b4e3b;
  font-size: 11px;
}
.skill-info-table-row:last-child { border-bottom: 0; }
.skill-info-table-row.heading {
  color: #f0d47c;
  font-family: "Courier New", monospace;
  font-weight: 900;
  background: #3c3226;
}
.skill-info-table-row > span:first-child { display: grid; gap: 2px; }
.skill-info-table-row small { color: #a99b83; }
.skill-info-note { margin: 7px 0 14px; color: #c4b79d; font-size: 11px; line-height: 1.45; }
.skill-info-content h3 { margin: 12px 0 7px; color: #f0d47c; }
.skill-requirements { display: grid; gap: 6px; }
.skill-requirements > div {
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #75644d;
  background: #30281f;
}
.skill-requirements .unlocked strong { color: #79de8b; }
.skill-requirements .locked { opacity: .58; }
.skill-requirements .locked strong { color: #d78c7e; }

.admin-map-tool {
  margin-top: 10px;
  padding: 10px;
  display: grid;
  gap: 9px;
  border: 2px inset #806d51;
  background: #2c251c;
}
.admin-map-tool > div { display: grid; gap: 3px; }
.admin-map-tool strong { color: #efd477; }
.admin-map-tool span { color: #c5b69a; font-size: 11px; line-height: 1.4; }
.admin-map-tool .primary-button { margin: 0; }

#map-editor {
  position: absolute;
  z-index: 120;
  inset: 0;
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  color: var(--ink);
  background: radial-gradient(circle at 50% 40%, #242019, #0c0a07 76%);
}
.map-editor-header {
  min-height: 62px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.map-editor-header > div:first-child { display: grid; gap: 1px; }
.map-editor-header strong { color: #f1d47a; font-size: 21px; }
.map-editor-header small { color: #c5b79d; font-family: "Courier New", monospace; }
.map-editor-header-actions { display: flex; align-items: center; gap: 8px; }
.map-editor-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 8px;
}
.map-editor-toolbar {
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
}
.map-editor-toolbar label {
  margin-top: 4px;
  color: #efd47c;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}
.map-editor-toolbar select,
.map-editor-toolbar input[type="range"],
.map-editor-toolbar input[type="text"],
.map-editor-toolbar input[type="number"] {
  width: 100%;
}
.map-editor-toolbar select,
.map-editor-toolbar input[type="text"],
.map-editor-toolbar input[type="number"] {
  padding: 7px;
  color: #f2e7d1;
  border: 2px inset #806d51;
  background: #332a20;
}
.map-editor-toolbar fieldset {
  min-width: 0;
  margin: 3px 0;
  padding: 8px;
  display: grid;
  gap: 6px;
  border: 1px solid #65533c;
  background: #241d16;
}
.map-editor-toolbar fieldset legend {
  padding: 0 5px;
  color: #f0d47c;
  font: 900 10px "Courier New", monospace;
}
.map-editor-toolbar fieldset label { margin: 0; }
.map-editor-inline-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.map-editor-inline-action .panel-button { min-width: 68px; padding-inline: 7px; }
.map-editor-warp-settings { grid-template-columns: 1fr 1fr; }
.map-editor-warp-settings > label:first-of-type,
.map-editor-warp-settings > select,
.map-editor-warp-settings > small { grid-column: 1 / -1; }
.map-editor-warp-settings small { color: #bcb098; font-size: 9px; line-height: 1.35; }
#map-editor-brush-value { color: #fff2a0; font-family: "Courier New", monospace; }
.map-editor-help {
  margin-top: 5px;
  padding: 8px;
  color: #c5b89e;
  font-size: 11px;
  line-height: 1.45;
  border: 1px solid #665641;
  background: #292119;
}
.map-editor-help code { color: #7ddccf; user-select: text; }
.map-editor-legend { display: grid; gap: 5px; margin-top: 4px; font-size: 11px; }
.map-editor-legend > span { display: flex; align-items: center; gap: 7px; }
.map-editor-legend i { width: 13px; height: 13px; display: inline-block; border: 2px solid; }
.legend-blocked { border-color: #ff3b30 !important; background: linear-gradient(45deg, transparent 42%, #ff3b30 43% 57%, transparent 58%); }
.legend-wall { border-color: #f0e1bf !important; }
.legend-resource { border-color: #d7c36b !important; background: #77ddff; }
.legend-foliage { border-color: #4c9b46 !important; border-radius: 50%; background: #75cc63; }
.legend-warp { border-color: #95efff !important; border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, #8d6cff 22% 42%, #35d9f2 48% 62%, #23113f 68%); box-shadow: 0 0 7px #69dff7; }
#map-editor-status { margin-top: auto; color: #77dccc; font-family: "Courier New", monospace; font-size: 10px; line-height: 1.4; }
.map-editor-stage-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  grid-template-rows: 42px minmax(0, 1fr) 42px;
  grid-template-areas:
    ". north ."
    "west stage east"
    ". south .";
  gap: 5px;
}
.map-editor-stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 3px ridge #7e6c51;
  background: #080705;
}
.map-editor-chunk-arrow {
  align-self: stretch;
  justify-self: stretch;
  min-width: 0;
  border: 2px outset #806d51;
  background: linear-gradient(#4a3d2b, #292116);
  color: #f3d878;
  font: 900 18px/1 Georgia, serif;
  cursor: pointer;
  text-shadow: 0 1px #000;
}
.map-editor-chunk-arrow:hover { filter: brightness(1.18); }
.map-editor-chunk-arrow:active { border-style: inset; }
.map-editor-chunk-arrow.north { grid-area: north; }
.map-editor-chunk-arrow.south { grid-area: south; }
.map-editor-chunk-arrow.west { grid-area: west; }
.map-editor-chunk-arrow.east { grid-area: east; }
#map-editor-canvas {
  display: block;
  width: min(100%, calc(100dvh - 100px));
  height: auto;
  max-height: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 0 0 1px #000, 0 8px 30px #000;
}
#map-editor-coordinates {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  color: #fff1a1;
  background: rgba(15, 12, 8, .82);
  border: 1px solid #7d6c50;
  font-family: "Courier New", monospace;
  font-size: 10px;
  pointer-events: none;
}

.skill-info-content,
.map-editor-toolbar {
  scrollbar-width: thin;
  scrollbar-color: #a88442 #211b14;
}
.skill-info-content::-webkit-scrollbar,
.map-editor-toolbar::-webkit-scrollbar { width: 11px; }
.skill-info-content::-webkit-scrollbar-track,
.map-editor-toolbar::-webkit-scrollbar-track { background: #211b14; }
.skill-info-content::-webkit-scrollbar-thumb,
.map-editor-toolbar::-webkit-scrollbar-thumb {
  border: 2px solid #251e16;
  background: linear-gradient(90deg, #725932, #c29b4d 50%, #725932);
}

@media (max-width: 900px) {
  #xp-drops { right: 196px; top: 18px; transform: scale(.86); transform-origin: top right; }
  .map-editor-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .skill-info-table-row { grid-template-columns: 1fr 42px 1.1fr 66px; gap: 5px; padding: 7px 6px; }
}
@media (max-width: 650px) {
  #xp-drops { right: 118px; top: 8px; transform: scale(.68); }
  .map-editor-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .map-editor-toolbar { max-height: 210px; display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .map-editor-stage-shell { grid-template-columns: 34px minmax(0, 1fr) 34px; grid-template-rows: 34px minmax(0, 1fr) 34px; gap: 3px; }
  .map-editor-chunk-arrow { font-size: 14px; }
  .map-editor-toolbar .map-editor-help,
  .map-editor-toolbar .map-editor-legend,
  .map-editor-toolbar #map-editor-status { grid-column: 1 / -1; }
  .skill-info-metrics { grid-template-columns: 1fr; }
  .skill-info-table-row { grid-template-columns: 1fr 40px; }
  .skill-info-table-row > span:nth-child(3),
  .skill-info-table-row > span:nth-child(4) { text-align: right; }
}
.shop-item-icon { position: relative; overflow: hidden; }


/* News, information viewer, and administrator content editors */
.minimap-bubble {
  position: absolute;
  right: 20px;
  top: 232px;
  z-index: 24;
  min-width: 72px;
  height: 30px;
  border: 2px solid #24160a;
  border-radius: 15px;
  background: linear-gradient(#c9a25d, #755126);
  color: #1b1008;
  font: 700 12px Georgia, serif;
  box-shadow: inset 0 0 0 1px rgba(255,236,172,.36), 0 2px 5px rgba(0,0,0,.55);
  cursor: pointer;
}
.minimap-bubble span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 3px;
  border-radius: 50%;
  background: #7e1f17;
  color: #ffe8a1;
  font-family: Arial, sans-serif;
}
.minimap-bubble:hover { filter: brightness(1.15); }

.content-viewer {
  position: absolute;
  z-index: 80;
  inset: 7% 10%;
  display: flex;
  flex-direction: column;
  min-width: 620px;
  min-height: 420px;
  overflow: hidden;
  background: linear-gradient(135deg, #5b4933, #2a2118);
}
.content-viewer[hidden] { display: none; }
.content-viewer-filters {
  display: flex;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid #21170e;
  background: #3b2d20;
}
.content-viewer-filters button {
  border: 1px solid #21160c;
  border-radius: 3px;
  padding: 7px 12px;
  background: #6c5337;
  color: #f2dfb0;
  font: 700 12px Georgia, serif;
  cursor: pointer;
}
.content-viewer-filters button.active,
.content-viewer-filters button:hover {
  background: #aa8349;
  color: #171006;
}
.content-viewer-layout {
  display: grid;
  grid-template-columns: minmax(210px, 29%) 1fr;
  min-height: 0;
  flex: 1;
}
.content-viewer-list {
  overflow-y: auto;
  border-right: 2px solid #21170e;
  background: #30251b;
}
.content-list-entry {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid rgba(225,191,128,.18);
  background: transparent;
  color: #e6d3aa;
  text-align: left;
  cursor: pointer;
}
.content-list-entry span {
  color: #c8a866;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.content-list-entry strong { font: 700 15px Georgia, serif; }
.content-list-entry small { color: #9d8c70; }
.content-list-entry:hover,
.content-list-entry.active {
  background: linear-gradient(90deg, #80613b, #4e3a28);
  color: #fff1c6;
}
.content-viewer-body {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 30px 40px;
  background:
    linear-gradient(rgba(255,248,220,.92), rgba(222,202,156,.96)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(75,50,24,.04) 29px);
  color: #2b2114;
  font: 15px/1.55 Georgia, serif;
}
.content-viewer-body.guidelines-body { grid-column: 1 / -1; }
.content-article-header {
  margin-bottom: 22px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(68,44,21,.3);
}
.content-article-header span {
  color: #79531f;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.content-article-header h2 {
  margin: 5px 0;
  font-size: clamp(24px, 3vw, 38px);
}
.content-html img,
.content-viewer-body img { max-width: 100%; height: auto; }
.content-html table,
.content-viewer-body table { width: 100%; border-collapse: collapse; }
.content-html td, .content-html th,
.content-viewer-body td, .content-viewer-body th { border: 1px solid #7d6748; padding: 7px; }

#admin-editor {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(144,106,54,.18), transparent 45%),
    rgba(15,12,9,.97);
}
#admin-editor[hidden] { display: none; }
.admin-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 9px 14px;
}
.admin-editor-header > div { display: grid; gap: 2px; }
.admin-editor-header strong { color: #f4d88a; font: 700 20px Georgia, serif; }
.admin-editor-header small { color: #a99572; }
.admin-editor-tabs {
  display: flex;
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
}
.admin-editor-tabs button {
  min-width: 96px;
  border: 1px solid #21160b;
  border-radius: 3px;
  padding: 8px 10px;
  background: #4a3927;
  color: #e5d2aa;
  font: 700 12px Georgia, serif;
  cursor: pointer;
}
.admin-editor-tabs button.active,
.admin-editor-tabs button:hover {
  background: #af884b;
  color: #1b1107;
}
.admin-editor-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 8px;
}
.admin-editor-browser,
.admin-editor-workspace {
  min-height: 0;
  overflow: hidden;
  background: #30251b;
}
.admin-editor-browser {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.admin-editor-browser-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #20160d;
}
.admin-editor-browser-tools input {
  min-width: 0;
  border: 1px solid #21160c;
  border-radius: 3px;
  padding: 8px;
  background: #17120e;
  color: #f2dfb5;
}
.admin-editor-list {
  overflow-y: auto;
  padding: 5px;
}
.admin-list-entry {
  display: grid;
  width: 100%;
  gap: 2px;
  margin-bottom: 4px;
  padding: 9px;
  border: 1px solid #21170e;
  border-radius: 3px;
  background: #473626;
  color: #e8d6b2;
  text-align: left;
  cursor: pointer;
}
.admin-list-entry strong { font: 700 14px Georgia, serif; }
.admin-list-entry span { color: #c1ab84; font-size: 11px; }
.admin-list-entry small { color: #89775c; }
.admin-list-entry:hover,
.admin-list-entry.active {
  background: #88663a;
  color: #fff0c2;
}
.admin-list-empty {
  padding: 18px;
  color: #aa9879;
  text-align: center;
}
.admin-editor-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.admin-editor-form {
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}
#admin-editor-status {
  min-height: 30px;
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid #1c130b;
  background: #211910;
  color: #ddc894;
}
.admin-editor-placeholder {
  max-width: 620px;
  margin: 80px auto;
  color: #cdbb94;
  text-align: center;
}
.admin-editor-placeholder h2 { color: #f0d78d; font-family: Georgia, serif; }

.admin-definition-form {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}
.admin-form-heading {
  padding: 12px 14px;
  border: 1px solid #21160c;
  border-radius: 4px;
  background: linear-gradient(90deg, #6f5332, #3a2b1d);
}
.admin-form-heading h2 { margin: 3px 0 0; color: #ffe6a3; font: 700 23px Georgia, serif; }
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}
.admin-definition-form label {
  display: grid;
  gap: 5px;
  color: #d6c29b;
  font: 700 11px Georgia, serif;
  letter-spacing: .02em;
}
.admin-definition-form input,
.admin-definition-form select,
.admin-definition-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #1d140c;
  border-radius: 3px;
  padding: 8px;
  background: #17120e;
  color: #f1dfb9;
  font: 13px Arial, sans-serif;
  resize: vertical;
}
.admin-definition-form input:focus,
.admin-definition-form select:focus,
.admin-definition-form textarea:focus {
  outline: 2px solid #b98d4a;
  outline-offset: 1px;
}
.admin-wide-field { width: 100%; }
.admin-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid #21170e;
  border-radius: 3px;
  background: #443325;
}
.admin-check-grid input { width: auto; }
.admin-json-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-form-note {
  margin: 0;
  padding: 10px;
  border-left: 4px solid #b58a47;
  background: rgba(22,16,11,.55);
  color: #bfae8d;
  font-size: 12px;
}
.admin-form-actions {
  position: sticky;
  bottom: -14px;
  z-index: 3;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px;
  border-top: 1px solid #1d140c;
  background: rgba(35,27,19,.96);
}
.danger-button {
  border: 1px solid #3c0f0d;
  border-radius: 3px;
  padding: 8px 12px;
  background: linear-gradient(#9d3d32, #5e211b);
  color: #ffe4d3;
  font-weight: 700;
  cursor: pointer;
}
.danger-button.compact { padding: 5px 8px; font-size: 11px; }
.danger-button:hover { filter: brightness(1.15); }

.admin-tool-grid {
  display: grid;
  gap: 7px;
}
.admin-tool-card {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid #21160c;
  border-radius: 3px;
  background: #4d3a27;
  color: #e5d2aa;
  text-align: left;
  cursor: pointer;
}
.admin-tool-card strong { color: #f2d883; font: 700 14px Georgia, serif; }
.admin-tool-card span { font-size: 11px; line-height: 1.35; }
.admin-tool-card:hover { background: #725431; }

.punishment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.punishment-card {
  display: grid;
  gap: 8px;
  border: 1px solid #5f2b25;
  border-radius: 4px;
  background: #3b2520;
}
.punishment-card legend { padding: 0 6px; color: #f0b49d; font: 700 13px Georgia, serif; }
.punishment-card label:first-of-type,
.punishment-card label:nth-of-type(2) { display: flex; align-items: center; gap: 6px; }
.punishment-card input[type="checkbox"] { width: auto; }
.account-items-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.account-items-layout section {
  min-width: 0;
  border: 1px solid #21160d;
  border-radius: 4px;
  overflow: hidden;
  background: #261d15;
}
.account-items-layout h3 { margin: 0; padding: 9px; background: #57412b; color: #efd58d; }
.account-item-list { max-height: 310px; overflow-y: auto; padding: 6px; }
.account-item-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 4px;
  padding: 6px;
  border: 1px solid rgba(226,191,124,.16);
  background: #35281d;
}
.account-item-row > span:nth-child(2) { display: grid; min-width: 0; }
.account-item-row small { overflow: hidden; color: #9f8d70; text-overflow: ellipsis; white-space: nowrap; }
.account-item-icon { font-size: 22px; text-align: center; }
.account-add-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 160px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #21160d;
  background: #3b2d20;
}
.admin-html-preview {
  overflow: hidden;
  border: 1px solid #21160d;
  border-radius: 4px;
  background: #d7c598;
  color: #2a2116;
}
.admin-html-preview > span { display: block; padding: 7px 10px; background: #4c3825; }
.admin-html-preview article {
  max-height: 360px;
  overflow-y: auto;
  padding: 18px;
  font: 14px/1.5 Georgia, serif;
}
.admin-html-preview img { max-width: 100%; }

.admin-editor-list,
.admin-editor-form,
.content-viewer-list,
.content-viewer-body,
.account-item-list {
  scrollbar-color: #9c7542 #241a12;
  scrollbar-width: thin;
}
.admin-editor-list::-webkit-scrollbar,
.admin-editor-form::-webkit-scrollbar,
.content-viewer-list::-webkit-scrollbar,
.content-viewer-body::-webkit-scrollbar,
.account-item-list::-webkit-scrollbar { width: 12px; height: 12px; }
.admin-editor-list::-webkit-scrollbar-track,
.admin-editor-form::-webkit-scrollbar-track,
.content-viewer-list::-webkit-scrollbar-track,
.content-viewer-body::-webkit-scrollbar-track,
.account-item-list::-webkit-scrollbar-track {
  border-left: 1px solid #120c07;
  background: #241a12;
}
.admin-editor-list::-webkit-scrollbar-thumb,
.admin-editor-form::-webkit-scrollbar-thumb,
.content-viewer-list::-webkit-scrollbar-thumb,
.content-viewer-body::-webkit-scrollbar-thumb,
.account-item-list::-webkit-scrollbar-thumb {
  border: 2px solid #241a12;
  border-radius: 5px;
  background: linear-gradient(90deg, #6c4b2b, #b0874e, #6c4b2b);
}

@media (max-width: 900px) {
  .content-viewer { inset: 5% 3%; min-width: 0; }
  .content-viewer-layout { grid-template-columns: 1fr; }
  .content-viewer-list { max-height: 155px; border-right: 0; border-bottom: 2px solid #21170e; }
  .admin-editor-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-form-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .punishment-grid { grid-template-columns: 1fr; }
  .account-add-item { grid-template-columns: 1fr 110px; }
}
@media (max-width: 650px) {
  .minimap-bubble { right: 12px; top: 205px; }
  .admin-editor-layout { grid-template-columns: 1fr; grid-template-rows: 190px minmax(0, 1fr); }
  .admin-form-grid,
  .admin-json-grid,
  .account-items-layout { grid-template-columns: 1fr; }
  .account-add-item { grid-template-columns: 1fr; }
  .admin-editor-tabs button { min-width: 82px; }
}

.legend-npc { background: #efc56f !important; border-radius: 50%; }

/* World map, travel, broadcasts, and administrator item spawning */
#minimap-panel { overflow: visible; }
.minimap-icon-button {
  position: absolute;
  z-index: 8;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px outset #9b8155;
  border-radius: 50%;
  background: linear-gradient(#655642, #342c22);
  color: #f6df91;
  font: 900 17px/1 Georgia, serif;
  box-shadow: 0 3px 8px rgba(0,0,0,.55);
}
.logout-button { top: 2px; right: 2px; }
.minimap-icon-button:hover { filter: brightness(1.2); }
.world-map-bubble { right: 178px !important; }

#server-broadcast {
  position: absolute;
  z-index: 24;
  left: 8px;
  right: 8px;
  top: -58px;
  min-height: 48px;
  padding: 8px 38px 6px 11px;
  border: 2px solid #2a1d0d;
  background: linear-gradient(180deg, rgba(113,82,36,.97), rgba(45,32,18,.97));
  box-shadow: inset 0 0 0 1px #c5a35e, 0 7px 18px rgba(0,0,0,.5);
  color: #fff1bd;
  font: 800 13px/1.35 "Courier New", monospace;
  text-align: center;
  transition: width .14s ease, min-height .14s ease, padding .14s ease;
}
#server-broadcast-content { min-width: 0; }
#server-broadcast-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px outset #b69a61;
  border-radius: 4px;
  background: linear-gradient(#67583f, #30271c);
  color: #fff1bd;
  font: 900 18px/1 Georgia, serif;
  box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
#server-broadcast-toggle:hover { filter: brightness(1.18); }
#server-broadcast.minimized {
  left: auto;
  right: 8px;
  top: -38px;
  width: 34px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
}
#server-broadcast.minimized #server-broadcast-content { display: none; }
#server-broadcast.minimized #server-broadcast-toggle {
  top: 2px;
  right: 2px;
  width: 26px;
  height: 22px;
}
#server-broadcast a { color: #7ee4ff; text-decoration: underline; }
.broadcast-timer-track { height: 5px; margin-top: 6px; border: 1px inset #6e5634; background: #1e1710; overflow: hidden; }
#server-broadcast-timer { width: 100%; height: 100%; background: linear-gradient(90deg, #e0bc52, #fff0a0); }

.world-map-interface {
  position: absolute;
  z-index: 175;
  inset: 4.5% 4%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(#4a3c2c, #241d15);
}
.world-map-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; }
.world-map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #080b0d; cursor: grab; }
.world-map-stage.dragging { cursor: grabbing; }
#world-map-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.world-map-legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  max-width: calc(100% - 20px);
  padding: 7px 9px;
  border: 1px solid #17100a;
  background: rgba(35,26,17,.88);
  color: #e8d8b6;
  font: 10px "Courier New", monospace;
  pointer-events: none;
}
.world-map-legend i { width: 17px; display: inline-grid; place-items: center; font-style: normal; font-weight: 900; color: #ffe77a; }
.world-map-admin { min-width: 0; padding: 12px; overflow-y: auto; border-left: 2px ridge #756044; background: #33281d; }
.world-map-admin h3 { margin: 0 0 10px; color: #f0d57d; }
.world-map-admin label { display: block; margin-top: 8px; color: #d9c9a8; font-size: 11px; }
.world-map-admin input, .world-map-admin select { width: 100%; padding: 7px; border: 2px inset #7e674a; background: #211a13; color: #fff; }
.marker-coordinate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.world-marker-list { display: grid; gap: 6px; margin-top: 12px; }
.world-marker-entry { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 7px; border: 1px solid #1b120b; background: #493725; }
.world-marker-entry small { display: block; color: #b7a587; }
.world-marker-entry button { border: 1px outset #7b5e3d; background: #6b342c; color: #ffd3cb; }
.world-map-header-actions { display: flex; gap: 8px; align-items: center; }

.admin-item-spawner {
  position: absolute;
  z-index: 190;
  top: 50%;
  left: 50%;
  width: min(560px, 92vw);
  max-height: min(720px, 88vh);
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #33291f;
}
.admin-item-spawner-body { display: grid; gap: 9px; padding: 12px; min-height: 0; }
#admin-item-search, #admin-item-quantity { width: 100%; padding: 8px; border: 2px inset #806b4e; background: #211a13; color: #fff; }
.admin-item-list { max-height: 430px; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.admin-item-entry { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 7px; align-items: center; padding: 6px; border: 2px outset #705d43; background: #443628; color: #f0e2c7; text-align: left; }
.admin-item-entry.selected { border-color: #e5c45e; background: #69502f; }
.admin-item-entry .item-visual {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px inset #766248;
  background: #241b13;
  font-size: 20px;
}
.admin-item-entry .item-visual .item-icon-image { inset: 7%; width: 86%; height: 86%; max-width: 30px; max-height: 30px; }

.map-size-settings { margin-top: 8px; padding: 8px; border: 1px solid #24170d; background: #3a2d20; }
.map-size-settings summary { cursor: pointer; color: #f0d57d; font-weight: 800; }
.map-size-settings label { margin-top: 7px; }
.map-size-settings input[type="number"] { width: 100%; padding: 6px; border: 2px inset #775f43; background: #211a13; color: #fff; }
.map-size-settings .danger-check { display: flex; gap: 7px; align-items: flex-start; color: #ffbdad; line-height: 1.35; }
.map-size-settings .danger-check input { width: auto; margin-top: 2px; }

.fast-travel-bar-label { color: #f7e7aa; font: 800 9px "Courier New", monospace; text-align: center; }

.admin-item-list,
.world-map-admin,
.world-marker-list {
  scrollbar-color: #9c7542 #241a12;
  scrollbar-width: thin;
}
.admin-item-list::-webkit-scrollbar,
.world-map-admin::-webkit-scrollbar,
.world-marker-list::-webkit-scrollbar { width: 11px; }
.admin-item-list::-webkit-scrollbar-track,
.world-map-admin::-webkit-scrollbar-track,
.world-marker-list::-webkit-scrollbar-track { background: #241a12; }
.admin-item-list::-webkit-scrollbar-thumb,
.world-map-admin::-webkit-scrollbar-thumb,
.world-marker-list::-webkit-scrollbar-thumb { border: 2px solid #241a12; border-radius: 5px; background: linear-gradient(90deg, #6c4b2b, #b0874e, #6c4b2b); }

@media (max-width: 900px) {
  .world-map-interface { inset: 2%; }
  .world-map-layout { grid-template-columns: 1fr; }
  .world-map-admin { max-height: 210px; border-left: 0; border-top: 2px ridge #756044; }
  .world-map-bubble { right: 145px !important; }
}
@media (max-width: 650px) {
  .world-map-bubble { right: 106px !important; top: 205px; }
  #server-broadcast { top: -54px; font-size: 11px; }
  .admin-item-list { grid-template-columns: 1fr; }
}

/* Status orbs, minimap overlays, and map zoom controls */
#status-orbs {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 24;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  pointer-events: none;
}
.status-orb {
  --fill: 100%;
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 4px ridge #88765a;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #6d6252 0 18%, #30291f 52%, #100d09 100%);
  box-shadow: 0 0 0 2px #17120d, 0 8px 18px rgba(0,0,0,.6), inset 0 0 12px rgba(255,255,255,.16);
  color: #fff4d0;
  text-shadow: 1px 2px 2px #000;
  pointer-events: auto;
  isolation: isolate;
}
button.status-orb { cursor: pointer; }
.status-orb .orb-liquid {
  position: absolute;
  z-index: -2;
  left: -8%;
  right: -8%;
  bottom: -4%;
  height: var(--fill);
  min-height: 0;
  transition: height .35s ease;
  filter: saturate(1.12);
}
.status-orb .orb-liquid::before,
.status-orb .orb-liquid::after {
  content: "";
  position: absolute;
  left: -20%;
  width: 140%;
  height: 13px;
  top: -6px;
  border-radius: 45%;
  animation: orb-wave 2.8s linear infinite;
}
.status-orb .orb-liquid::after { animation-duration: 4.1s; animation-direction: reverse; opacity: .5; transform: translateX(8px); }
.hitpoints-orb .orb-liquid { background: linear-gradient(#e74b48, #9e1e22 55%, #5f0d14); }
.hitpoints-orb .orb-liquid::before, .hitpoints-orb .orb-liquid::after { background: rgba(255,112,105,.82); }
.run-energy-orb .orb-liquid { background: linear-gradient(#ffdf4d, #d29a16 58%, #80530d); }
.run-energy-orb .orb-liquid::before, .run-energy-orb .orb-liquid::after { background: rgba(255,239,118,.86); }
.status-orb .orb-glass {
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.38), transparent 24%), linear-gradient(145deg, rgba(255,255,255,.11), transparent 54%);
  box-shadow: inset 0 0 12px rgba(0,0,0,.44);
  pointer-events: none;
}
.status-orb .orb-symbol, .status-orb small { display: none; }
.status-orb strong { position: relative; z-index: 2; font: 900 18px/1 "Courier New", monospace; letter-spacing: -1px; }
.run-energy-orb[aria-pressed="true"] {
  border-color: #e5ca62;
  box-shadow: 0 0 0 2px #2b2107, 0 0 20px rgba(255,218,72,.78), inset 0 0 12px rgba(255,255,255,.2);
}
.run-energy-orb:disabled { cursor: not-allowed; filter: grayscale(.45); }
@keyframes orb-wave { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
@keyframes run-pulse { from { transform: scale(.92); } to { transform: scale(1.14); } }

#action-line { top: 98px; }

#minimap-panel { overflow: visible; }
.minimap-border-bubble {
  position: absolute;
  z-index: 10;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 3px outset #9b8155;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4b86c, #765128 64%, #342312);
  color: #241405;
  font: 900 18px/1 Georgia, serif;
  box-shadow: 0 3px 9px rgba(0,0,0,.62), inset 0 0 0 1px rgba(255,240,176,.35);
  cursor: pointer;
}
.minimap-border-bubble:hover { filter: brightness(1.18); transform: translateY(-1px); }
.world-map-bubble { left: -4px !important; right: auto !important; bottom: -3px; top: auto !important; }
.free-fast-travel-timer {
  position: absolute;
  z-index: 9;
  left: -76px;
  bottom: 4px;
  min-width: 62px;
  padding: 5px 7px;
  border: 2px outset #9b8155;
  border-radius: 6px;
  background: linear-gradient(#4d432f, #282219);
  color: #f6df91;
  box-shadow: 0 3px 8px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,240,176,.18);
  font: 900 10px/1 "Courier New", monospace;
  text-align: center;
  pointer-events: none;
  text-shadow: 1px 1px #000;
}
.free-fast-travel-timer.ready { color: #8dff9f; box-shadow: 0 0 10px rgba(99,255,125,.35), inset 0 0 0 1px rgba(255,240,176,.18); }
.news-bubble { right: -4px; bottom: -3px; }
.minimap-zoom-button { width: 25px; height: 25px; left: 3px; right: auto; font: 900 15px/1 Arial, sans-serif; }
.minimap-zoom-in { top: 7px; }
.minimap-zoom-out { top: 36px; }
.logout-button { top: 2px; right: 2px; }

.map-zoom-controls { display: inline-flex; align-items: center; gap: 5px; }
.map-zoom-controls span {
  min-width: 48px;
  color: #f5dfa0;
  font: 900 10px/1 "Courier New", monospace;
  text-align: center;
}
.compact-map-button { min-width: 31px !important; padding-left: 8px !important; padding-right: 8px !important; font-size: 16px; }
#map-editor-canvas { transform-origin: center; }
.map-editor-stage.panning, .world-map-stage.dragging { cursor: grabbing; }
.map-editor-stage { cursor: crosshair; }

@media (max-width: 720px) {
  #status-orbs { left: 6px; top: 6px; transform: scale(.72); transform-origin: top left; }
  #action-line { top: 64px; }
  .map-zoom-controls span { min-width: 38px; }
  .map-editor-header-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 430px) {
  #status-orbs { transform: scale(.62); }
}
.minimap-border-bubble::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 140px;
  padding: 4px 7px;
  border: 1px solid #1d1309;
  border-radius: 3px;
  background: rgba(37,27,17,.96);
  color: #f7e8bd;
  font: 800 10px/1.2 "Courier New", monospace;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.minimap-border-bubble:hover::after,
.minimap-border-bubble:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }


/* Staff role presentation */
.staff-name {
  display: inline-block;
  font-weight: 900;
  text-shadow: 1px 1px 0 #000;
  cursor: help;
}
.role-moderator { color: #FFD700 !important; }
.role-admin {
  color: #FF3131 !important;
  animation: game-master-pulse 1.35s ease-in-out infinite;
}
@keyframes game-master-pulse {
  0%, 100% { text-shadow: 0 0 2px rgba(255,49,49,.65), 1px 1px 0 #000; }
  50% { text-shadow: 0 0 7px #FF3131, 0 0 14px rgba(255,49,49,.8), 1px 1px 0 #000; }
}
.role-tooltip {
  position: absolute;
  z-index: 275;
  min-width: 92px;
  padding: 6px 9px;
  border: 2px solid #17100a;
  background: linear-gradient(#4c3f2e, #241b13);
  box-shadow: inset 0 0 0 1px #9e855d, 0 8px 20px rgba(0,0,0,.6);
  color: #fff;
  font: 900 11px/1.2 "Courier New", monospace;
  text-align: center;
  pointer-events: none;
}
.social-player-list { display: grid; gap: 5px; margin-top: 12px; }
.social-player-row { padding: 4px 6px; border: 1px solid rgba(151,126,87,.36); background: rgba(25,19,13,.26); }
.context-title .staff-name { font-size: 12px; }

/* Daily login rewards, travel vouchers, and 365-day name reward */
.login-streak-button {
  position: absolute;
  z-index: 10;
  left: -76px;
  bottom: 38px;
  min-width: 62px;
  height: 30px;
  padding: 3px 7px;
  border: 2px outset #9b8155;
  border-radius: 7px;
  background: linear-gradient(#5b4c30, #2b2318);
  color: #f5d978;
  box-shadow: 0 3px 8px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,240,176,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  font: 900 11px/1 "Courier New", monospace;
  text-shadow: 1px 1px #000;
}
.login-streak-button:hover { filter: brightness(1.18); }
.login-streak-button span { color: #ffd75a; font-size: 14px; }
.login-streak-button strong { min-width: 18px; text-align: center; }
.login-streak-button.milestone-unlocked {
  color: #75c8ff;
  border-color: #5caef0;
  box-shadow: 0 0 10px rgba(55,168,255,.62), inset 0 0 0 1px rgba(180,229,255,.35);
}

.daily-login-interface {
  position: absolute;
  z-index: 265;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1080px, calc(100% - 34px));
  height: min(780px, calc(100% - 34px));
  overflow: hidden;
  background: linear-gradient(rgba(66,54,38,.98), rgba(30,24,17,.99));
  box-shadow: 0 20px 70px rgba(0,0,0,.8), inset 0 0 0 1px rgba(236,211,151,.2);
}
.daily-login-body {
  height: calc(100% - 52px);
  overflow: auto;
  padding: 14px;
}
.daily-login-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.daily-login-summary > div {
  padding: 10px 13px;
  border: 2px inset #8d7958;
  background: linear-gradient(#493d2c, #2c241a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.daily-login-summary span { color: #c9b786; font: 800 10px/1 "Courier New", monospace; text-transform: uppercase; }
.daily-login-summary strong { color: #ffe08a; font: 900 16px/1 "Courier New", monospace; }
.daily-login-summary p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border-left: 4px solid #d6ad50;
  background: rgba(20,16,11,.5);
  color: #eadfc3;
  font: 700 12px/1.45 "Courier New", monospace;
}
.daily-login-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.daily-reward-card {
  position: relative;
  min-height: 132px;
  padding: 8px 6px 7px;
  border: 2px outset #816d4d;
  background: radial-gradient(circle at 50% 38%, #62533d, #30271c 75%);
  display: grid;
  grid-template-rows: auto 52px minmax(28px, auto) auto;
  place-items: center;
  align-content: start;
  gap: 3px;
  color: #eee0be;
  text-align: center;
  overflow: hidden;
}
.daily-reward-card.claimed { border-color: #766e51; filter: saturate(.72); }
.daily-reward-card.claimed::after {
  content: "✓";
  position: absolute;
  right: 5px;
  top: 4px;
  color: #82dc86;
  font: 900 16px/1 Arial, sans-serif;
  text-shadow: 1px 1px #000;
}
.daily-reward-card.current {
  border-color: #f0cb62;
  background: radial-gradient(circle at 50% 38%, #80642d, #3b2d17 76%);
  box-shadow: 0 0 13px rgba(255,207,88,.45), inset 0 0 0 1px rgba(255,239,168,.3);
}
.daily-reward-card.upcoming { opacity: .84; }
.daily-reward-day { color: #d8bf7c; font: 900 9px/1 "Courier New", monospace; letter-spacing: .6px; }
.daily-reward-icon {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 31px;
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,.65));
}
.daily-reward-card strong { font: 900 10px/1.15 "Courier New", monospace; color: #f4e5bd; }
.daily-reward-card small { color: #fff07a; font: 900 10px/1 "Courier New", monospace; }
.daily-reward-card em {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  color: #ffe36e;
  font: normal 900 8px/1 "Courier New", monospace;
}
.login-365-prize {
  margin-top: 14px;
  padding: 15px;
  border: 2px outset #689dcc;
  background:
    radial-gradient(circle at 86% 50%, rgba(54,157,255,.23), transparent 33%),
    linear-gradient(105deg, #202b3a, #17202d 58%, #1c3148);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: center;
  box-shadow: inset 0 0 20px rgba(59,166,255,.13), 0 7px 20px rgba(0,0,0,.35);
}
.login-365-prize h3 { margin: 4px 0 6px; color: #e8f6ff; font: 900 17px/1.25 Georgia, serif; }
.login-365-prize p { margin: 0; color: #8fd0ff; font: 900 11px/1.3 "Courier New", monospace; }
.login-365-preview {
  min-height: 82px;
  border: 1px solid rgba(125,197,255,.42);
  background: rgba(4,12,22,.58);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
}
.login-365-preview span { color: #9eb7c9; font: 800 9px/1 "Courier New", monospace; text-transform: uppercase; }
.login-365-preview strong,
.login-365-name-glow {
  color: #56b8ff !important;
  font-weight: 900;
  animation: login-blue-name-pulse 1.55s ease-in-out infinite;
}
.login-365-preview strong { font: 900 20px/1 "Courier New", monospace; }
@keyframes login-blue-name-pulse {
  0%, 100% { text-shadow: 0 0 3px rgba(60,170,255,.7), 1px 1px 0 #000; }
  50% { text-shadow: 0 0 7px #38a8ff, 0 0 15px rgba(56,168,255,.9), 1px 1px 0 #000; }
}

@media (max-width: 880px) {
  .daily-login-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login-365-prize { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  .daily-login-interface { width: calc(100% - 12px); height: calc(100% - 12px); }
  .daily-login-body { padding: 8px; }
  .daily-login-summary { grid-template-columns: 1fr; }
  .daily-login-summary p { grid-column: 1; }
  .daily-login-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .daily-reward-card { min-height: 122px; }
}

/* Performance settings, standard cursor, and examine interfaces */
#game,
#minimap-panel,
#minimap {
  cursor: default;
}

.settings-section-heading {
  display: grid;
  gap: 3px;
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid #8d7955;
  background: linear-gradient(180deg, rgba(35, 29, 21, .96), rgba(24, 20, 15, .96));
  box-shadow: inset 0 0 0 1px rgba(225, 200, 143, .11);
}
.settings-section-heading strong {
  color: #f1d27a;
  font-size: .96rem;
  letter-spacing: .04em;
}
.settings-section-heading span {
  color: #c7b898;
  font-size: .72rem;
  line-height: 1.25;
}
.settings-section-divider { margin-top: 14px; }

.examine-interface {
  width: min(760px, calc(100vw - 28px));
  height: min(590px, calc(100dvh - 36px));
  z-index: 78;
}
.examine-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  height: calc(100% - 66px);
  padding: 14px;
  overflow: hidden;
}
#examine-preview {
  width: 100%;
  height: auto;
  max-height: 100%;
  align-self: start;
  border: 2px solid #211b13;
  background: #211c16;
  box-shadow: inset 0 0 0 1px #988466, 0 8px 18px rgba(0,0,0,.38);
  image-rendering: pixelated;
}
.examine-content {
  min-width: 0;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: #a88442 #2b241b;
}
.examine-content::-webkit-scrollbar { width: 10px; }
.examine-content::-webkit-scrollbar-track { background: #2b241b; border-left: 1px solid #16120e; }
.examine-content::-webkit-scrollbar-thumb { background: linear-gradient(#b59655, #80642f); border: 2px solid #2b241b; border-radius: 5px; }
.examine-description {
  margin: 0 0 10px;
  padding: 10px;
  color: #e7dcc3;
  line-height: 1.42;
  background: rgba(20, 17, 13, .58);
  border: 1px solid #75664f;
}
.examine-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.examine-stat-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #6d604c;
  background: rgba(30, 25, 19, .86);
}
.examine-stat-grid span { color: #c8b99d; font-size: .78rem; }
.examine-stat-grid strong { color: #f3d77d; font-family: "Courier New", monospace; }
.examine-content h3 {
  margin: 14px 0 7px;
  color: #f0d27a;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.examine-item-list { display: grid; gap: 5px; }
.examine-item-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 5px 8px;
  border: 1px solid #665944;
  background: linear-gradient(180deg, rgba(78, 68, 52, .75), rgba(43, 36, 27, .84));
}
.examine-item-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #2a2218;
  background: #31291f;
  font-size: 1.4rem;
}
.examine-item-icon .item-icon-image { inset: 6%; width: 88%; height: 88%; }
.examine-item-row > div { display: grid; gap: 2px; min-width: 0; }
.examine-item-row strong { color: #f1e3c6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.examine-item-row span { color: #bfae8f; font-size: .76rem; }
.examine-item-row > b { color: #85d48b; font-family: "Courier New", monospace; font-size: .82rem; }
.examine-empty { color: #bfb097; font-style: italic; }

@media (max-width: 700px) {
  .examine-interface { height: min(700px, calc(100dvh - 18px)); }
  .examine-layout { grid-template-columns: 1fr; grid-template-rows: 190px minmax(0, 1fr); }
  #examine-preview { width: min(240px, 100%); height: 190px; justify-self: center; }
  .examine-stat-grid { grid-template-columns: 1fr; }
}

.canvas-compatibility-error {
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  padding: 18px 20px;
  border: 2px solid #9f8756;
  background: #251f17;
  color: #f3ddb0;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .7), inset 0 0 0 1px #4d422f;
  font: 700 16px/1.45 Georgia, serif;
  text-align: center;
}

/* 30-slot inventory: five columns by six rows, always contained in the side panel. */
#panel-content.inventory-panel-content {
  overflow: hidden;
  display: block;
}
#panel-content.inventory-panel-content .inventory-grid {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
#panel-content.inventory-panel-content .inventory-slot {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  font-size: clamp(20px, 2vw, 29px);
}
@media (max-height: 700px) {
  #panel-content.inventory-panel-content .inventory-grid { gap: 3px; }
  #panel-content.inventory-panel-content .inventory-slot { font-size: 21px; }
}

/* Whisper, reporting, warnings, and Game Management Studio */
.report-interface {
  width: min(560px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 30px));
  z-index: 86;
}
.report-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}
.report-form label {
  display: grid;
  gap: 6px;
  color: #dfc690;
  font-weight: 700;
}
.report-form select,
.report-form textarea {
  width: 100%;
  border: 1px solid #72582f;
  border-radius: 5px;
  background: #1e1912;
  color: #f5e5be;
  padding: 9px 10px;
  font: inherit;
}
#report-status { min-height: 1.2em; margin: 0; color: #e3c77e; }

.warning-overlay {
  position: absolute;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 4, 3, .82);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}
.warning-overlay[hidden] { display: none; }
.warning-card {
  width: min(560px, 100%);
  padding: 26px;
  text-align: center;
  border-color: #b34835;
  box-shadow: 0 0 0 3px rgba(179,72,53,.25), 0 18px 60px rgba(0,0,0,.72);
}
.warning-card h2 { margin: 8px 0 15px; color: #ffcf83; }
.warning-card p {
  min-height: 80px;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid #775032;
  background: #21150f;
  color: #fff3db;
  white-space: pre-wrap;
}
.warning-card small { display: block; margin-bottom: 18px; color: #c9b58f; }
.warning-card .primary-button { min-width: 180px; }

.player-name.chat-name-interactive {
  cursor: context-menu;
  text-decoration: none;
}
.player-name.chat-name-interactive:hover { text-decoration: underline; }
.chat-line.private { color: #d7a9ff; }
.chat-line.private .whisper-direction { color: #a88bc0; }

.management-report-card,
.management-history-card,
.management-audit-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #695332;
  border-radius: 6px;
  background: linear-gradient(#2a2319, #1d1812);
}
.management-report-meta,
.management-history-meta,
.management-audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #cbb88e;
  font-size: 12px;
}
.management-chat-snapshot {
  max-height: 230px;
  overflow: auto;
  padding: 9px;
  border: 1px solid #554329;
  background: #14110d;
  color: #ddd0b4;
  font: 12px/1.45 "Courier New", monospace;
}
.management-chat-entry { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.management-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.management-action-grid .admin-wide-field { grid-column: 1 / -1; }
.management-status-open { color: #ffca64; }
.management-status-actioned { color: #77d28a; }
.management-status-ignored { color: #aaa; }
.audit-details { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.4 "Courier New", monospace; }

@media (max-width: 620px) {
  .management-action-grid { grid-template-columns: 1fr; }
  .management-action-grid .admin-wide-field { grid-column: auto; }
}

/* Mobile long-press context menus */
#game,
#minimap,
#world-map-canvas,
.inventory-slot,
.bank-slot,
.bank-inventory-slot,
.chat-name-interactive {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#game,
#minimap,
#world-map-canvas,
.bank-slot,
.bank-inventory-slot {
  touch-action: none;
}

.chat-name-interactive {
  touch-action: manipulation;
}

/* Expanded world editor controls */
.map-editor-jump { grid-template-columns: 1fr 1fr; }
.map-editor-jump input { min-width: 0; }
.map-editor-jump button { grid-column: 1 / -1; }
.legend-furniture { border-color: #9e6d43 !important; background: #714a2e; }

/* Cosmetic Journal, appearance overrides, and expanded equipment slots */
#top-tabs { max-width: min(780px, calc(100vw - 16px)); }
#top-tabs .tab-button { min-width: 58px; }

.equipment-expanded-layout,
.cosmetic-journal {
  display: grid;
  gap: 10px;
  padding: 2px;
}
.equipment-section,
.cosmetic-presets,
.cosmetic-rewards,
.cosmetic-collection-card,
.cosmetic-overview {
  border: 1px solid #5f4a2c;
  background: linear-gradient(#d2ba86, #baa06d);
  box-shadow: inset 0 0 0 2px rgba(255,245,205,.18), 0 2px 5px rgba(0,0,0,.35);
  padding: 8px;
}
.equipment-section h3,
.cosmetic-journal h3 { margin: 0; color: #39270f; font: bold 13px Georgia, serif; }
.equipment-section p,
.cosmetic-section-heading p { margin: 3px 0 7px; color: #514022; font-size: 10px; line-height: 1.25; }
.equipment-section-heading,
.cosmetic-section-heading,
.cosmetic-collection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.equipment-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.equipment-slot-grid .equipment-slot {
  position: static;
  inset: auto;
  transform: none;
  width: auto;
  min-width: 0;
  height: 62px;
  display: grid;
  grid-template-rows: 42px 14px;
  gap: 2px;
}
.equipment-slot-grid .equipment-item-button {
  position: relative;
  width: 100%;
  height: 42px;
  min-width: 0;
}
.equipment-slot-grid .equipment-slot-label {
  position: static;
  width: auto;
  font-size: 8px;
  line-height: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cosmetic-slot-grid .equipment-item-button { border-color: #9b6cc0; background: radial-gradient(circle, #543a64, #2c2132); }
.compact-button { min-height: 24px; padding: 3px 7px; font-size: 10px; }

.cosmetic-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}
.cosmetic-overview div { background: rgba(59,41,18,.15); border: 1px solid rgba(78,54,24,.45); padding: 6px 3px; }
.cosmetic-overview span { display: block; font-size: 8px; text-transform: uppercase; color: #654b26; }
.cosmetic-overview strong { display: block; margin-top: 2px; color: #2e1e0c; font-size: 12px; }
.cosmetic-preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.cosmetic-preset-card { border: 1px solid #775b31; background: rgba(255,244,204,.2); padding: 6px; display: grid; gap: 3px; }
.cosmetic-preset-card strong { color: #2f210e; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmetic-preset-card small { color: #6d5632; font-size: 9px; }
.cosmetic-preset-card > div { display: flex; gap: 4px; }
.cosmetic-preset-card button { flex: 1; }
.cosmetic-reward-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; }
.cosmetic-reward-button {
  border: 1px solid #71582f;
  background: #3e3021;
  color: #ead7a5;
  min-height: 42px;
  padding: 5px;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  grid-template-rows: auto auto;
  text-align: left;
}
.cosmetic-reward-button > span { grid-row: 1 / 3; font-size: 18px; align-self: center; }
.cosmetic-reward-button strong { font-size: 10px; }
.cosmetic-reward-button small { font-size: 8px; color: #bfae82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmetic-reward-button.active { outline: 2px solid #d5a7ff; box-shadow: 0 0 8px #925fc0; }
.cosmetic-collection-list { display: grid; gap: 8px; }
.cosmetic-collection-card.complete { border-color: #9b7b2b; box-shadow: inset 0 0 12px rgba(255,220,87,.28), 0 2px 5px rgba(0,0,0,.35); }
.cosmetic-collection-heading small { color: #755d35; text-transform: uppercase; font-size: 8px; letter-spacing: .08em; }
.cosmetic-collection-heading strong { color: #3d2a10; font-size: 12px; }
.cosmetic-progress-track { height: 6px; border: 1px solid #5f4727; background: #2f251b; margin: 6px 0; overflow: hidden; }
.cosmetic-progress-track span { display: block; height: 100%; background: linear-gradient(90deg, #7651a4, #d3a7ff); }
.cosmetic-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
.cosmetic-item-button {
  min-width: 0;
  min-height: 76px;
  border: 1px solid #6c5430;
  background: #4b3925;
  color: #ead9aa;
  padding: 4px;
  display: grid;
  grid-template-rows: 38px auto auto;
  gap: 2px;
  text-align: center;
  overflow: hidden;
}
.cosmetic-item-button.locked { filter: grayscale(1); opacity: .48; }
.cosmetic-item-button.unlocked:hover { outline: 2px solid #d6a9ff; background: #584036; }
.cosmetic-item-visual { position: relative; display: block; width: 38px; height: 38px; margin: 0 auto; }
.cosmetic-item-button strong { font-size: 9px; line-height: 1.05; overflow: hidden; }
.cosmetic-item-button small { font-size: 7px; color: #c8b787; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmetic-collection-reward { margin-top: 6px; border-top: 1px solid rgba(70,47,20,.45); padding-top: 6px; display: flex; align-items: center; gap: 7px; opacity: .55; }
.cosmetic-collection-reward.unlocked { opacity: 1; color: #5d2d82; }
.cosmetic-collection-reward > span { font-size: 20px; }
.cosmetic-collection-reward strong, .cosmetic-collection-reward small { display: block; }
.cosmetic-collection-reward strong { font-size: 10px; }
.cosmetic-collection-reward small { font-size: 8px; color: #6c5531; }
.cosmetic-reward-name { font-weight: 700; }

@media (max-width: 720px) {
  #top-tabs .tab-button { min-width: 46px; padding-inline: 2px; }
  #top-tabs .tab-button small { font-size: 7px; }
  .equipment-slot-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .cosmetic-item-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* Cosmetic collection release manager */
.cosmetic-release-summary,
.cosmetic-release-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.cosmetic-release-summary > div,
.cosmetic-release-metrics > div {
  min-width: 0;
  border: 1px solid rgba(169, 133, 70, .48);
  background: linear-gradient(180deg, rgba(255,247,213,.58), rgba(119,87,40,.13));
  padding: 10px;
  display: grid;
  gap: 3px;
}
.cosmetic-release-summary span,
.cosmetic-release-metrics span {
  color: #72572e;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cosmetic-release-summary strong,
.cosmetic-release-metrics strong { color: #34230d; font: bold 16px Georgia, serif; }
.cosmetic-release-status {
  border: 1px solid #866934;
  background: rgba(102,78,37,.12);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cosmetic-release-status > div { display: grid; gap: 4px; min-width: 0; }
.cosmetic-release-status strong { color: #38270f; }
.cosmetic-release-status small { color: #755e3a; }
.cosmetic-release-status.released { border-color: #56844c; background: rgba(96,156,79,.14); box-shadow: inset 4px 0 #73ad62; }
.cosmetic-release-status.hidden { border-color: #985d5d; background: rgba(157,73,73,.12); box-shadow: inset 4px 0 #b15b5b; }
.cosmetic-release-toggle {
  flex: 0 0 auto;
  border: 1px solid #71582f;
  background: #3e3021;
  color: #f3dfae;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 700;
}
.cosmetic-release-toggle input { width: 17px; height: 17px; accent-color: #875ab3; }
.cosmetic-title-preview {
  border: 1px solid #786039;
  background: radial-gradient(circle at center, rgba(111,72,145,.32), rgba(29,22,34,.96));
  color: #ead9b2;
  padding: 14px;
  display: grid;
  justify-items: center;
  gap: 7px;
  overflow: hidden;
}
.cosmetic-title-preview-name,
.cosmetic-title-inline,
.cosmetic-reward-name[data-title-animation] {
  position: relative;
  display: inline-block;
  font-weight: 800;
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: cosmetic-title-shimmer 3.2s linear infinite;
}
.cosmetic-title-preview-name { font: bold 18px Georgia, serif; text-shadow: 0 0 9px rgba(255,238,171,.5); }
.cosmetic-title-preview small { color: #c7b58f; font-size: 9px; }
.cosmetic-release-item-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.cosmetic-release-item-columns > section { min-width: 0; }
.cosmetic-release-item-list { display: grid; gap: 5px; max-height: 360px; overflow: auto; padding-right: 3px; }
.cosmetic-release-item-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(111,83,43,.55);
  background: rgba(255,247,214,.28);
  padding: 5px;
}
.cosmetic-release-item-row > div { min-width: 0; display: grid; gap: 2px; }
.cosmetic-release-item-row strong,
.cosmetic-release-item-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmetic-release-item-row strong { color: #38270f; font-size: 10px; }
.cosmetic-release-item-row small { color: #765f3c; font-size: 8px; }
.cosmetic-release-item-row code { color: #69517e; font-size: 8px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.cosmetic-bulk-actions { border-top: 1px solid rgba(91,65,28,.4); margin-top: 12px; padding-top: 10px; }
.cosmetic-collection-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; align-items: center; }
.cosmetic-collection-heading p { grid-column: 1 / -1; margin: 0; color: #765f3a; font-size: 8px; line-height: 1.3; }
.cosmetic-item-button.optional-variant { border-style: dashed; background: linear-gradient(180deg, #493a2a, #392d23); }
.cosmetic-item-button.optional-variant small { color: #d1b4e9; }

@keyframes cosmetic-title-shimmer { from { background-position: 100% 50%; } to { background-position: -100% 50%; } }
@keyframes cosmetic-title-glitch { 0%,88%,100% { transform: translate(0); filter: none; } 90% { transform: translate(-1px,1px); filter: drop-shadow(2px 0 #45e6ff); } 94% { transform: translate(1px,-1px); filter: drop-shadow(-2px 0 #ff4faa); } }
@keyframes cosmetic-title-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); filter: brightness(1.18); } }
@keyframes cosmetic-title-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes cosmetic-title-flicker { 0%,100% { opacity: 1; } 45% { opacity: .78; } 47% { opacity: .35; } 49% { opacity: .95; } }
[data-title-animation*="glitch" i], [data-title-animation*="error" i], [data-title-animation*="pixel" i] { animation: cosmetic-title-glitch 2.1s steps(1,end) infinite; }
[data-title-animation*="heart" i], [data-title-animation*="pulse" i], [data-title-animation*="achievement" i] { animation: cosmetic-title-pulse 1.5s ease-in-out infinite; }
[data-title-animation*="seraph" i], [data-title-animation*="wing" i], [data-title-animation*="float" i], [data-title-animation*="star" i] { animation: cosmetic-title-float 2.4s ease-in-out infinite, cosmetic-title-shimmer 3s linear infinite; }
[data-title-animation*="ghost" i], [data-title-animation*="shadow" i], [data-title-animation*="void" i] { animation: cosmetic-title-flicker 2.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  [data-title-animation], .cosmetic-title-inline, .cosmetic-title-preview-name { animation: none !important; }
}
@media (max-width: 900px) {
  .cosmetic-release-summary, .cosmetic-release-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cosmetic-release-item-columns { grid-template-columns: 1fr; }
}


/* Maintenance Tool */
.maintenance-status-card {
  border: 1px solid #866934;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.maintenance-status-card.disabled { background: rgba(91,145,73,.12); box-shadow: inset 4px 0 #6b9d5c; }
.maintenance-status-card.enabled { background: rgba(164,65,65,.15); border-color: #9a5555; box-shadow: inset 4px 0 #c25757, 0 0 16px rgba(173,54,54,.13); }
.maintenance-status-copy { display: grid; gap: 5px; min-width: 0; }
.maintenance-status-copy strong { color: #38270f; font: bold 18px Georgia, serif; }
.maintenance-status-copy p { margin: 0; color: #6f5735; line-height: 1.45; }
.maintenance-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #735735;
  background: #3e3021;
  color: #f4dfad;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}
.maintenance-toggle input { width: 18px; height: 18px; accent-color: #b44949; }
.maintenance-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.maintenance-impact-grid > div,
.maintenance-message-preview {
  border: 1px solid rgba(122,91,45,.48);
  background: rgba(255,247,213,.34);
  padding: 10px;
}
.maintenance-impact-grid > div { display: grid; gap: 4px; }
.maintenance-impact-grid span { color: #72572e; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.maintenance-impact-grid strong { color: #34230d; }
.maintenance-message-preview { margin: 8px 0; }
.maintenance-message-preview p { margin: 7px 0 0; color: #3f2b12; font-weight: 700; line-height: 1.45; }
.auth-switch button.maintenance-disabled { opacity: .72; }
.auth-switch button.maintenance-disabled::after { content: ' · Maintenance'; font-size: .7em; }
@media (max-width: 820px) {
  .maintenance-status-card { align-items: stretch; flex-direction: column; }
  .maintenance-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


.ui-tutorial{position:fixed;inset:0;z-index:30000;pointer-events:none;background:rgba(4,6,12,.68)}.ui-tutorial[hidden]{display:none}.ui-tutorial #ui-tutorial-spotlight{position:fixed;border:3px solid #e9d47b;border-radius:14px;box-shadow:0 0 0 9999px rgba(4,6,12,.68),0 0 30px #d5b958;transition:.22s;pointer-events:none}.ui-tutorial aside{position:fixed;width:min(360px,calc(100vw - 24px));padding:18px;z-index:2;pointer-events:auto;background:#201d2e;color:#fff;border:1px solid #d7c371}.ui-tutorial h2{margin:5px 0 8px;color:#fff0aa}.ui-tutorial p{line-height:1.5}.ui-tutorial aside>div{display:flex;justify-content:flex-end;gap:8px}.ui-tutorial button,.quest-complete-panel button{padding:9px 14px;border-radius:7px;border:1px solid #cbb765;background:#34304b;color:white}.quest-complete-panel{position:fixed;z-index:30010;left:50%;top:50%;transform:translate(-50%,-50%);padding:25px;min-width:320px;text-align:center;background:#211e30}.quest-complete-panel h2{color:#f3db7d}.quest-list{display:grid;gap:10px}.quest-card{padding:12px;border:1px solid rgba(255,255,255,.15);border-radius:8px;background:rgba(255,255,255,.04)}.quest-objective{display:flex;gap:8px;margin:6px 0}.quest-objective.done{text-decoration:line-through;opacity:.65}.quest-badge{font-size:11px;padding:3px 7px;border-radius:999px;background:#5d4f83}.quest-progress-bar{height:6px;background:#16131f;border-radius:999px;overflow:hidden}.quest-progress-bar i{display:block;height:100%;background:#ddca72}

/* Mosselune onboarding clarity pass */
.new-adventurer-guide{position:absolute;left:18px;top:104px;z-index:155;width:min(360px,calc(100vw - 36px));padding:0;overflow:hidden;background:linear-gradient(180deg,rgba(31,28,45,.97),rgba(18,17,27,.96));border:1px solid #d0ba68;box-shadow:0 10px 30px rgba(0,0,0,.46),0 0 18px rgba(219,199,115,.18)}
.new-adventurer-guide[hidden]{display:none}.new-adventurer-guide header{display:flex;align-items:center;justify-content:space-between;padding:11px 12px;background:linear-gradient(90deg,rgba(108,86,145,.58),rgba(40,34,58,.55));border-bottom:1px solid rgba(235,214,132,.3)}
.new-adventurer-guide header>div{display:grid;gap:2px}.guide-kicker{font-size:10px;letter-spacing:.13em;color:#d8c984}.new-adventurer-guide header strong{font-size:13px;color:#fff4bd}.new-adventurer-guide header button{width:29px;height:29px;border:1px solid #8d7a42;border-radius:6px;background:#252237;color:#fff;font-weight:900}
#quest-guide-body{padding:12px;display:grid;gap:10px}.new-adventurer-guide.collapsed #quest-guide-body{display:none}.new-adventurer-guide.collapsed{width:min(300px,calc(100vw - 36px))}
.guide-objective-row,.guide-location{display:flex;align-items:center;gap:10px}.guide-objective-row>span{display:grid;place-items:center;width:39px;height:39px;border-radius:50%;background:#4a3d65;border:1px solid #d8c56f;font-size:20px;box-shadow:0 0 14px rgba(227,205,112,.22)}.guide-objective-row>div,.guide-location>div{display:grid;gap:2px}.guide-objective-row small,.guide-location small{font-size:10px;color:#bdb6ca}.guide-objective-row strong{font-size:15px;color:#fff;line-height:1.25}.guide-location>span{font-size:20px;color:#8fe2ff}.guide-location strong{font-size:13px;color:#dff8ff}
.guide-progress-track{height:7px;border-radius:999px;background:#100e18;overflow:hidden;border:1px solid rgba(255,255,255,.09)}.guide-progress-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#7b65a5,#f1d975);transition:width .25s}
#quest-guide-instructions{margin:0;padding:9px 10px;border-left:3px solid #75cfee;background:rgba(71,133,159,.13);font-size:12px;line-height:1.45;color:#f1eef8}.new-adventurer-guide details{padding:7px 9px;border:1px solid rgba(255,255,255,.11);border-radius:7px;background:rgba(255,255,255,.035)}.new-adventurer-guide summary{cursor:pointer;font-size:11px;font-weight:700;color:#ead88d}.new-adventurer-guide details p{margin:7px 0 0;font-size:11px;line-height:1.4;color:#cfc9d9}.guide-actions{display:flex;gap:8px}.guide-actions button{flex:1;min-height:34px}.guide-complete{padding:13px;color:#e6dbac;text-align:center}
#quest-guide-distance{color:#8fe2ff;font-weight:700}.quest-card.current-quest{border-color:#d8c56f;box-shadow:0 0 14px rgba(218,194,102,.12)}.quest-objective-list{display:grid;gap:6px;margin-top:10px}.quest-objective-step{display:grid;grid-template-columns:23px 1fr auto;gap:7px;align-items:start;padding:7px;border-radius:6px;background:rgba(255,255,255,.035);font-size:11px}.quest-objective-step.current{background:rgba(116,201,235,.12);outline:1px solid rgba(116,201,235,.35)}.quest-objective-step.done{opacity:.62}.quest-objective-step b{color:#fff}.quest-objective-step small{color:#bbb4c6}.quest-current-guidance{margin:9px 0;padding:9px;border-left:3px solid #d8c56f;background:rgba(216,197,111,.08);font-size:12px;line-height:1.45}
#dialogue{width:min(560px,calc(100vw - 32px));white-space:normal}.dialogue-heading{display:flex;align-items:center;gap:12px;margin-bottom:8px}.dialogue-heading>div:last-child{display:grid;gap:3px}.dialogue-heading small{font-size:10px;color:#a9a2b5}.dialogue-heading strong{color:#f2dc83;font-size:17px}.dialogue-heading #dialogue-portrait{display:grid;place-items:center;width:54px;height:54px;border-radius:12px;border:1px solid #a58e50;background:radial-gradient(circle at 50% 35%,#6e6282,#272132 72%);font-size:26px;box-shadow:inset 0 0 18px rgba(255,255,255,.08)}#dialogue-text{white-space:pre-line;line-height:1.55;min-height:54px}
.dialogue-heading #dialogue-portrait[data-style="mosseluneElder"]::before{content:'☾'}.dialogue-heading #dialogue-portrait[data-style="mosseluneWoodcutter"]::before{content:'🪓'}.dialogue-heading #dialogue-portrait[data-style="mosseluneCook"]::before{content:'🍲'}.dialogue-heading #dialogue-portrait[data-style="mosseluneFisher"]::before{content:'🎣'}.dialogue-heading #dialogue-portrait[data-style="mosseluneMiner"]::before{content:'⛏'}.dialogue-heading #dialogue-portrait[data-style="mosseluneGuardian"]::before{content:'🛡'}.dialogue-heading #dialogue-portrait[data-style="mosselunePriest"]::before{content:'✦'}.dialogue-heading #dialogue-portrait[data-style] {font-size:0}.dialogue-heading #dialogue-portrait[data-style]::before{font-size:26px}
@media (max-width:760px){.new-adventurer-guide{top:88px;left:8px;width:min(330px,calc(100vw - 16px))}.new-adventurer-guide.collapsed{width:250px}.new-adventurer-guide details{display:none}}

/* Mosselune living-world and quest tracker reliability pass */
.new-adventurer-guide{
  max-height:calc(100vh - 122px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.new-adventurer-guide[hidden]{display:none}
.new-adventurer-guide>header{flex:0 0 auto}
#quest-guide-body{
  min-height:0;
  max-height:calc(100vh - 186px);
  overflow-y:auto;
  overscroll-behavior:contain;
  touch-action:pan-y;
  scrollbar-gutter:stable;
  padding-right:10px;
}
#quest-guide-body::-webkit-scrollbar{width:8px}
#quest-guide-body::-webkit-scrollbar-thumb{background:#746440;border-radius:8px;border:2px solid #211d2d}
.guide-objective-row{grid-template-columns:auto minmax(0,1fr) auto}
.guide-objective-count{align-self:center;white-space:nowrap;padding:5px 7px;border:1px solid rgba(255,231,136,.35);border-radius:999px;background:rgba(255,231,136,.09);color:#fff0a9;font:800 11px/1 Courier New}
.dialogue-heading #dialogue-portrait[data-style="sorenAdventurer"]::before{content:'☀'}
.dialogue-heading #dialogue-portrait[data-style="shadowWaystone"]::before{content:'◈'}
@media (max-width:760px){
  .new-adventurer-guide{max-height:calc(100vh - 96px)}
  #quest-guide-body{max-height:calc(100vh - 158px)}
  .new-adventurer-guide details{display:block}
}


/* Performance diagnostics and adaptive renderer */
.performance-diagnostics {
  position:absolute; left:12px; top:12px; z-index:52; width:290px; padding:8px;
  background:rgba(18,15,11,.92); pointer-events:auto; backdrop-filter:blur(4px);
}
.performance-diagnostics header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
.performance-diagnostics header div { display:grid; gap:1px; }
.performance-diagnostics header small { color:#a99976; font:700 9px/1.2 "Courier New",monospace; letter-spacing:.8px; }
.performance-diagnostics header strong { color:#f0d882; font:800 12px/1.2 "Courier New",monospace; }
.performance-diagnostics header button { width:24px; height:24px; border:1px solid #806e50; background:#292219; color:#ead9ad; }
.performance-diagnostics-grid { display:grid; grid-template-columns:auto 1fr auto 1fr; gap:3px 7px; align-items:baseline; font:700 10px/1.25 "Courier New",monospace; }
.performance-diagnostics-grid span { color:#9f947d; }
.performance-diagnostics-grid b { color:#e6dfcb; text-align:right; white-space:nowrap; }
.performance-diagnostics-grid .diagnostic-wide { grid-column:span 3; }
.performance-diagnostics > .panel-button { width:100%; margin-top:8px; font-size:10px; }
@media (max-width:700px) { .performance-diagnostics { left:6px; top:6px; width:250px; transform:scale(.88); transform-origin:top left; } }

/* 3.7.0 session, minimap, and portrait-mobile polish */
#minimap {
  background:#151a10;
  overflow:hidden;
}

#chat-collapse-toggle {
  position:absolute;
  top:-28px;
  right:0;
  z-index:5;
  min-width:34px;
  height:28px;
  padding:0 9px;
  border:2px outset #806f56;
  border-radius:5px 5px 0 0;
  background:linear-gradient(#554a3b,#302820);
  color:#f0d98c;
  font:900 12px/1 "Courier New",monospace;
  box-shadow:0 -2px 7px rgba(0,0,0,.3);
}
#chat-collapse-toggle:hover { filter:brightness(1.15); }
#chat-panel.chat-collapsed {
  width:86px !important;
  min-width:86px !important;
  height:0 !important;
  border:0;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}
#chat-panel.chat-collapsed > :not(#chat-collapse-toggle):not(#server-clock) { display:none !important; }
#chat-panel.chat-collapsed #chat-collapse-toggle {
  top:-36px;
  width:86px;
  height:36px;
  border-radius:7px;
}

.dialogue-heading #dialogue-portrait[data-style="sorenAdventurer"] {
  background:radial-gradient(circle at 62% 35%,#5b756d,#1a2028 72%);
  border-color:#76a99a;
  box-shadow:inset 0 0 18px rgba(138,232,194,.12),0 0 12px rgba(85,173,145,.16);
}
.dialogue-heading #dialogue-portrait[data-style="sorenAdventurer"]::before{content:'◐'}

@media (orientation: portrait) and (max-width: 760px) {
  #top-tabs {
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    width:100%;
    max-width:none;
    min-height:64px;
    padding:3px 3px calc(3px + env(safe-area-inset-bottom));
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(42px,1fr));
    gap:2px;
    transform:none !important;
    transform-origin:center bottom;
    border-left:0;
    border-right:0;
    border-bottom:0;
    border-radius:0;
    background:linear-gradient(rgba(73,62,47,.98),rgba(35,29,22,.99));
    box-shadow:0 -4px 18px rgba(0,0,0,.56),inset 0 1px rgba(246,220,150,.18);
    z-index:35;
  }
  #top-tabs .tab-button {
    width:auto;
    min-width:0;
    height:56px;
    padding:3px 1px;
    border-radius:5px;
    touch-action:manipulation;
  }
  #top-tabs .tab-button span { font-size:20px; }
  #top-tabs .tab-button small {
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:7px;
  }
  #side-panel {
    left:5px;
    right:5px;
    bottom:calc(68px + env(safe-area-inset-bottom));
    width:auto;
    max-height:calc(100dvh - 210px - env(safe-area-inset-bottom));
  }
  #panel-content { max-height:calc(100dvh - 258px - env(safe-area-inset-bottom)); }
  #chat-panel {
    left:6px;
    right:6px;
    bottom:calc(72px + env(safe-area-inset-bottom));
    width:auto;
    min-width:0;
    height:148px;
    z-index:30;
  }
  #chat-messages { height:86px; }
  #chat-panel.chat-collapsed {
    left:6px;
    right:auto;
    bottom:calc(72px + env(safe-area-inset-bottom));
  }
  #chat-collapse-toggle {
    top:-34px;
    height:34px;
    min-width:48px;
  }
  #new-adventurer-guide {
    bottom:calc(72px + env(safe-area-inset-bottom));
    max-height:calc(100dvh - 170px - env(safe-area-inset-bottom));
  }
  #quest-guide-body { max-height:calc(100dvh - 232px - env(safe-area-inset-bottom)); }
}


/* Compact, truly collapsible New Adventurer Guide */
.new-adventurer-guide.collapsed {
  width:auto !important;
  max-width:none !important;
  max-height:none !important;
  min-height:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  overflow:visible !important;
}
.new-adventurer-guide.collapsed > header {
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  overflow:visible;
}
.new-adventurer-guide.collapsed > header > div { display:none !important; }
.new-adventurer-guide.collapsed #quest-guide-body { display:none !important; }
.new-adventurer-guide.collapsed #quest-guide-collapse {
  width:auto;
  min-width:86px;
  height:36px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid #cbb765;
  background:linear-gradient(180deg,#4c4261,#29243a);
  color:#fff2ae;
  box-shadow:0 5px 16px rgba(0,0,0,.48),0 0 12px rgba(226,204,112,.18);
  font:900 11px/1 "Courier New",monospace;
  letter-spacing:.02em;
  white-space:nowrap;
}

@media (max-width:760px) {
  #new-adventurer-guide:not(.collapsed) {
    top:78px;
    left:6px;
    bottom:auto;
    width:min(286px,calc(100vw - 12px));
    max-height:min(360px,calc(100dvh - 158px - env(safe-area-inset-bottom)));
    border-radius:9px;
  }
  #new-adventurer-guide:not(.collapsed) > header { padding:7px 8px; }
  #new-adventurer-guide:not(.collapsed) .guide-kicker { font-size:8px; letter-spacing:.1em; }
  #new-adventurer-guide:not(.collapsed) header strong { font-size:11px; line-height:1.15; }
  #new-adventurer-guide:not(.collapsed) header button { width:27px; height:27px; }
  #new-adventurer-guide:not(.collapsed) #quest-guide-body {
    max-height:min(306px,calc(100dvh - 210px - env(safe-area-inset-bottom)));
    padding:8px;
    padding-right:7px;
    gap:7px;
  }
  #new-adventurer-guide:not(.collapsed) .guide-objective-row,
  #new-adventurer-guide:not(.collapsed) .guide-location { gap:7px; }
  #new-adventurer-guide:not(.collapsed) .guide-objective-row > span {
    width:32px;
    height:32px;
    font-size:16px;
  }
  #new-adventurer-guide:not(.collapsed) .guide-objective-row strong { font-size:12px; }
  #new-adventurer-guide:not(.collapsed) .guide-objective-row small,
  #new-adventurer-guide:not(.collapsed) .guide-location small { font-size:8px; }
  #new-adventurer-guide:not(.collapsed) .guide-location > span { font-size:16px; }
  #new-adventurer-guide:not(.collapsed) .guide-location strong { font-size:11px; }
  #new-adventurer-guide:not(.collapsed) .guide-objective-count { padding:4px 6px; font-size:9px; }
  #new-adventurer-guide:not(.collapsed) .guide-progress-track { height:5px; }
  #new-adventurer-guide:not(.collapsed) #quest-guide-instructions {
    padding:7px 8px;
    font-size:10px;
    line-height:1.35;
  }
  #new-adventurer-guide:not(.collapsed) details { padding:6px 7px; }
  #new-adventurer-guide:not(.collapsed) summary { font-size:9px; }
  #new-adventurer-guide:not(.collapsed) details p { margin-top:5px; font-size:9px; line-height:1.3; }
  #new-adventurer-guide:not(.collapsed) .guide-actions { gap:6px; }
  #new-adventurer-guide:not(.collapsed) .guide-actions button { min-height:29px; padding:4px 6px; font-size:9px; }
  #new-adventurer-guide.collapsed {
    top:78px;
    left:6px;
    right:auto;
    bottom:auto;
  }
  #new-adventurer-guide.collapsed #quest-guide-collapse {
    min-width:76px;
    height:34px;
    padding:0 10px;
    font-size:10px;
  }
}

/* 3.7.0-alpha.4 Mosselune interaction and minimap polish */
.new-adventurer-guide { top:132px; }
@media (max-width:760px) {
  .new-adventurer-guide { top:112px; }
}

.minimap-zoom-controls {
  position:absolute;
  left:50%;
  bottom:-8px;
  z-index:7;
  display:flex;
  gap:4px;
  transform:translateX(-50%);
  pointer-events:auto;
}
.minimap-zoom-controls button {
  width:28px;
  height:25px;
  padding:0;
  border:2px outset #8e7b5d;
  border-radius:5px;
  background:linear-gradient(#5c5141,#332c23);
  color:#f5df98;
  font:900 16px/1 "Courier New",monospace;
  box-shadow:0 2px 5px rgba(0,0,0,.45);
}
.minimap-zoom-controls button:disabled { opacity:.38; filter:grayscale(.8); }

.dialogue-heading #dialogue-portrait[data-style="mosselunePriestess"]::before{content:'☾'}
.dialogue-heading #dialogue-portrait[data-style="mosselunePriestess"] {
  border-color:#9fb8ff;
  background:radial-gradient(circle at 50% 33%,#8d9bd1,#2a264f 50%,#111126 84%);
  box-shadow:inset 0 0 18px rgba(218,228,255,.18),0 0 14px rgba(125,151,235,.24);
}

/* Alpha .5 interaction polish overrides */
.skills-summary-card{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:10px;
  padding:12px;
  border:1px solid rgba(229,210,132,.28);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(44,39,58,.95),rgba(26,24,35,.96));
}
.skills-summary-card>div{
  display:grid;
  gap:4px;
  padding:10px;
  border-radius:8px;
  background:rgba(255,255,255,.045);
  text-align:center;
}
.skills-summary-card span{font-size:11px;letter-spacing:.04em;color:#d3c9e0;text-transform:uppercase}
.skills-summary-card strong{font-size:18px;color:#fff3bd}
.quest-list{display:grid;gap:10px;overflow-y:auto;overscroll-behavior:contain;padding-right:2px}
.quest-details{padding:0;overflow:hidden}
.quest-summary{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:12px;align-items:center;list-style:none;cursor:pointer;padding:12px}
.quest-summary::-webkit-details-marker{display:none}
.quest-summary h3{margin:6px 0 4px}
.quest-summary p{margin:0;color:#cbc5d6;font-size:12px;line-height:1.45}
.quest-summary-side{display:grid;gap:6px;align-content:center}
.quest-summary-side small{text-align:right;color:#efe3a2}
.quest-card-body{display:grid;gap:10px;padding:0 12px 12px}
.quest-journal-controls{display:flex;justify-content:flex-end}
.quest-guide-toggle{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:999px;background:rgba(116,201,235,.12);font-size:12px;color:#eaf8ff}
.quest-guide-toggle input{accent-color:#6ed8ff}
.quest-section{padding:10px;border-radius:8px;background:rgba(255,255,255,.03)}
.quest-section h4{margin:0 0 8px;color:#f4e4a2;font-size:12px;letter-spacing:.04em;text-transform:uppercase}
#new-adventurer-guide .guide-kicker{letter-spacing:.16em}
@media (max-width:760px){
  .skills-summary-card{grid-template-columns:1fr;gap:8px}
  .quest-summary{grid-template-columns:1fr}
}

/* 3.7.0-alpha.8 Quest Journal interaction repair */
#panel-content.quest-journal-content {
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  touch-action:pan-y;
  scrollbar-gutter:stable;
}
.quest-journal-content .quest-list {
  display:grid;
  gap:7px;
  overflow:visible;
  min-height:min-content;
  padding:0 2px 8px 0;
  touch-action:pan-y;
}
.quest-journal-content .quest-details {
  padding:0;
  overflow:clip;
  flex:none;
}
.quest-journal-content .quest-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:42px;
  padding:9px 11px;
  list-style:none;
  cursor:pointer;
  user-select:none;
  touch-action:manipulation;
}
.quest-journal-content .quest-summary::-webkit-details-marker { display:none; }
.quest-journal-content .quest-summary h3 {
  margin:0;
  color:#fff2bd;
  font-size:13px;
  line-height:1.25;
}
.quest-summary-chevron {
  flex:0 0 auto;
  color:#d9c875;
  font-size:22px;
  line-height:1;
  transform:rotate(0deg);
  transition:transform .16s ease;
}
.quest-details[open] .quest-summary-chevron { transform:rotate(90deg); }
.quest-journal-content .quest-card-body {
  display:grid;
  gap:10px;
  padding:0 11px 12px;
  border-top:1px solid rgba(255,255,255,.08);
}
.quest-expanded-heading { display:grid; gap:7px; padding-top:10px; }
.quest-expanded-heading>p { margin:0; color:#cbc5d6; font-size:12px; line-height:1.45; }
.quest-summary-progress { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; }
.quest-summary-progress small { color:#eadb94; font-size:10px; white-space:nowrap; }
.quest-journal-content button,
.quest-journal-content input,
.quest-journal-content label { pointer-events:auto; }
.quest-state-line { margin:0; color:#9fe0a3; font-weight:700; }
@media (max-width:760px) {
  .quest-journal-content .quest-summary { min-height:39px; padding:8px 9px; }
  .quest-journal-content .quest-summary h3 { font-size:12px; }
  .quest-journal-content .quest-card-body { padding:0 9px 10px; }
}


/* 3.7.0-alpha.9 Royal Relevance and reliable quest progress */
.dialogue-heading #dialogue-portrait[data-style="kingMelvin"]{background:linear-gradient(145deg,#2c5f9b,#e0bb42);border-color:#f2d86c;color:#fff7bd}
.dialogue-heading #dialogue-portrait[data-style="kingMelvin"]::before{content:'♛'}
.dialogue-heading #dialogue-portrait[data-style="messengerLore"]{background:linear-gradient(145deg,#17141a,#a62e2e);border-color:#e25d4f}
.dialogue-heading #dialogue-portrait[data-style="messengerYume"]{background:linear-gradient(145deg,#f0f0f2,#6f7580);border-color:#ffffff;color:#30333a}
.dialogue-heading #dialogue-portrait[data-style="messengerLicht"]{background:linear-gradient(145deg,#e1b632,#fff9dc);border-color:#fff09a;color:#5d4810}
.dialogue-heading #dialogue-portrait[data-style="messengerXedem"]{background:linear-gradient(145deg,#432566,#17121f);border-color:#a76bdd}
.dialogue-heading #dialogue-portrait[data-style^="messenger"]::before{content:'✉'}

/* 3.7.0-alpha.9: translucent story dialogue without fading text or controls */
#dialogue {
  background: linear-gradient(135deg,
    rgba(98, 87, 68, .60),
    rgba(64, 56, 45, .60) 52%,
    rgba(45, 39, 31, .60));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* 3.7.0-alpha.10 Five-Kingdom Council portraits */
.dialogue-heading #dialogue-portrait[data-style="kingKoi"]{background:linear-gradient(145deg,#f1f2f5,#737b88);border-color:#fff;color:#32363f}
.dialogue-heading #dialogue-portrait[data-style="kingKoi"]::before{content:'♛'}
.dialogue-heading #dialogue-portrait[data-style="kingHorus"]{background:linear-gradient(145deg,#4c2671,#17121f);border-color:#b77be8}
.dialogue-heading #dialogue-portrait[data-style="kingHorus"]::before{content:'♛'}
.dialogue-heading #dialogue-portrait[data-style="kingCaspian"]{background:linear-gradient(145deg,#e6bd35,#fff8dc);border-color:#fff5a1;color:#5f4b12}
.dialogue-heading #dialogue-portrait[data-style="kingCaspian"]::before{content:'♛'}
.dialogue-heading #dialogue-portrait[data-style="kingVictor"]{background:linear-gradient(145deg,#151319,#9f2b30);border-color:#ef6158}
.dialogue-heading #dialogue-portrait[data-style="kingVictor"]::before{content:'♛'}
.dialogue-heading #dialogue-portrait[data-style="asherMage"]{background:radial-gradient(circle at 50% 38%,#7d36ad,#17101f 62%,#09070d);border-color:#c56dff;box-shadow:0 0 18px rgba(159,61,221,.55)}
.dialogue-heading #dialogue-portrait[data-style="asherMage"]::before{content:'✦'}
.dialogue-heading #dialogue-portrait[data-style="darkMagic"]{background:radial-gradient(circle,#6d248f,#110a18);border-color:#bc66ed}
.dialogue-heading #dialogue-portrait[data-style="darkMagic"]::before{content:'◈'}
.dialogue-heading #dialogue-portrait[data-style="council"]{background:linear-gradient(145deg,#315a91,#e6bd35,#4c2671,#9f2b30);border-color:#fff1a0}
.dialogue-heading #dialogue-portrait[data-style="council"]::before{content:'♛'}

/* 3.7.0-alpha.11 Blacksmithing and Flint's forge */
.smithing-interface{width:min(760px,calc(100vw - 28px));max-height:min(700px,calc(100vh - 36px));overflow:hidden}
.smithing-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;border-bottom:1px solid rgba(255,255,255,.11)}
.smithing-summary>div{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:8px;background:rgba(255,255,255,.045)}
.smithing-summary span{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#cfc7d9}
.smithing-summary strong{color:#fff0aa}.smithing-summary strong.missing{color:#ff8d83}
.smithing-recipes{display:grid;gap:9px;max-height:520px;overflow-y:auto;overscroll-behavior:contain;padding:12px}
.smithing-category{margin:7px 0 0;padding-bottom:5px;border-bottom:1px solid rgba(231,210,124,.28);color:#f2dc83;font-size:13px;letter-spacing:.07em;text-transform:uppercase}
.smithing-recipe-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px;border:1px solid rgba(255,255,255,.12);border-radius:9px;background:linear-gradient(180deg,rgba(71,62,53,.55),rgba(35,31,31,.7))}
.smithing-recipe-copy{display:grid;gap:4px}.smithing-recipe-copy strong{color:#fff2bd;font-size:14px}.smithing-recipe-copy span{color:#ddd5c8;font-size:11px;line-height:1.35}.smithing-recipe-copy small{color:#9fcfe0;font-size:10px}
.smithing-craft-button{min-width:108px}.smithing-interface>.shop-status{padding:0 12px 12px}
@media(max-width:760px){.smithing-summary{grid-template-columns:1fr}.smithing-recipe-card{grid-template-columns:1fr}.smithing-craft-button{width:100%}.smithing-recipes{max-height:calc(100vh - 230px)}}
.dialogue-heading #dialogue-portrait[data-style="princessSona"]{background:radial-gradient(circle at 50% 35%,#fff8bf,#e3bd38 55%,#7a5d17);border-color:#fff3a1;color:#6b4d08;box-shadow:0 0 18px rgba(255,226,95,.45)}
.dialogue-heading #dialogue-portrait[data-style="princessSona"]::before{content:'♕'}
.dialogue-heading #dialogue-portrait[data-style="undeadGhoul"]{background:radial-gradient(circle at 50% 35%,#9aa87b,#343138 68%,#16151a);border-color:#b8cb75;color:#e3efac}

/* Mobile zoom, session notices, and persistent statistics */
#game,#minimap,#world-map-canvas{touch-action:none}
.session-warning-message{color:#ff3434!important;font-weight:900;letter-spacing:.02em;text-shadow:0 0 3px #f00,0 0 9px rgba(255,0,0,.95),0 0 18px rgba(255,65,65,.75);animation:session-warning-pulse 1.35s ease-in-out infinite alternate}
@keyframes session-warning-pulse{from{filter:brightness(1)}to{filter:brightness(1.4)}}
.lifetime-statistics-hero{display:grid;gap:6px;margin-bottom:12px;padding:15px;border:1px solid rgba(235,210,122,.36);border-radius:12px;background:radial-gradient(circle at 85% 15%,rgba(87,108,168,.27),transparent 42%),linear-gradient(145deg,rgba(50,44,64,.97),rgba(27,24,36,.98))}
.lifetime-statistics-hero>strong{color:#fff2ac;font:800 25px Georgia,serif}.lifetime-statistics-hero p{margin:0;color:#d0c9d8;font-size:11px;line-height:1.45}
.lifetime-statistics-grid,.realm-statistics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.lifetime-statistics-grid>div,.realm-statistics-grid>div{display:grid;gap:5px;padding:11px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:rgba(255,255,255,.045)}
.lifetime-statistics-grid span,.realm-statistics-grid span{color:#bfb6ca;font-size:10px;letter-spacing:.045em;text-transform:uppercase}.lifetime-statistics-grid strong,.realm-statistics-grid strong{color:#fff0ae;font-size:16px}.lifetime-statistics-back{width:100%;margin-top:12px}
.realm-statistics-editor{display:grid;gap:14px;min-width:0}.realm-statistics-editor .admin-form-heading p{margin:4px 0 0;color:#bbb1c7;font-size:11px}.realm-statistics-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.realm-statistics-table-wrap{max-width:100%;overflow:auto;border:1px solid rgba(255,255,255,.12);border-radius:9px}.realm-statistics-table{width:100%;min-width:1900px;border-collapse:collapse;background:rgba(15,14,20,.45);font-size:11px}
.realm-statistics-table th,.realm-statistics-table td{padding:9px 10px;border-bottom:1px solid rgba(255,255,255,.08);text-align:left;white-space:nowrap}.realm-statistics-table th{color:#e8d78e;background:rgba(255,255,255,.055);font-size:9px;letter-spacing:.06em;text-transform:uppercase}.realm-statistics-table td{color:#d7d0dc}.realm-statistics-table td:first-child{position:sticky;left:0;background:#1d1a23;z-index:1}.realm-statistics-table td:first-child strong,.realm-statistics-table td:first-child small{display:block}.realm-statistics-table td:first-child small{margin-top:2px}.realm-statistics-table td small{color:#93899e}.realm-statistics-table td.online{color:#83e59c;font-weight:800}.realm-statistics-refresh{margin-top:8px}
@media(max-width:760px){#new-adventurer-guide.collapsed{top:154px}.lifetime-statistics-grid,.realm-statistics-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.session-warning-message{animation:none}}
.dialogue-heading #dialogue-portrait[data-style="undeadGhoul"]::before{content:'☠'}

/* Linkable-map environment controls, quick editor access, and server clock */
.admin-map-editor-quick {
  left: -47px;
  right: auto !important;
  top: 48px;
  bottom: auto;
  font-size: 17px;
}

#server-clock {
  position: absolute;
  z-index: 25;
  left: 0;
  top: -34px;
  min-width: 212px;
  height: 30px;
  padding: 3px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 2px outset #806f56;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(74,64,50,.98), rgba(42,34,26,.98));
  color: #f4df9e;
  box-shadow: 0 -2px 8px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,235,168,.1);
  font-family: "Courier New", monospace;
  text-shadow: 1px 1px #000;
  cursor: pointer;
  transition: top .16s ease, min-width .16s ease, width .16s ease;
}
#server-clock:hover { filter: brightness(1.12); }
#server-clock small {
  color: #b8a77c;
  font: 900 9px/1 "Courier New", monospace;
  letter-spacing: .7px;
  white-space: nowrap;
}
#server-clock strong {
  color: #fff0b0;
  font: 900 13px/1 "Courier New", monospace;
  white-space: nowrap;
}
#server-clock span {
  max-width: 92px;
  overflow: hidden;
  color: #9fcae7;
  font: 800 9px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#server-clock.clock-collapsed {
  min-width: 105px;
  width: 105px;
  justify-content: center;
  padding-inline: 6px;
}
#server-clock.clock-collapsed small,
#server-clock.clock-collapsed span { display: none; }
#chat-panel.broadcast-active #server-clock { top: -94px; }

#chat-panel.chat-collapsed > :not(#chat-collapse-toggle):not(#server-clock) { display:none !important; }
#chat-panel.chat-collapsed #server-clock {
  display: flex !important;
  left: 0;
  top: -72px;
  width: 86px;
  min-width: 86px;
  height: 31px;
  padding-inline: 4px;
  justify-content: center;
  border-radius: 7px;
}
#chat-panel.chat-collapsed #server-clock small,
#chat-panel.chat-collapsed #server-clock span { display: none; }
#chat-panel.chat-collapsed.broadcast-active #server-clock { top: -128px; }

.map-editor-environment-settings small,
.map-editor-chunk-management small { color: #b7aa8a; line-height: 1.35; }
.map-editor-environment-settings output {
  min-width: 52px;
  color: #ffe89a;
  font: 900 12px/1 "Courier New", monospace;
}
.seasonal-weather-card { border-color: #6f8492; }
.seasonal-weather-card.enabled {
  border-color: #b9e3f8;
  box-shadow: inset 0 0 20px rgba(195,235,255,.08);
}

@media (max-width: 700px) {
  .admin-map-editor-quick { left: -40px; top: 47px; width: 34px; height: 34px; }
  #server-clock { min-width: 174px; }
  #server-clock span { display: none; }
}

/* Divinity, offerings, and categorized quest journal */
.sacrifice-interface { width:min(680px,calc(100vw - 28px)); max-height:min(720px,calc(100vh - 28px)); }
.sacrifice-favor { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border:1px solid #8f7445; background:rgba(35,26,18,.82); }
.sacrifice-favor strong { color:#ffe49a; font:900 20px/1 "Courier New",monospace; }
.sacrifice-items { display:grid; gap:8px; max-height:380px; overflow:auto; margin:12px 0; }
.sacrifice-item { display:grid; grid-template-columns:auto 38px 1fr 92px; gap:10px; align-items:center; padding:9px; border:1px solid #5e513f; background:rgba(20,17,14,.76); }
.sacrifice-item small { display:block; color:#bdb39e; margin-top:3px; }
.sacrifice-icon { font-size:24px; text-align:center; }
.sacrifice-qty { width:100%; min-width:0; background:#15120f; color:#f5e8ca; border:1px solid #76664d; padding:7px; }
.sacrifice-actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.divinity-tutorial { position:absolute; z-index:75; width:min(500px,calc(100vw - 30px)); left:50%; top:50%; transform:translate(-50%,-50%); padding:24px; text-align:center; }
.divinity-book-intro { border:1px solid #8a7344; background:linear-gradient(145deg,rgba(45,35,24,.96),rgba(23,20,27,.96)); padding:12px; margin-bottom:12px; }
.divinity-book-intro strong { color:#ffe39a; font-size:18px; }
.divinity-gods { display:grid; gap:12px; }
.divinity-god { --god:#d9c28b; border:1px solid color-mix(in srgb,var(--god) 55%,#29231d); background:rgba(16,14,18,.84); padding:10px; box-shadow:inset 0 0 18px color-mix(in srgb,var(--god) 8%,transparent); }
.divinity-god.god-yume{--god:#c69bff}.divinity-god.god-licht{--god:#fff07a}.divinity-god.god-yora{--god:#ff9d6c}.divinity-god.god-lore{--god:#9e62df}.divinity-god.god-xedem{--god:#62baff}
.divinity-god header { display:grid; grid-template-columns:34px 1fr auto; align-items:center; gap:8px; }
.divinity-god header>span { font-size:25px; color:var(--god); text-shadow:0 0 10px var(--god); }
.divinity-god h3 { margin:0; color:#fff3d6; }.divinity-god header small{color:#aaa1a3}.divinity-god header b{color:var(--god)}
.divinity-favor { height:12px; border:1px solid #554d44; background:#100e0d; margin:9px 0; overflow:hidden; }
.divinity-favor i { display:block; height:100%; background:linear-gradient(90deg,color-mix(in srgb,var(--god) 55%,#2d2730),var(--god)); box-shadow:0 0 10px var(--god); }
.blessing-grid { display:grid; grid-template-columns:repeat(6,minmax(0,52px)); gap:8px; align-items:start; justify-content:start; overflow:visible; }
.blessing-button { position:relative; width:52px; height:52px; display:grid; place-items:center; border:1px solid #5e554c; background:linear-gradient(145deg,#2a2529,#171519); color:#eee3d4; padding:0; cursor:pointer; overflow:visible; }
.blessing-slot-empty { width:52px; height:52px; display:block; border:1px dashed rgba(150,136,119,.24); background:rgba(10,9,12,.28); }
.blessing-button>.blessing-icon { display:grid; place-items:center; font-size:27px; color:var(--god); text-shadow:0 0 10px color-mix(in srgb,var(--god) 68%,transparent); }
.blessing-button:hover,.blessing-button:focus-visible { border-color:var(--god); z-index:8; }
.blessing-button.locked { filter:grayscale(.8); opacity:.48; cursor:not-allowed; }
.blessing-button.cooldown { opacity:.62; box-shadow:inset 0 0 0 2px rgba(255,255,255,.08); }
.blessing-button.active { border-color:var(--god); box-shadow:0 0 14px color-mix(in srgb,var(--god) 60%,transparent),inset 0 0 18px color-mix(in srgb,var(--god) 18%,transparent); animation:divineBlessingPulse 1.4s ease-in-out infinite; }
.blessing-info-source { display:none !important; }
.blessing-tooltip-layer { --god:#d9c28b; pointer-events:none; position:fixed; z-index:2147483000; width:min(290px,calc(100vw - 20px)); padding:10px 11px; border:1px solid color-mix(in srgb,var(--god) 70%,#3d352e); background:rgba(13,12,16,.99); color:#eee3d4; box-shadow:0 12px 30px rgba(0,0,0,.7),0 0 14px color-mix(in srgb,var(--god) 18%,transparent); text-align:left; }
.blessing-tooltip-layer.god-yume{--god:#c69bff}.blessing-tooltip-layer.god-licht{--god:#fff07a}.blessing-tooltip-layer.god-yora{--god:#ff9d6c}.blessing-tooltip-layer.god-lore{--god:#9e62df}.blessing-tooltip-layer.god-xedem{--god:#62baff}
.blessing-tooltip-layer b { display:block; color:var(--god); margin-bottom:4px; font-size:12px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.blessing-tooltip-layer small,.blessing-tooltip-layer p,.blessing-tooltip-layer em { display:block; color:#bcb2b3; margin:3px 0 0; font-size:12px; font-style:normal; line-height:1.35; }
.blessing-tooltip-layer em { color:#ffe49a; }
@keyframes divineBlessingPulse { 50%{filter:brightness(1.25)} }
.quest-category { margin-bottom:18px; }.quest-category>h2 { margin:0 0 8px; padding:8px 10px; color:#f4d99b; border-bottom:2px solid #826c42; background:linear-gradient(90deg,rgba(111,82,39,.24),transparent); font-size:16px; letter-spacing:.08em; text-transform:uppercase; }
.quest-category-empty { color:#887f71; padding:8px; font-style:italic; }
@media(max-width:700px){.sacrifice-item{grid-template-columns:auto 32px 1fr}.sacrifice-qty{grid-column:2/4}.divinity-tutorial{top:46%}.blessing-grid{grid-template-columns:repeat(6,minmax(0,46px));gap:5px}.blessing-button,.blessing-slot-empty{width:46px;height:46px}.blessing-tooltip-layer{width:min(270px,calc(100vw - 16px));}}


/* People of the Moon and Mosselune Amulet */
.mosselune-amulet-interface { width:min(620px,calc(100vw - 28px)); }
.mosselune-amulet-interface > p { color:#d9d5e7; margin:10px 0 12px; }
.mosselune-amulet-gods { display:grid; gap:9px; margin-top:12px; }
.mosselune-amulet-god { display:grid; grid-template-columns:42px 1fr auto; align-items:center; gap:11px; width:100%; padding:11px 13px; border:1px solid #78708d; background:linear-gradient(135deg,rgba(37,32,51,.96),rgba(18,18,28,.96)); color:#f4f1ff; text-align:left; cursor:pointer; }
.mosselune-amulet-god:hover:not(:disabled) { transform:translateY(-1px); border-color:#d6e4ff; box-shadow:0 0 18px rgba(171,201,255,.28); }
.mosselune-amulet-god:disabled { opacity:.48; cursor:not-allowed; }
.mosselune-amulet-god > span { font-size:28px; text-align:center; text-shadow:0 0 12px currentColor; }
.mosselune-amulet-god div { display:grid; gap:2px; }
.mosselune-amulet-god small { color:#aaa5ba; }
.mosselune-amulet-god > b { color:#dceaff; white-space:nowrap; }
.mosselune-amulet-god.god-yume > span { color:#d5bfff; }
.mosselune-amulet-god.god-licht > span { color:#fff18a; }
.mosselune-amulet-god.god-yora > span { color:#8fffa6; }
.mosselune-amulet-god.god-lore > span { color:#b277ff; }
.mosselune-amulet-god.god-xedem > span { color:#79c7ff; }
@media(max-width:620px){.mosselune-amulet-god{grid-template-columns:36px 1fr}.mosselune-amulet-god>b{grid-column:2}}

.client-version-gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 8, 12, .92);
  backdrop-filter: blur(8px);
}
.client-version-gate[hidden] { display: none !important; }
.client-version-card {
  width: min(520px, 100%);
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
}
.client-version-card h1 { margin: 8px 0 10px; }
.client-version-card p { color: #d9ccb0; line-height: 1.5; }
.client-version-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.client-version-card dl div { padding: 10px; border: 1px solid rgba(209,177,103,.35); border-radius: 7px; background: rgba(0,0,0,.2); }
.client-version-card dt { color: #a99a79; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.client-version-card dd { margin: 5px 0 0; color: #ffe4a1; font-weight: 900; }

/* Source-controlled NPC appearance locks */
.npc-appearance-lock-notice {
  border: 1px solid rgba(238, 210, 112, .55);
  background: linear-gradient(135deg, rgba(70, 54, 24, .72), rgba(34, 29, 39, .88));
  color: #f7e7a5;
  box-shadow: inset 0 0 18px rgba(243, 209, 94, .06);
}
.npc-appearance-lock-notice strong { color: #fff2b1; }
.dialogue-heading #dialogue-portrait[data-style="fatherKeno"]::before{content:'✦'}
.dialogue-heading #dialogue-portrait[data-style="pendantShopkeeper"]::before{content:'♦'}
.dialogue-heading #dialogue-portrait[data-style="banker"]::before{content:'▣'}
.dialogue-heading #dialogue-portrait[data-style="mosseluneCaptain"]::before{content:'☾'}

/* Gate C — moderation queue, evidence, appeals, and safety states */
.warning-actions,.moderation-action-buttons{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#appeal-panel{width:min(610px,calc(100vw - 24px));max-height:min(720px,calc(100vh - 28px));overflow:auto}
.moderation-status-badge{display:inline-flex;align-items:center;margin:8px 0;padding:5px 10px;border:1px solid rgba(255,255,255,.18);border-radius:999px;background:rgba(255,255,255,.07);font-size:10px;font-weight:900;letter-spacing:.08em;color:#eee}
.moderation-status-badge.status-open{border-color:#e7c85c;color:#ffe899;background:rgba(178,134,20,.15)}
.moderation-status-badge.status-escalated,.moderation-status-badge.severity-critical{border-color:#ff6f66;color:#ffafa8;background:rgba(150,25,25,.19)}
.moderation-status-badge.status-actioned,.moderation-status-badge.status-upheld{border-color:#75aee8;color:#bfe0ff;background:rgba(33,91,150,.18)}
.moderation-status-badge.status-reversed,.moderation-status-badge.status-false-positive{border-color:#6fd194;color:#baf5ce;background:rgba(30,125,68,.18)}
.moderation-evidence-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.moderation-evidence-grid>section{min-width:0}
.management-chat-entry.blocked{color:#ffaaa4;background:rgba(159,38,38,.12);padding-inline:5px}
.moderation-notes{display:grid;gap:7px;max-height:230px;overflow:auto}
.moderation-note{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:8px;border:1px solid rgba(255,255,255,.09);border-radius:7px;background:rgba(255,255,255,.035)}
.moderation-note strong{color:#f5e39f}.moderation-note span{color:#9fb3c7;font-size:10px}.moderation-note p{grid-column:1/-1;margin:0;color:#ddd6ca;white-space:pre-wrap}
@media(max-width:760px){.moderation-evidence-grid{grid-template-columns:1fr}.moderation-action-buttons>button{flex:1 1 145px}}

/* Gate B1 centralized staff permissions */
.account-permission-editor {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(208, 183, 112, .45);
  border-radius: 8px;
  background: rgba(22, 18, 13, .58);
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, .65fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  background: rgba(0,0,0,.2);
}
.permission-row span { min-width: 0; }
.permission-row strong,
.permission-row small { display: block; overflow-wrap: anywhere; }
.permission-row small { margin-top: 3px; opacity: .72; }
.npc-readonly-inspector input[readonly],
.npc-readonly-inspector textarea[readonly] { opacity: .88; cursor: default; }
@media (max-width: 640px) {
  .permission-row { grid-template-columns: 1fr; }
}

/* Gate B3 — audited Account Editor */
.account-editor-gate-b3 { gap: 12px; }
.account-editor-section {
  border: 1px solid #765b34;
  background: linear-gradient(180deg, rgba(244,226,180,.92), rgba(192,160,103,.82));
  box-shadow: inset 0 0 0 2px rgba(255,248,216,.18), 0 2px 5px rgba(0,0,0,.28);
  padding: 10px;
  display: grid;
  gap: 9px;
}
.account-editor-section > h3 { margin: 0; color: #3f2b12; font: bold 14px Georgia, serif; }
.account-reason-field { position: sticky; top: 0; z-index: 3; background: #49331f; border: 1px solid #a8864c; color: #f6e4ad; padding: 8px; }
.account-reason-field textarea { background: #fff7dc; color: #2d2113; }
.account-overview-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.account-overview-grid > div { border:1px solid rgba(96,67,30,.45); background:rgba(255,248,216,.35); padding:7px; min-width:0; }
.account-overview-grid span { display:block; color:#73572f; font-size:8px; text-transform:uppercase; letter-spacing:.06em; }
.account-overview-grid strong { display:block; margin-top:3px; color:#34220e; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-action-row { display:flex; flex-wrap:wrap; gap:7px; }
.account-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; align-items:end; }
.account-inspection-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.account-inspection-tile { border:1px solid rgba(83,58,27,.5); background:#51402d; color:#f2dfad; padding:7px; min-height:48px; display:grid; gap:2px; }
.account-inspection-tile span { color:#bfa977; font-size:8px; text-transform:uppercase; }
.account-inspection-tile strong { font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-inspection-tile small { color:#a99975; font-size:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-skill-list { display:grid; gap:4px; }
.account-skill-row { display:grid; grid-template-columns:minmax(140px,1fr) minmax(100px,160px) auto; gap:6px; align-items:center; border:1px solid rgba(98,70,33,.35); background:rgba(255,248,216,.3); padding:5px; }
.account-skill-row span { min-width:0; }
.account-skill-row strong,.account-skill-row small { display:block; }
.account-skill-row small { color:#725a34; font-size:8px; }
.account-note-list { display:grid; gap:5px; max-height:240px; overflow:auto; }
.account-note-list > div { border-left:4px solid #7652a5; background:rgba(67,46,27,.12); padding:7px; }
.account-note-list strong,.account-note-list span { display:inline-block; margin-right:7px; }
.account-note-list span { color:#765e3c; font-size:8px; }
.account-note-list p { margin:5px 0 0; white-space:pre-wrap; }
.account-activity-row { display:grid; grid-template-columns:minmax(130px,1fr) auto; gap:4px 8px; border-bottom:1px solid rgba(93,66,31,.3); padding:6px 2px; }
.account-activity-row span { color:#705839; font-size:9px; }
.account-activity-row small { grid-column:1 / -1; color:#6d5638; overflow-wrap:anywhere; }
.account-preview-section { border-color:#8b6cb1; box-shadow:inset 4px 0 #7950a7; }
.account-change-preview-card { display:grid; gap:7px; }
.account-change-preview-card h4,.account-change-preview-card p { margin:0; }
.account-preview-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.account-preview-columns section { min-width:0; border:1px solid #624a2c; background:#2c251d; color:#ecddb6; padding:7px; }
.account-preview-columns h5 { margin:0 0 5px; color:#d6b8ff; }
.account-preview-columns pre { margin:0; max-height:260px; overflow:auto; font-size:9px; white-space:pre-wrap; overflow-wrap:anywhere; }
.account-confirmation-phrase code { background:#2e2419; color:#ffe899; padding:2px 5px; }
.admin-error-state { border:1px solid #a64444; background:rgba(142,48,48,.15); color:#742828; padding:8px; }
@media(max-width:760px){
  .account-overview-grid,.account-inspection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .account-action-grid,.account-preview-columns { grid-template-columns:1fr; }
  .account-skill-row { grid-template-columns:1fr minmax(0,1fr); }
  .account-skill-row button { grid-column:1 / -1; }
}

/* Gate B4 — Moderator Dashboard */
.moderator-side-panel { gap: 9px; }
.moderator-side-heading {
  padding: 11px;
  border: 2px inset #786d59;
  background: linear-gradient(145deg, rgba(56, 66, 72, .92), rgba(33, 38, 42, .94));
}
.moderator-side-heading strong { display: block; margin-top: 3px; color: #9fe4e8; font-size: 17px; }
.moderator-side-heading p { margin: 5px 0 0; color: #c6d2d0; font-size: 10px; line-height: 1.4; }
.moderator-only-tools { grid-template-columns: 1fr; }
.moderator-boundary-note,
.moderator-action-limit,
.moderator-privacy-note {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(105, 210, 216, .35);
  background: rgba(20, 42, 46, .5);
  color: #b9d9d8;
  font-size: 10px;
  line-height: 1.45;
}
.moderator-dashboard { display: grid; gap: 12px; min-width: 0; }
.moderator-dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px;
  border: 2px inset #6f796f;
  background: linear-gradient(135deg, #38474a, #232c2e 58%, #1d2425);
}
.moderator-dashboard-heading h2 { margin: 3px 0 4px; color: #b3f1ee; font-size: 22px; }
.moderator-dashboard-heading p { max-width: 680px; margin: 0; color: #c4d3d2; font-size: 11px; line-height: 1.5; }
.moderator-dashboard-heading > small { color: #93aaa8; white-space: nowrap; }
.moderator-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}
.moderator-summary-tile {
  min-width: 0;
  padding: 10px;
  border: 2px inset #65736c;
  background: linear-gradient(145deg, #34403e, #202927);
}
.moderator-summary-tile span,
.moderator-summary-tile small { display: block; color: #a8bbb7; font-size: 9px; }
.moderator-summary-tile strong { display: block; margin: 3px 0; color: #9be6e5; font-size: 22px; }
.moderator-dashboard-card {
  min-width: 0;
  padding: 11px;
  border: 2px inset #716a58;
  background: rgba(38, 35, 29, .82);
}
.moderator-dashboard-card > h3 { margin: 0 0 8px; color: #ecd887; font-size: 14px; }
.moderator-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.moderator-tool-card,
.moderator-list-row {
  min-width: 0;
  padding: 9px;
  border: 2px outset #66766f;
  background: linear-gradient(#43544f, #293632);
  color: #eef6f4;
  text-align: left;
}
.moderator-tool-card:hover,
.moderator-list-row:hover { filter: brightness(1.12); }
.moderator-tool-card strong,
.moderator-list-row strong { display: block; color: #a8ece7; }
.moderator-tool-card span,
.moderator-list-row span,
.moderator-list-row small { display: block; margin-top: 3px; color: #c1d0cc; font-size: 9px; line-height: 1.4; }
.moderator-priority-list,
.moderator-appeal-list,
.moderator-chat-list,
.moderator-action-list { display: grid; gap: 7px; }
.moderator-priority-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #665e4d;
  background: #29251f;
}
.moderator-priority-card > div { display: flex; justify-content: space-between; gap: 10px; }
.moderator-priority-card strong { color: #f0d97f; }
.moderator-priority-card span,
.moderator-priority-card small { color: #aebbb6; font-size: 9px; }
.moderator-priority-card p { margin: 0; color: #ddd4c4; font-size: 10px; line-height: 1.45; }
.moderator-priority-card blockquote {
  margin: 2px 0;
  padding: 7px 9px;
  border-left: 3px solid #70cdd0;
  background: rgba(23, 46, 49, .58);
  color: #d3eeee;
  font-size: 10px;
}
.moderator-priority-card .panel-button { justify-self: start; }
.moderator-chat-row,
.moderator-action-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 142px minmax(120px, .45fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(136, 123, 94, .38);
  color: #d8d2c4;
  font-size: 9px;
}
.moderator-chat-row time,
.moderator-action-row small { color: #9ba9a6; }
.moderator-chat-row strong,
.moderator-action-row strong { color: #9edddd; }
.moderator-action-row { grid-template-columns: minmax(150px, .55fr) minmax(0, 1fr) 170px; }

@media (max-width: 900px) {
  .moderator-summary-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .moderator-tool-grid { grid-template-columns: 1fr 1fr; }
  .moderator-chat-row,
  .moderator-action-row { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 560px) {
  .moderator-dashboard-heading { display: grid; }
  .moderator-dashboard-heading > small { white-space: normal; }
  .moderator-summary-grid,
  .moderator-tool-grid { grid-template-columns: 1fr; }
  .moderator-priority-card > div { display: grid; }
}

/* Gate E1 — Friends and Community Foundations */
.social-community-shell{display:grid;gap:var(--space-3,12px);min-width:0}
.social-community-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid rgba(151,126,87,.42);border-radius:var(--radius-md,8px);background:linear-gradient(135deg,rgba(95,73,44,.24),rgba(28,22,16,.45))}
.social-community-summary strong{color:#f0d98c;font-size:14px}.social-community-summary span{color:#c9b995;font-size:10px;text-align:right}
.social-friend-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.social-friend-search input{min-width:0;height:44px;padding:0 11px;border:1px solid rgba(151,126,87,.55);border-radius:7px;background:#18130f;color:#f5ead1}
.social-community-tabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:3px;scrollbar-width:thin}.social-community-tabs .social-action-button{flex:0 0 auto}.social-community-tabs .social-action-button.active{border-color:#e7cf77;background:#67522e;color:#fff1b6}
.social-community-list{display:grid;gap:8px;min-width:0}.social-community-list>h3{margin:8px 0 0;color:#e8d18a;font-size:11px;text-transform:uppercase;letter-spacing:.08em}.social-muted{margin:0;padding:9px;color:#aa9d87;font-size:10px}
.social-community-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px;border:1px solid rgba(151,126,87,.34);border-radius:8px;background:rgba(27,21,15,.5);min-width:0}.social-community-row.favorite{box-shadow:inset 3px 0 #d8bc55}.social-community-row.offline{opacity:.83}.social-community-identity{display:grid;grid-template-columns:10px minmax(0,1fr);align-items:center;column-gap:7px;min-width:0}.social-community-identity>.role-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.social-community-identity small{grid-column:2;color:#a99d87;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.social-presence-dot{width:9px;height:9px;border-radius:50%;background:#68635b;box-shadow:0 0 0 2px rgba(0,0,0,.28)}.social-community-row.online .social-presence-dot{background:#6fe29a;box-shadow:0 0 7px rgba(111,226,154,.75)}
.social-community-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;max-width:190px}.social-action-button{min-height:44px;padding:7px 10px;border:1px solid rgba(180,151,102,.56);border-radius:7px;background:#33291e;color:#eadfc8;font:inherit;font-size:9px;cursor:pointer}.social-action-button:hover,.social-action-button:focus-visible{border-color:#ead278;background:#4b3a25;outline:none}.social-action-button.primary{background:#635029;border-color:#dbc76f;color:#fff0b0}.social-action-button.danger{background:#512626;border-color:#b96868;color:#ffd2cf}.social-private-note{grid-column:1/-1;margin:0;padding:7px 8px;border-left:3px solid #8a70a8;background:rgba(83,61,104,.18);color:#d8c8e8;font-size:9px;line-height:1.45}
.social-privacy-row,.social-privacy-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:9px 10px;border:1px solid rgba(151,126,87,.34);border-radius:8px;background:rgba(27,21,15,.5)}.social-privacy-row span{color:#e5d8be;font-size:10px}.social-privacy-row select{min-width:125px;height:44px;padding:0 8px;border:1px solid rgba(180,151,102,.52);border-radius:6px;background:#17120e;color:#f2e5ca}.social-privacy-toggle{justify-content:flex-start}.social-privacy-toggle input{width:22px;height:22px;accent-color:#d8bd63}.social-privacy-toggle span{display:grid;gap:2px}.social-privacy-toggle strong{color:#f0dda1}.social-privacy-toggle small{color:#aa9e87;font-size:9px;line-height:1.4}
.social-profile-card{display:grid;gap:14px;padding:14px;border:1px solid rgba(211,185,106,.58);border-radius:10px;background:linear-gradient(145deg,rgba(75,58,34,.52),rgba(23,18,14,.82))}.social-profile-header{display:flex;justify-content:space-between;gap:10px}.social-profile-header h3{margin:0;color:#f2dc8a}.social-profile-header p{margin:4px 0 0;color:#bcaf97;font-size:10px}.social-profile-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.social-profile-metrics div{padding:9px;border:1px solid rgba(180,151,102,.3);border-radius:7px;background:rgba(0,0,0,.18)}.social-profile-metrics small,.social-profile-metrics strong{display:block}.social-profile-metrics small{color:#a99d87;font-size:8px;text-transform:uppercase}.social-profile-metrics strong{margin-top:4px;color:#f2e5ca}.social-profile-actions{display:flex;flex-wrap:wrap;gap:7px}
@media(max-width:760px){.social-community-summary{align-items:flex-start;flex-direction:column}.social-community-summary span{text-align:left}.social-community-row{grid-template-columns:1fr}.social-community-actions{justify-content:flex-start;max-width:none}.social-community-actions .social-action-button{flex:1 1 110px}.social-profile-metrics{grid-template-columns:1fr}.social-privacy-row{align-items:flex-start;flex-direction:column}.social-privacy-row select{width:100%}.social-friend-search{grid-template-columns:1fr}.social-friend-search .social-action-button{width:100%}}
.social-profile-preview{display:block;width:100%;height:170px;border:1px solid rgba(180,151,102,.3);border-radius:8px;background:radial-gradient(circle at 50% 62%,#665846,#211c16 70%);image-rendering:pixelated}

/* Gate E2: secure player trading */
.trade-request-interface{width:min(92vw,430px);z-index:44}.trade-request-body{padding:var(--space-5,20px);display:grid;gap:var(--space-4,16px);text-align:center}.trade-request-body p{margin:0;font-size:1.05rem}.trade-request-body small{color:var(--text-muted,#c7bea8)}.trade-request-actions{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3,12px)}
.trade-interface{width:min(96vw,930px);max-height:min(92vh,820px);overflow:auto;z-index:43}.trade-status{min-height:1.5em;margin:0;padding:0 var(--space-4,16px);color:var(--text-muted,#d7ccb3)}.trade-stage-track{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:var(--space-3,12px) var(--space-4,16px)}.trade-stage-track span{padding:8px;border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-md,8px);text-align:center;color:var(--text-muted,#b9b09d);font-size:.78rem}.trade-stage-track span.active{border-color:#d8b85f;color:#fff5c9;background:rgba(216,184,95,.13)}.trade-columns{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4,16px);padding:0 var(--space-4,16px)}.trade-offer-card{min-height:190px;border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-lg,12px);background:rgba(12,10,8,.72);overflow:hidden}.trade-card-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,.1)}.trade-card-heading small,.trade-editor-heading small{display:block;color:var(--text-muted,#b9b09d)}.trade-offer-list{display:grid;gap:8px;padding:12px;max-height:245px;overflow:auto}.trade-offer-row{display:flex;align-items:center;gap:10px;padding:9px;border-radius:8px;background:rgba(255,255,255,.045)}.trade-offer-row>div{display:grid}.trade-offer-row small{color:var(--text-muted,#c0b7a3)}.trade-item-icon{width:38px;height:38px;display:grid;place-items:center;flex:none}.trade-coins-row>span{font-size:1.5rem}.trade-editor{margin:var(--space-4,16px);padding:var(--space-4,16px);border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-lg,12px);background:rgba(255,255,255,.035)}.trade-editor-heading{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:12px}.trade-editor-heading label{display:grid;gap:4px;min-width:150px}.trade-editor-heading input{min-height:44px}.trade-inventory-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px;max-height:220px;overflow:auto;margin-bottom:12px}.trade-inventory-item{min-height:58px;display:flex;align-items:center;gap:8px;text-align:left;padding:8px}.trade-inventory-item>span:last-child{display:grid}.trade-inventory-item small{color:var(--text-muted,#c0b7a3)}.trade-inventory-item.restricted{opacity:.45}.trade-final-warning{margin:var(--space-4,16px);padding:14px;border:1px solid #d8b85f;border-radius:10px;background:rgba(216,184,95,.1)}.trade-final-warning p{margin:.45rem 0 0}.trade-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:0 var(--space-4,16px) var(--space-3,12px)}.trade-transaction-id{display:block;padding:0 var(--space-4,16px) var(--space-4,16px);color:var(--text-muted,#948b79);word-break:break-all}.ui-empty-state.compact{padding:10px;margin:0}.status-pill.good{background:rgba(91,185,111,.16);border-color:rgba(91,185,111,.5)}
@media (max-width:720px){.trade-interface{inset:auto max(env(safe-area-inset-right),8px) max(env(safe-area-inset-bottom),8px) max(env(safe-area-inset-left),8px);width:auto;max-height:88dvh;transform:none}.trade-columns{grid-template-columns:1fr}.trade-offer-card{min-height:140px}.trade-offer-list{max-height:160px}.trade-editor-heading{align-items:stretch;flex-direction:column}.trade-editor-heading label{width:100%}.trade-inventory-grid{grid-template-columns:1fr 1fr;max-height:190px}.trade-actions{display:grid;grid-template-columns:1fr 1fr}.trade-actions button:last-child:nth-child(3){grid-column:1/-1}.trade-request-interface{width:calc(100vw - 16px)}}
@media (max-width:430px){.trade-inventory-grid{grid-template-columns:1fr}.trade-request-actions,.trade-actions{grid-template-columns:1fr}.trade-actions button:last-child:nth-child(3){grid-column:auto}}


/* Gate E3 — server-authoritative Kingdoms */
.kingdom-card{display:grid;gap:var(--space-3,12px);padding:var(--space-4,16px);border:1px solid rgba(217,200,255,.22);border-radius:var(--radius-lg,14px);background:linear-gradient(145deg,rgba(37,27,53,.94),rgba(15,13,25,.96));box-shadow:var(--shadow-panel,0 12px 28px rgba(0,0,0,.28))}
.kingdom-card h3,.kingdom-card p{margin:0}.kingdom-header>div:first-child{display:flex;align-items:flex-start;gap:12px}.kingdom-role-symbol{font-size:30px;color:#ffe75c;text-shadow:0 0 10px rgba(255,231,92,.55)}
.kingdom-header blockquote{margin:0;padding:10px 12px;border-left:3px solid #a886d7;background:rgba(168,134,215,.09);font-style:italic;color:#eee4ff}
.kingdom-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.kingdom-metric{display:grid;gap:4px;padding:10px;border-radius:10px;background:rgba(255,255,255,.045);min-width:0}.kingdom-metric small{color:#bcb0cb}.kingdom-metric strong{font-size:15px;overflow-wrap:anywhere}
.kingdom-create-form,.kingdom-invite-form,.kingdom-donation-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.kingdom-donation-controls{grid-template-columns:minmax(120px,1fr) minmax(90px,.55fr) minmax(110px,.65fr) auto}
.kingdom-card input,.kingdom-card select,.kingdom-card textarea,.kingdom-create-form input,.kingdom-invite-form input{min-height:44px;width:100%;box-sizing:border-box}.kingdom-card textarea{min-height:88px;resize:vertical}
.kingdom-invitation-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.035)}.kingdom-invitation-row div:first-child{display:grid;gap:4px}.kingdom-invitation-row small{color:#bcb0cb}
.kingdom-member-contribution{grid-column:1/-1!important;margin-top:6px!important;color:#bcb0cb;font-size:12px}.kingdom-history>div{display:grid;gap:5px;max-height:260px;overflow:auto}.kingdom-history p{font-size:12px;padding:6px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.kingdom-danger-card{border-color:rgba(255,105,105,.28);background:linear-gradient(145deg,rgba(65,24,35,.72),rgba(20,12,20,.95))}.chat-channel-prefix.kingdom{color:#d9c8ff;font-weight:700}.chat-line.kingdom{background:rgba(117,79,157,.08)}
@media(max-width:760px){.kingdom-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.kingdom-donation-controls,.kingdom-create-form,.kingdom-invite-form,.kingdom-invitation-row{grid-template-columns:1fr}.kingdom-invitation-row .social-community-actions{justify-content:stretch}.kingdom-invitation-row .social-community-actions button{flex:1}}

/* Gate E4 — server-authoritative Auction House */
.auction-shell{display:grid;gap:var(--space-3,12px);min-width:0}.auction-summary{display:grid;grid-template-columns:1fr auto;gap:12px;padding:14px;border:1px solid rgba(112,211,145,.35);border-radius:var(--radius-lg,12px);background:linear-gradient(145deg,rgba(20,48,35,.88),rgba(13,19,17,.96))}.auction-summary.disabled{border-color:rgba(225,115,105,.55);background:linear-gradient(145deg,rgba(65,25,25,.9),rgba(18,13,13,.96))}.auction-summary>div{display:grid}.auction-summary span{color:var(--text-muted,#b9b09d);font-size:.78rem}.auction-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.auction-tabs .active{border-color:#d8b85f;background:rgba(216,184,95,.14);color:#fff4c2}.auction-content{display:grid;gap:10px}.auction-search-form{display:grid;grid-template-columns:minmax(140px,1fr) minmax(110px,.55fr) minmax(120px,.65fr) auto;gap:8px}.auction-search-form input,.auction-search-form select,.auction-list-form input,.auction-list-form select{min-height:44px;width:100%;box-sizing:border-box}.auction-card{display:grid;gap:9px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-lg,12px);background:rgba(12,10,8,.74)}.auction-card.suspicious{border-color:#d28b48;box-shadow:0 0 0 1px rgba(210,139,72,.2)}.auction-card.frozen{opacity:.72}.auction-card-heading{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center}.auction-card-heading>div:nth-child(2){display:grid}.auction-card-heading small{color:var(--text-muted,#b9b09d)}.auction-item-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:9px;background:rgba(255,255,255,.06);font-size:1.35rem}.auction-card-details{display:flex;gap:8px 14px;flex-wrap:wrap;color:var(--text-muted,#b9b09d);font-size:.78rem}.auction-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.auction-review-flag{color:#f0ba77}.auction-list-form{display:grid;gap:8px;padding:14px;border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-lg,12px);background:rgba(255,255,255,.035)}.auction-list-form label{font-size:.76rem;color:var(--text-muted,#b9b09d)}.auction-fee-preview{margin:4px 0;color:#ffe7a1}
@media(max-width:720px){.auction-tabs{grid-template-columns:1fr 1fr}.auction-search-form{grid-template-columns:1fr 1fr}.auction-search-form button{grid-column:1/-1}.auction-card-heading{grid-template-columns:auto 1fr}.auction-card-heading>b{grid-column:2}.auction-summary{grid-template-columns:1fr}.auction-card-actions>*{flex:1}.auction-card-actions small{flex-basis:100%}}

/* Dormant official logo treatment. */
.dormant-login-brand{width:100%;display:flex;justify-content:center;align-items:center}
.dormant-login-brand img{display:block;width:min(430px,92%);height:auto;max-height:230px;object-fit:contain;filter:drop-shadow(0 16px 24px rgba(0,0,0,.75))}
@media(max-width:640px){.dormant-login-brand img{width:min(330px,94%);max-height:175px}}
.social-profile-badge{display:inline-flex;align-items:center;margin-top:7px;min-height:25px;padding:4px 9px;border:1px solid rgba(211,185,106,.6);border-radius:999px;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.social-profile-badge.og-tester{background:linear-gradient(135deg,#3b2812,#181109);color:#ffe29a;box-shadow:0 0 12px rgba(211,164,74,.2)}

/* Gate G2 Open Alpha information and bug reporting */
.bug-report-interface{width:min(700px,calc(100vw - 24px));max-height:min(820px,calc(100dvh - 24px))}.bug-report-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.report-form input{width:100%;border:1px solid #72582f;border-radius:5px;background:#1e1912;color:#f5e5be;padding:9px 10px;font:inherit}.bug-report-diagnostics{color:#9f947e;line-height:1.45}.open-alpha-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.open-alpha-actions button{min-height:44px;padding:8px 15px}#bug-report-status{min-height:1.2em;margin:0;color:#e3c77e}
@media(max-width:620px){.bug-report-grid{grid-template-columns:1fr}.bug-report-interface{width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}.bug-report-interface .report-form{padding:13px;gap:11px}.open-alpha-actions button{width:100%}}

/* Alpha 37: quest dialogue/cutscene focus keeps the world unobstructed. */
.game-shell.dialogue-focus #side-panel,
.game-shell.dialogue-focus #chat-panel,
.game-shell.dialogue-focus #bottom-actions,
.game-shell.dialogue-focus #adventure-guide,
.game-shell.dialogue-focus #adventure-guide-button,
.game-shell.dialogue-focus #server-clock,
.game-shell.dialogue-focus #chat-collapse-toggle {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Alpha 37: contain all main-panel content and remove horizontal overflow. */
#side-panel,
#side-panel .panel-content,
.social-community-shell,
.social-community-list,
.social-community-tabs,
.auction-shell,
.auction-list,
.quest-journal-content,
.cosmetics-panel,
.skills-panel {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}
#side-panel .panel-content {
  min-height: 0 !important;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
  overscroll-behavior: contain;
}
.social-community-tabs,
.social-profile-actions,
.social-person-actions,
.auction-actions,
.quest-journal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.social-community-tabs > *,
.social-profile-actions > *,
.social-person-actions > *,
.auction-actions > * {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}
.social-community-shell *,
.auction-shell * { box-sizing: border-box; }

/* Bug report and other modal forms scroll inside their own border. */
#bug-report-interface,
.bug-report-interface {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  max-height: min(82dvh, 720px) !important;
  overflow: hidden !important;
}
#bug-report-form,
.bug-report-form {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (orientation: portrait) and (max-width: 760px) {
  #chat-panel:not(.chat-collapsed) {
    height: clamp(190px, 28dvh, 260px) !important;
    min-height: 190px !important;
  }
  #chat-panel:not(.chat-collapsed) #chat-messages {
    min-height: 112px !important;
  }
  #chat-collapse-toggle {
    top: calc(-1 * var(--mobile-chat-toggle-height, 36px)) !important;
    height: var(--mobile-chat-toggle-height, 36px) !important;
    margin: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

#panel-content {
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
}
#panel-content > :last-child { margin-bottom: 0 !important; }


/* Alpha 38: death protection and reliable hidden modal state. */
.bug-report-interface[hidden],
#bug-report-panel[hidden],
.death-protection-interface[hidden],
#death-protection-panel[hidden] {
  display: none !important;
}
.panel-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title-row > #panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.death-protection-header-button {
  min-width: 0 !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 3px 9px !important;
  border: 1px solid #b58b3c;
  border-radius: 999px;
  background: linear-gradient(#6d2c38, #35131c);
  color: #ffe0aa;
  font: 800 10px/1 "Courier New", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-sizing: border-box;
}
.death-protection-header-button:hover,
.death-protection-header-button:focus-visible {
  filter: brightness(1.18);
  outline: 1px solid #ffe49a;
}
.death-protection-interface {
  width: min(760px, calc(100vw - 24px));
  max-height: min(84dvh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.death-protection-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}
.death-protection-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(226, 190, 102, .34);
  border-radius: 10px;
  background: rgba(111, 61, 31, .2);
}
.death-protection-summary > div { display: grid; gap: 2px; text-align: center; }
.death-protection-summary strong { color: #ffe49a; font-size: 1.45rem; }
.death-protection-summary span,
.death-protection-summary p,
.death-protection-footer p { color: #cfc3aa; }
.death-protection-summary p,
.death-protection-footer p,
#death-protection-status { margin: 0; line-height: 1.45; }
.death-protection-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 3px;
}
.death-protection-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  background: rgba(18, 14, 10, .78);
  color: #f4e8cb;
  text-align: left;
  box-sizing: border-box;
}
.death-protection-item:not(:disabled):hover { border-color: #d9b45c; background: rgba(83, 55, 24, .72); }
.death-protection-item.selected { border-color: #74d58f; box-shadow: inset 0 0 0 1px rgba(116,213,143,.18); }
.death-protection-item.automatic { border-color: #ae8ce0; }
.death-protection-item-visual { width: 42px; height: 42px; display: grid; place-items: center; }
.death-protection-item-copy { min-width: 0; display: grid; gap: 2px; }
.death-protection-item-copy strong,
.death-protection-item-copy span,
.death-protection-item-copy small { overflow-wrap: anywhere; }
.death-protection-item-copy span { color: #c9b991; font-size: 11px; }
.death-protection-item-copy small { color: #9f947e; }
.death-protection-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #ffe7ae;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.death-protection-footer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
}
#death-protection-status { min-height: 1.3em; color: #e5ca7e; }
@media (max-width: 620px) {
  .death-protection-interface { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .death-protection-body { padding: 10px; gap: 9px; }
  .death-protection-summary,
  .death-protection-footer { grid-template-columns: 1fr; }
  .death-protection-summary > div { text-align: left; }
  .death-protection-footer button { width: 100%; }
  .death-protection-item { grid-template-columns: 40px minmax(0, 1fr); }
  .death-protection-item-visual { width: 36px; height: 36px; }
  .death-protection-badge { grid-column: 2; justify-self: start; }
}

/* Alpha 39 account security and stable auth links */
.auth-footer-links a, .auth-footer-links a:visited, .policy-consent a, .policy-consent a:visited { color:#d7c27d !important; text-decoration-color:rgba(215,194,125,.55); }
.auth-footer-links a:hover, .auth-footer-links a:focus-visible, .policy-consent a:hover, .policy-consent a:focus-visible { color:#fff0b5 !important; }
.policy-consent,.remember-device-option { display:flex; align-items:flex-start; gap:10px; margin:14px 0; font-size:.82rem; line-height:1.4; color:#d8d1bd; }
.policy-consent input,.remember-device-option input { width:18px; height:18px; min-width:18px; margin-top:1px; }
.auth-secondary-form h2 { margin:.25rem 0 .35rem; color:#f4e5b0; }
.auth-help-copy { color:#c6bfaa; line-height:1.45; }
#auth-code { font-family:Consolas,monospace; font-size:1.65rem; letter-spacing:.24em; text-align:center; }
.auth-recovery-links { display:flex; justify-content:center; gap:8px; align-items:center; margin:10px 0 2px; color:#817a68; }
.auth-recovery-links button { border:0; min-height:0; padding:3px; background:transparent; color:#d7c27d; text-decoration:underline; cursor:pointer; }
/* Alpha 39 achievements */
.achievement-toast-region{position:absolute;z-index:1500;top:max(16px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(520px,calc(100vw - 24px));pointer-events:none;display:grid;gap:10px}
.achievement-toast{display:flex;gap:14px;align-items:center;padding:15px 18px;background:linear-gradient(135deg,rgba(20,28,21,.98),rgba(8,11,9,.98));border:1px solid #b69a4b;border-radius:14px;box-shadow:0 16px 40px #000a,0 0 24px rgba(222,190,93,.18);opacity:0;transform:translateY(-20px) scale(.96);transition:opacity .35s,transform .35s}
.achievement-toast.visible{opacity:1;transform:translateY(0) scale(1)}
.achievement-toast-icon{font-size:2.2rem}.achievement-toast small{display:block;color:#d1b867;letter-spacing:.16em}.achievement-toast strong{display:block;color:#fff1be;font:700 1.15rem Georgia,serif}.achievement-toast p{margin:3px 0 0;color:#d8d2c1}
.achievement-panel-header{padding:16px;border:1px solid #5d5135;border-radius:12px;background:#141914}.achievement-panel-header strong{font-size:1.8rem;color:#f2d980}.achievement-panel-header p{margin:.35rem 0 0;color:#bdb6a4}
.achievement-grid{display:grid;gap:10px;margin-top:12px}.achievement-card{display:flex;gap:13px;padding:13px;border:1px solid #494536;border-radius:10px;background:#111511}.achievement-card.locked{filter:saturate(.25);opacity:.65}.achievement-card.earned{border-color:#84703d;background:linear-gradient(135deg,#171d17,#201c12)}.achievement-icon{font-size:2rem}.achievement-card strong{color:#efe2b2}.achievement-card p{margin:3px 0;color:#c9c2af}.achievement-card small{color:#9f9887}


/* Alpha 39 PvP zones and public profile effects */
.pvp-zone-indicator{position:relative;z-index:2;top:auto;right:auto;left:auto;align-self:center;flex:0 0 auto;display:grid;gap:2px;min-width:142px;margin-left:2px;padding:8px 11px;border:1px solid rgba(213,76,76,.72);border-radius:10px;background:linear-gradient(145deg,rgba(55,12,15,.94),rgba(20,9,10,.96));box-shadow:0 8px 22px #0008,0 0 18px rgba(220,58,58,.18);color:#ffd7d7;text-align:center;pointer-events:none}
.pvp-zone-indicator[hidden]{display:none!important}.pvp-zone-indicator strong{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#ff7b7b}.pvp-zone-indicator span{font-size:9px;color:#eed0d0}
.map-editor-toggle-row{display:flex!important;align-items:flex-start;gap:9px;margin-top:10px;padding:10px;border:1px solid rgba(211,185,106,.28);border-radius:8px;background:rgba(0,0,0,.16)}
.map-editor-toggle-row input{width:18px;height:18px;flex:0 0 auto;margin-top:1px}.map-editor-toggle-row span{display:grid;gap:3px}.map-editor-toggle-row strong{color:#f0d88b}.map-editor-toggle-row small{color:#b9ad98;line-height:1.35}
.social-profile-preview-wrap{position:relative;display:block;overflow:hidden;border-radius:8px}
.social-profile-preview-wrap .social-profile-preview{position:relative;z-index:1}
.social-profile-effect-mote{position:absolute;z-index:2;left:calc(10% + (var(--mote-index) * 12%));bottom:-16px;color:#fff0a6;font-style:normal;font-size:13px;text-shadow:0 0 8px currentColor;animation:social-profile-mote 2.8s linear infinite;animation-delay:calc(var(--mote-index) * -.37s);pointer-events:none}
.social-profile-preview-wrap[data-particle*="heart"] .social-profile-effect-mote{color:#ff7fa7}.social-profile-preview-wrap[data-particle*="snow"] .social-profile-effect-mote{color:#d7f5ff}.social-profile-preview-wrap[data-particle*="ember"] .social-profile-effect-mote{color:#ff9b58}.social-profile-preview-wrap[data-particle*="void"] .social-profile-effect-mote{color:#c296ff}.social-profile-preview-wrap[data-particle*="rainbow"] .social-profile-effect-mote{animation-name:social-profile-rainbow-mote}
.social-profile-preview-wrap[data-idle-animation*="wobble"] .social-profile-preview{animation:social-profile-wobble 2.4s ease-in-out infinite}.social-profile-preview-wrap[data-idle-animation*="float"] .social-profile-preview,.social-profile-preview-wrap[data-idle-animation*="hop"] .social-profile-preview{animation:social-profile-float 2.2s ease-in-out infinite}.social-profile-preview-wrap[data-idle-animation*="pulse"] .social-profile-preview,.social-profile-preview-wrap[data-idle-animation*="beat"] .social-profile-preview{animation:social-profile-pulse 1.5s ease-in-out infinite}
.social-profile-achievements{display:grid;gap:9px}.social-profile-achievements>header{display:flex;justify-content:space-between;align-items:center;color:#e9dba8}.social-profile-achievements>header span{color:#a99d87;font-size:9px;text-transform:uppercase}.social-profile-achievements>div{display:grid;gap:7px;max-height:220px;overflow-y:auto;padding-right:3px}.social-profile-achievements article{display:flex;gap:9px;padding:9px;border:1px solid rgba(180,151,102,.28);border-radius:8px;background:rgba(0,0,0,.16)}.social-profile-achievements article>span{font-size:20px}.social-profile-achievements article strong,.social-profile-achievements article small{display:block}.social-profile-achievements article strong{color:#f0e2b6}.social-profile-achievements article small{margin-top:3px;color:#aaa18e;font-size:8px;line-height:1.4}.social-profile-achievements p{margin:0;color:#aaa18e}
@keyframes social-profile-mote{0%{transform:translateY(0) scale(.7);opacity:0}18%{opacity:.9}100%{transform:translateY(-185px) scale(1.15) rotate(28deg);opacity:0}}@keyframes social-profile-rainbow-mote{0%{transform:translateY(0);opacity:0;color:#ff7a7a}30%{opacity:1;color:#ffe271}60%{color:#75e9c1}100%{transform:translateY(-185px) rotate(30deg);opacity:0;color:#b98cff}}@keyframes social-profile-wobble{0%,100%{transform:rotate(-.7deg)}50%{transform:rotate(.7deg)}}@keyframes social-profile-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}@keyframes social-profile-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.015)}}
@media(max-width:760px){.pvp-zone-indicator{top:auto;right:auto;min-width:112px;margin-left:0;padding:6px 7px}.pvp-zone-indicator strong{font-size:9px}.pvp-zone-indicator span{font-size:8px}}

.creator-name-glow{color:#5D3FD3!important;text-shadow:0 0 5px #5D3FD3,0 0 12px #5D3FD3,0 0 20px rgba(93,63,211,.8)!important;animation:creatorNamePulse 1.6s ease-in-out infinite}
@keyframes creatorNamePulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.35)}}
.account-permanent-delete{border-color:rgba(255,70,70,.62)!important;background:linear-gradient(145deg,rgba(88,16,16,.6),rgba(34,10,10,.72))!important}.account-permanent-delete h3{color:#ff9a9a}.account-permanent-delete p{color:#e7c3c3}

/* Alpha 41.1: side-panel containment and Familiar Pouch. */
#side-panel{grid-template-rows:auto minmax(0,1fr);overflow:hidden;contain:layout paint}
#panel-content{min-height:0;max-height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-bottom:max(22px,calc(14px + env(safe-area-inset-bottom)));scrollbar-gutter:stable;box-sizing:border-box}
#panel-content>*{max-width:100%;box-sizing:border-box}
.auction-shell,.social-community-shell,.equipment-layout,.collections-shell,.skills-list,.character-editor{min-height:0;max-width:100%;overflow-x:hidden}
.auction-content,.social-community-content{content-visibility:auto;contain-intrinsic-size:600px}
.familiar-pouch-shell{display:grid;gap:14px;padding:12px;max-width:100%;box-sizing:border-box}
.familiar-pouch-intro,.familiar-bait-shop{padding:14px;border:1px solid rgba(205,178,101,.36);border-radius:10px;background:rgba(20,17,12,.72)}
.familiar-pouch-intro p,.familiar-bait-shop p,.familiar-card p{margin:5px 0;color:var(--text-muted,#c5baa2);line-height:1.45}
.familiar-list{display:grid;gap:10px}
.familiar-card{display:grid;grid-template-columns:50px minmax(0,1fr);gap:11px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:rgba(8,9,7,.72)}
.familiar-card.active{border-color:#8fd4a2;box-shadow:inset 0 0 0 1px rgba(143,212,162,.16)}
.familiar-card-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:radial-gradient(circle,#984332,#391b1a);font-size:25px}
.familiar-card small{display:block;color:#c7b993;margin-top:3px}.familiar-health{height:7px;margin-top:7px;border-radius:999px;background:#271b18;overflow:hidden}.familiar-health i{display:block;height:100%;background:linear-gradient(90deg,#a33131,#6ed486)}
.familiar-card-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}.familiar-card-actions button{flex:1 1 115px}
.familiar-bait-shop{display:grid;gap:8px}.familiar-bait-shop h3{margin:0;color:#f0d98e}.familiar-bait-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;border-radius:8px;background:rgba(255,255,255,.045)}.familiar-bait-row span{display:grid}.familiar-bait-row small{color:#bbaa87}

/* Alpha 42.5.2 — compact icon navigation and paired panel toggles */
#top-tabs {
  width: min(460px, calc(100% - 24px));
  max-width: min(460px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  gap: 3px;
}
#top-tabs .tab-button {
  width: auto;
  min-width: 0;
  height: clamp(38px, 4.5vw, 46px);
  padding: 2px;
}
#top-tabs .tab-button span { font-size: clamp(17px, 2.1vw, 21px); }
#top-tabs .tab-button small { display: none !important; }
.panel-title-row { min-width: 0; display: flex; align-items: center; gap: 7px; }
.panel-mode-toggle {
  width: 28px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #211b14;
  border-radius: 5px;
  color: #271b08;
  background: linear-gradient(#f0d377, #b9872d);
  box-shadow: inset 0 0 0 1px #ffe8a5;
  font-size: 15px;
  line-height: 1;
}
.panel-mode-toggle:hover { filter: brightness(1.12); }
.equipment-slot-grid .equipment-slot-label {
  color: #17110a !important;
  text-shadow: none !important;
  font-weight: 800;
}
.cosmetic-equipment-section .equipment-section-heading > .compact-button {
  min-width: 0;
  min-height: 20px;
  max-width: 62px;
  padding: 2px 5px;
  font-size: 8px;
  line-height: 1.05;
  white-space: normal;
}
@media (min-width: 981px) {
  #chat-panel { width: min(740px, calc(100% - 500px)); }
}
@media (max-width: 980px) and (orientation: landscape) {
  #top-tabs {
    right: 6px;
    bottom: 6px;
    width: min(390px, calc(100% - 12px));
    max-width: min(390px, calc(100% - 12px));
    transform: none;
  }
  #chat-panel { width: min(520px, calc(100% - 420px)); min-width: 260px; }
}
@media (orientation: portrait) and (max-width: 760px) {
  #top-tabs {
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    min-height: 54px;
  }
  #top-tabs .tab-button { height: 48px; }
}
.skill-info-tips{margin:0 0 12px;padding:10px 14px 10px 30px;border:1px solid rgba(205,178,101,.28);border-radius:9px;background:rgba(20,17,12,.55);color:var(--text-muted,#c5baa2);line-height:1.45}.skill-info-tips li+li{margin-top:5px}

/* The Bonds of the Divine */
.dialogue-heading #dialogue-portrait[data-style="ladySena"]{background:radial-gradient(circle at 50% 35%,#fff2bd,#2b63a7 58%,#17345f);border-color:#f1ce62;color:#fff5c7;box-shadow:0 0 18px rgba(240,194,76,.45)}
.dialogue-heading #dialogue-portrait[data-style="ladySena"]::before{content:'♕'}

/* Harvesting skill, Soil Patches, and Bucket Workshop */
.harvesting-modal {
  position: fixed;
  inset: 0;
  z-index: 18000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .68);
}
.harvesting-card {
  width: min(680px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 14px;
  color: #17120c;
  background: #eee2c8;
  border: 3px solid #5d4329;
  border-radius: 10px;
  box-shadow: 0 18px 60px #000;
}
.harvesting-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #8b7251;
}
.harvesting-card h2 { margin: 0 0 8px; font-size: 22px; }
.harvesting-card header button {
  border: 0;
  color: #26180e;
  background: none;
  font-size: 24px;
  cursor: pointer;
}
.harvesting-status { font-weight: 700; line-height: 1.45; }
.harvesting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.harvesting-grid button {
  min-height: 48px;
  padding: 8px;
  border: 1px solid #65472d;
  border-radius: 5px;
  color: #17120c;
  background: #d7c39d;
  font-weight: 700;
  cursor: pointer;
}
.harvesting-grid button:hover:not(:disabled) { background: #ead8b4; }
.harvesting-grid button:disabled { opacity: .48; cursor: not-allowed; }
@media (max-width: 560px) {
  .harvesting-modal { padding: 8px; }
  .harvesting-card { width: 100%; max-height: 92vh; padding: 10px; }
  .harvesting-grid { grid-template-columns: 1fr; }
}


/* Animated player emotes */
.emote-panel-intro{padding:10px 12px;margin-bottom:10px;border:1px solid rgba(191,166,255,.34);background:rgba(31,24,49,.72)}
.emote-panel-intro strong{display:block;color:#f0e6ff;letter-spacing:.08em}
.emote-panel-intro p{margin:6px 0 0;color:#cfc6df;font-size:.78rem;line-height:1.35}
.emote-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.emote-option{min-height:96px;padding:9px;border:1px solid rgba(173,151,214,.34);border-radius:4px;background:linear-gradient(180deg,rgba(55,43,78,.9),rgba(29,23,43,.94));color:#f7f0ff;text-align:left;cursor:pointer}
.emote-option:hover,.emote-option:focus-visible{border-color:#d9b8ff;transform:translateY(-1px)}
.emote-option.active{border-color:#ffe28a;box-shadow:0 0 12px rgba(255,226,138,.32)}
.emote-option .emote-icon{display:block;min-height:26px;font:700 1.3rem/1 Courier New;color:#ffe28a}
.emote-option strong{display:block;margin-top:4px}
.emote-option small{display:block;margin-top:4px;color:#bfb4d1;line-height:1.25}
.emote-stop{width:100%;margin-top:10px}
@media(max-width:560px){.emote-grid{grid-template-columns:1fr}.emote-option{min-height:76px}}
