﻿:root {
  --ui-gold: #b89d63;
  --ui-border: #3f3625;
  --bg-dark: #0f0d0a;
  --panel-bg: rgba(16, 12, 8, 0.88);
  --text-main: #e3dbc7;
  --danger: #bb2f2f;
  --mana: #2f4cae;
  --menu-bg-1: #120d08;
  --menu-bg-2: #2a1b11;
  --menu-bg-3: #080604;
  --steam-widget-height: 190px;
}

* {
  box-sizing: border-box;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Noto Serif TC", serif;
  color: var(--text-main);
  background: radial-gradient(circle at 30% 20%, #221b14 0%, #090705 65%);
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#char-select-screen {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.char-select-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(167, 115, 52, 0.23), transparent 38%),
    radial-gradient(circle at 80% 82%, rgba(117, 61, 33, 0.25), transparent 35%),
    linear-gradient(130deg, var(--menu-bg-1) 0%, var(--menu-bg-2) 48%, var(--menu-bg-3) 100%);
}

.char-select-shell {
  position: relative;
  width: min(980px, 100%);
  border: 1px solid #5f4930;
  background: rgba(14, 10, 7, 0.92);
  box-shadow: 0 0 0 1px #000, 0 26px 50px rgba(0, 0, 0, 0.65);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.char-select-header h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  color: #f0d9a8;
  letter-spacing: 0.08em;
}

.char-select-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.char-select-header p {
  margin: 8px 0 0;
  color: #ccb999;
  font-size: 14px;
}

.char-select-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.create-card,
.slot-card {
  border: 1px solid #4e3b28;
  background: linear-gradient(180deg, rgba(29, 21, 14, 0.95), rgba(17, 12, 8, 0.92));
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-card h2,
.slot-card h2 {
  margin: 0 0 4px;
  font-family: "Cinzel", serif;
  font-size: 16px;
  letter-spacing: 0.06em;
}

.field-label {
  font-size: 12px;
  color: #dcc7a0;
}

.field-input {
  width: 100%;
  border: 1px solid #685235;
  background: rgba(13, 10, 7, 0.95);
  color: #f4e3c0;
  height: 36px;
  padding: 6px 10px;
  font-family: "Noto Serif TC", serif;
}

.field-input:focus {
  outline: 1px solid #caa568;
}

.menu-btn {
  margin-top: 6px;
  border: 1px solid #8a6b42;
  background: linear-gradient(180deg, #3c2a1a 0%, #24180f 100%);
  color: #efdcb4;
  height: 36px;
  font-family: "Cinzel", serif;
  cursor: pointer;
}

.menu-btn:hover {
  border-color: #c79c5f;
  box-shadow: inset 0 0 10px rgba(233, 184, 108, 0.22);
}

.menu-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.menu-btn-secondary {
  margin-top: 0;
  min-width: 96px;
}

.char-select-status {
  min-height: 20px;
  margin: 2px 0 0;
  color: #d8c093;
  font-size: 12px;
}

.announcement-overlay {
  position: absolute;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 2, 0.7);
  padding: 18px;
}

.announcement-overlay.open {
  display: flex;
}

.announcement-panel {
  width: min(980px, 100%);
  height: min(78vh, 760px);
  border: 1px solid #5f4930;
  background: linear-gradient(180deg, rgba(22, 16, 10, 0.97), rgba(14, 10, 7, 0.97));
  box-shadow: 0 0 0 1px #000, 0 26px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
}

.announcement-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #5f4930;
  background: linear-gradient(180deg, rgba(38, 29, 19, 0.95), rgba(25, 18, 12, 0.95));
  min-height: 56px;
  padding: 10px 54px 10px 16px;
}

.announcement-header h2 {
  margin: 0;
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-size: 22px;
}

.announcement-close-btn {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid #7a6040;
  background: #23180f;
  color: #f0e0bd;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.announcement-close-btn:hover {
  border-color: #d2a560;
}

.announcement-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 280px) 1fr;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.announcement-tab-list {
  border: 1px solid #4e3b28;
  background: linear-gradient(180deg, rgba(28, 21, 14, 0.96), rgba(16, 12, 8, 0.94));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.announcement-tab-item {
  border: 1px solid #665136;
  background: #1d1610;
  color: #d9c9a8;
  padding: 9px 10px;
  text-align: left;
  font-family: "Noto Serif TC", serif;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.announcement-tab-item:hover {
  border-color: #c79c5f;
}

.announcement-tab-item.active {
  border-color: #d2a560;
  box-shadow: inset 0 0 10px rgba(233, 184, 108, 0.22);
}

.announcement-tab-title {
  font-size: 14px;
  color: #f0dcac;
}

.announcement-tab-tag {
  justify-self: start;
  border: 1px solid #335a8a;
  background: rgba(28, 54, 82, 0.7);
  color: #b8d8ff;
  font-size: 11px;
  padding: 1px 7px;
}

.announcement-content {
  border: 1px solid #4e3b28;
  background: linear-gradient(180deg, rgba(23, 17, 12, 0.97), rgba(14, 10, 8, 0.95));
  color: var(--text-main);
  padding: 16px;
  overflow: auto;
  line-height: 1.7;
}

.announcement-entry-title {
  margin: 0;
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  font-size: 22px;
  letter-spacing: 0.04em;
}

.announcement-entry-date {
  margin-top: 2px;
  color: #bca885;
  font-size: 12px;
}

.announcement-entry-summary {
  margin: 10px 0 14px;
  color: #d8c6a2;
  font-size: 14px;
}

.announcement-block-text {
  margin: 10px 0;
  color: #dfd2b8;
  white-space: pre-wrap;
}

.announcement-block-image {
  margin: 12px 0 16px;
}

.announcement-block-image img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid #6e5637;
  background: #0c0906;
}

.announcement-block-image figcaption {
  margin-top: 5px;
  color: #bca885;
  font-size: 12px;
}

.announcement-link-wrap {
  margin: 10px 0 12px;
  border: 1px solid #5d4a30;
  background: rgba(24, 18, 12, 0.92);
  padding: 9px 10px;
}

.announcement-link-wrap a {
  color: #9fc6ff;
  text-decoration: underline;
  font-weight: 600;
}

.announcement-link-desc {
  margin-top: 3px;
  color: #bca885;
  font-size: 12px;
}

.announcement-empty {
  color: #bca885;
  font-size: 14px;
}

.tower-selection-overlay {
  position: absolute;
  inset: 0;
  z-index: 88;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 2, 0.74);
  padding: 16px;
}

.tower-selection-overlay.open {
  display: flex;
}

.tower-selection-panel {
  width: min(1060px, 100%);
  max-height: min(82vh, 760px);
  border: 1px solid #5f4930;
  background: linear-gradient(180deg, rgba(22, 16, 10, 0.97), rgba(13, 10, 7, 0.97));
  box-shadow: 0 0 0 1px #000, 0 26px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tower-selection-header {
  position: relative;
  min-height: 56px;
  border-bottom: 1px solid #5f4930;
  background: linear-gradient(180deg, rgba(38, 29, 19, 0.95), rgba(25, 18, 12, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 54px 10px 16px;
}

.tower-selection-title {
  margin: 0;
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-size: 22px;
}

.tower-selection-close-btn {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 36px;
  height: 36px;
  border: 1px solid #7a6040;
  background: #23180f;
  color: #f0e0bd;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.tower-selection-close-btn:hover {
  border-color: #d2a560;
}

.tower-selection-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 14px;
  align-content: start;
}

.tower-selection-empty {
  border: 1px dashed #5f4930;
  background: rgba(20, 15, 10, 0.9);
  color: #d5c4a4;
  font-size: 14px;
  padding: 14px;
}

.tower-selection-card {
  min-width: 0;
  position: relative;
  border: 1px solid #5a452d;
  background: linear-gradient(180deg, rgba(27, 20, 14, 0.95), rgba(13, 10, 7, 0.95));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.66);
  min-height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tower-selection-card.is-locked {
  opacity: 0.72;
}

.tower-selection-floor-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid #b58d53;
  background: linear-gradient(180deg, #2f2114 0%, #1a130c 100%);
  color: #f3dfb5;
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 15px;
  font-weight: 700;
  z-index: 2;
}

.tower-selection-card-scene {
  position: relative;
  height: 240px;
  border-bottom: 1px solid #4f3b27;
  overflow: hidden;
}

.tower-scene-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tower-selection-card-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tower-scene-wasteland::after {
  background:
    radial-gradient(circle at 72% 14%, rgba(255, 210, 132, 0.22), transparent 32%),
    linear-gradient(180deg, transparent 48%, rgba(19, 14, 10, 0.68) 100%);
}

.tower-scene-ivory::after {
  background:
    radial-gradient(circle at 76% 16%, rgba(255, 255, 255, 0.32), transparent 32%),
    linear-gradient(180deg, transparent 44%, rgba(206, 214, 226, 0.45) 100%);
}

.tower-selection-card-body {
  min-width: 0;
  padding: 12px 12px 12px;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.tower-selection-card-name {
  margin: 0;
  padding-right: 50px;
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.tower-selection-card-theme {
  margin: 0;
  color: #cbb894;
  font-size: 12px;
  line-height: 1.4;
  min-height: 34px;
}

.tower-selection-card-progress {
  border: 1px solid #5f4a30;
  background: rgba(15, 11, 8, 0.76);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  color: #d3c09a;
  font-size: 12px;
}

.tower-selection-card-progress strong {
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  font-size: 14px;
}

.tower-selection-card-actions {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tower-selection-action-btn {
  flex-shrink: 0;
  border: 1px solid #7e6240;
  background: linear-gradient(180deg, #2e2115, #20160e);
  color: #eddcba;
  height: 34px;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.tower-selection-action-btn:hover:not(:disabled) {
  border-color: #d3a864;
}

.tower-floor-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 6px 0;
  flex-shrink: 0;
  overscroll-behavior: contain;
}

.tower-floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  padding: 16px;
  min-height: 0;
  overflow-y: auto;
}

.skill-reset-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  overflow-y: auto;
  padding: 24px;
  background: #21190f;
  color: #f1dfbd;
  border: 1px solid #b99a61;
  border-radius: 10px;
  box-shadow: 0 16px 70px #000b;
}
.skill-reset-dialog::backdrop { background: #000b; }
.skill-reset-dialog h2 { margin-top: 0; }
.skill-reset-dialog p { line-height: 1.6; }
.skill-reset-dialog > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.skill-reset-dialog button { min-height: 44px; padding: 10px 14px; background: #49331a; border: 1px solid #b99a61; color: #ffe4b5; cursor: pointer; }
.skill-reset-dialog button:disabled { opacity: 0.5; cursor: default; }
.skill-reset-status { color: #ffcd83; min-height: 24px; }
.tower-floor-panel > .tower-selection-population { padding: 0 16px; flex-shrink: 0; }
.tower-floor-panel .tower-selection-header { flex-shrink: 0; }
.tower-floor-panel .tower-floor-btn { height: auto; min-height: 58px; }

.tower-floor-btn {
  min-width: 104px;
  min-height: 44px;
  padding: 8px;
  white-space: nowrap;
}

.tower-selection-action-progress {
  border-color: #6e4a2d;
  background: linear-gradient(180deg, #412015, #2a140d);
  color: #ffd9c2;
}

.tower-selection-action-progress:hover:not(:disabled) {
  border-color: #d9805b;
}

.tower-selection-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-item {
  border: 1px solid #5b472f;
  background: rgba(20, 15, 10, 0.92);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-item.empty {
  border-style: dashed;
  color: #968261;
}

.slot-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.slot-name {
  font-weight: 600;
  color: #f0dcac;
}

.slot-meta {
  color: #bca885;
  font-size: 12px;
}

.slot-actions {
  display: flex;
  gap: 8px;
}

.slot-btn {
  flex: 1;
  border: 1px solid #695335;
  background: #1e1610;
  color: #e5d8b9;
  height: 30px;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 12px;
}

.slot-btn:hover {
  border-color: #d3a864;
}

.slot-btn.delete {
  border-color: #6f2f2f;
  color: #efc1c1;
}

#in-game-toolbar {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 10px;
}

#active-character {
  border: 1px solid #5a482f;
  background: rgba(18, 13, 9, 0.9);
  color: #efd8ac;
  font-size: 12px;
  padding: 7px 10px;
  max-width: min(52vw, 300px);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

#perf-hud {
  border: 1px solid #5a482f;
  background: rgba(18, 13, 9, 0.9);
  color: #b8d8ff;
  font-size: 12px;
  padding: 7px 10px;
  white-space: nowrap;
}

.save-exit-btn {
  border: 1px solid #a47a48;
  background: linear-gradient(180deg, #3b2918 0%, #24170d 100%);
  color: #ffe8bf;
  height: 42px;
  min-width: 148px;
  padding: 0 14px;
  font-family: "Cinzel", serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 0 0 1px rgba(255, 219, 158, 0.18), 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.save-exit-btn:hover {
  border-color: #e7be75;
  background: linear-gradient(180deg, #4a3220 0%, #2b1b10 100%);
}

#game-root.menu-mode #char-select-screen {
  display: flex;
}

#game-root.menu-mode #game-ui-layer,
#game-root.menu-mode #gameCanvas,
#game-root.menu-mode #notification,
#game-root.menu-mode #char-panel,
#game-root.menu-mode #inv-panel,
#game-root.menu-mode #skill-panel,
#game-root.menu-mode #quest-panel,
#game-root.menu-mode #enemy-status-panel,
#game-root.menu-mode #item-tooltip,
#game-root.menu-mode #bottom-ui,
#game-root.menu-mode #in-game-toolbar,
#game-root.menu-mode #tower-selection-overlay {
  display: none !important;
}

#game-root.menu-mode #steam-widget-wrap {
  display: block;
}

#game-root:not(.menu-mode) #in-game-toolbar {
  display: flex;
}

#game-ui-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

#game-ui-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  pointer-events: none;
}

#game-ui-canvas > * {
  pointer-events: auto;
}

#top-ui-container {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  height: 420px;
  z-index: 32;
  pointer-events: none;
}

#top-ui-container > .panel {
  pointer-events: auto;
}

.top-ui-panel-inner {
  display: flex;
  flex-direction: column;
  gap: inherit;
  min-width: 0;
  transform-origin: top left;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: crosshair;
}

.panel {
  position: absolute;
  z-index: 30;
  background: var(--panel-bg);
  border: 1px solid var(--ui-border);
  box-shadow: 0 0 0 1px #000, 0 8px 22px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(1px);
  display: none;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.panel-title {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f0d9a8;
  font-size: 16px;
  text-shadow: 0 1px 0 #000;
}

.panel-drag-handle {
  cursor: move;
  user-select: none;
}

.left-panel {
  top: 14px;
  left: 14px;
  width: 240px;
  max-height: calc(100vh - 190px);
}

.right-panel {
  top: 14px;
  right: 14px;
  width: 372px;
  max-height: calc(100vh - 198px);
}

.mid-panel {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  max-height: calc(100vh - 176px);
}

.quest-panel {
  display: flex;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  text-align: center;
  background: rgba(15, 11, 8, 0.75);
  pointer-events: none;
}

.enemy-status-panel {
  top: 14px;
  left: calc(50% + 176px);
  width: 260px;
  min-height: 108px;
  display: none;
  pointer-events: none;
  background: rgba(15, 11, 8, 0.8);
}

#enemy-name {
  color: #f0d9a8;
  font-family: "Cinzel", serif;
  font-size: 16px;
}

#enemy-hp-bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #5e3a32;
  background: linear-gradient(180deg, rgba(38, 17, 14, 0.9), rgba(17, 9, 8, 0.92));
}

#enemy-hp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b43d3d 0%, #d96767 50%, #f2a18c 100%);
  box-shadow: 0 0 8px rgba(212, 102, 102, 0.45);
  transition: width 90ms linear;
}

#enemy-hp {
  color: #ff9d9d;
  font-size: 14px;
}

#enemy-effects {
  color: #bcd8ff;
  font-size: 12px;
  line-height: 1.35;
}

#control-text {
  display: none;
  font-size: 11px;
  color: #cbb890;
}

.stat-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  font-size: 13px;
}

.stat-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-row > span:last-child {
  justify-self: end;
  white-space: nowrap;
}

.divider {
  border-top: 1px solid #3a3022;
  margin: 3px 0;
}

.inv-layout-shell {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.inventory-gold {
  border: 1px solid #5e4c33;
  background: linear-gradient(180deg, rgba(40, 30, 19, 0.88), rgba(19, 13, 8, 0.88));
  padding: 6px 8px;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #f0d27f;
  text-shadow: 0 1px 0 #000;
}

.equip-grid {
  border: 1px solid #4d3d2a;
  background:
    radial-gradient(circle at 28% 20%, rgba(195, 130, 72, 0.12), transparent 43%),
    linear-gradient(180deg, rgba(21, 15, 10, 0.94), rgba(13, 10, 7, 0.94));
  padding: 12px 10px 10px;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  grid-template-rows: 54px 112px;
  grid-template-areas:
    ". amulet ."
    "weapon armor ring";
  column-gap: 12px;
  row-gap: 8px;
  justify-items: center;
  align-items: center;
  min-width: 0;
}

.equip-slot {
  position: relative;
  --equip-quality-border: #5f4c33;
  --equip-quality-glow: rgba(236, 190, 112, 0.16);
  border: 1px solid var(--equip-quality-border);
  background: linear-gradient(180deg, #19120c 0%, #0f0b08 100%);
  color: #d7caab;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.62);
}

.equip-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212, 177, 112, 0.08);
  pointer-events: none;
}

.equip-slot:hover,
.equip-slot.has-item {
  border-color: var(--equip-quality-border);
  box-shadow: inset 0 0 0 1px var(--equip-quality-glow), 0 0 10px var(--equip-quality-glow);
}

.equip-slot.quality-normal {
  --equip-quality-border: #7f6d53;
  --equip-quality-glow: rgba(214, 194, 156, 0.18);
}

.equip-slot.quality-magic {
  --equip-quality-border: #5f87e8;
  --equip-quality-glow: rgba(89, 133, 255, 0.26);
}

.equip-slot.quality-rare {
  --equip-quality-border: #d5a33f;
  --equip-quality-glow: rgba(235, 188, 92, 0.3);
}

.equip-slot.quality-legendary {
  --equip-quality-border: #ff9f3a;
  --equip-quality-glow: rgba(255, 145, 54, 0.34);
}

.equip-slot-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #bca885;
  pointer-events: none;
}

.equip-slot-icon {
  width: 80%;
  height: 80%;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.equip-slot-amulet {
  grid-area: amulet;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.equip-slot-weapon {
  grid-area: weapon;
  width: 68px;
  height: 108px;
}

.equip-slot-armor {
  grid-area: armor;
  width: 90px;
  height: 108px;
}

.equip-slot-ring {
  grid-area: ring;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.inventory-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 132, 78, 0.75), transparent);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-auto-rows: 33px;
  gap: 3px;
  padding: 4px;
  border: 1px solid #534329;
  background: linear-gradient(180deg, rgba(21, 16, 11, 0.92), rgba(11, 9, 7, 0.9));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.62);
  overflow: auto;
  max-height: min(290px, 42vh);
  min-width: 0;
}

.inv-item {
  position: relative;
  border: 1px solid #4a3c28;
  background: #14100c;
  color: #eee;
  cursor: pointer;
  overflow: hidden;
}

.inv-item.quality-normal {
  border-color: #6d5f48;
}

.inv-item.quality-magic {
  border-color: #4f72c7;
}

.inv-item.quality-rare {
  border-color: #c59639;
}

.inv-item.quality-legendary {
  border-color: #dd7e2e;
}

.inv-item-inner {
  position: absolute;
  inset: 0;
  border: 1px solid var(--item-quality-border, #6d5f4a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.66);
}

.inv-item-icon-wrap {
  position: absolute;
  inset: 2px 2px 4px;
  display: grid;
  place-items: center;
}

.inv-item-rarity-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), var(--item-quality-bar, #7f735b), rgba(0, 0, 0, 0.25));
}

.inv-item-stack-count {
  position: absolute;
  right: 3px;
  bottom: 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #f5e6be;
  text-shadow: 0 1px 1px #000;
}

.inv-item:hover .inv-item-inner {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.66), 0 0 10px var(--item-quality-glow, rgba(220, 184, 120, 0.2));
}

.inv-empty {
  border-style: dashed;
  border-color: #3b2f22;
  background: rgba(13, 10, 7, 0.42);
  cursor: default;
}

.inv-item-empty-core {
  position: absolute;
  inset: 2px;
  border: 1px dashed #3f3326;
}

.item-svg-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.inv-svg-icon {
  width: 82%;
  height: 82%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.66));
}

.equip-svg-icon {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.72));
}

.equip-item-inner {
  position: absolute;
  inset: 2px;
  border: 1px solid var(--item-quality-border, #6d5f4a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.66), 0 0 9px var(--item-quality-glow, rgba(220, 184, 120, 0.18));
}

.equip-item-icon-wrap {
  position: absolute;
  inset: 2px 2px 4px;
  display: grid;
  place-items: center;
}

.equip-item-rarity-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), var(--item-quality-bar, #7f735b), rgba(0, 0, 0, 0.25));
}

.hotbar-svg-icon {
  width: 30px;
  height: 30px;
  margin-top: 3px;
}

.hotkey-icon-text {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 22px;
  line-height: 1;
}

.hotkey-count {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: #f1dfb2;
  text-shadow: 0 1px 1px #000;
}

.skill-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

#skill-panel {
  width: min(var(--skill-panel-width, 600px), calc(100vw - 28px)) !important;
  height: min(720px, calc(100dvh - 160px)) !important;
  overflow: hidden;
}
#skill-panel > .top-ui-panel-inner { display:flex; flex-direction:column; height:100%; min-height:0; transform:none !important; }
.skill-tree-viewport { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; touch-action:pan-x pan-y; }
.skill-tree-viewport { scrollbar-width:none; cursor:grab; user-select:none; }
.skill-tree-viewport::-webkit-scrollbar { display:none; }
.skill-tree-viewport:active { cursor:grabbing; }
#town-beginner-guide { color:#efcf8d; font-size:12px; line-height:1.6; margin:8px 0 0; }

.skill-tree-empty {
  border: 1px solid #58472f;
  background: rgba(22, 17, 11, 0.94);
  color: #d9c59a;
  padding: 10px;
  font-size: 12px;
  text-align: center;
}

.skill-tree-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #5a482f;
  background: linear-gradient(180deg, rgba(34, 25, 16, 0.96), rgba(20, 14, 8, 0.96));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65);
  padding: 6px 8px;
}

.skill-tree-points {
  color: #f1dfb1;
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.skill-tree-reset-btn {
  border: 1px solid #7b5a37;
  background: linear-gradient(180deg, #2e2013, #21170e);
  color: #f2dfb8;
  height: 28px;
  min-width: 76px;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 12px;
}

.skill-tree-reset-btn:hover:not(:disabled) {
  border-color: #cf9d5a;
}

.skill-tree-reset-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.skill-tree-board {
  --skill-cols: 3;
  --skill-rows: 6;
  position: relative;
  border: 1px solid #5a482f;
  background:
    radial-gradient(circle at 50% 10%, rgba(102, 81, 44, 0.2), rgba(14, 10, 6, 0.94) 58%),
    linear-gradient(180deg, rgba(28, 20, 12, 0.96), rgba(15, 11, 8, 0.96));
  box-sizing: content-box;
  width: var(--skill-width);
  height: var(--skill-height);
  overflow: hidden;
  padding: var(--skill-padding);
}

.skill-tree-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 209, 121, 0.06), transparent 36%),
    radial-gradient(circle at 75% 78%, rgba(121, 169, 255, 0.06), transparent 38%);
}

.skill-tree-links {
  position: absolute;
  top: var(--skill-padding);
  left: var(--skill-padding);
  width: var(--skill-width);
  height: var(--skill-height);
  z-index: 1;
  pointer-events: none;
}

.skill-link {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.skill-link.locked {
  stroke: rgba(93, 87, 77, 0.85);
}

.skill-link.unlocked {
  stroke: rgba(231, 186, 105, 0.95);
}

.skill-tree-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--skill-cols), var(--skill-node-width));
  grid-template-rows: repeat(var(--skill-rows), var(--skill-node-height));
  gap: var(--skill-gap);
  width: var(--skill-width);
  height: var(--skill-height);
}

.skill-tree-node {
  position: relative;
  border: 1px solid #5e4d33;
  background: linear-gradient(180deg, rgba(28, 22, 14, 0.95), rgba(17, 13, 9, 0.95));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0, 0, 0, 0.38);
  color: #d9c79f;
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 6px 4px 8px;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.skill-tree-node:hover {
  border-color: #ca9f5f;
  transform: translateY(-1px);
}

.skill-tree-node.is-locked {
  opacity: 0.66;
}

.skill-tree-node.is-available {
  border-color: #d8ab64;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), 0 0 10px rgba(226, 183, 109, 0.2);
}

.skill-tree-node.is-learned {
  border-color: #7ba6c8;
}

.skill-tree-node.is-max {
  border-color: #f0ce7f;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65), 0 0 14px rgba(240, 206, 127, 0.3);
}

.skill-tree-node-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.skill-icon-svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.64));
}

.skill-tree-node-name {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  color: #e7d6b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-tree-node-req {
  font-size: 10px;
  color: #bda57d;
}

.skill-tree-rank-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 28px;
  border: 1px solid #6b5738;
  background: rgba(18, 13, 9, 0.92);
  color: #f2dfb8;
  font-family: "Cinzel", serif;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  padding: 1px 4px;
}

.hotbar-skill-svg {
  width: 30px;
  height: 30px;
  margin-top: 2px;
}

#bottom-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 156px;
  z-index: 25;
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: center;
  background: linear-gradient(0deg, rgba(6, 4, 3, 0.98), rgba(19, 13, 9, 0.92));
  border-top: 2px solid #22180f;
  pointer-events: auto;
}

#steam-widget-wrap {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(646px, 100vw);
  height: var(--steam-widget-height);
  z-index: 130;
  background: #000;
  border-top: 1px solid #2b2116;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
}

#steam-widget {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.exp-bar-wrap {
  position: absolute;
  left: 122px;
  right: 122px;
  bottom: 6px;
  height: 16px;
  border: 1px solid rgba(94, 75, 28, 0.95);
  background: linear-gradient(180deg, rgba(28, 22, 10, 0.95), rgba(16, 12, 6, 0.95));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  pointer-events: none;
}

.exp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b5881b 0%, #d8b642 52%, #f3de87 100%);
  box-shadow: inset 0 0 8px rgba(255, 232, 146, 0.34);
  transition: width 0.16s linear;
}

.exp-bar-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f7e9b5;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px #000;
}

.orb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#bottom-orb-left {
  justify-content: flex-start;
  padding-left: 8px;
}

#bottom-orb-right {
  justify-content: flex-end;
  padding-right: 8px;
}

.gargoyle {
  font-size: 20px;
  color: #8a7a5a;
}

.orb {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid #2d2418;
  overflow: hidden;
  background: #070606;
}

.orb-fluid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  transition: height 0.18s linear;
}

.orb-red .orb-fluid {
  background: radial-gradient(circle at 50% 0%, #ff7d7d 0%, #bf1616 58%, #540303 100%);
}

.orb-blue .orb-fluid {
  background: radial-gradient(circle at 50% 0%, #83a6ff 0%, #2744aa 56%, #0b194f 100%);
}

.orb-glare {
  position: absolute;
  left: 13%;
  top: 10%;
  width: 54%;
  height: 28%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.65), transparent 80%);
}

.orb-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Cinzel", serif;
  text-shadow: 0 1px 2px #000;
}

.center-console {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.console-row {
  display: flex;
  gap: 8px;
}

.console-row.bottom {
  gap: 6px;
}
#interact-slot { display:none !important; }

.ui-btn,
.hotkey-slot {
  border: 1px solid #6d5c3c;
  background: #1e1811;
  color: #e5d8b9;
  min-width: 84px;
  height: 34px;
  font-family: "Cinzel", serif;
  cursor: pointer;
}

.ui-btn.is-active {
  border-color: #d1a765;
  box-shadow: inset 0 0 10px rgba(220, 181, 106, 0.24);
  color: #f6e5c2;
}

.hotkey-slot {
  min-width: 58px;
  height: 50px;
  font-size: 24px;
  position: relative;
}

.hotkey-slot span {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 12px;
  color: #d3b778;
}

.hotkey-cd-overlay {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  pointer-events: none;
  display: none;
  --cd-progress: 0;
  background: conic-gradient(
    rgba(112, 166, 255, 0.58) calc(var(--cd-progress) * 1turn),
    rgba(112, 166, 255, 0.08) 0turn
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}

#quest-panel.hidden-for-skills { display:none !important; }

.tooltip {
  position: fixed;
  z-index: 90;
  max-width: 260px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #826f42;
  padding: 8px;
  display: none;
  pointer-events: none;
}

.tt-name {
  font-weight: 600;
  color: #f5dfa9;
}

.tt-desc {
  margin-top: 4px;
  font-size: 12px;
}

.inventory-action-menu {
  position: fixed;
  z-index: 95;
  display: none;
  min-width: 118px;
  padding: 4px;
  border: 1px solid #6c5538;
  background: rgba(12, 9, 6, 0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  gap: 4px;
  flex-direction: column;
}

.inventory-action-menu.open {
  display: flex;
}

.inventory-action-btn {
  border: 1px solid #6c5538;
  background: #21180f;
  color: #e9dab8;
  height: 30px;
  font-family: "Noto Serif TC", serif;
  font-size: 13px;
  cursor: pointer;
}

.inventory-action-btn:hover {
  border-color: #d2a560;
}

.inventory-action-btn.cancel {
  border-style: dashed;
  color: #c7b58f;
}

.notification {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  color: #ffb43b;
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-size: 28px;
  opacity: 0;
  transition: opacity 0.3s, top 0.3s;
  text-shadow: 0 2px 0 #000;
  pointer-events: none;
}

@media (max-width: 960px) {
  #char-select-screen {
    padding: 14px;
  }

  .char-select-shell {
    padding: 14px;
  }

  .char-select-layout {
    grid-template-columns: 1fr;
  }

  .announcement-overlay {
    padding: 10px;
  }

  .announcement-panel {
    height: min(84vh, 760px);
  }

  .announcement-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(124px, 33%) 1fr;
  }

  .tower-selection-overlay {
    padding: 10px;
  }

  .tower-selection-panel {
    max-height: min(86vh, 760px);
  }

  .tower-selection-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .announcement-tab-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }

  #in-game-toolbar {
    top: 8px;
    left: 8px;
    right: 8px;
    justify-content: space-between;
    gap: 8px;
  }

  #active-character {
    max-width: calc(100vw - 146px);
    padding: 6px 8px;
  }

  .save-exit-btn {
    min-width: 136px;
    height: 38px;
    font-size: 13px;
  }

  .left-panel,
  .mid-panel {
    width: 44vw;
  }

  .right-panel {
    width: min(92vw, 478px);
  }

  .equip-grid {
    grid-template-columns: 64px 1fr 64px;
    grid-template-rows: 50px 102px;
  }

  .equip-slot-weapon {
    width: 62px;
    height: 98px;
  }

  .equip-slot-armor {
    width: 82px;
    height: 98px;
  }

  .inventory-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-auto-rows: 32px;
    max-height: min(270px, 40vh);
  }

  .enemy-status-panel {
    left: 50%;
    transform: translateX(-50%);
    top: 104px;
    width: min(82vw, 320px);
  }

  #bottom-ui {
    grid-template-columns: 128px 1fr 128px;
    height: 145px;
  }

  .exp-bar-wrap {
    left: 90px;
    right: 90px;
    height: 14px;
  }

  .orb {
    width: 82px;
    height: 82px;
  }

  .hotkey-slot {
    min-width: 52px;
  }

  .console-row.bottom {
    gap: 5px;
  }

  .hotbar-svg-icon {
    width: 28px;
    height: 28px;
  }

  .hotkey-icon-text {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .char-select-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-btn-secondary {
    width: 100%;
  }

  .announcement-header h2 {
    font-size: 18px;
  }

  .announcement-tab-list {
    grid-template-columns: 1fr;
  }

  .announcement-content {
    padding: 12px;
  }

  .tower-selection-title {
    font-size: 18px;
  }

  .tower-selection-list {
    grid-template-columns: 1fr;
  }

  .tower-selection-card {
    min-height: 372px;
  }

  .tower-selection-card-scene {
    height: 188px;
  }

  .slot-actions {
    flex-direction: column;
  }

  .slot-btn {
    width: 100%;
  }

  .char-select-header p {
    font-size: 13px;
  }

  .right-panel {
    width: min(96vw, 430px);
  }

  .equip-grid {
    grid-template-columns: 56px 1fr 56px;
    grid-template-rows: 46px 92px;
    column-gap: 8px;
    row-gap: 6px;
    padding: 10px 8px 8px;
  }

  .equip-slot-amulet,
  .equip-slot-ring {
    width: 48px;
    height: 48px;
  }

  .equip-slot-weapon {
    width: 56px;
    height: 86px;
  }

  .equip-slot-armor {
    width: 76px;
    height: 86px;
  }

  .inventory-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 31px;
    max-height: min(248px, 39vh);
  }

  #bottom-ui {
    grid-template-columns: 100px 1fr 100px;
    height: 138px;
  }

  .exp-bar-wrap {
    left: 64px;
    right: 64px;
    height: 13px;
    bottom: 5px;
  }

  .exp-bar-text {
    font-size: 10px;
  }

  .orb {
    width: 72px;
    height: 72px;
  }

  .hotkey-slot {
    min-width: 44px;
    height: 46px;
    font-size: 20px;
  }

  .console-row.bottom {
    gap: 4px;
  }

  .hotbar-svg-icon {
    width: 24px;
    height: 24px;
  }

  .hotkey-icon-text {
    width: 24px;
    height: 24px;
    font-size: 17px;
  }

  .enemy-status-panel {
    top: 96px;
    width: min(88vw, 320px);
  }
}

/* ---- online login panel (multiplayer) ---- */
.hidden {
  display: none !important;
}

#buff-text:empty { display: none; }

.tower-selection-population {
  margin: 4px 0 10px;
  color: #9bd4bb;
  font-size: 13px;
}

.login-card {
  max-width: 420px;
  margin: 0 auto 18px;
  padding: 18px 20px;
  border: 1px solid rgba(200, 170, 110, 0.35);
  border-radius: 8px;
  background: rgba(20, 14, 10, 0.78);
}

.login-card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.login-user {
  margin-left: auto;
  margin-right: 8px;
  align-self: center;
  font-size: 0.85rem;
  color: #d8c7a1;
  opacity: 0.85;
}

/* ---- online counter (title screen) ---- */
.online-count {
  margin-left: auto;
  align-self: center;
  font-size: 0.85rem;
  color: #9fd8a5;
  letter-spacing: 0.04em;
}

.online-count:empty {
  display: none;
}

.online-count + .login-user {
  margin-left: 12px;
}

/* ---- in-game chat ---- */
.chat-panel {
  position: fixed;
  left: 16px;
  bottom: 172px;
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 40;
  pointer-events: none;
  font-family: "Noto Serif TC", "Cinzel", serif;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.chat-line {
  font-size: 13px;
  line-height: 1.35;
  color: #f1e8d2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
  transition: opacity 0.6s ease;
  word-break: break-word;
}

.chat-name {
  color: #ffd27d;
}

.chat-row {
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
}

.chat-toggle {
  padding: 4px 10px;
  border: 1px solid rgba(200, 170, 110, 0.55);
  border-radius: 4px;
  background: rgba(20, 14, 10, 0.75);
  color: #e8d9b5;
  font-size: 12px;
  cursor: pointer;
}

.chat-toggle:hover {
  background: rgba(60, 44, 24, 0.85);
}

.chat-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid rgba(200, 170, 110, 0.7);
  border-radius: 4px;
  background: rgba(10, 8, 6, 0.88);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.chat-input:focus {
  border-color: #ffd27d;
}

.online-count.offline {
  color: #b39a8a;
}

/* ---- mercenary hire / rejoin / dismiss menu ---- */
.mercenary-menu {
  position: fixed;
  z-index: 96;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 270px;
  padding: 12px 14px;
  border: 1px solid #8a6d3f;
  background: rgba(12, 9, 6, 0.96);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  font-family: "Noto Serif TC", serif;
  color: #e9dab8;
}

.mercenary-menu.open {
  display: flex;
}

.mercenary-menu-title {
  font-family: Cinzel, "Noto Serif TC", serif;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.04em;
}

.mercenary-menu-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.mercenary-menu-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mercenary-menu-row span {
  color: #b9a67f;
}

.mercenary-menu-status {
  font-size: 13px;
  color: #ffd27d;
  text-align: center;
  padding: 5px 0;
  border-top: 1px dashed #5a4630;
  border-bottom: 1px dashed #5a4630;
}

.mercenary-menu-status.warn {
  color: #ff8a8a;
}

.mercenary-menu-actions {
  display: flex;
  gap: 6px;
}

.mercenary-menu-actions .inventory-action-btn {
  flex: 1;
}

.mercenary-menu-actions .inventory-action-btn.primary {
  border-color: #d2a560;
  color: #ffe1a6;
}

.mercenary-menu-actions .inventory-action-btn.danger {
  border-color: #a04a3c;
  color: #ff9d8a;
}

.mercenary-menu-actions .inventory-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
