:root {
  color-scheme: dark;
  --bg: #17130f;
  --panel: #241c15;
  --panel-light: #30251c;
  --surface-menu: #241c15;
  --surface-menu-raised: #2e241a;
  --text: #f8ead7;
  --muted: #c5aa8b;
  --accent: #d8a64f;
  --accent-dark: #8f6124;
  --danger: #c75f46;
  --success: #77b76d;
  --border: #463424;
  --cream: #f8ead7;
  --cream-light: #fff8e6;
  --cream-mid: #f4e0b4;
  --cream-panel: #f8f0e1;
  --button-text: #2a2018;
  --button-text-muted: rgba(42, 32, 24, 0.68);
  --button-bg: linear-gradient(180deg, rgba(255, 248, 230, 0.98) 0%, rgba(244, 224, 180, 0.96) 100%);
  --button-bg-hover: linear-gradient(180deg, #fffdf5 0%, #f8e8c8 100%);
  --button-bg-active: linear-gradient(180deg, rgba(252, 235, 198, 0.98) 0%, rgba(232, 196, 132, 0.96) 100%);
  --button-border: rgba(143, 97, 36, 0.42);
  --button-border-strong: rgba(143, 97, 36, 0.58);
  --button-border-active: rgba(143, 97, 36, 0.72);
  --button-shadow: 0 8px 22px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --button-shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --button-shadow-active: 0 0 0 1px rgba(216, 166, 79, 0.22), 0 10px 24px rgba(120, 72, 18, 0.14);
  --button-danger-bg: linear-gradient(180deg, rgba(255, 242, 236, 0.98) 0%, rgba(248, 210, 198, 0.96) 100%);
  --button-danger-border: rgba(199, 95, 70, 0.55);
  --button-danger-text: #4a2018;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(216, 166, 79, 0.18), transparent 30rem),
    linear-gradient(135deg, #17130f 0%, #24160f 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 0.8rem;
  box-shadow: var(--button-shadow);
  color: var(--button-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1rem;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

button:hover:not(:disabled):not(.map-node):not(.placed-building):not(.text-button):not(.hud-level-link):not(.castle-crest-level-overlay):not(.castle-level-chip):not(.research-tree-node):not(.season-hall-speak):not(.season-hall-dialogue-advance):not(.season-hall-dialogue-action):not(.season-launcher--icon) {
  background: var(--button-bg-hover);
  border-color: var(--button-border-strong);
  box-shadow: var(--button-shadow-hover);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.map-node:disabled {
  cursor: pointer;
  opacity: 1;
}

button.map-node,
button.placed-building,
button.research-tree-node {
  box-shadow: none;
}

button.placed-building,
button.research-tree-node {
  background: transparent;
  border-radius: 0.35rem;
  color: inherit;
}

button.hud-level-link {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
  padding: 0;
}

.app {
  margin: 0 auto;
  max-width: 1180px;
  padding: 2rem;
}

.is-hidden {
  display: none !important;
}

.hero {
  align-items: center;
  background: linear-gradient(135deg, rgba(75, 49, 25, 0.85), rgba(36, 28, 21, 0.95));
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.hero h1,
.panel h2 {
  margin: 0;
}

.hero p {
  color: var(--muted);
  margin: 0.45rem 0 0;
  max-width: 58rem;
}

.eyebrow {
  color: var(--accent) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.2rem;
}

.primary-button {
  border-color: var(--button-border-strong);
  font-weight: 800;
  min-width: 11rem;
}

.secondary-button {
  min-width: auto;
}

.danger-button {
  background: var(--button-danger-bg);
  border-color: var(--button-danger-border);
  color: var(--button-danger-text);
}

.danger-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff5ef 0%, #f8c8b8 100%);
  border-color: rgba(199, 95, 70, 0.72);
}

.settings-subnav button.active,
.keep-side-menu button.active,
.round-table-subnav button.active,
.wiki-interface .wiki-category-tabs button.active,
.wiki-entry-button.active,
.castle-quest-toggle.is-open,
.castle-queue-toggle.is-open,
.castle-resource-toggle.is-open,
.castle-minigame-toggle.is-open,
.castle-menu-toggle[aria-expanded="true"] {
  background: var(--button-bg-active);
  border-color: var(--button-border-active);
  box-shadow: var(--button-shadow-active);
  color: var(--button-text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.button-row button {
  flex: 1;
  min-width: 7rem;
}

.menu-button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.menu-button-row button,
.menu-button-row .badge {
  min-width: auto;
}

.view-menu-card,
.map-menu-card {
  background: var(--surface-menu);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
}

.view-menu-card > span,
.map-menu-card > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-card {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(216, 166, 79, 0.12);
}

.resource-grid,
.card-list,
.land-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.two-columns {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.land-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-card,
.game-card,
.land-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.resource-card strong,
.game-card strong,
.land-card strong {
  display: block;
  font-size: 1.05rem;
}

.resource-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resource-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.resource-card-icon .resource-icon-img {
  width: 1.5rem;
  height: 1.5rem;
}

.resource-value {
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
  margin-top: 0.35rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.cost-row,
.stat-row {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.pill {
  background: rgba(216, 166, 79, 0.12);
  border: 1px solid rgba(216, 166, 79, 0.25);
  border-radius: 99rem;
  color: #f3d39d;
  padding: 0.25rem 0.5rem;
}

.pill.pill-class {
  background: rgba(120, 170, 255, 0.16);
  border-color: rgba(120, 170, 255, 0.4);
  color: #cfe0ff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.counter-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  margin: 0.35rem 0 0;
  line-height: 1.35;
}

.research-queue.is-empty {
  opacity: 0.92;
}

.research-card.research-active {
  border-color: rgba(216, 166, 79, 0.45);
}

.research-card-progress {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.35rem 0 0.5rem;
}

.demolish-controls {
  border-top: 1px solid rgba(216, 166, 79, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.building-rotation-controls {
  border-top: 1px solid rgba(216, 166, 79, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
}

.building-rotation-controls .button-row {
  margin: 0;
}

.demolish-hint {
  font-size: 0.82rem;
  margin: 0;
}

.demolish-button {
  align-self: flex-start;
  font-size: 0.82rem;
  min-width: auto;
  padding: 0.35rem 0.7rem;
  width: auto;
}

.demolish-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.demolish-confirm p {
  margin: 0;
}

.demolish-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.training-queue {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.training-queue-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.training-active {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.training-active-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.9rem;
}

.progress-track {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(216, 166, 79, 0.2);
  border-radius: 99rem;
  height: 0.85rem;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  background: linear-gradient(90deg, #b9812f, #f3d39d);
  border-radius: inherit;
  height: 100%;
  transition: width 0.4s linear;
}

.training-waiting {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.training-queue-summary {
  margin: 0;
}

.training-waiting-item {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.training-waiting-name {
  font-weight: 600;
}

.text-button {
  background: none;
  border: none;
  color: #e8a86b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  text-decoration: underline;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.section-heading p {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.badge {
  background: rgba(119, 183, 109, 0.14);
  border: 1px solid rgba(119, 183, 109, 0.3);
  border-radius: 99rem;
  color: #b9efb1;
  font-weight: 800;
  padding: 0.55rem 0.8rem;
  white-space: nowrap;
}

.badge.badge-danger {
  background: rgba(217, 122, 108, 0.16);
  border-color: rgba(217, 122, 108, 0.4);
  color: #ffcabf;
}

.world-map {
  aspect-ratio: 5 / 2;
  cursor: grab;
  background:
    linear-gradient(rgba(216, 166, 79, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 166, 79, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(119, 183, 109, 0.18), transparent 20rem),
    radial-gradient(circle at 82% 18%, rgba(85, 118, 155, 0.2), transparent 16rem),
    radial-gradient(circle at 12% 72%, rgba(180, 140, 90, 0.16), transparent 14rem),
    radial-gradient(circle at 78% 82%, rgba(119, 183, 109, 0.14), transparent 18rem),
    #1d2a1d;
  background-size:
    4% 4%,
    4% 4%,
    auto,
    auto,
    auto,
    auto,
    auto;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.45);
  margin-top: 1rem;
  min-height: 58rem;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.app.is-world-view {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.is-world-view {
  overflow: hidden;
}

.app.is-world-view .hero {
  display: none;
}

.app.is-world-view #worldPanel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.app.is-world-view #worldPanel .section-heading {
  display: none;
}

.app.is-world-view .world-map {
  aspect-ratio: unset;
  background: #0f160f;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.world-map.is-panning {
  cursor: grabbing;
  user-select: none;
}

.world-map-markers-layer {
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.world-map-markers-layer .map-node,
.world-map-markers-layer .map-troop-marker,
.world-map-markers-layer .map-troop-detail-panel,
.world-map-markers-layer .map-region-label {
  pointer-events: auto;
}

.map-region-label {
  color: rgba(216, 166, 79, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  left: var(--map-x);
  letter-spacing: 0.14em;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  top: var(--map-y);
  transform: translate(-50%, -50%);
  z-index: 4;
}

.map-node.interest-point {
  border-color: rgba(216, 166, 79, 0.55);
  height: 3.2rem;
  width: 3.2rem;
  z-index: 6;
}

.map-node.interest-point.region-north {
  background: rgba(120, 170, 210, 0.22);
  border-color: rgba(140, 190, 230, 0.55);
}

.map-node.interest-point.region-south {
  background: rgba(210, 160, 90, 0.2);
  border-color: rgba(220, 180, 110, 0.55);
}

.map-node.interest-point.region-east {
  background: rgba(170, 120, 90, 0.2);
  border-color: rgba(190, 140, 100, 0.55);
}

.map-node.interest-point.region-west {
  background: rgba(140, 170, 120, 0.2);
  border-color: rgba(160, 190, 130, 0.55);
}

.map-node.interest-point.player-main {
  box-shadow:
    0 0 14px rgba(119, 183, 109, 0.45),
    inset 0 0 12px rgba(119, 183, 109, 0.2);
}

.map-node.interest-point.neutral-held {
  opacity: 0.92;
}

.interest-point-interface .badge {
  text-transform: none;
}

.world-map.has-map-texture {
  background-color: #0f160f;
}

.world-map-texture-layer {
  background-position: 0 0;
  background-repeat: repeat;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.world-map.has-map-texture .map-hud,
.world-map.has-map-texture .map-axis,
.world-map.has-map-texture .world-map-markers-layer .map-node,
.world-map.has-map-texture .world-map-markers-layer .map-troop-routes,
.world-map.has-map-texture .world-map-markers-layer .map-troop-marker,
.world-map.has-map-texture .world-map-markers-layer .map-region-label {
  position: absolute;
}

.world-map.has-map-texture .map-hud {
  z-index: 10;
}

.map-node.has-map-texture {
  background: transparent;
  border-color: rgba(216, 166, 79, 0.55);
  height: 3.6rem;
  overflow: hidden;
  width: 3.6rem;
}

.map-node.land.has-map-texture.land-owned-player,
.map-node.land.has-map-texture.player-owned,
.map-node.land.has-map-texture.conquered,
.map-node.land.has-map-texture.land-owned-alliance {
  border: 3px solid #4fd4a0;
  box-shadow:
    0 0 0 2px rgba(79, 212, 160, 0.55),
    0 0 16px rgba(79, 212, 160, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.map-node.land.has-map-texture.land-owned-enemy,
.map-node.land.has-map-texture.npc-owned {
  border: 3px solid #e85a4a;
  box-shadow:
    0 0 0 2px rgba(232, 90, 74, 0.55),
    0 0 16px rgba(232, 90, 74, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.map-node.land.has-map-texture.conquerable {
  border: 2px solid rgba(201, 168, 106, 0.9);
  box-shadow:
    0 0 0 1px rgba(201, 168, 106, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.3);
}

.map-node.has-map-texture.map-node-compact .map-label {
  display: none;
}

.map-node.has-map-texture .map-icon {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.map-node-texture-layer {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: inherit;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.map-troop-marker.has-map-texture {
  background: transparent;
  border: none;
  box-shadow: none;
  height: 80px;
  overflow: visible;
  width: 80px;
}

.map-troop-marker.has-map-texture .map-troop-texture-wrap {
  background: transparent;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
  height: 100%;
  line-height: 0;
  pointer-events: none;
  transform: rotate(var(--troop-heading, 0deg)) scale(1.08);
  transform-origin: center center;
  width: 100%;
}

.map-troop-marker.has-map-texture .map-troop-texture-img {
  display: block;
  height: 100%;
  image-rendering: pixelated;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}

.map-troop-marker.has-map-texture .map-troop-texture-layer {
  display: none;
}

.map-troop-marker.has-map-texture .map-troop-icon {
  display: none;
}

.map-troop-texture-layer {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.map-hud {
  align-items: flex-start;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, auto));
  left: 1rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 10;
}

.map-world-boss-timer {
  background: rgba(18, 12, 10, 0.82);
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.15rem;
  min-width: 8.5rem;
  padding: 0.55rem 0.7rem;
  pointer-events: none;
}

.map-world-boss-timer span {
  color: rgba(248, 234, 215, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.map-world-boss-timer strong {
  color: #f3d38b;
  font-size: 0.95rem;
  line-height: 1.2;
}

.map-world-boss-timer.is-active {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.15);
}

.map-world-boss-timer.is-active strong {
  color: #ffe7a8;
}

.map-menu-launcher {
  position: relative;
}

.map-menu-toggle {
  min-width: 6.5rem;
}

.map-menu-dropdown {
  background: var(--surface-menu);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
  min-width: 12rem;
  padding: 0.65rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
}

.map-menu-dropdown button {
  justify-content: center;
  width: 100%;
}

.retreat-toggle {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.retreat-settings-interface .settings-field input[type="number"] {
  width: 100%;
}

.map-date,
.map-resource-bar,
.map-army,
.map-capital-hud,
.map-menu-card {
  background: var(--surface-menu);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding: 0.65rem 0.8rem;
}

.map-date span,
.map-army span,
.map-capital-hud span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-date strong,
.map-army strong,
.map-capital-hud strong {
  color: var(--accent);
  display: block;
  font-size: 1rem;
  margin-top: 0.1rem;
}

.map-capital-hud {
  appearance: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.map-capital-hud:hover {
  border-color: #f5d889;
  transform: translateY(-1px);
}

.map-resource-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.hud-resource {
  background: rgba(216, 166, 79, 0.12);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 99rem;
  color: var(--text);
  padding: 0.35rem 0.55rem;
  position: relative;
}

.hud-resource strong {
  color: var(--accent);
  margin-right: 0.25rem;
}

.resource-with-tooltip {
  cursor: help;
}

.resource-with-tooltip::after {
  content: "";
  display: none;
  height: 0.85rem;
  left: 50%;
  pointer-events: auto;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  width: max(100%, 17rem);
  z-index: 39;
}

.resource-with-tooltip:hover::after,
.resource-with-tooltip.is-tooltip-open::after,
.resource-with-tooltip:focus-within::after {
  display: block;
}

.hud-resource-row .resource-with-tooltip::after {
  bottom: 100%;
  height: 0.85rem;
  top: auto;
}

.hud-resource-row .resource-tooltip {
  bottom: calc(100% + 0.35rem);
  top: auto;
  transform: translateX(-50%) translateY(0.25rem);
}

.hud-resource-row .resource-with-tooltip:hover .resource-tooltip,
.hud-resource-row .resource-with-tooltip.is-tooltip-open .resource-tooltip,
.hud-resource-row .resource-with-tooltip:focus-within .resource-tooltip {
  transform: translateX(-50%) translateY(0);
}

.resource-tooltip {
  background: rgba(23, 19, 15, 0.96);
  border: 1px solid rgba(216, 166, 79, 0.3);
  border-radius: 0.9rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  color: var(--text);
  display: grid;
  gap: 0.4rem;
  left: 50%;
  max-height: min(70vh, 28rem);
  max-width: min(22rem, calc(100vw - 1.5rem));
  min-width: 17rem;
  opacity: 0;
  overflow-y: auto;
  padding: 0.8rem;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%) translateY(-0.25rem);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  z-index: 40;
}

.resource-tooltip-section {
  border-top: 1px solid rgba(216, 166, 79, 0.14);
  display: grid;
  gap: 0.28rem;
  padding-top: 0.45rem;
}

.resource-tooltip-section-title {
  color: rgba(216, 166, 79, 0.92);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resource-tooltip-source {
  align-items: baseline;
  display: grid;
  gap: 0.2rem 0.55rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.resource-tooltip-source-label {
  color: rgba(248, 234, 215, 0.88);
  font-size: 0.8rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.resource-tooltip-source strong {
  color: #f8ead7;
  font-size: 0.78rem;
  white-space: nowrap;
}

.resource-tooltip-section.is-income .resource-tooltip-source strong {
  color: #9fd6a8;
}

.resource-tooltip-section.is-expense .resource-tooltip-source strong {
  color: #e8a0a0;
}

.resource-with-tooltip:hover .resource-tooltip,
.resource-with-tooltip.is-tooltip-open .resource-tooltip,
.resource-with-tooltip:focus-within .resource-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tooltip-title {
  color: var(--accent);
  font-weight: 900;
}

.resource-progress {
  background: rgba(248, 234, 215, 0.12);
  border-radius: 99rem;
  height: 0.5rem;
  overflow: hidden;
}

.resource-progress span {
  animation: resourcePulse 2.8s ease-in-out infinite;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 65%;
}

.resource-calculator {
  color: var(--muted);
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.resource-calculator input {
  background: rgba(248, 234, 215, 0.08);
  border: 1px solid rgba(248, 234, 215, 0.16);
  border-radius: 0.55rem;
  color: var(--text);
  padding: 0.4rem 0.5rem;
}

@keyframes resourcePulse {
  0% {
    transform: translateX(-55%);
  }

  50% {
    transform: translateX(20%);
  }

  100% {
    transform: translateX(105%);
  }
}

.map-next-day {
  min-width: 0;
  white-space: nowrap;
}

.land-map {
  min-height: 34rem;
}

.map-node {
  align-items: center;
  background: rgba(36, 28, 21, 0.92);
  border: 2px solid var(--accent);
  border-radius: 999rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  height: 2.45rem;
  justify-content: center;
  left: var(--map-x);
  position: absolute;
  top: var(--map-y);
  transform: translate(-50%, -50%);
  width: 2.45rem;
  z-index: 4;
}

.map-troop-routes {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.map-troop-route-bg {
  stroke: rgba(248, 234, 215, 0.28);
  stroke-dasharray: 1.6 1.1;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}

.map-troop-route-bg--attack {
  stroke: rgba(240, 184, 74, 0.35);
}

.map-troop-route-bg--garrison {
  stroke: rgba(79, 212, 160, 0.35);
}

.map-troop-route-bg--return,
.map-troop-route-bg--withdraw {
  stroke: rgba(94, 176, 240, 0.35);
}

.map-troop-route-bg--escort {
  stroke: rgba(232, 192, 96, 0.35);
}

.map-troop-route-bg--goblin {
  stroke: rgba(144, 240, 96, 0.35);
}

.map-troop-route-bg--siege {
  stroke: rgba(255, 140, 64, 0.35);
}

.map-troop-route-bg--enemy,
.map-troop-route-bg--raid,
.map-troop-route-bg--goblin-enemy {
  stroke: rgba(255, 96, 80, 0.38);
}

.map-troop-route-progress {
  stroke-linecap: round;
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}

.map-troop-route-progress--attack {
  stroke: #f0b84a;
}

.map-troop-route-progress--garrison {
  stroke: #4fd4a0;
}

.map-troop-route-progress--return,
.map-troop-route-progress--withdraw {
  stroke: #5eb0f0;
}

.map-troop-route-progress--escort {
  stroke: #e8c060;
}

.map-troop-route-progress--goblin {
  stroke: #90f060;
}

.map-troop-route-progress--siege {
  stroke: #ff8c40;
}

.map-troop-route-progress--raid,
.map-troop-route-progress--goblin-enemy {
  stroke: #ff6050;
}

.map-troop-route-progress--player {
  stroke: rgba(216, 166, 79, 0.88);
}

.map-troop-route-progress--enemy {
  stroke: rgba(220, 90, 70, 0.9);
}

.map-troop-marker {
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  height: 80px;
  justify-content: center;
  left: var(--map-x);
  padding: 0;
  pointer-events: auto;
  position: absolute;
  top: var(--map-y);
  touch-action: manipulation;
  transform: translate(-50%, -50%);
  width: 80px;
  z-index: 5;
}

.map-troop-marker:focus,
.map-troop-marker:focus-visible {
  outline: none;
}

.map-troop-marker.has-map-texture:focus,
.map-troop-marker.has-map-texture:focus-visible,
.map-troop-marker.has-map-texture:active {
  background: transparent;
}

.map-troop-marker:not(.has-map-texture) {
  border-radius: 999rem;
  height: 2.45rem;
  width: 2.45rem;
}

.map-troop-marker--player:not(.has-map-texture) {
  background: rgba(36, 28, 21, 0.94);
  border: 2px solid rgba(216, 166, 79, 0.85);
  box-shadow: 0 0 10px rgba(216, 166, 79, 0.35);
}

.map-troop-marker--enemy:not(.has-map-texture) {
  animation: troop-marker-pulse 1.5s ease-in-out infinite;
  background: rgba(48, 16, 12, 0.94);
  border: 2px solid rgba(220, 90, 70, 0.85);
  box-shadow: 0 0 12px rgba(220, 90, 70, 0.35);
}

.map-troop-marker--selected.has-map-texture {
  z-index: 7;
}

.map-troop-count {
  background: rgba(12, 10, 8, 0.9);
  border: 1px solid rgba(248, 234, 215, 0.55);
  border-radius: 999rem;
  bottom: -0.15rem;
  color: #f8ead7;
  font-size: 0.58rem;
  font-weight: 800;
  left: 50%;
  line-height: 1;
  min-width: 1.15rem;
  padding: 0.12rem 0.28rem;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  z-index: 1;
}

.map-troop-marker--selected {
  z-index: 6;
}

.map-troop-marker--selected.has-map-texture .map-troop-texture-wrap {
  filter: drop-shadow(0 0 10px rgba(216, 166, 79, 0.55)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
  transform: rotate(var(--troop-heading, 0deg)) scale(1.14);
}

.map-troop-marker--selected:not(.has-map-texture) {
  box-shadow: 0 0 12px rgba(216, 166, 79, 0.55);
}

.map-troop-marker--enemy.has-map-texture .map-troop-texture-wrap {
  animation: troop-texture-pulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 96, 80, 0.45)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
}

.map-troop-icon {
  color: #f8ead7;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.map-troop-marker--enemy .map-troop-icon {
  color: #ffc8bf;
}

.map-troop-detail-panel {
  background: rgba(248, 240, 225, 0.96);
  border: 1px solid rgba(216, 166, 79, 0.55);
  border-radius: 0.9rem;
  bottom: 5.5rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  color: #2a2118;
  display: grid;
  gap: 0.55rem;
  max-width: min(22rem, 42vw);
  padding: 0.75rem 0.85rem;
  pointer-events: auto;
  position: absolute;
  right: 1rem;
  z-index: 12;
}

.map-troop-detail-header {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.map-troop-detail-header strong {
  display: block;
  font-size: 0.95rem;
}

.map-troop-detail-subtitle {
  color: rgba(42, 32, 24, 0.62);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.map-troop-detail-close {
  font-size: 1.25rem;
  line-height: 1;
  min-width: 1.75rem;
  padding: 0.1rem 0.35rem;
}

.map-troop-detail-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.map-troop-detail-breakdown .pill {
  background: rgba(216, 166, 79, 0.18);
  border-color: rgba(216, 166, 79, 0.45);
  color: #2a2118;
}

@keyframes troop-marker-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes troop-texture-pulse {
  0%,
  100% {
    transform: rotate(var(--troop-heading, 0deg)) scale(1);
  }
  50% {
    transform: rotate(var(--troop-heading, 0deg)) scale(1.08);
  }
}

.map-node.loot-goblin.contested {
  animation: loot-goblin-contested-pulse 1.2s ease-in-out infinite;
  border-color: rgba(220, 120, 70, 0.85);
}

@keyframes loot-goblin-contested-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(220, 120, 70, 0.35);
  }
  50% {
    box-shadow: 0 0 16px rgba(220, 120, 70, 0.55);
  }
}

.map-node.loot-goblin {
  animation: loot-goblin-pulse 1.4s ease-in-out infinite;
  border-color: var(--loot-goblin-color, rgba(120, 210, 90, 0.75));
  box-shadow: 0 0 12px color-mix(in srgb, var(--loot-goblin-color, #78d25a) 35%, transparent);
}

.map-node.loot-goblin--common {
  --loot-goblin-color: #9ca3af;
}

.map-node.loot-goblin--uncommon {
  --loot-goblin-color: #22c55e;
}

.map-node.loot-goblin--rare {
  --loot-goblin-color: #3b82f6;
}

.map-node.loot-goblin--epic {
  --loot-goblin-color: #a855f7;
}

.map-node.loot-goblin--legendary {
  --loot-goblin-color: #f59e0b;
  animation: loot-goblin-legendary-pulse 1.1s ease-in-out infinite;
}

.map-node.loot-goblin .map-icon {
  background: linear-gradient(135deg, color-mix(in srgb, var(--loot-goblin-color, #4a8f3a) 72%, #000), var(--loot-goblin-color, #9fe07a));
  color: #102008;
}

.map-node.npc-caravan {
  animation: npc-caravan-pulse 2s ease-in-out infinite;
  border-color: rgba(212, 168, 67, 0.65);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.28);
  z-index: 3;
}

.map-node.npc-caravan.has-map-texture {
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  height: 5rem;
  width: 5rem;
}

.map-node.npc-caravan.has-map-texture .map-node-texture-layer {
  background-size: 115% auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.map-node.npc-caravan .map-icon {
  background: linear-gradient(135deg, #8b6914, #d4a843);
  color: #1a1208;
}

.map-node.barbarian-camp {
  animation: barbarian-camp-pulse 1.8s ease-in-out infinite;
  border-color: rgba(191, 89, 48, 0.78);
  box-shadow: 0 0 13px rgba(191, 70, 40, 0.32);
  z-index: 4;
}

.map-node.barbarian-camp.has-map-texture {
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  height: 4.8rem;
  width: 4.8rem;
}

.map-node.barbarian-camp.has-map-texture .map-node-texture-layer {
  background-size: 115% auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.map-node.barbarian-camp.under-raid {
  border-color: rgba(242, 181, 68, 0.9);
  box-shadow: 0 0 18px rgba(242, 181, 68, 0.48);
}

.map-node.barbarian-camp.already-raided {
  animation: none;
  filter: grayscale(0.7);
  opacity: 0.68;
}

.map-node.barbarian-camp .map-icon {
  background: linear-gradient(135deg, #5e2518, #c76835);
  color: #fff0d4;
}

.barbarian-camp-interface {
  border-color: rgba(191, 89, 48, 0.42);
}

.map-node.season-rift {
  animation: season-rift-pulse 2.2s ease-in-out infinite;
  border-color: rgba(173, 92, 255, 0.85);
  box-shadow: 0 0 18px rgba(139, 65, 219, 0.48);
  z-index: 5;
}

.map-node.season-rift.has-map-texture {
  background: transparent;
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  height: 4.8rem;
  width: 4.8rem;
}

.map-node.season-rift.has-map-texture .map-node-texture-layer {
  background-size: 115% auto;
  filter: drop-shadow(0 0 14px rgba(231, 54, 32, 0.55));
}

.map-node.season-rift--hell.has-map-texture .map-node-texture-layer {
  filter: drop-shadow(0 0 16px rgba(231, 54, 32, 0.62));
}

.map-node.season-rift--heaven.has-map-texture .map-node-texture-layer {
  filter: drop-shadow(0 0 16px rgba(100, 190, 255, 0.62));
}

.map-node.season-rift--heaven {
  border-color: rgba(151, 213, 255, 0.9);
  box-shadow: 0 0 20px rgba(100, 190, 255, 0.5);
}

.map-node.season-rift--hell {
  border-color: rgba(255, 91, 70, 0.9);
  box-shadow: 0 0 20px rgba(231, 54, 32, 0.5);
}

.map-node.season-rift--boss.has-map-texture {
  height: 5.5rem;
  width: 5.5rem;
}

.map-node.season-rift--boss.season-rift--hell.has-map-texture .map-node-texture-layer {
  filter: drop-shadow(0 0 20px rgba(231, 54, 32, 0.72));
}

.map-node.season-rift--boss.season-rift--heaven.has-map-texture .map-node-texture-layer {
  filter: drop-shadow(0 0 20px rgba(100, 190, 255, 0.72));
}

.map-node.season-rift.is-locked {
  filter: grayscale(0.55);
  opacity: 0.76;
}

.map-node.season-rift .map-icon {
  background: radial-gradient(circle at 35% 30%, #eee1ff, #7c35ad 45%, #241033);
  color: #fff;
}

.map-node.season-rift--heaven .map-icon {
  background: radial-gradient(circle at 35% 30%, #fff, #70bfe9 48%, #244b75);
}

.map-node.season-rift--hell .map-icon {
  background: radial-gradient(circle at 35% 30%, #ffd4ad, #bd3929 48%, #42120f);
}

.season-rift-interface {
  border-color: rgba(151, 93, 211, 0.5);
}

.map-node.season-territory {
  border-color: rgba(203, 166, 84, 0.9);
  box-shadow: 0 0 16px rgba(203, 166, 84, 0.42);
  z-index: 4;
}

.map-node.season-territory .map-icon {
  background: radial-gradient(circle at 35% 30%, #fff1b9, #a47625 52%, #3d2910);
  color: #fff9df;
}

.map-node.season-territory--heaven {
  border-color: rgba(151, 213, 255, 0.95);
}

.map-node.season-territory--hell {
  border-color: rgba(255, 91, 70, 0.95);
}

.season-territory-interface {
  border-color: rgba(203, 166, 84, 0.55);
}

.season-rift-hp {
  background: rgba(16, 9, 24, 0.75);
  border: 1px solid rgba(220, 188, 255, 0.35);
  border-radius: 999px;
  height: 0.8rem;
  margin: 0.8rem 0 1rem;
  overflow: hidden;
}

.season-rift-hp > span {
  background: linear-gradient(90deg, #8f36c7, #dd78ff);
  display: block;
  height: 100%;
  transition: width 240ms ease;
}

@keyframes season-rift-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.07);
  }
}

@keyframes barbarian-camp-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.055);
  }
}

@keyframes npc-caravan-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes loot-goblin-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes loot-goblin-legendary-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 14px color-mix(in srgb, var(--loot-goblin-color, #f59e0b) 45%, transparent);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 22px color-mix(in srgb, var(--loot-goblin-color, #f59e0b) 65%, transparent);
  }
}

.menu-badge.loot-goblin--common {
  background: rgba(156, 163, 175, 0.22);
  border-color: rgba(156, 163, 175, 0.55);
}

.menu-badge.loot-goblin--uncommon {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.55);
}

.menu-badge.loot-goblin--rare {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.55);
}

.menu-badge.loot-goblin--epic {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.55);
}

.menu-badge.loot-goblin--legendary {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.65);
}

.loot-goblin-rarity-badge--common {
  background: rgba(156, 163, 175, 0.18);
  border-color: rgba(156, 163, 175, 0.45);
}

.loot-goblin-rarity-badge--uncommon {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
}

.loot-goblin-rarity-badge--rare {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
}

.loot-goblin-rarity-badge--epic {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.45);
}

.loot-goblin-rarity-badge--legendary {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.55);
}

.loot-goblin-interface--legendary {
  border-color: rgba(245, 158, 11, 0.45);
}

.loot-goblin-interface--epic {
  border-color: rgba(168, 85, 247, 0.4);
}

.loot-goblin-interface--rare {
  border-color: rgba(59, 130, 246, 0.35);
}

.map-node.castle {
  background: #4c2d1b;
  border-color: #f0c16e;
}

.map-node.server-capital {
  background: radial-gradient(circle at 35% 30%, #8b6a2d 0%, #4e321b 58%, #24170f 100%);
  border-color: #f5d889;
  box-shadow:
    0 0 0 4px rgba(245, 216, 137, 0.2),
    0 0 22px rgba(216, 166, 79, 0.48),
    0 12px 30px rgba(0, 0, 0, 0.42);
  height: 80px;
  width: 80px;
  z-index: 6;
}

.map-node.server-capital.has-map-texture {
  border-color: rgba(245, 216, 137, 0.85);
  box-shadow:
    0 0 0 3px rgba(245, 216, 137, 0.28),
    0 0 18px rgba(216, 166, 79, 0.42),
    0 10px 24px rgba(0, 0, 0, 0.38);
  height: 80px;
  width: 80px;
}

.map-node.server-capital .map-icon {
  color: #fff0bd;
  font-weight: 900;
}

.map-node.enemy-castle {
  background: #51251f;
  border-color: var(--danger);
}

.map-node.multiplayer-slot {
  background: #2a3550;
  border-color: #7aa2ff;
}

.map-node.multiplayer-slot.vacant {
  background: #2f3440;
  border-color: #8a93a8;
  opacity: 0.82;
}

.map-node.multiplayer-slot.owned {
  background: linear-gradient(160deg, #1f5a4a 0%, #163d4f 100%);
  border-color: #6fd4b0;
}

.map-node.multiplayer-slot.player-castle {
  box-shadow:
    0 0 0 3px rgba(111, 212, 176, 0.28),
    0 0 18px rgba(111, 212, 176, 0.42),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.map-node.multiplayer-slot.occupied {
  background: #4a2438;
  border-color: #e07a9a;
}

.map-node.land {
  background: #3a3528;
  border: 2px solid #c9a86a;
  box-shadow:
    0 0 0 2px rgba(201, 168, 106, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.32);
  color: #f0e2c8;
}

.map-node.land.land-owned-alliance {
  background: linear-gradient(160deg, #1f5a4a 0%, #163d4f 100%);
  border: 3px solid #4fd4a0;
  box-shadow:
    0 0 0 3px rgba(79, 212, 160, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.35);
  color: #dff8ef;
}

.map-node.land.land-owned-alliance .map-icon {
  color: #b8f5dc;
}

.map-node.land.land-owned-enemy {
  background: #4a1f22;
  border: 3px solid #e85a4a;
  box-shadow:
    0 0 0 3px rgba(232, 90, 74, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.35);
  color: #ffdcd4;
}

.map-node.land.land-owned-enemy .map-icon {
  color: #ff9f92;
}

.map-node.land.conquerable {
  background: #3a3528;
  border-color: #c9a86a;
}

.map-node.conquered,
.map-node.player-owned,
.map-node.land.land-owned-player {
  background: linear-gradient(160deg, #1f5a4a 0%, #163d4f 100%);
  border: 3px solid #4fd4a0;
  box-shadow:
    0 0 0 3px rgba(79, 212, 160, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.35);
  color: #dff8ef;
}

.map-node.player-owned .map-icon {
  color: #b8f5dc;
}

.map-node.special {
  background: #3a2159;
  border-color: #b57edc;
  box-shadow:
    0 0 0 3px rgba(181, 126, 220, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.35);
  color: #f0e3ff;
}

.map-node.special .map-icon {
  color: #e7d3ff;
  font-weight: 800;
}

.map-node.npc-owned,
.map-node.land.land-owned-enemy {
  background: #4a1f22;
  border: 3px solid #e85a4a;
  box-shadow:
    0 0 0 3px rgba(232, 90, 74, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.35);
  color: #ffdcd4;
}

.map-node.npc-owned .map-icon {
  color: #ffcabf;
}

.map-node.selected {
  box-shadow:
    0 0 0 4px rgba(216, 166, 79, 0.22),
    0 16px 34px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 5;
}

.map-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.map-label {
  background: rgba(23, 19, 15, 0.86);
  border: 1px solid rgba(248, 234, 215, 0.1);
  border-radius: 0.7rem;
  left: 50%;
  min-width: 8.8rem;
  padding: 0.45rem 0.55rem;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
}

.map-label strong {
  display: block;
  font-size: 0.82rem;
}

.map-label span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  margin-top: 0.1rem;
}

.map-label-compact {
  min-width: auto;
  padding: 0.35rem 0.5rem;
}

.map-label-compact strong {
  font-size: 0.78rem;
  white-space: nowrap;
}

.map-label-compact span {
  font-size: 0.68rem;
}

.map-node-compact .map-label-compact span:empty {
  display: none;
}

.battle-record-list,
.battle-record-incoming {
  display: grid;
  gap: 0.75rem;
}

.battle-record-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
}

.battle-record-card.victory {
  border-color: rgba(119, 183, 109, 0.45);
}

.battle-record-card.defeat {
  border-color: rgba(199, 95, 70, 0.45);
}

.battle-record-card.neutral {
  border-color: rgba(111, 143, 170, 0.35);
}

.battle-record-header {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.battle-record-header span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.battle-record-interface .interface-stat-grid {
  margin-bottom: 0.35rem;
}

.battle-unit-damage-panel {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 0.85rem;
  padding: 0.65rem 0.75rem;
}

.battle-unit-damage-panel summary {
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.battle-unit-damage-panel summary::-webkit-details-marker {
  display: none;
}

.battle-damage-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.75rem;
}

.battle-damage-phase-note {
  font-size: 0.86rem;
  margin: 0.45rem 0 0;
}

.battle-unit-damage-section {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.battle-unit-damage-section > strong {
  color: var(--accent);
  font-size: 0.88rem;
}

.battle-unit-damage-table-wrap {
  overflow-x: auto;
}

.battle-unit-damage-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 100%;
  width: max-content;
}

.battle-unit-damage-table th,
.battle-unit-damage-table td {
  border-bottom: 1px solid rgba(248, 234, 215, 0.08);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.battle-unit-damage-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.battle-unit-class {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.battle-unit-damage-hint,
.battle-unit-damage-empty {
  font-size: 0.78rem;
  margin: 0.55rem 0 0;
}

/* Hover affordance for explained battle metrics. */
.battle-unit-damage-table th.has-tooltip,
.battle-unit-damage-table td.has-tooltip,
.battle-damage-summary-grid .pill.has-tooltip {
  cursor: help;
}

.battle-unit-damage-table th.has-tooltip {
  text-decoration: underline dotted rgba(248, 234, 215, 0.4);
  text-underline-offset: 0.2rem;
}

.battle-unit-damage-table td.has-tooltip:hover,
.battle-unit-damage-table th.has-tooltip:hover {
  background: rgba(248, 234, 215, 0.06);
}

.battle-damage-summary-grid .pill.has-tooltip {
  border-bottom: 1px dashed rgba(248, 234, 215, 0.35);
}

.battle-damage-formula-note {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
}

.battle-damage-formula-note summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  list-style: none;
}

.battle-damage-formula-note summary::-webkit-details-marker {
  display: none;
}

.battle-damage-formula-steps {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}

.battle-damage-formula-steps li {
  font-size: 0.82rem;
  line-height: 1.35;
}

.battle-damage-formula-steps strong {
  color: var(--accent);
}

.map-axis {
  color: rgba(248, 234, 215, 0.5);
  font-size: 0.75rem;
  font-weight: 800;
  position: absolute;
  text-transform: uppercase;
}

.map-axis.x-axis {
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
}

.map-axis.y-axis {
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
}

.castle-details {
  margin-top: 1rem;
}

.castle-card {
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.1), transparent),
    var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.world-map .castle-card {
  bottom: 1rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  left: 1rem;
  max-width: min(44rem, calc(100% - 2rem));
  position: absolute;
  right: 1rem;
  z-index: 12;
}

.castle-card.enemy-castle {
  background:
    linear-gradient(135deg, rgba(199, 95, 70, 0.12), transparent),
    var(--panel-light);
}

.castle-card.server-capital {
  background:
    linear-gradient(135deg, rgba(245, 216, 137, 0.18), rgba(139, 106, 45, 0.08)),
    var(--panel-light);
  border-color: rgba(245, 216, 137, 0.48);
}

.castle-card.multiplayer-slot {
  background:
    linear-gradient(135deg, rgba(122, 162, 255, 0.12), transparent),
    var(--panel-light);
}

.castle-card.multiplayer-slot.vacant {
  background:
    linear-gradient(135deg, rgba(138, 147, 168, 0.1), transparent),
    var(--panel-light);
}

.castle-card.multiplayer-slot.owned {
  background:
    linear-gradient(135deg, rgba(111, 212, 176, 0.12), transparent),
    var(--panel-light);
}

.castle-card.multiplayer-slot.enemy {
  background:
    linear-gradient(135deg, rgba(224, 122, 154, 0.12), transparent),
    var(--panel-light);
}

.castle-card-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.castle-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.close-button {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  box-shadow: var(--button-shadow);
  color: var(--button-text);
  font-weight: 700;
  min-width: auto;
  padding: 0.45rem 0.65rem;
}

.close-button:hover:not(:disabled) {
  background: var(--button-bg-hover);
  border-color: var(--button-border-strong);
}

.castle-card h3 {
  font-size: 1.35rem;
  margin: 0.15rem 0 0;
}

.castle-stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 1rem 0;
}

.castle-stat {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.85rem;
}

.castle-stat span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.castle-stat strong {
  color: var(--accent);
  display: block;
  font-size: 1.45rem;
  margin-top: 0.15rem;
}

.castle-view-actions {
  align-items: stretch;
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.castle-hud {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  overflow: visible;
}

.hud-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hud-level-block {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 240px;
}

.hud-level-link {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 0.7rem;
  padding: 0;
  text-align: left;
}

.hud-level-link:hover .hud-level-badge {
  border-color: rgba(216, 166, 79, 0.65);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.25);
}

.hud-level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.8rem;
  background: linear-gradient(160deg, rgba(216, 166, 79, 0.35), rgba(111, 177, 224, 0.25));
  border: 1px solid rgba(216, 166, 79, 0.5);
}

.hud-level-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.hud-level-caption {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-xp {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.hud-xp-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.hud-xp-track {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.hud-xp-fill {
  display: block;
  height: 100%;
  border-radius: 99rem;
  background: linear-gradient(90deg, #6fb1e0, #d8a64f);
  transition: width 0.4s ease;
}

.hud-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.hud-chip {
  background: rgba(216, 166, 79, 0.12);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 99rem;
  padding: 0.35rem 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.hud-chip strong {
  color: var(--accent);
  margin-right: 0.3rem;
  font-weight: 800;
}

.hud-chip.hud-glory strong,
.hud-chip.hud-glory {
  color: #e6c14a;
}

.hud-chip.hud-emeralds strong,
.hud-chip.hud-emeralds {
  color: #2fae76;
}

.hud-resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: visible;
}

.castle-map-shell {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  position: relative;
}

.castle-view-screen,
.app.is-castle-view .castle-view-screen {
  width: 100%;
}

.app.is-castle-view {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.is-castle-view {
  overflow: hidden;
}

.app.is-castle-view .hero {
  display: none;
}

.app.is-castle-view #castlePanel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.app.is-castle-view .castle-map-shell {
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  padding: 4.25rem 1rem 5.5rem;
  width: 100%;
}

.app.is-castle-view .castle-map-stage {
  transform: translateY(-0.65rem);
}

.capital-map-scenery.has-capital-background {
  background-color: #2a3f5f;
}

.capital-map-shell.has-capital-scenery .castle-map-center-cluster {
  position: relative;
  z-index: 1;
}

.app.is-capital-view {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.is-capital-view {
  overflow: hidden;
}

.app.is-capital-view .hero {
  display: none;
}

.app.is-capital-view #capitalPanel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.app.is-capital-view .capital-view-screen {
  min-height: 100vh;
  width: 100%;
}

.app.is-capital-view .capital-map-shell {
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  padding: 5.25rem 1rem 5rem;
  position: relative;
  width: 100%;
}

.app.is-demon-view {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.is-demon-view {
  overflow: hidden;
}

.app.is-demon-view .hero {
  display: none;
}

.app.is-demon-view #demonPanel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.app.is-demon-view .demon-view-screen {
  min-height: 100vh;
  width: 100%;
}

.app.is-demon-view .demon-map-shell {
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  padding: 5.25rem 1rem 5rem;
  position: relative;
  width: 100%;
}

.demon-map-shell.has-demon-scenery .demon-castle-scenery {
  inset: 0;
  position: absolute;
  z-index: 0;
}

.demon-map-shell.has-demon-scenery .castle-map-center-cluster {
  position: relative;
  z-index: 1;
}

.demon-overlay-hud .demon-castle-hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  left: 0.85rem;
  position: absolute;
  top: 0.85rem;
}

.demon-placed-building.is-ruin {
  filter: saturate(0.45) brightness(0.72);
  opacity: 0.82;
}

.demon-placed-building.is-ruin.has-texture .building-texture-layer {
  filter: grayscale(0.35);
}

.demon-placed-building.demon-grid-keep-tile {
  --building-color: #4a0f1f;
}

.demon-view-screen--locked {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.demon-bottom-nav .demon-research-badge {
  position: absolute;
  right: -0.2rem;
  top: -0.2rem;
}

.demon-building-interface .interface-stat-grid {
  margin-bottom: 0.75rem;
}

.demon-shop-interface .demon-card-icon,
.demon-building-interface .demon-card-icon {
  border-radius: 0.55rem;
  display: block;
  height: 4.5rem;
  margin: 0 auto 0.5rem;
  object-fit: cover;
  width: 4.5rem;
}

.demon-march-planning-banner {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(74, 15, 31, 0.94), rgba(26, 8, 16, 0.96));
  border: 1px solid rgba(220, 90, 120, 0.45);
  border-radius: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  left: 50%;
  max-width: min(36rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  pointer-events: auto;
  position: fixed;
  top: 5.5rem;
  transform: translateX(-50%);
  width: 100%;
  z-index: 30;
}

.demon-march-planning-banner .eyebrow {
  color: #ffb3c7;
}

.demon-march-target-interface .demon-assault-units {
  display: grid;
  gap: 0.55rem;
}

.demon-battle-records-section .battle-record-list {
  max-height: 18rem;
  overflow-y: auto;
}

.castle-map-scenery.has-castle-background {
  background-color: #2f4f2a;
}

.castle-map-scenery-layer,
.harbor-map-scenery-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.map-scenery-image {
  display: block;
  height: 100%;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  object-fit: cover;
  object-position: center center;
  width: 100%;
}

.castle-map-scenery {
  background:
    radial-gradient(circle at 18% 82%, rgba(119, 183, 109, 0.35), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(85, 118, 155, 0.18), transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(45, 72, 38, 0.55), transparent 55%),
    linear-gradient(180deg, #5f9a4d 0%, #46753a 42%, #355f2f 100%);
  inset: 0;
  position: absolute;
  z-index: 0;
}

.castle-map-center-cluster {
  align-items: flex-start;
  display: flex;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.castle-map-stage {
  flex: 0 0 auto;
  max-width: none;
  position: relative;
  width: fit-content;
  z-index: 1;
}

.castle-layout-mode-rail {
  flex: 0 0 min(15.5rem, 26vw);
  max-width: 15.5rem;
  pointer-events: auto;
  position: sticky;
  top: 5.5rem;
  z-index: 2;
}

.castle-grid.is-virtual-grid {
  background-size:
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    auto;
}

.coord-inputs--corners {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.castle-overlay-hud {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 12;
}

.castle-overlay-hud > * {
  pointer-events: auto;
}

.castle-left-column {
  align-items: flex-start;
  bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  left: 0.85rem;
  pointer-events: none;
  position: absolute;
  top: 0.85rem;
  width: min(100%, 16rem);
  z-index: 13;
}

.castle-left-column > * {
  pointer-events: auto;
}

.castle-left-top {
  display: grid;
  gap: 0.55rem;
  position: relative;
  width: 100%;
}

.castle-left-bottom {
  display: grid;
  flex-shrink: 0;
  gap: 0.55rem;
  margin-top: auto;
  position: relative;
  width: 100%;
}

.castle-left-column .castle-account-panel {
  position: static;
}

.castle-left-column .castle-log-launcher {
  bottom: auto;
  left: auto;
  position: relative;
}

.castle-chat-panel {
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

.castle-chat-panel.is-collapsed {
  gap: 0;
  width: auto;
}

.castle-chat-panel.is-collapsed .castle-chat-list,
.castle-chat-panel.is-collapsed .castle-chat-form {
  display: none;
}

.castle-chat-panel.is-expanded {
  border-color: rgba(120, 72, 18, 0.42);
  box-shadow:
    0 0 0 1px rgba(120, 72, 18, 0.12),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

.castle-chat-head {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
}

.castle-chat-head-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.3rem;
}

.castle-chat-toggle {
  background: rgba(42, 32, 24, 0.08);
  border: 1px solid rgba(90, 70, 45, 0.24);
  border-radius: 0.45rem;
  color: #2a2018;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  min-width: 1.55rem;
  padding: 0.18rem 0.38rem;
}

.castle-chat-toggle[aria-pressed="true"] {
  background: rgba(120, 72, 18, 0.14);
  border-color: rgba(120, 72, 18, 0.42);
}

.castle-chat-head strong {
  font-size: 0.82rem;
}

.castle-chat-admin-badge {
  background: rgba(120, 72, 18, 0.14);
  border: 1px solid rgba(120, 72, 18, 0.35);
  border-radius: 999px;
  color: #6b3f12;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem;
  text-transform: uppercase;
}

.castle-chat-world-badge {
  background: rgba(31, 90, 74, 0.14);
  border: 1px solid rgba(111, 212, 176, 0.45);
  border-radius: 999px;
  color: #2f7a62;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem;
  text-transform: uppercase;
}

.castle-chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  list-style: none;
  margin: 0;
  max-height: 7.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  scroll-behavior: auto;
}

.castle-chat-panel.is-expanded .castle-chat-list {
  max-height: min(22rem, 42vh);
}

.castle-chat-item {
  display: grid;
  gap: 0.1rem;
  font-size: 0.74rem;
  line-height: 1.25;
}

.castle-chat-author {
  color: rgba(42, 32, 24, 0.62);
  font-size: 0.68rem;
  font-weight: 700;
}

.castle-chat-text {
  color: #2a2018;
  overflow-wrap: anywhere;
}

.castle-chat-system .castle-chat-author,
.castle-chat-system .castle-chat-text {
  color: rgba(42, 32, 24, 0.72);
  font-style: italic;
}

.castle-chat-command .castle-chat-author {
  color: #6b3f12;
}

.castle-chat-command .castle-chat-text {
  color: #4a3118;
}

.castle-chat-highlighted {
  border-left: 3px solid #c9a227;
  padding-left: 0.45rem;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.14), transparent 85%);
}

.castle-chat-highlighted .castle-chat-author {
  color: #8a6418;
  font-weight: 700;
}

.castle-chat-highlighted .castle-chat-text {
  color: #3d2f12;
  font-weight: 600;
}

.castle-chat-empty {
  color: rgba(42, 32, 24, 0.55);
  font-size: 0.74rem;
  font-style: italic;
  list-style: none;
}

.castle-chat-form {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.castle-chat-input {
  background: rgba(255, 252, 245, 0.95);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.45rem;
  color: #2a2018;
  font-size: 0.78rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
}

.castle-chat-input:focus {
  border-color: rgba(120, 72, 18, 0.55);
  outline: none;
}

.castle-chat-send {
  font-size: 0.74rem;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.castle-profile-header {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
}

.castle-profile-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.castle-player-name {
  color: #2a2018;
  font-size: 0.95rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.castle-name-label {
  color: rgba(42, 32, 24, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.castle-game-date {
  color: rgba(42, 32, 24, 0.72);
  display: grid;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 0.05rem;
  line-height: 1.15;
}

.castle-game-date-eta {
  color: rgba(42, 32, 24, 0.52);
  font-size: 0.66rem;
  font-weight: 600;
}

.castle-currency-stack {
  display: grid;
  gap: 0.3rem;
  width: 100%;
}

.castle-currency-stack .castle-currency-pill {
  justify-content: flex-start;
  width: 100%;
}

.castle-currency-label {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
}

.castle-log-launcher,
.castle-resource-launcher,
.castle-quest-launcher,
.castle-minigame-launcher {
  position: relative;
  width: 100%;
  z-index: 16;
}

.castle-log-launcher {
  z-index: 17;
}

.castle-resource-toggle,
.castle-minigame-toggle {
  align-items: flex-start;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 0.15rem;
  text-align: left;
  width: 100%;
}

.castle-resource-toggle--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
  width: auto;
}

.castle-resource-toggle-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-resource-toggle.is-open,
.castle-minigame-toggle.is-open,
.castle-quest-toggle.is-open {
  border-color: rgba(143, 97, 36, 0.65);
}

.castle-hud-toggle-label {
  font-size: 0.82rem;
  font-weight: 800;
}

.castle-hud-toggle-summary {
  color: var(--button-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.castle-quest-toggle-head {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
}

.castle-quest-toggle {
  display: grid;
  gap: 0.35rem;
  text-align: left;
  width: 100%;
}

.castle-quest-toggle--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
  width: auto;
}

.castle-quest-toggle-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-minigame-toggle--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
  width: auto;
}

.castle-minigame-toggle-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-minigame-icon-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-minigame-launcher.has-memory-alert .castle-minigame-toggle--icon {
  border-color: rgba(220, 90, 70, 0.85);
  box-shadow:
    var(--button-shadow),
    0 0 0 1px rgba(220, 90, 70, 0.25);
}

.castle-quest-icon-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-quest-launcher.has-claimable .castle-quest-toggle--icon {
  border-color: rgba(216, 166, 79, 0.85);
  box-shadow:
    var(--button-shadow),
    0 0 0 1px rgba(216, 166, 79, 0.25);
}

.castle-quest-toggle-head strong {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.castle-quest-preview {
  color: var(--button-text-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.castle-hud-dropdown {
  left: 0;
  max-height: min(70vh, 28rem);
  overflow: auto;
  position: absolute;
  right: auto;
  top: calc(100% + 0.45rem);
  width: min(100%, 18rem);
  z-index: 24;
}

.castle-resource-dropdown.castle-hud-dropdown {
  max-height: min(58vh, 19rem);
  width: min(100%, 13rem);
}

.castle-resource-dropdown {
  gap: 0.3rem;
  min-width: 11rem;
  padding: 0.42rem 0.48rem;
}

.castle-resource-dropdown .castle-menu-meta {
  gap: 0.12rem;
}

.castle-resource-dropdown .castle-menu-meta strong {
  font-size: 0.76rem;
}

.castle-resource-dropdown .castle-menu-meta .muted {
  font-size: 0.64rem;
  line-height: 1.2;
}

.castle-resource-dropdown .castle-resource-list--rows {
  gap: 0.24rem;
}

.castle-resource-dropdown .castle-resource-list--premium {
  margin-top: 0.22rem;
  padding-top: 0.28rem;
}

.castle-resource-dropdown .castle-resource-row {
  gap: 0.35rem;
  grid-template-columns: 1.35rem 1fr auto;
  padding: 0.24rem 0.38rem;
}

.castle-resource-dropdown .castle-resource-row-icon {
  height: 1.3rem;
  width: 1.3rem;
}

.castle-resource-dropdown .castle-resource-row-icon .resource-icon-img {
  height: 1.1rem;
  width: 1.1rem;
}

.castle-resource-dropdown .castle-resource-row-name {
  font-size: 0.64rem;
}

.castle-resource-dropdown .castle-resource-row-amount {
  font-size: 0.8rem;
}

.castle-resource-dropdown .castle-resource-row-rate {
  font-size: 0.58rem;
}

.castle-quest-dropdown .quest-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.castle-quest-dropdown .quest-list {
  gap: 0.55rem;
}

.castle-minigame-dropdown .castle-minigame-hint {
  font-size: 0.78rem;
  margin: 0;
}

.castle-minigame-toggle.has-memory-alert {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow:
    0 0 10px rgba(220, 90, 70, 0.2),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-resource-list {
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  color: #2a2018;
  display: grid;
  gap: 0.3rem;
  overflow: visible;
  padding: 0.45rem;
  width: 100%;
}

.castle-hud-dropdown .castle-resource-list {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.castle-resource-list .resource-tooltip {
  bottom: auto;
  color: var(--text);
  left: calc(100% + 0.45rem);
  top: 50%;
  transform: translateY(-50%) translateX(0.25rem);
}

.castle-resource-list .resource-with-tooltip:hover .resource-tooltip,
.castle-resource-list .resource-with-tooltip.is-tooltip-open .resource-tooltip,
.castle-resource-list .resource-with-tooltip:focus-within .resource-tooltip {
  transform: translateY(-50%) translateX(0);
}

.castle-resource-bar {
  align-items: center;
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.7rem;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: #2a2018;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding: 0.45rem 0.7rem;
}

.castle-resource-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 70, 45, 0.18);
  border-radius: 0.55rem;
  color: #2a2018;
  display: inline-flex;
  font-weight: 800;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  position: relative;
  width: 100%;
}

.castle-resource-pill strong {
  display: none;
}

.castle-resource-pill .castle-resource-label {
  display: none;
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
}

.castle-resource-side-item .castle-resource-label {
  display: inline;
}

.castle-resource-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1rem;
  line-height: 1;
}

.resource-icon-img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.item-icon-img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  display: block;
}

.item-icon-img--detail {
  width: 2.5rem;
  height: 2.5rem;
}

.treasury-consumable-detail-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.treasury-consumable-detail-head > div {
  display: flex;
  flex-direction: column;
}

.castle-resource-amount {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  margin-left: 0.35rem;
}

.castle-resource-rate {
  color: rgba(42, 32, 24, 0.58);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

.castle-resource-rate.is-positive {
  color: rgba(58, 120, 68, 0.92);
}

.castle-resource-rate.is-negative {
  color: rgba(170, 70, 55, 0.92);
}

.castle-resource-list .resource-with-tooltip::after {
  display: none;
}

.castle-resource-bar .resource-tooltip {
  bottom: calc(100% + 0.35rem);
  color: var(--text);
  top: auto;
  transform: translateX(-50%) translateY(0.25rem);
}

.castle-resource-bar .resource-with-tooltip::after {
  bottom: 100%;
  height: 0.85rem;
  top: auto;
}

.castle-resource-bar .resource-with-tooltip:hover .resource-tooltip,
.castle-resource-bar .resource-with-tooltip.is-tooltip-open .resource-tooltip,
.castle-resource-bar .resource-with-tooltip:focus-within .resource-tooltip {
  transform: translateX(-50%) translateY(0);
}

.castle-account-panel {
  align-items: stretch;
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  isolation: isolate;
  overflow: hidden;
  padding: 0.55rem;
  position: relative;
  width: 100%;
}

.castle-account-panel.has-crest-slot {
  min-height: 7.5rem;
}

.castle-account-panel--crest.has-crest-slot {
  min-height: 0;
}

.castle-account-panel.has-crest-texture {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0.35rem 0.45rem 0.5rem;
}

.castle-account-panel--crest {
  gap: 0.3rem;
  padding: 0.2rem 0.3rem 0.38rem;
}

.castle-account-crest-hero {
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  max-width: 10.5rem;
  position: relative;
  width: 100%;
}

.castle-account-crest-hero .castle-account-crest-layer {
  background-position: center center;
  background-size: contain;
  inset: 0;
}

.castle-crest-level-overlay {
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  left: 50%;
  padding: 0;
  position: absolute;
  top: 41%;
  transform: translate(-50%, -50%);
  width: 42%;
  z-index: 2;
}

.castle-crest-level-overlay:hover,
.castle-crest-level-overlay:focus-visible {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.castle-crest-level-overlay:hover .castle-crest-level-num,
.castle-crest-level-overlay:focus-visible .castle-crest-level-num {
  text-shadow:
    0 1px 0 #6b4a10,
    0 2px 4px rgba(0, 0, 0, 0.65),
    0 0 16px rgba(255, 214, 120, 0.55);
}

.castle-crest-level-num {
  color: #f4e4b8;
  display: block;
  font-size: clamp(1.35rem, 5vw, 1.95rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 #6b4a10,
    0 2px 4px rgba(0, 0, 0, 0.65),
    0 0 12px rgba(255, 214, 120, 0.35);
}

.castle-crest-level-xp {
  background: rgba(20, 12, 6, 0.55);
  border: 1px solid rgba(216, 166, 79, 0.45);
  border-radius: 99rem;
  display: block;
  height: 0.28rem;
  margin-top: 0.2rem;
  overflow: hidden;
  width: 72%;
}

.castle-crest-level-xp-fill {
  background: linear-gradient(90deg, #c9892e, #ffe08a);
  display: block;
  height: 100%;
  transition: width 0.25s ease;
}

.castle-crest-profile-banner {
  align-items: baseline;
  background: rgba(248, 240, 225, 0.88);
  border: 1px solid rgba(90, 70, 45, 0.22);
  border-radius: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem 0.32rem;
  justify-content: center;
  padding: 0.3rem 0.45rem;
  text-align: center;
}

.castle-crest-profile-divider {
  color: rgba(42, 32, 24, 0.35);
  font-weight: 700;
}

.castle-account-panel--crest .castle-game-date {
  flex-basis: 100%;
}

.castle-crest-resource-strip {
  display: grid;
  gap: 0.28rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.castle-crest-resource-chip {
  align-items: center;
  background: linear-gradient(180deg, rgba(36, 24, 14, 0.88), rgba(16, 10, 6, 0.94));
  border: 1px solid rgba(216, 166, 79, 0.34);
  border-radius: 0.55rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 170, 0.1),
    0 4px 14px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 0.06rem;
  justify-items: center;
  min-width: 0;
  padding: 0.32rem 0.2rem 0.28rem;
  position: relative;
}

.castle-crest-resource-chip.resource-with-tooltip {
  cursor: help;
}

.castle-crest-resource-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  font-size: 0.95rem;
  line-height: 1;
}

.castle-crest-resource-value {
  color: #f8f0e1;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.castle-crest-resource-label,
.castle-crest-resource-rate {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
}

.castle-crest-resource-rate {
  color: #7dce8a;
}

.castle-crest-resource-chip--gold .castle-crest-resource-value {
  color: #ffe6a8;
}

.castle-crest-resource-chip--glory .castle-crest-resource-value {
  color: #f0d060;
}

.castle-crest-resource-chip--glory .castle-crest-resource-label {
  color: rgba(240, 208, 96, 0.72);
}

.castle-crest-resource-chip--emerald .castle-crest-resource-value {
  color: #6fdca0;
}

.castle-crest-resource-chip--emerald .castle-crest-resource-label {
  color: rgba(111, 220, 160, 0.72);
}

.castle-account-panel--crest .castle-account-panel-body {
  gap: 0.32rem;
  margin-top: 0;
}

.castle-account-panel--crest.has-crest-variant-picker .castle-account-panel-body {
  margin-top: 0;
}

.castle-account-panel--crest .castle-crest-variant-picker {
  margin: 0.05rem 0 0;
}

.castle-account-crest-layer {
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% auto;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.castle-account-panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  width: 100%;
  z-index: 1;
}

.castle-account-panel.has-crest-texture:not(.castle-account-panel--crest) .castle-account-panel-body {
  margin-top: 2.8rem;
}

.castle-account-panel.has-crest-variant-picker.has-crest-texture:not(.castle-account-panel--crest) .castle-account-panel-body {
  margin-top: 4.8rem;
}

.castle-account-panel.has-crest-texture:not(.castle-account-panel--crest) .castle-level-chip,
.castle-account-panel.has-crest-texture:not(.castle-account-panel--crest) .castle-currency-pill {
  background: rgba(248, 240, 225, 0.9);
}

.castle-crest-variant-picker {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
  width: 100%;
  z-index: 2;
}

.castle-account-panel.has-crest-texture .castle-crest-variant-picker {
  margin-bottom: 0.15rem;
}

.castle-crest-variant-button {
  align-items: center;
  background: rgba(248, 240, 225, 0.92);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.55rem;
  color: #2a2018;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 3.2rem;
  padding: 0.25rem 0.3rem 0.35rem;
}

.castle-crest-variant-button.is-active {
  border-color: rgba(120, 72, 18, 0.65);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.45);
}

.castle-crest-variant-button--demonic.is-active {
  border-color: rgba(120, 24, 24, 0.65);
  box-shadow: 0 0 0 1px rgba(176, 48, 48, 0.45);
}

.castle-crest-variant-preview {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: block;
  height: 1.55rem;
  width: 1.55rem;
}

.castle-crest-variant-fallback {
  font-size: 1rem;
  line-height: 1;
}

.castle-crest-variant-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.castle-account-panel.has-crest-variant-picker:not(.has-crest-texture) .castle-crest-variant-picker {
  margin-bottom: 0.35rem;
}

.castle-account-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-start;
}

.castle-level-chip {
  align-items: center;
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.65rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  color: #2a2018;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 3.1rem;
  padding: 0.35rem 0.45rem 0.4rem;
}

.castle-level-shield {
  align-items: center;
  background: linear-gradient(160deg, #d8a64f, #8f6124);
  border: 1px solid rgba(90, 70, 45, 0.35);
  border-radius: 0.45rem;
  color: #fff;
  display: flex;
  height: 2.1rem;
  justify-content: center;
  width: 2.1rem;
}

.castle-level-num {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.castle-level-xp-track {
  background: rgba(42, 32, 24, 0.12);
  border-radius: 99rem;
  display: block;
  height: 0.35rem;
  overflow: hidden;
  width: 100%;
}

.castle-currency-pill {
  align-items: center;
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 99rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  color: #2a2018;
  display: inline-flex;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  gap: 0.3rem;
  padding: 0.42rem 0.65rem;
}

.castle-currency-emerald {
  color: #1f7a52;
}

.castle-currency-glory {
  color: #9a7a12;
}

.castle-currency-gold .castle-resource-row-rate {
  font-size: 0.68rem;
  margin-left: 0.15rem;
}

.castle-currency-gold.resource-with-tooltip {
  position: relative;
}

.castle-upkeep-warnings {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.castle-upkeep-warning {
  align-items: flex-start;
  border-radius: 0.65rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  font-size: 0.86rem;
  font-weight: 700;
  gap: 0.5rem;
  line-height: 1.4;
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.castle-upkeep-warning-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1.2;
}

.castle-upkeep-warning-text {
  margin: 0;
}

.castle-upkeep-warning.is-warning {
  background: linear-gradient(135deg, rgba(255, 196, 72, 0.95), rgba(255, 168, 40, 0.88));
  border: 2px solid rgba(140, 85, 10, 0.55);
  color: #3d2600;
}

.castle-upkeep-warning.is-critical {
  animation: castle-upkeep-pulse 1.6s ease-in-out infinite;
  background: linear-gradient(135deg, rgba(255, 92, 72, 0.96), rgba(220, 48, 38, 0.9));
  border: 2px solid rgba(120, 18, 12, 0.65);
  color: #fff8f6;
}

@keyframes castle-upkeep-pulse {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(220, 48, 38, 0.35), 0 6px 18px rgba(120, 18, 12, 0.28);
  }
}

.resource-tooltip-section.is-totals {
  border-bottom: 1px solid rgba(90, 70, 45, 0.18);
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
}

.castle-top-right-panel {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: min(18rem, calc(100vw - 2rem));
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
}

.castle-queue-launcher {
  position: relative;
  width: 100%;
  z-index: 16;
}

.castle-queue-toggle {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  min-width: 9.5rem;
  width: 100%;
}

.castle-queue-toggle--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
  width: auto;
}

.castle-queue-toggle-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-queue-icon-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-queue-launcher.has-active .castle-queue-toggle--icon {
  border-color: rgba(16, 120, 88, 0.55);
  box-shadow:
    0 0 10px rgba(16, 120, 88, 0.18),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-queue-toggle.has-active {
  border-color: rgba(16, 120, 88, 0.55);
  box-shadow:
    0 0 10px rgba(16, 120, 88, 0.18),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-queue-toggle.is-open {
  border-color: rgba(143, 97, 36, 0.65);
}

.castle-queue-modal-sections {
  display: grid;
  gap: 0.85rem;
}

.castle-queue-modal-sections .training-queue {
  margin: 0;
}

.building-queue-inline {
  margin-top: 0.65rem;
}

.building-queue-inline.is-waiting .button-row {
  justify-content: flex-start;
}

.castle-queue-idle {
  color: rgba(42, 32, 24, 0.45);
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-track-compact {
  height: 0.38rem;
}

.castle-menu-launcher {
  position: relative;
}

.castle-shop-launcher {
  position: relative;
  z-index: 15;
}

.castle-gacha-launcher {
  position: relative;
  z-index: 15;
}

.castle-treasury-launcher {
  position: relative;
  z-index: 15;
}

.castle-bau-launcher {
  position: relative;
  z-index: 15;
}

.castle-commerce-launchers {
  align-items: flex-end;
  display: flex;
  gap: 0.45rem;
}

.castle-bottom-nav {
  align-items: flex-end;
  bottom: 0.65rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr auto 1fr;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: min(34rem, calc(100vw - 2rem));
  z-index: 15;
}

.castle-bottom-nav-side {
  align-items: flex-end;
  display: flex;
}

.castle-bottom-nav-side--left {
  justify-content: flex-end;
}

.castle-bottom-nav-side--right {
  justify-content: flex-start;
}

.castle-bottom-nav-center {
  display: flex;
  justify-content: center;
}

.castle-world-map-button {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  font-weight: 800;
  min-width: 9.5rem;
  padding: 0.7rem 1.35rem;
}

.castle-world-map-button--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
}

.castle-world-map-button-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-world-map-button--icon .menu-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-world-map-button.has-loot-goblin-alert {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow:
    0 0 12px rgba(220, 90, 70, 0.24),
    0 12px 34px rgba(0, 0, 0, 0.38);
}

.castle-bottom-right-actions {
  display: contents;
}

.castle-memory-launcher {
  position: relative;
}

.castle-memory-toggle {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  min-width: 5.5rem;
}

.castle-memory-toggle.has-memory-alert {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow:
    0 0 10px rgba(220, 90, 70, 0.2),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-left-column .castle-log-launcher {
  position: relative;
  width: 100%;
  z-index: 17;
}

.castle-shop-toggle,
.castle-bau-toggle,
.castle-log-toggle {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  min-width: 5.5rem;
}

.castle-shop-toggle--icon,
.castle-bau-toggle--icon,
.castle-social-toggle--icon,
.castle-guild-toggle--icon,
.castle-gacha-toggle--icon,
.castle-treasury-toggle--icon,
.castle-research-toggle--icon,
.castle-resource-toggle--icon,
.castle-log-toggle--icon,
.harbor-launcher-button--icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 0.2rem;
  position: relative;
}

.castle-shop-toggle-icon,
.capital-shop-toggle-icon,
.demon-shop-toggle-icon,
.castle-bau-toggle-icon,
.castle-social-toggle-icon,
.castle-guild-toggle-icon,
.castle-gacha-toggle-icon,
.castle-treasury-toggle-icon,
.castle-research-toggle-icon,
.castle-resource-toggle-icon,
.castle-log-toggle-icon,
.harbor-launcher-button-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.castle-research-toggle--icon .capital-research-badge,
.castle-research-toggle--icon .pill {
  position: absolute;
  right: -0.15rem;
  top: -0.15rem;
}

.castle-social-toggle--icon .social-fab-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-shop-toggle--icon.is-open,
.castle-bau-toggle--icon.is-open,
.castle-social-toggle--icon.is-open,
.castle-guild-toggle--icon.is-open,
.castle-gacha-toggle--icon.is-open,
.castle-treasury-toggle--icon.is-open,
.castle-resource-toggle--icon.is-open,
.castle-log-toggle--icon.is-open {
  box-shadow:
    0 0 0 2px rgba(216, 166, 79, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-left-column .castle-log-toggle {
  min-width: 0;
  width: 100%;
}

.castle-log-toggle--icon {
  width: auto;
}

.castle-log-icon-badge {
  position: absolute;
  right: -0.1rem;
  top: -0.1rem;
}

.castle-log-launcher.has-alert .castle-log-toggle--icon {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow:
    0 0 10px rgba(220, 90, 70, 0.2),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-log-toggle.has-alert {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow:
    0 0 10px rgba(220, 90, 70, 0.2),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.castle-shop-dropdown {
  bottom: calc(100% + 0.45rem);
  left: auto;
  max-height: min(50vh, 26rem);
  overflow-y: auto;
  position: absolute;
  right: 0;
}

.castle-bau-dropdown {
  min-width: 14.5rem;
}

.bau-dropdown-section {
  border-top: 1px solid rgba(216, 166, 79, 0.12);
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.bau-dropdown-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bau-dropdown-overview {
  border-top: 1px solid rgba(216, 166, 79, 0.12);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.castle-bau-dropdown .secondary-button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.castle-log-dropdown {
  bottom: calc(100% + 0.45rem);
  left: 0;
  max-height: min(50vh, 28rem);
  max-width: min(22rem, calc(100vw - 2rem));
  min-width: 18rem;
  overflow-y: auto;
  position: absolute;
  right: auto;
  top: auto;
  z-index: 24;
}

.castle-log-section {
  display: grid;
  gap: 0.4rem;
}

.castle-log-section + .castle-log-section {
  border-top: 1px solid rgba(90, 70, 45, 0.16);
  margin-top: 0.35rem;
  padding-top: 0.55rem;
}

.castle-log-section strong {
  font-size: 0.82rem;
}

.castle-log-list {
  list-style: none;
  margin: 0;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0;
}

.castle-log-section-head {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
}

.castle-log-item {
  align-items: flex-start;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

.castle-log-text {
  flex: 1;
  min-width: 0;
}

.castle-log-item.is-unread .castle-log-text {
  font-weight: 800;
}

.castle-log-item.is-read .castle-log-text {
  color: rgba(42, 32, 24, 0.62);
}

.castle-log-delete {
  color: #8f6124;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.castle-log-list li {
  border-bottom: 1px solid rgba(90, 70, 45, 0.1);
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.35rem 0;
}

.castle-log-list li:last-child {
  border-bottom: 0;
}

.castle-log-empty {
  color: rgba(42, 32, 24, 0.55);
  font-size: 0.82rem;
  margin: 0;
}

.castle-log-alert {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 70, 45, 0.14);
  border-radius: 0.55rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.45rem 0.55rem;
}

.castle-log-alert-danger {
  border-color: rgba(220, 90, 70, 0.35);
}

.castle-log-alert-warning {
  border-color: rgba(216, 166, 79, 0.45);
}

.castle-log-alert-info {
  border-color: rgba(111, 177, 224, 0.35);
}

.castle-log-alert span {
  font-size: 0.82rem;
  line-height: 1.35;
}

.castle-log-alert .text-button {
  color: #8f6124;
  justify-self: start;
}

.castle-menu-toggle {
  align-items: center;
  border-radius: 0.65rem;
  display: inline-flex;
  font-size: 1.15rem;
  height: 2.55rem;
  justify-content: center;
  min-width: 2.55rem;
  padding: 0;
}

.castle-menu-dropdown {
  background: rgba(248, 240, 225, 0.97);
  border: 1px solid rgba(90, 70, 45, 0.28);
  border-radius: 0.85rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  color: #2a2018;
  display: grid;
  gap: 0.45rem;
  min-width: 13rem;
  padding: 0.65rem;
}

.castle-menu-meta {
  display: grid;
  gap: 0.35rem;
}

.castle-menu-meta strong {
  font-size: 0.92rem;
}

.castle-menu-dropdown .secondary-button {
  min-width: 0;
  width: 100%;
}

.castle-menu-launcher .castle-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 20;
}

.app.is-castle-view .castle-wall-ring {
  --castle-cell-size: min(
    var(--castle-cell-max, 7.5rem),
    calc((100vw - 4rem) / var(--castle-ring-span-x)),
    calc((100dvh - 11rem) / var(--castle-ring-span-y))
  );
}

.castle-wall-ring {
  --castle-cell-size: min(
    var(--castle-cell-max, 7rem),
    calc((min(100vw, 100%) - 3rem) / var(--castle-ring-span-x)),
    calc((100dvh - 10.5rem) / var(--castle-ring-span-y))
  );
  --wall-visual-cell-size: max(var(--castle-cell-size), 5.25rem);
  --wall-thickness: calc(var(--wall-visual-cell-size) * 0.55);
  --castle-grid-width-px: calc(var(--castle-width) * var(--castle-cell-size));
  --castle-grid-height-px: calc(var(--castle-height) * var(--castle-cell-size));
  --castle-ring-width: calc(2 * var(--wall-thickness) + var(--castle-grid-width-px));
  --castle-ring-height: calc(2 * var(--wall-thickness) + var(--castle-grid-height-px));
  --wall-corner-visual-scale: 1;
  display: inline-grid;
  grid-template-columns:
    var(--wall-thickness)
    var(--castle-grid-width-px)
    var(--wall-thickness);
  grid-template-rows:
    var(--wall-thickness)
    var(--castle-grid-height-px)
    var(--wall-thickness);
  height: var(--castle-ring-height);
  max-width: 100%;
  position: relative;
  width: min(100%, var(--castle-ring-width));
}

.castle-wall-segment.has-wall-texture {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.castle-wall-segment.has-wall-texture.wall-top,
.castle-wall-segment.has-wall-texture.wall-bottom,
.castle-wall-segment.has-wall-texture.wall-left,
.castle-wall-segment.has-wall-texture.wall-right {
  border-radius: 0;
}

.castle-wall-segment.has-wall-texture.selected-wall {
  box-shadow: inset 0 0 0 2px rgba(185, 239, 177, 0.95);
}

.castle-wall-corner-layer {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 6;
}

.castle-wall-corner {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  block-size: calc(var(--wall-thickness) * var(--wall-corner-visual-scale));
  inline-size: calc(var(--wall-thickness) * var(--wall-corner-visual-scale));
  pointer-events: none;
  position: absolute;
  z-index: 7;
}

.castle-wall-corner--tl {
  left: 0;
  top: 0;
}

.castle-wall-corner--tr {
  right: 0;
  top: 0;
}

.castle-wall-corner--bl {
  bottom: 0;
  left: 0;
}

.castle-wall-corner--br {
  bottom: 0;
  right: 0;
}

.wall-texture-layer {
  background-position: 0 0;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.wall-texture-layer--top,
.wall-texture-layer--bottom {
  background-position: 0 0;
  background-repeat: repeat-x;
  background-size: calc(var(--wall-visual-cell-size) * 2) var(--wall-thickness);
  left: var(--wall-thickness);
  right: var(--wall-thickness);
}

.wall-texture-layer--left,
.wall-texture-layer--right {
  background-position: 0 0;
  background-repeat: repeat-y;
  background-size: var(--wall-thickness) calc(var(--wall-visual-cell-size) * 2);
}

.wall-texture-layer--bottom {
  transform: scaleY(-1);
  transform-origin: center;
}

.wall-texture-layer--right {
  transform: scaleX(-1);
  transform-origin: center;
}

.castle-wall-segment.has-wall-texture span {
  position: relative;
  z-index: 1;
}

.castle-wall-segment {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.16), rgba(65, 48, 35, 0.42));
  border: 2px solid rgba(127, 96, 64, 0.95);
  box-shadow: inset 0 0 0 1px rgba(248, 234, 215, 0.08);
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 0.15rem;
  position: relative;
  z-index: 5;
}

.castle-wall-segment.wall-top {
  border-radius: 0.85rem 0.85rem 0 0;
  grid-column: 1 / -1;
  grid-row: 1;
}

.castle-wall-segment.wall-bottom {
  border-radius: 0 0 0.85rem 0.85rem;
  grid-column: 1 / -1;
  grid-row: 3;
}

.castle-wall-segment.wall-left {
  border-radius: 0.85rem 0 0 0.85rem;
  grid-column: 1;
  grid-row: 2;
}

.castle-wall-segment.wall-right {
  border-radius: 0 0.85rem 0.85rem 0;
  grid-column: 3;
  grid-row: 2;
}

.castle-wall-segment:hover {
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.24), rgba(65, 48, 35, 0.5));
  transform: none !important;
}

.castle-wall-segment span {
  background: rgba(23, 19, 15, 0.84);
  border: 1px solid rgba(248, 234, 215, 0.14);
  border-radius: 99rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
}

.castle-wall-segment.selected-wall {
  border-color: #b9efb1;
  box-shadow:
    0 0 0 3px rgba(119, 183, 109, 0.18),
    inset 0 0 0 1px rgba(248, 234, 215, 0.12);
}

.castle-grid {
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(160deg, #5a9348 0%, #3f6f35 45%, #35602e 100%);
  background-size:
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    auto;
  border: 2px solid rgba(72, 104, 52, 0.9);
  box-sizing: border-box;
  display: grid;
  gap: 0;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: repeat(var(--castle-width), minmax(0, 1fr));
  grid-template-rows: repeat(var(--castle-height), minmax(0, 1fr));
  height: calc(var(--castle-height) * var(--castle-cell-size));
  overflow: hidden;
  position: relative;
  user-select: none;
  width: calc(var(--castle-width) * var(--castle-cell-size));
}

.castle-shop-button {
  bottom: 1rem;
  position: absolute;
  right: 1rem;
  z-index: 8;
}

.castle-cell {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  min-width: 0;
  padding: 0;
  pointer-events: none;
  position: relative;
}

.cell-coord {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.5rem, 2.4cqmin, 0.72rem);
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  user-select: none;
}

.placement-preview {
  border: 2px dashed rgba(248, 234, 215, 0.65);
  border-radius: 0.35rem;
  box-sizing: border-box;
  grid-column: var(--building-x) / span var(--building-w);
  grid-row: var(--building-y) / span var(--building-h);
  margin: 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  pointer-events: none;
  position: relative;
  z-index: 6;
}

.placement-preview.has-texture {
  background: transparent;
}

.placement-preview.has-texture .building-texture-layer {
  opacity: 0.72;
}

.placement-preview.has-texture.valid {
  box-shadow: inset 0 0 0 2px rgba(185, 239, 177, 0.95);
}

.placement-preview.has-texture.invalid {
  box-shadow: inset 0 0 0 2px rgba(255, 150, 150, 0.95);
}

.placement-preview.valid {
  background: rgba(119, 183, 109, 0.22);
  border-color: rgba(185, 239, 177, 0.95);
}

.placement-preview.invalid {
  background: rgba(176, 72, 72, 0.22);
  border-color: rgba(255, 150, 150, 0.95);
}

.build-chip.is-disabled {
  opacity: 0.55;
}

.build-chip.is-rotated .pill:first-child {
  border-color: rgba(185, 239, 177, 0.75);
  color: #d6f5cf;
}

.coord-controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.16);
}

.coord-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: #f0ddc0;
}

.coord-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.coord-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: rgba(248, 234, 215, 0.7);
}

.coord-inputs input[type="number"] {
  width: 4.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(216, 166, 79, 0.45);
  background: rgba(24, 18, 12, 0.85);
  color: #f8ead7;
  font-size: 0.9rem;
}

.coord-hint {
  font-size: 0.72rem;
  color: rgba(248, 234, 215, 0.55);
}

.placed-building {
  align-items: stretch;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.35rem;
  box-shadow: none;
  box-sizing: border-box;
  container-type: size;
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-column: var(--building-x) / span var(--building-w);
  grid-row: var(--building-y) / span var(--building-h);
  justify-content: flex-end;
  margin: 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: clamp(0.1rem, 6cqmin, 0.3rem);
  position: relative;
  text-align: center;
  z-index: calc(20 + var(--building-stack, 1));
}

button.placed-building {
  appearance: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
}

button.placed-building:hover:not(:disabled) {
  transform: none !important;
}

.placed-building.has-texture {
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.placed-building.has-texture.selected-building,
.placed-building.has-texture.moving-building {
  border-color: #ffe1a3;
  border-style: solid;
}

.building-texture-layer {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.placed-building.is-texture-rotated .building-texture-layer,
.placement-preview.is-texture-rotated .building-texture-layer {
  height: calc(100% * var(--building-w) / var(--building-h));
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
  width: calc(100% * var(--building-h) / var(--building-w));
}

.building-label {
  align-items: center;
  background: linear-gradient(to top, rgba(16, 12, 8, 0.88), rgba(16, 12, 8, 0.45) 55%, transparent);
  border-radius: 0 0 0.28rem 0.28rem;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  justify-content: flex-end;
  margin-top: auto;
  max-width: 100%;
  min-height: 38%;
  padding: clamp(0.12rem, 8cqmin, 0.32rem) clamp(0.1rem, 5cqmin, 0.22rem) clamp(0.08rem, 5cqmin, 0.18rem);
  pointer-events: none;
  position: relative;
  width: 100%;
  z-index: 1;
}

.placed-building:not(.has-texture) .building-label {
  background: transparent;
  min-height: 0;
  padding: 0;
}

.build-chip-icon {
  border: 1px solid rgba(248, 234, 215, 0.18);
  border-radius: 0.55rem;
  display: block;
  height: 3.85rem;
  object-fit: cover;
  width: 3.85rem;
}

.building-ui-icon-wrap--shop .building-ui-icon-fallback {
  border-radius: 0.55rem;
  height: 3.85rem;
  margin: 0 auto;
  width: 3.85rem;
}

.placed-building:hover {
  transform: none !important;
}

.placed-building {
  user-select: none;
  cursor: pointer;
}

.placed-building.selected-building {
  border-color: #ffe1a3;
  box-shadow:
    0 0 0 4px rgba(216, 166, 79, 0.24),
    0 12px 28px rgba(0, 0, 0, 0.34);
  z-index: calc(40 + var(--building-stack, 1));
}

.placed-building.is-under-move,
button.placed-building.is-under-move:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

button.placed-building.construction-site,
button.placed-building.is-under-construction {
  cursor: pointer;
  pointer-events: auto;
}

.placed-building.construction-site:not(button) {
  pointer-events: none;
}

.placed-building.construction-site {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(138, 106, 58, 0.92),
      rgba(138, 106, 58, 0.92) 10px,
      rgba(106, 80, 40, 0.92) 10px,
      rgba(106, 80, 40, 0.92) 20px
    ),
    linear-gradient(180deg, rgba(72, 54, 30, 0.55), rgba(48, 36, 20, 0.72));
  border-color: rgba(216, 166, 79, 0.5);
  box-shadow: inset 0 0 0 2px rgba(255, 225, 163, 0.12);
}

.placed-building.construction-site.has-construction-texture {
  background: transparent;
  box-shadow: none;
}

.placed-building.construction-site.is-queued-construction {
  opacity: 0.78;
}

.construction-site-texture-layer {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.placed-building-move-overlay,
.construction-progress-overlay {
  align-items: center;
  background: rgba(12, 18, 12, 0.58);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  inset: 0;
  justify-content: center;
  padding: 0.35rem;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.placed-building-move-label {
  color: #dff5d8;
  font-size: clamp(0.62rem, 2.8cqmin, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.placed-building-move-time {
  color: rgba(248, 234, 215, 0.92);
  font-size: clamp(0.58rem, 2.4cqmin, 0.76rem);
}

.placed-building-move-progress {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999rem;
  height: 0.28rem;
  max-width: 72%;
  overflow: hidden;
  width: 100%;
}

.placed-building-move-progress-fill {
  background: linear-gradient(90deg, #77b76d, #b9efb1);
  height: 100%;
  transition: width 0.35s linear;
}

.shop-category-card--roads {
  border-color: rgba(196, 168, 118, 0.45);
}

.placed-road {
  background:
    linear-gradient(180deg, rgba(92, 78, 58, 0.92), rgba(58, 48, 36, 0.96)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 0.35rem,
      transparent 0.35rem,
      transparent 0.7rem
    );
  border: 1px solid rgba(196, 168, 118, 0.55);
  border-radius: 0.2rem;
  box-sizing: border-box;
  grid-column: var(--building-x) / span var(--building-w);
  grid-row: var(--building-y) / span var(--building-h);
  margin: 0;
  min-height: 0;
  min-width: 0;
  pointer-events: none;
  position: relative;
  z-index: calc(8 + var(--road-stack, 1));
}

.placed-road.layout-road {
  cursor: grab;
  padding: 0;
  pointer-events: auto;
}

.placed-road.layout-road.is-selected {
  border-color: rgba(201, 162, 39, 0.95);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.45);
}

.castle-layout-mode-storage-group + .castle-layout-mode-storage-group {
  margin-top: 0.65rem;
}

.castle-layout-mode-storage-label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.layout-stored-chip--road {
  min-height: 2.1rem;
}

.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(92, 78, 58, 0.92), rgba(58, 48, 36, 0.96)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 0.35rem,
      transparent 0.35rem,
      transparent 0.7rem
    );
}

.placed-road--type-path {
  background:
    linear-gradient(180deg, rgba(118, 96, 68, 0.9), rgba(74, 58, 40, 0.95)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 0.45rem,
      transparent 0.45rem,
      transparent 0.9rem
    );
  border-color: rgba(168, 138, 96, 0.55);
}

.placed-road--type-path.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(118, 96, 68, 0.9), rgba(74, 58, 40, 0.95)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 0.45rem,
      transparent 0.45rem,
      transparent 0.9rem
    );
}

.placed-road--type-cobblestone {
  background:
    linear-gradient(180deg, rgba(108, 104, 98, 0.94), rgba(68, 64, 58, 0.98)),
    radial-gradient(circle at 0.35rem 0.35rem, rgba(220, 214, 200, 0.35) 0.12rem, transparent 0.13rem);
  background-size: auto, 0.7rem 0.7rem;
  border-color: rgba(186, 178, 160, 0.65);
}

.placed-road--type-cobblestone.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(108, 104, 98, 0.94), rgba(68, 64, 58, 0.98)),
    radial-gradient(circle at 0.35rem 0.35rem, rgba(220, 214, 200, 0.35) 0.12rem, transparent 0.13rem);
  background-size: auto, 0.7rem 0.7rem;
}

.placed-road--type-straightCobble {
  background:
    linear-gradient(180deg, rgba(98, 94, 88, 0.95), rgba(58, 54, 48, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(210, 202, 186, 0.22) 0,
      rgba(210, 202, 186, 0.22) 0.5rem,
      rgba(88, 84, 78, 0.22) 0.5rem,
      rgba(88, 84, 78, 0.22) 1rem
    );
  border-color: rgba(196, 188, 168, 0.7);
}

.placed-road--type-straightCobble.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(98, 94, 88, 0.95), rgba(58, 54, 48, 0.98)),
    repeating-linear-gradient(
      180deg,
      rgba(210, 202, 186, 0.22) 0,
      rgba(210, 202, 186, 0.22) 0.5rem,
      rgba(88, 84, 78, 0.22) 0.5rem,
      rgba(88, 84, 78, 0.22) 1rem
    );
}

.placed-road--type-paved {
  background:
    linear-gradient(180deg, rgba(88, 86, 82, 0.96), rgba(48, 46, 42, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(230, 226, 214, 0.16) 0,
      rgba(230, 226, 214, 0.16) 0.8rem,
      transparent 0.8rem,
      transparent 1.6rem
    );
  border-color: rgba(214, 208, 188, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.placed-road--type-paved.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(88, 86, 82, 0.96), rgba(48, 46, 42, 0.98)),
    repeating-linear-gradient(
      180deg,
      rgba(230, 226, 214, 0.16) 0,
      rgba(230, 226, 214, 0.16) 0.8rem,
      transparent 0.8rem,
      transparent 1.6rem
    );
}

.placed-road--type-roman {
  background:
    linear-gradient(180deg, rgba(126, 112, 92, 0.96), rgba(72, 62, 48, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(244, 232, 196, 0.24) 0,
      rgba(244, 232, 196, 0.24) 1rem,
      rgba(96, 84, 64, 0.2) 1rem,
      rgba(96, 84, 64, 0.2) 2rem
    );
  border-color: rgba(232, 210, 150, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 190, 0.12);
}

.placed-road--type-roman.placed-road--vertical {
  background:
    linear-gradient(90deg, rgba(126, 112, 92, 0.96), rgba(72, 62, 48, 0.98)),
    repeating-linear-gradient(
      180deg,
      rgba(244, 232, 196, 0.24) 0,
      rgba(244, 232, 196, 0.24) 1rem,
      rgba(96, 84, 64, 0.2) 1rem,
      rgba(96, 84, 64, 0.2) 2rem
    );
}

.road-status-card {
  border-color: rgba(196, 168, 118, 0.35);
}

.castle-grid.is-road-build-mode {
  cursor: crosshair;
}

.castle-road-demolish-mode-banner {
  border-color: rgba(196, 96, 96, 0.55);
}

.castle-move-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.placed-road.is-marked-for-demolish {
  box-shadow:
    inset 0 0 0 2px rgba(255, 120, 120, 0.95),
    0 0 0 2px rgba(180, 48, 48, 0.55);
  filter: saturate(0.75) brightness(0.9);
}

.road-demolish-preview {
  display: contents;
  pointer-events: none;
}

.placement-preview.road-demolish-mark {
  background: rgba(220, 72, 72, 0.34);
  border: 2px dashed rgba(255, 140, 140, 0.95);
  border-radius: 0.2rem;
  box-sizing: border-box;
  grid-column: var(--building-x) / span var(--building-w);
  grid-row: var(--building-y) / span var(--building-h);
  pointer-events: none;
  z-index: 24;
}

.castle-grid.is-road-demolish-mode {
  cursor: cell;
}

.castle-road-build-mode-banner {
  border-color: rgba(196, 168, 118, 0.55);
}

.road-segments-preview {
  display: contents;
  pointer-events: none;
}

.placement-preview.road-preview.valid {
  background: rgba(196, 168, 118, 0.28);
  border-color: rgba(230, 205, 150, 0.95);
}

.is-road-connected-card {
  border-color: rgba(196, 168, 118, 0.35);
}

.placed-building.moving-building {
  border-color: #b9efb1;
  border-style: solid;
  box-shadow:
    0 0 0 4px rgba(119, 183, 109, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.34);
  z-index: calc(40 + var(--building-stack, 1));
}

.placed-building.is-drag-ready {
  cursor: grab;
  touch-action: none;
}

.placed-building.is-drag-ready:active {
  cursor: grabbing;
}

.castle-grid.is-move-mode,
.castle-grid.is-place-mode,
.castle-grid.is-layout-mode {
  cursor: crosshair;
}

.castle-layout-mode-panel {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.castle-layout-mode-header {
  align-items: stretch;
  background: rgba(23, 19, 15, 0.94);
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.castle-layout-mode-header .castle-move-mode-actions {
  display: grid;
  gap: 0.35rem;
}

.castle-layout-mode-header .castle-move-mode-actions .primary-button,
.castle-layout-mode-header .castle-move-mode-actions .secondary-button {
  justify-content: center;
  width: 100%;
}

.castle-layout-mode-storage {
  background: rgba(23, 19, 15, 0.94);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 0.55rem;
  max-height: min(24rem, calc(100vh - 14rem));
  overflow: auto;
  padding: 0.65rem 0.75rem;
}

.castle-layout-mode-storage-hint {
  display: block;
}

.layout-stored-list {
  display: grid;
  gap: 0.4rem;
}

.layout-stored-row {
  align-items: center;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.layout-stored-row.is-selected .layout-stored-chip {
  border-color: rgba(201, 162, 39, 0.85);
}

.layout-stored-demolish {
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
}

.castle-layout-mode-demolish {
  background: rgba(58, 28, 28, 0.55);
  border: 1px solid rgba(201, 90, 90, 0.35);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
}

.layout-demolished-list {
  display: grid;
  gap: 0.4rem;
}

.layout-demolished-row {
  align-items: center;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.layout-demolished-name {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.layout-demolished-refund {
  font-size: 0.82rem;
  white-space: nowrap;
}

.layout-demolish-confirm {
  background: rgba(58, 28, 28, 0.72);
  border: 1px solid rgba(201, 90, 90, 0.45);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
}

.layout-demolish-confirm-actions {
  display: grid;
  gap: 0.35rem;
}

.layout-demolish-confirm-actions .primary-button,
.layout-demolish-confirm-actions .secondary-button,
.layout-demolish-confirm-actions .danger-button {
  justify-content: center;
  width: 100%;
}

.layout-stored-chip {
  align-items: center;
  background: rgba(58, 48, 36, 0.95);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 0.55rem;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 0.45rem;
  justify-content: flex-start;
  padding: 0.35rem 0.65rem 0.35rem 0.4rem;
  text-align: left;
  width: 100%;
}

.layout-stored-chip-name {
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.layout-stored-chip.is-selected,
.layout-stored-chip:hover {
  background: rgba(88, 68, 36, 0.95);
  border-color: rgba(201, 162, 39, 0.85);
}

.building-ui-icon-wrap {
  display: inline-flex;
  flex-shrink: 0;
  position: relative;
}

.building-ui-icon-wrap--shop {
  display: block;
  margin: 0 auto 0.45rem;
}

.building-ui-icon-wrap .building-ui-icon-fallback {
  background: var(--building-fallback-color, #8a6a44);
  border: 1px solid rgba(248, 234, 215, 0.18);
  border-radius: 0.35rem;
  display: none;
}

.building-ui-icon-wrap.is-fallback .building-ui-icon-fallback {
  display: block;
}

.building-ui-icon-wrap--inline .building-ui-icon-fallback,
.building-ui-icon-wrap--label .building-ui-icon-fallback {
  border: 1px solid rgba(248, 234, 215, 0.18);
}

.building-ui-icon-wrap--inline .building-ui-icon-fallback {
  height: 2.15rem;
  width: 2.15rem;
}

.building-ui-icon-wrap--label .building-ui-icon-fallback {
  height: 1.2rem;
  width: 1.2rem;
}

.building-ui-icon--inline {
  border: 1px solid rgba(248, 234, 215, 0.18);
  border-radius: 0.35rem;
  display: block;
  height: 2.15rem;
  object-fit: cover;
  width: 2.15rem;
}

.building-ui-icon--label {
  border: 1px solid rgba(248, 234, 215, 0.18);
  border-radius: 0.2rem;
  display: block;
  height: 1.2rem;
  object-fit: cover;
  width: 1.2rem;
}

.building-label-title {
  align-items: center;
  display: inline-flex;
  gap: 0.25rem;
}

.placed-building.is-layout-building {
  outline: 2px dashed rgba(201, 162, 39, 0.55);
  outline-offset: 2px;
}

.move-drag-controls .button-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.castle-move-mode-banner {
  align-items: center;
  background: rgba(23, 19, 15, 0.92);
  border: 1px solid rgba(185, 239, 177, 0.45);
  border-radius: 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  left: 50%;
  max-width: min(32rem, calc(100% - 2rem));
  padding: 0.65rem 0.85rem;
  pointer-events: auto;
  position: absolute;
  top: 5.5rem;
  transform: translateX(-50%);
  width: 100%;
  z-index: 20;
}

.castle-place-mode-banner {
  top: 0.85rem;
}

.castle-move-mode-copy {
  display: grid;
  gap: 0.15rem;
}

.shop-category-card--move {
  border-color: rgba(185, 239, 177, 0.35);
}

.shop-category-card--layout {
  border-color: rgba(216, 166, 79, 0.45);
}

.shop-category-card--wall {
  border-color: rgba(140, 180, 220, 0.35);
}

.placed-building .building-label strong {
  display: -webkit-box;
  font-weight: 700;
  line-height: 1.05;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.placed-building .building-label span {
  color: rgba(248, 234, 215, 0.78);
  line-height: 1.05;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placed-building.has-texture.compact .building-label {
  background: linear-gradient(to top, rgba(16, 12, 8, 0.84), rgba(16, 12, 8, 0.35) 45%, transparent);
  min-height: auto;
  padding: 0.1rem 0.12rem 0.08rem;
}

.placed-building.has-texture.compact .building-label strong {
  font-size: clamp(0.44rem, 28cqmin, 0.58rem);
  -webkit-line-clamp: 1;
}

.placed-building.has-texture.compact .building-label span {
  font-size: clamp(0.4rem, 20cqmin, 0.52rem);
}

.placed-building.compact .building-label strong {
  font-size: clamp(0.5rem, 34cqmin, 0.68rem);
  -webkit-line-clamp: 2;
}

.placed-building.compact .building-label span {
  font-size: clamp(0.44rem, 24cqmin, 0.58rem);
}

.placed-building.medium .building-label strong {
  font-size: clamp(0.52rem, 22cqmin, 0.74rem);
}

.placed-building.medium .building-label span {
  font-size: clamp(0.46rem, 16cqmin, 0.62rem);
}

.placed-building.large .building-label strong {
  font-size: clamp(0.58rem, 18cqmin, 0.88rem);
}

.placed-building.large .building-label span {
  font-size: clamp(0.5rem, 14cqmin, 0.68rem);
}

.build-palette {
  background: rgba(23, 19, 15, 0.35);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 1rem;
  padding: 1rem;
}

.build-palette h3 {
  margin: 0;
}

.shop-interface:not(.shop-showroom-interface) {
  max-width: 62rem;
}

.shop-showroom-interface {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-width: none;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.shop-showroom-scroll-chrome {
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.94) 0%, rgba(12, 10, 8, 0.82) 72%, rgba(12, 10, 8, 0));
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.shop-showroom-scroll-chrome > * {
  pointer-events: auto;
}

.shop-showroom-scroll-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.2rem;
}

.shop-showroom-scroll-header h3 {
  font-size: 1.15rem;
  margin: 0;
}

.shop-showroom-scroll-header .eyebrow {
  font-size: 0.68rem;
  margin-bottom: 0.1rem;
}

.shop-showroom-scroll-subtitle {
  font-size: 0.82rem;
  margin: 0.15rem 0 0;
}

.shop-showroom-scroll-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.75rem 0.35rem;
}

.shop-showroom-scroll-chrome .shop-showroom-tabs {
  margin-top: 0;
  padding: 0 0.65rem;
}

.shop-showroom-toolbar {
  padding: 0.35rem 0.65rem 0.65rem;
}

.shop-showroom-scroll-chrome .shop-showroom-pan-hint {
  left: auto;
  margin: 0;
  position: static;
  top: auto;
}

.shop-showroom-tabs {
  margin-top: 0.15rem;
}

.shop-showroom-panel {
  padding-bottom: 0.35rem;
}

.shop-showroom-stage {
  background:
    radial-gradient(circle at 80% 20%, rgba(216, 166, 79, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(12, 10, 8, 0.96), rgba(20, 16, 12, 0.98));
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 1rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: min(78vh, 52rem);
  overflow: hidden;
  position: relative;
}

.shop-showroom-stage--empty {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 12rem;
  padding: 2rem;
}

.shop-showroom-stage .shop-showroom-scroll {
  flex: 1;
  min-height: min(78vh, 52rem);
}

.shop-showroom-scroll--empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.shop-showroom-empty-copy {
  margin: 0;
  max-width: 24rem;
  padding: 12rem 1.5rem 2rem;
  position: relative;
  text-align: center;
  z-index: 1;
}

.shop-showroom-scroll {
  background-color: #120f0c;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.38), rgba(12, 10, 8, 0.52)),
    url("texturen/ui/shop-showroom-hall.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: grab;
  min-height: 28rem;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.shop-showroom-scroll.is-panning {
  cursor: grabbing;
}

.shop-showroom-canvas {
  height: 100%;
  min-height: 28rem;
  position: relative;
  transition: transform 0.02s linear;
  will-change: transform;
  z-index: 1;
}

.shop-showroom-track-card.is-emerald-purchase {
  border-color: rgba(72, 196, 140, 0.55);
  box-shadow: 0 0 0 1px rgba(72, 196, 140, 0.18), 0 10px 24px rgba(8, 40, 28, 0.28);
}

.shop-showroom-track-card.is-emerald-purchase:hover {
  border-color: rgba(96, 220, 168, 0.72);
}

.shop-building-detail-card.is-emerald-purchase,
.build-chip.is-emerald-purchase {
  border-color: rgba(72, 196, 140, 0.45);
}

.premium-emerald-pill {
  background: rgba(24, 88, 62, 0.55);
  border-color: rgba(96, 220, 168, 0.45);
  color: #b8f5d8;
  font-weight: 700;
}

.premium-emerald-cost {
  background: linear-gradient(180deg, rgba(18, 72, 52, 0.92), rgba(10, 38, 28, 0.96));
  border: 2px solid rgba(96, 220, 168, 0.55);
  border-radius: 12px;
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  width: 100%;
}

.premium-emerald-cost--compact {
  border-width: 1px;
  padding: 0.55rem 0.75rem;
}

.premium-emerald-cost.is-unaffordable {
  border-color: rgba(220, 96, 96, 0.55);
  opacity: 0.82;
}

.premium-emerald-cost-header {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.premium-emerald-cost-icon {
  font-size: 1.1rem;
}

.premium-emerald-cost-amount {
  color: #8ef0c0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.premium-emerald-cost--compact .premium-emerald-cost-amount {
  font-size: 1rem;
}

.premium-emerald-cost-warning,
.premium-emerald-cost--compact .muted {
  color: rgba(184, 245, 216, 0.82);
  font-size: 0.82rem;
  margin: 0;
}

.premium-emerald-button {
  border-color: rgba(96, 220, 168, 0.45) !important;
}

.shop-showroom-track-card {
  background: var(--surface-menu-raised);
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 14px;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 0.75rem;
  overflow: hidden;
  padding: 1rem;
  position: absolute;
  text-align: left;
  top: 11.25rem;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.shop-showroom-track-card:hover {
  border-color: rgba(216, 166, 79, 0.42);
  transform: translateY(-2px);
}

.shop-showroom-track-card.is-disabled {
  opacity: 0.72;
}

.shop-showroom-track-art {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 9.25rem;
}

.shop-showroom-track-art .building-ui-icon-wrap--shop {
  transform: scale(1.32);
}

.shop-showroom-track-meta {
  display: grid;
  gap: 0.45rem;
}

.shop-showroom-track-meta strong {
  font-size: 1.05rem;
}

.shop-showroom-track-meta .muted {
  display: -webkit-box;
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.shop-showroom-track-stats {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.shop-showroom-track-stats .pill {
  font-size: 0.78rem;
}

.shop-showroom-track-cta {
  font-size: 0.82rem;
}

.shop-showroom-footer {
  align-items: center;
  background: rgba(20, 16, 12, 0.72);
  border: 1px solid rgba(216, 166, 79, 0.14);
  border-radius: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.shop-showroom-footer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-showroom-footer-stat {
  display: grid;
  gap: 0.15rem;
}

.shop-showroom-footer-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shop-showroom-back {
  margin-bottom: 0.45rem;
}

.shop-showroom-detail-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr);
}

.shop-showroom-detail-art {
  align-items: center;
  background: rgba(12, 10, 8, 0.72);
  border: 1px solid rgba(216, 166, 79, 0.14);
  border-radius: 1rem;
  display: flex;
  justify-content: center;
  min-height: 14rem;
  padding: 1rem;
}

.shop-showroom-detail-art .building-ui-icon-wrap--shop {
  transform: scale(1.52);
}

.shop-building-detail-card {
  margin: 0;
}

.modal-panel:has(.shop-showroom-interface),
.modal-panel:has(.research-tree-interface),
.modal-panel:has(.capital-research-tree-interface) {
  display: flex;
  flex-direction: column;
  max-height: 98vh;
  max-width: min(99vw, 118rem);
  overflow: hidden;
  width: min(99vw, 118rem);
}

.modal-panel:has(.building-work-interface) {
  display: flex;
  flex-direction: column;
  max-height: min(84vh, 40rem);
  max-width: min(36rem, 96vw);
  overflow: hidden;
  width: min(36rem, 96vw);
}

.modal-panel:has(.memory-game-interface) {
  display: flex;
  flex-direction: column;
  max-height: min(84vh, 38rem);
  max-width: min(36rem, 96vw);
  overflow: hidden;
  width: min(36rem, 96vw);
}

.modal-panel:has(.memory-game-interface) .building-interface {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.modal-panel:has(.shop-showroom-interface) .building-interface,
.modal-panel:has(.research-tree-interface) .building-interface,
.modal-panel:has(.capital-research-tree-interface) .building-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 94vh;
  min-height: 0;
  overflow: hidden;
}

.modal-panel:has(.building-work-interface) .building-interface {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.building-work-interface.building-interface {
  gap: 0;
  margin-top: 0;
  padding: 0;
}

.building-work-stage {
  background:
    radial-gradient(circle at 80% 20%, rgba(216, 166, 79, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(12, 10, 8, 0.96), rgba(20, 16, 12, 0.98));
  border-radius: 0.85rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.building-work-stage .building-work-scroll {
  flex: 1;
  min-height: 0;
}

.building-work-scroll {
  background-color: #120f0c;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.38), rgba(12, 10, 8, 0.52)),
    url("texturen/ui/research-tree-hall.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 38rem);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

.building-work-scroll-chrome {
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.94) 0%, rgba(12, 10, 8, 0.82) 72%, rgba(12, 10, 8, 0));
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.building-work-scroll-header {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  padding: 0.45rem 0.65rem 0.2rem;
}

.building-work-scroll-header h3 {
  font-size: 1rem;
  margin: 0;
}

.building-work-scroll-header .eyebrow {
  font-size: 0.62rem;
  margin-bottom: 0.05rem;
}

.building-work-body {
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0.65rem 0.65rem;
  position: relative;
  z-index: 1;
}

.building-work-body .unit-training-list,
.building-work-body .shop-category-grid,
.building-work-body .shop-building-list,
.building-work-body .quest-list,
.building-work-body .build-palette {
  margin-top: 0.35rem;
}

.marketplace-interface .building-work-scroll {
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.4), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/marketplace-showroom-hall.png");
}

.barracks-interface .building-work-scroll {
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.4), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/barracks-showroom-hall.png");
}

.treasury-interface .building-work-scroll,
.treasury-menu-interface .building-work-scroll,
.capital-treasury-interface .building-work-scroll {
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.42), rgba(12, 10, 8, 0.58)),
    url("texturen/ui/treasury-showroom-hall.png");
}

.round-table-interface .building-work-scroll,
.gacha-menu-interface .building-work-scroll {
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.4), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/round-table-showroom-hall.png");
}

.resource-building-interface .building-work-scroll {
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.4), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/resource-building-showroom-hall.png");
}

.building-combo-action {
  border-top: 1px solid rgba(143, 97, 36, 0.25);
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}

.building-combo-action .muted {
  margin: 0;
}

.round-table-interface .building-work-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.widget-carousel-stage {
  margin-top: 0.4rem;
}

.widget-carousel-hint {
  font-size: 0.72rem;
  margin: 0 0 0.3rem;
  padding: 0 0.1rem;
}

.widget-carousel-empty {
  margin-top: 0.4rem;
}

.widget-carousel-scroll {
  border-radius: 0.85rem;
  cursor: grab;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
}

.widget-carousel-scroll.is-panning {
  cursor: grabbing;
}

.widget-carousel-canvas {
  position: relative;
  transition: transform 0.02s linear;
  will-change: transform;
}

.widget-carousel-card {
  background: rgba(18, 15, 12, 0.88);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 0.8rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.6rem;
  position: absolute;
  top: 0;
  touch-action: pan-y;
}

.widget-carousel-nav {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin-top: 0.45rem;
  padding: 0 0.15rem;
}

.widget-carousel-nav[hidden] {
  display: none;
}

.widget-carousel-slider {
  accent-color: #d8a64f;
  flex: 1;
  min-width: 0;
}

.widget-carousel-nav-label {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 0.78rem;
  min-width: 6.5rem;
  text-align: right;
}

.barracks-interface .widget-carousel-card {
  background: rgba(12, 18, 28, 0.9);
  border-color: rgba(96, 148, 220, 0.28);
}

.marketplace-interface .widget-carousel-card {
  background: rgba(24, 16, 10, 0.9);
  border-color: rgba(216, 166, 79, 0.3);
  gap: 0.28rem;
  padding: 0.45rem 0.5rem;
}

.marketplace-interface .widget-carousel-card-art {
  min-height: 2.1rem;
}

.marketplace-interface .widget-carousel-resource-icon {
  height: 2rem;
  width: 2rem;
}

.marketplace-interface .widget-carousel-card-header {
  gap: 0.3rem;
}

.marketplace-interface .widget-carousel-card-header strong {
  font-size: 0.86rem;
}

.marketplace-interface .widget-carousel-card-header .pill {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
}

.marketplace-interface .widget-carousel-card-copy {
  font-size: 0.7rem;
  line-height: 1.2;
}

.marketplace-interface .widget-carousel-card .primary-button {
  font-size: 0.76rem;
  margin-top: 0.1rem;
  padding: 0.32rem 0.5rem;
}

.marketplace-interface .widget-carousel-hint {
  font-size: 0.68rem;
  margin-bottom: 0.2rem;
}

.marketplace-interface .widget-carousel-stage + .widget-carousel-stage {
  margin-top: 0.55rem;
}

.widget-carousel-card-art {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 3.5rem;
}

.widget-carousel-resource-icon {
  height: 3.25rem;
  image-rendering: pixelated;
  width: 3.25rem;
}

.widget-carousel-card-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: space-between;
}

.widget-carousel-card-header strong {
  font-size: 1rem;
}

.widget-carousel-card-copy {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0;
}

.widget-carousel-card-stats {
  gap: 0.35rem;
}

.university-interface .university-clean-stats {
  margin-top: 0.35rem;
}

.university-interface .building-hero-slot {
  margin-top: 0.85rem;
}

.research-tree-node.is-choice.available:hover:not(:disabled) {
  transform: scale(1.04);
}

.research-tree-node.is-choice:disabled,
.research-tree-node.is-choice.locked {
  cursor: not-allowed;
  opacity: 0.72;
}

.barracks-interface .widget-carousel-stage,
.marketplace-interface .widget-carousel-stage {
  margin-bottom: 0.35rem;
}

/* Barracks — match research tree fullscreen modal */
.modal-panel:has(.barracks-interface) {
  display: flex;
  flex-direction: column;
  max-height: 98vh;
  max-width: min(99vw, 118rem);
  overflow: hidden;
  width: min(99vw, 118rem);
}

.modal-panel:has(.barracks-interface) .building-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 94vh;
  min-height: 0;
  overflow: hidden;
}

.barracks-interface .building-work-scroll {
  max-height: none;
  overscroll-behavior: contain;
}

.barracks-interface .building-work-scroll-header {
  padding: 0.55rem 0.85rem 0.25rem;
}

.barracks-interface .building-work-scroll-header h3 {
  font-size: 1.18rem;
}

.barracks-interface .building-work-scroll-header .eyebrow {
  font-size: 0.72rem;
}

.barracks-interface .building-work-scroll-header .muted {
  font-size: 0.86rem;
}

.barracks-interface .building-work-body {
  padding: 0.35rem 0.85rem 0.9rem;
}

.barracks-interface .stat-row {
  gap: 0.45rem;
}

.barracks-interface .widget-carousel-stage {
  margin-top: 0.55rem;
}

.barracks-interface .widget-carousel-hint {
  font-size: 0.84rem;
  margin-bottom: 0.4rem;
}

.barracks-interface .widget-carousel-card {
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
}

.barracks-interface .widget-carousel-card-header strong {
  font-size: 0.98rem;
}

.barracks-interface .widget-carousel-card .muted,
.barracks-interface .counter-hint {
  font-size: 0.78rem;
  line-height: 1.35;
}

.barracks-interface .stat-row .pill,
.barracks-interface .widget-carousel-card-stats .pill {
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
}

.barracks-interface .unit-training-actions {
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.barracks-interface .unit-training-actions button {
  font-size: 0.78rem;
  min-height: 1.9rem;
  padding: 0.3rem 0.55rem;
}

.barracks-interface .training-queue {
  margin: 0.85rem 0;
  padding: 1rem 1.1rem;
}

.barracks-interface .training-queue-head,
.barracks-interface .training-active-head {
  font-size: 0.95rem;
}

.barracks-interface .training-waiting-item {
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
}

.barracks-interface .progress-track {
  height: 0.95rem;
}

.barracks-interface .building-hero-slot--compact {
  margin-top: 0.65rem;
}

.barracks-interface .hero-slot-box--compact {
  min-height: 4rem;
  min-width: 4rem;
}

.barracks-interface .interest-point-barracks-section .unit-training-card {
  padding: 0.75rem 0.8rem;
}

.capital-royal-barracks-interface .unit-training-list {
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.capital-royal-barracks-interface .capital-barracks-unit {
  background: rgba(12, 10, 8, 0.45);
  border: 1px solid rgba(216, 166, 79, 0.14);
  border-radius: 0.85rem;
  padding: 1rem;
}

.capital-royal-barracks-interface .capital-barracks-unit strong {
  font-size: 1.05rem;
}

.capital-royal-barracks-interface .capital-barracks-unit .muted {
  font-size: 0.88rem;
}

.resource-building-interface .widget-carousel-card {
  background: rgba(16, 22, 14, 0.92);
  border-color: rgba(120, 168, 88, 0.32);
}

.resource-building-widget-art {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 5.5rem;
}

.resource-building-widget-art .building-ui-icon-wrap--shop {
  transform: scale(1.28);
}

.resource-building-widget-summary {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0;
}

.resource-building-back {
  margin-bottom: 0.45rem;
}

.resource-building-detail-interface .building-interface-header h3 {
  margin-top: 0;
}

/* Resource building gallery — larger showroom carousel */
.modal-panel:has(.resource-building-interface:not(.resource-building-detail-interface)) {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 56rem);
  max-width: min(58rem, 96vw);
  overflow: hidden;
  width: min(58rem, 96vw);
}

.modal-panel:has(.resource-building-interface:not(.resource-building-detail-interface)) .building-interface {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.resource-building-interface:not(.resource-building-detail-interface) .building-work-scroll {
  max-height: min(84vh, 52rem);
}

.resource-building-interface:not(.resource-building-detail-interface) .widget-carousel-stage {
  margin-top: 0.55rem;
}

.resource-building-interface:not(.resource-building-detail-interface) .widget-carousel-card {
  padding: 0.75rem;
}

.resource-building-interface:not(.resource-building-detail-interface) .widget-carousel-card-header strong {
  font-size: 1.08rem;
}

.resource-building-interface:not(.resource-building-detail-interface) .resource-building-widget-art {
  min-height: 7rem;
}

.resource-building-interface:not(.resource-building-detail-interface) .resource-building-widget-art .building-ui-icon-wrap--shop {
  transform: scale(1.58);
}

.resource-building-interface:not(.resource-building-detail-interface) .resource-building-widget-summary {
  font-size: 0.88rem;
}

/* Resource building statistics — stay compact */
.modal-panel:has(.resource-building-detail-interface) {
  max-height: min(82vh, 38rem);
  max-width: min(34rem, 96vw);
  width: min(34rem, 96vw);
}

.resource-building-detail-interface .building-work-scroll {
  max-height: min(76vh, 34rem);
}

.resource-building-detail-interface .building-work-scroll-header h3 {
  font-size: 0.95rem;
}

.resource-building-detail-interface .building-work-scroll-header .muted {
  font-size: 0.76rem;
}

.resource-building-detail-interface .interface-stat-grid {
  gap: 0.3rem;
  margin: 0.35rem 0;
}

.resource-building-detail-interface .interface-stat-grid .castle-stat {
  padding: 0.4rem 0.5rem;
}

.resource-building-detail-interface .interface-stat-grid .castle-stat span {
  font-size: 0.62rem;
}

.resource-building-detail-interface .interface-stat-grid .castle-stat strong {
  font-size: 0.82rem;
}

.resource-building-detail-interface .stat-row .pill {
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
}

.resource-building-detail-interface .building-upgrade-section,
.resource-building-detail-interface .building-hero-slot,
.resource-building-detail-interface .demolish-controls {
  margin-top: 0.45rem;
}

.shop-category-grid,
.shop-building-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.shop-category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-building-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-category-card {
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.08), transparent),
    rgba(36, 28, 21, 0.92);
  border: 1px solid rgba(216, 166, 79, 0.16);
  border-radius: 1rem;
  padding: 1rem;
  text-align: left;
}

.shop-category-card:hover {
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.16), transparent),
    rgba(48, 37, 28, 0.96);
}

.shop-category-card strong,
.shop-category-card span {
  display: block;
}

.shop-category-card span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.edit-tools {
  background: rgba(216, 166, 79, 0.08);
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 1rem;
  margin-top: 0.85rem;
  padding: 0.85rem;
}

.edit-tools strong {
  display: block;
}

.building-interface {
  background:
    linear-gradient(135deg, rgba(119, 183, 109, 0.1), var(--surface-menu)),
    var(--surface-menu);
  border: 1px solid rgba(119, 183, 109, 0.22);
  border-radius: 0.9rem;
  display: flex;
  flex-direction: column;
  margin-top: 0.65rem;
  padding: 0.85rem 0.95rem;
}

.keep-interface {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 34rem;
}

.modal-panel:has(.keep-interface) {
  display: flex;
  flex-direction: column;
  height: min(86vh, 48rem);
  max-height: min(86vh, 48rem);
  max-width: min(52rem, 100%);
  overflow: hidden;
}

.modal-panel:has(.keep-interface) .keep-interface {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-backdrop {
  align-items: center;
  background: rgba(0, 0, 0, 0.58);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 1.25rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 200;
}

.modal-panel {
  max-height: min(82vh, 40rem);
  max-width: min(36rem, 100%);
  overflow: auto;
  width: 100%;
}

.modal-panel .castle-card,
.modal-panel .building-interface {
  background: var(--surface-menu);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.building-interface h3 {
  font-size: 1.05rem;
  margin: 0.1rem 0 0;
}

.building-interface-header {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
}

.building-interface .muted {
  font-size: 0.82rem;
  line-height: 1.35;
}

.building-interface .castle-actions .badge {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
}

.building-work-interface .stat-row,
.building-work-interface .cost-row {
  gap: 0.35rem;
  margin: 0.4rem 0;
}

.building-work-interface .button-row {
  gap: 0.35rem;
}

.building-work-interface .button-row button {
  min-width: 6rem;
}

.building-work-interface .demolish-controls,
.building-work-interface .building-rotation-controls {
  padding-top: 0.5rem;
}

.building-work-interface .building-upgrade-section {
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.building-work-interface .building-hero-slot {
  margin-top: 0.55rem;
  padding: 0.55rem 0.6rem;
}

.building-work-interface .building-combo-action {
  gap: 0.45rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.building-work-interface .resource-building-widget-art {
  min-height: 4rem;
}

.modal-section-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  margin-top: 0.55rem;
  padding: 0.6rem 0.65rem;
}

.modal-section-header {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.modal-section-header strong,
.modal-section-header span {
  display: block;
}

.modal-section-header strong {
  color: var(--accent);
}

.modal-section-header span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

.interface-stat-grid {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.45rem 0;
}

.interface-stat-grid .castle-stat {
  padding: 0.5rem 0.6rem;
}

.interface-stat-grid .castle-stat span {
  font-size: 0.68rem;
}

.interface-stat-grid .castle-stat strong {
  font-size: 0.88rem;
}

.compact-building-stat-grid {
  gap: 0.32rem;
  grid-template-columns: repeat(auto-fit, minmax(5.75rem, 1fr));
  margin: 0.35rem 0;
}

.compact-building-stat-grid .castle-stat {
  min-width: 0;
  overflow: hidden;
  padding: 0.38rem 0.45rem;
}

.compact-building-stat-grid .castle-stat span {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.compact-building-stat-grid .castle-stat strong {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.12rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.operungsaltar-interface .modal-section-card,
.castle-emerald-mine-interface .modal-section-card,
.capital-emerald-mine-interface .modal-section-card {
  padding: 0.65rem 0.75rem;
}

.operungsaltar-interface .modal-section-card .muted,
.castle-emerald-mine-interface .modal-section-card .muted,
.capital-emerald-mine-interface .modal-section-card .muted {
  font-size: 0.76rem;
  line-height: 1.35;
}

.emerald-interface .land-manage-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
}

.unit-training-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.unit-training-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.55rem 0.6rem;
}

.unit-training-card strong {
  display: block;
}

.unit-training-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.research-tree-pillar-headers {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.research-tree-pillar-header {
  color: rgba(248, 234, 215, 0.9);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.research-tree-stage.is-compact .research-tree-scroll {
  background-color: #120f0c;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.42), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/research-tree-hall.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.research-tree-lane-rail.is-hidden {
  display: none;
}

.quest-series-label {
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.quest-all-done {
  padding: 0.5rem 0;
}

.research-group {
  margin-top: 1rem;
}

.research-group h4 {
  margin-bottom: 0.55rem;
}

.research-tree {
  display: grid;
  gap: 0.7rem;
}

.research-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.8rem;
  position: relative;
}

.research-card.completed {
  border-color: rgba(119, 183, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(119, 183, 109, 0.12);
}

.research-card-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.research-card-header strong,
.research-card-header span {
  display: block;
}

.research-card-header strong {
  color: var(--accent);
}

.research-card-header span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.game-loading-screen {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  position: fixed;
  z-index: 20000;
}

.game-loading-screen.is-hidden {
  display: none;
}

.game-loading-screen.is-fading {
  animation: game-loading-fade-out 0.42s ease forwards;
}

body.is-game-loading {
  overflow: hidden;
}

.game-loading-screen-backdrop {
  background:
    radial-gradient(circle at 50% 30%, rgba(95, 154, 77, 0.16), transparent 42%),
    rgba(8, 12, 10, 0.94);
  backdrop-filter: blur(8px);
  inset: 0;
  position: absolute;
}

.game-loading-screen-card {
  background:
    linear-gradient(180deg, rgba(34, 28, 22, 0.96), rgba(18, 15, 12, 0.98));
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 1.2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  max-width: min(42rem, 96vw);
  overflow: hidden;
  position: relative;
  text-align: center;
  width: 100%;
}

.game-loading-screen-art {
  aspect-ratio: 16 / 9;
  background: #1d2a1d;
  overflow: hidden;
  position: relative;
}

.game-loading-screen-art img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.game-loading-screen-eyebrow {
  color: rgba(216, 166, 79, 0.82);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  margin: 1rem 1.25rem 0.35rem;
  text-transform: uppercase;
}

.game-loading-screen-title {
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  margin: 0 1.25rem 0.45rem;
}

.game-loading-screen-status {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  margin: 0 1.25rem 1.1rem;
}

.game-loading-screen-progress {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 0.35rem;
  margin: 0 1.25rem 1.25rem;
  overflow: hidden;
}

.game-loading-screen-progress-bar {
  background: linear-gradient(90deg, #8fbf63, #d8a64f);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
  width: 100%;
}

@keyframes game-loading-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.profile-screen {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.profile-screen.is-hidden {
  display: none;
}

.profile-screen-content {
  width: 100%;
}

.profile-shell {
  isolation: isolate;
  min-height: 100vh;
  position: relative;
}

.profile-shell-backdrop {
  background: url("assets/kronenfall-season1-landing.png") center center / cover no-repeat;
  inset: 0;
  position: fixed;
  transform: scale(1.02);
}

.profile-shell--season1-art .profile-shell-overlay {
  backdrop-filter: blur(1px);
  background:
    linear-gradient(
      90deg,
      rgba(8, 6, 5, 0.88) 0%,
      rgba(8, 6, 5, 0.42) 34%,
      rgba(8, 6, 5, 0.28) 52%,
      rgba(8, 6, 5, 0.62) 72%,
      rgba(8, 6, 5, 0.86) 100%
    ),
    linear-gradient(180deg, rgba(8, 6, 5, 0.35) 0%, transparent 38%, rgba(8, 6, 5, 0.5) 100%);
}

.profile-shell--season1-art .profile-shell-hero .profile-brand-mark,
.profile-shell--season1-art .profile-shell-hero .profile-shell-eyebrow,
.profile-shell--season1-art .profile-shell-hero .profile-shell-title {
  display: none;
}

.profile-shell--season1-art.profile-shell--admin .profile-shell-hero .profile-shell-title {
  display: block;
}

.profile-shell--season1-art .profile-shell-hero {
  align-self: end;
  padding-bottom: clamp(0.5rem, 2vw, 1.5rem);
}

.profile-shell--season1-art .profile-shell-tagline {
  color: rgba(248, 234, 215, 0.92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.profile-shell--season1-art .profile-shell-subtitle,
.profile-shell--season1-art .profile-shell-features {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.profile-shell-overlay {
  backdrop-filter: blur(2px);
  background:
    linear-gradient(115deg, rgba(8, 6, 5, 0.92) 0%, rgba(18, 12, 9, 0.78) 42%, rgba(10, 7, 5, 0.55) 100%),
    radial-gradient(circle at 18% 22%, rgba(216, 166, 79, 0.18), transparent 34rem),
    radial-gradient(circle at 82% 78%, rgba(79, 121, 212, 0.12), transparent 28rem);
  inset: 0;
  position: fixed;
}

.profile-shell-inner {
  align-items: center;
  display: grid;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  grid-template-columns: minmax(0, 1fr) minmax(24rem, 38rem);
  margin: 0 auto;
  max-width: 92rem;
  min-height: 100vh;
  padding: clamp(1.25rem, 3.5vw, 3rem);
  position: relative;
  width: 100%;
  z-index: 1;
}

.profile-shell--admin .profile-shell-inner {
  align-items: start;
  grid-template-columns: minmax(0, 0.9fr) minmax(28rem, 1.35fr);
}

@media (max-width: 960px) {
  .profile-shell-inner,
  .profile-shell--admin .profile-shell-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 2rem;
  }

  .profile-shell-hero {
    max-width: none;
  }
}

.profile-shell-hero {
  display: grid;
  gap: 0.85rem;
  max-width: 34rem;
}

.profile-brand-mark {
  align-items: center;
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, rgba(216, 166, 79, 0.22), rgba(216, 166, 79, 0.06));
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  font-size: 1.65rem;
  height: 3.25rem;
  justify-content: center;
  margin-bottom: 0.15rem;
  width: 3.25rem;
}

.profile-shell-eyebrow {
  letter-spacing: 0.14em;
  margin: 0;
}

.profile-shell-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

.profile-shell-tagline {
  color: var(--accent);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

.profile-shell-subtitle {
  color: rgba(248, 234, 215, 0.78);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  max-width: 30rem;
}

.profile-shell-features {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.profile-shell-features li {
  align-items: center;
  color: rgba(248, 234, 215, 0.86);
  display: flex;
  font-size: 0.95rem;
  gap: 0.65rem;
  line-height: 1.45;
}

.profile-shell-features li::before {
  background: linear-gradient(135deg, rgba(216, 166, 79, 0.95), rgba(143, 97, 36, 0.95));
  border-radius: 999px;
  content: "";
  flex: 0 0 0.45rem;
  height: 0.45rem;
  box-shadow: 0 0 12px rgba(216, 166, 79, 0.45);
}

.profile-shell-panel {
  backdrop-filter: blur(22px);
  background: rgba(14, 10, 8, 0.72);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 1.5rem;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: clamp(1.35rem, 2.8vw, 2rem);
  scrollbar-color: rgba(216, 166, 79, 0.35) transparent;
}

.profile-shell--admin .profile-shell-panel {
  max-height: calc(100vh - 2rem);
  min-height: min(70vh, 44rem);
}

.profile-panel-head,
.auth-panel-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.profile-panel-kicker,
.auth-panel-head .profile-panel-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
}

.profile-panel-title,
.auth-panel-head .profile-panel-title {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.profile-panel-limit {
  backdrop-filter: blur(8px);
  background: rgba(216, 166, 79, 0.1);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.auth-panel-lead {
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0.35rem 0 0;
}

.profile-screen-card {
  background: rgba(36, 28, 21, 0.92);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
  padding: 1.5rem;
}

.profile-screen-card h1 {
  margin: 0 0 0.35rem;
}

.profile-screen-card > p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.auth-tagline {
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.auth-message {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
}

.auth-message.threat {
  background: rgba(199, 95, 70, 0.12);
  border-color: rgba(199, 95, 70, 0.28);
  color: #ffb4a8;
}

.auth-message.success {
  background: rgba(119, 183, 109, 0.12);
  border-color: rgba(119, 183, 109, 0.28);
  color: #9fd89f;
}

.auth-setup-hint {
  background: rgba(111, 212, 176, 0.08);
  border: 1px solid rgba(111, 212, 176, 0.22);
  border-radius: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
}

.auth-help-list {
  margin: 0.55rem 0 0.45rem 1.1rem;
  padding: 0;
}

.auth-help-list li {
  margin-bottom: 0.25rem;
}

.auth-help-note {
  font-size: 0.88rem;
  margin: 0.35rem 0 0;
  opacity: 0.92;
}

.auth-mode-tabs {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 999px;
  display: grid;
  gap: 0.25rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
  padding: 0.25rem;
}

.auth-mode-tab {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(248, 234, 215, 0.72);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.62rem 0.85rem;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.auth-mode-tab.is-active {
  background: linear-gradient(180deg, rgba(255, 248, 230, 0.98) 0%, rgba(244, 224, 180, 0.96) 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  color: var(--button-text);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field span {
  color: rgba(248, 234, 215, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form input,
.profile-create-row input {
  background: rgba(248, 234, 215, 0.05);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 0.9rem;
  color: var(--text);
  font: inherit;
  min-width: 0;
  padding: 0.82rem 0.95rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.auth-form input:focus,
.profile-create-row input:focus {
  background: rgba(248, 234, 215, 0.08);
  border-color: rgba(216, 166, 79, 0.55);
  box-shadow: 0 0 0 3px rgba(216, 166, 79, 0.14);
  outline: none;
}

.auth-form input {
  width: 100%;
}

.auth-submit-button {
  margin-top: 0.35rem;
  width: 100%;
}

.auth-footnote {
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 1rem 0 0;
  text-align: center;
}

.account-menu-card {
  backdrop-filter: blur(10px);
  background: rgba(216, 166, 79, 0.07);
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 0.95rem;
}

.account-menu-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.account-menu-user {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.account-menu-avatar {
  align-items: center;
  background: linear-gradient(135deg, rgba(216, 166, 79, 0.95), rgba(143, 97, 36, 0.95));
  border-radius: 999px;
  color: #24160f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 800;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}

.account-menu-email {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.account-logout-button {
  margin-left: auto;
}

.account-sync-pill {
  font-size: 0.74rem;
}

.profile-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-card {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(248, 234, 215, 0.1);
  border-radius: 1.1rem;
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.profile-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(216, 166, 79, 0.28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.profile-card-top {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.profile-card-identity {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.profile-card-initial {
  align-items: center;
  background: linear-gradient(135deg, rgba(216, 166, 79, 0.95), rgba(143, 97, 36, 0.95));
  border-radius: 0.85rem;
  color: #24160f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.profile-card-copy strong {
  display: block;
  font-size: 1.05rem;
}

.profile-card-copy span {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
  margin-top: 0.18rem;
}

.profile-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.profile-server-selector {
  border: 0;
  display: grid;
  gap: 0.55rem;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.profile-server-selector legend {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.profile-server-selector > p {
  font-size: 0.82rem;
  margin: 0;
}

.profile-server-list {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-server-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(248, 234, 215, 0.1);
  border-radius: 0.85rem;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 0.8rem;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.profile-server-card:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(216, 166, 79, 0.3);
  transform: translateY(-1px);
}

.profile-server-card.is-selected {
  background: rgba(216, 166, 79, 0.12);
  border-color: rgba(216, 166, 79, 0.5);
  box-shadow: 0 0 0 2px rgba(216, 166, 79, 0.08);
}

.profile-server-card:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.profile-server-card-head {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.profile-server-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-server-status {
  border: 1px solid rgba(98, 180, 118, 0.28);
  border-radius: 999px;
  color: #9ed6a9;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.16rem 0.42rem;
  text-transform: uppercase;
}

.profile-server-card.is-full .profile-server-status,
.profile-server-card.is-closed .profile-server-status {
  border-color: rgba(199, 95, 70, 0.35);
  color: #e4a092;
}

.profile-server-population,
.profile-server-region,
.profile-server-loading {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-card-meta {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 520px) {
  .profile-card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-meta-chip {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(248, 234, 215, 0.07);
  border-radius: 0.8rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
}

.profile-meta-chip span {
  color: rgba(197, 170, 139, 0.88);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-meta-chip strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-actions {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.profile-open-button {
  width: 100%;
}

.profile-delete-button {
  white-space: nowrap;
}

.profile-card-header {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.profile-card-header strong {
  display: block;
  font-size: 1.05rem;
}

.profile-card-header span {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.profile-card-stats {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.profile-admin-badge {
  background: rgba(120, 72, 18, 0.16);
  border-color: rgba(120, 72, 18, 0.35);
  color: #8a4d12;
}

.profile-screen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.profile-screen-tabs button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(248, 234, 215, 0.1);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.profile-screen-tabs button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.profile-screen-tabs button.active {
  background: rgba(216, 166, 79, 0.14);
  border-color: rgba(216, 166, 79, 0.35);
  color: var(--accent);
}

.admin-profile-browser {
  display: grid;
  gap: 1rem;
}

.admin-profile-browser-lead {
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0.35rem 0 0;
}

.admin-server-population {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.admin-server-tools {
  background: rgba(18, 10, 16, 0.72);
  border: 1px solid rgba(171, 56, 83, 0.35);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.admin-action-feedback {
  border-radius: 0.45rem;
  font-weight: 600;
  margin: 0;
  padding: 0.55rem 0.7rem;
}

.admin-action-feedback.is-success {
  background: rgba(58, 140, 88, 0.18);
  border: 1px solid rgba(88, 196, 120, 0.4);
  color: #b8f0c8;
}

.admin-action-feedback.is-error {
  background: rgba(140, 42, 58, 0.2);
  border: 1px solid rgba(220, 88, 108, 0.4);
  color: #ffc0cf;
}

.admin-server-population-card {
  background: rgba(216, 166, 79, 0.06);
  border: 1px solid rgba(216, 166, 79, 0.16);
  border-radius: 0.8rem;
  display: grid;
  gap: 0.12rem;
  padding: 0.7rem 0.8rem;
}

.admin-server-population-card span,
.admin-server-population-card small {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-server-population-card strong {
  font-size: 1.05rem;
}

.admin-profile-search {
  display: grid;
  gap: 0.45rem;
}

.admin-profile-search span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-profile-search input {
  background: rgba(248, 234, 215, 0.06);
  border: 1px solid rgba(248, 234, 215, 0.14);
  border-radius: 0.85rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.8rem 0.95rem;
  width: 100%;
}

.admin-profile-search input:focus {
  border-color: rgba(216, 166, 79, 0.45);
  outline: none;
}

.admin-profile-browser-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(14rem, 0.95fr) minmax(16rem, 1.05fr);
  min-height: 24rem;
}

@media (max-width: 720px) {
  .admin-profile-browser-layout {
    grid-template-columns: 1fr;
  }
}

.admin-profile-browser-list,
.admin-profile-browser-detail {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 1rem;
  display: grid;
  gap: 0.65rem;
  max-height: min(58vh, 36rem);
  overflow: auto;
  padding: 0.85rem;
}

.admin-profile-browser-list-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0 0.15rem 0.35rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-profile-result {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 0.85rem;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 0.95rem;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
  width: 100%;
}

.admin-profile-result:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(216, 166, 79, 0.22);
}

.admin-profile-result.is-selected {
  background: rgba(216, 166, 79, 0.1);
  border-color: rgba(216, 166, 79, 0.35);
}

.admin-profile-result.is-admin {
  border-color: rgba(120, 72, 18, 0.28);
}

.admin-profile-result-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.admin-profile-result-main strong {
  font-size: 0.98rem;
}

.admin-profile-result-meta {
  font-size: 0.8rem;
}

.admin-profile-result-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-profile-detail-card {
  display: grid;
  gap: 1rem;
}

.admin-profile-detail-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.admin-profile-detail-head h3 {
  font-size: 1.25rem;
  margin: 0.15rem 0 0;
}

.admin-profile-detail-id {
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
  word-break: break-all;
}

.admin-profile-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-profile-detail-section h4 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

.admin-profile-stat-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.admin-profile-stat-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(248, 234, 215, 0.07);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem 0.75rem;
}

.admin-profile-stat-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-profile-stat-chip strong {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-profile-detail-empty {
  display: grid;
  gap: 0.45rem;
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.admin-profile-detail-loading {
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.admin-profile-panel {
  background: rgba(120, 72, 18, 0.08);
  border: 1px solid rgba(120, 72, 18, 0.22);
  border-radius: 1rem;
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.admin-profile-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.admin-profile-list {
  display: grid;
  gap: 0.55rem;
}

.admin-profile-row {
  align-items: center;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(248, 234, 215, 0.08);
  border-radius: 0.75rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
}

.admin-profile-row.is-admin {
  border-color: rgba(120, 72, 18, 0.35);
}

.admin-profile-row-main {
  display: grid;
  gap: 0.15rem;
}

.admin-profile-row-main strong {
  font-size: 0.98rem;
}

.admin-profile-row .secondary-button.is-active {
  border-color: rgba(120, 72, 18, 0.45);
  color: #8a4d12;
}

.profile-create-card {
  backdrop-filter: blur(10px);
  background: rgba(216, 166, 79, 0.06);
  border: 1px solid rgba(216, 166, 79, 0.16);
  border-radius: 1.1rem;
  display: grid;
  gap: 0.85rem;
  margin-top: 0.25rem;
  padding: 1rem;
}

.profile-create-head {
  display: grid;
  gap: 0.2rem;
}

.profile-create-head strong {
  font-size: 1rem;
}

.profile-create-row {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.profile-create-row input {
  flex: 1 1 auto;
}

@media (max-width: 520px) {
  .profile-server-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.profile-empty {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(248, 234, 215, 0.14);
  border-radius: 1rem;
  color: var(--muted);
  margin: 0;
  padding: 1.35rem 1rem;
  text-align: center;
}

.profile-help {
  color: rgba(197, 170, 139, 0.92);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 1rem 0 0;
  text-align: center;
}

.warfare-alert-panel {
  background: rgba(199, 95, 70, 0.14);
  border: 1px solid rgba(199, 95, 70, 0.45);
  border-radius: 1rem;
  display: grid;
  gap: 0.65rem;
  grid-column: 1 / -1;
  margin-bottom: 0.35rem;
  padding: 0.85rem 1rem;
}

.warfare-alert-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.warfare-alert-header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.warfare-alert {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
}

.warfare-alert.warning {
  border-color: rgba(216, 166, 79, 0.55);
}

.warfare-alert strong {
  font-size: 0.95rem;
}

.warfare-alert span {
  color: var(--muted);
  font-size: 0.85rem;
}

.incoming-attacks-interface .interface-stat-grid {
  margin-bottom: 0.75rem;
}

.incoming-notice-list,
.incoming-attacks-interface .battle-record-incoming {
  display: grid;
  gap: 0.65rem;
}

.incoming-notice {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
}

.incoming-notice.incoming,
.incoming-notice.warning {
  border-color: rgba(216, 166, 79, 0.55);
}

.incoming-notice.victory {
  border-color: rgba(95, 168, 112, 0.55);
}

.incoming-notice.defeat {
  border-color: rgba(199, 95, 70, 0.55);
}

.incoming-notice span {
  color: var(--muted);
  font-size: 0.82rem;
}

.incoming-attacks-button {
  position: relative;
}

.menu-badge {
  background: rgba(216, 166, 79, 0.95);
  border-radius: 999px;
  color: #1a1410;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.35rem;
  padding: 0.2rem 0.45rem;
}

.menu-badge.alert {
  background: rgba(199, 95, 70, 0.95);
  color: #fff8f2;
}

.menu-badge.loot-goblin {
  background: rgba(119, 183, 109, 0.95);
  color: #102010;
}

.raid-strength-estimate {
  display: block;
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.raid-strength-estimate strong {
  color: #e6c14a;
}

.castle-incoming-alert {
  margin-top: 0.85rem;
}

.castle-incoming-alert .warfare-alert-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.login-rewards-interface .login-reward-timeline {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.login-reward-slot {
  align-items: center;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  padding: 0.75rem 0.9rem;
}

button.login-reward-slot {
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

button.login-reward-slot.is-claimable:hover {
  background: rgba(216, 166, 79, 0.1);
  border-color: rgba(216, 166, 79, 0.55);
  transform: translateY(-1px);
}

button.login-reward-slot.is-claimable:active {
  transform: translateY(0);
}

.login-reward-slot.is-claimable {
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.2);
}

.login-reward-slot.is-pending-unit {
  animation: loginRewardPulse 1.8s ease-in-out infinite;
}

.login-reward-hint {
  margin-top: 0.85rem;
  text-align: center;
}

@keyframes loginRewardPulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.2);
  }

  50% {
    box-shadow: 0 0 0 2px rgba(216, 166, 79, 0.45);
  }
}

.login-reward-slot.is-claimed {
  opacity: 0.72;
}

.login-reward-slot.is-current {
  border-color: rgba(216, 166, 79, 0.45);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.15);
}

.login-reward-slot.is-locked {
  opacity: 0.55;
}

.login-reward-slot-head {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
}

.login-reward-slot-num {
  align-items: center;
  background: rgba(216, 166, 79, 0.18);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  height: 1.75rem;
  justify-content: center;
  width: 1.75rem;
}

.login-reward-slot-head strong {
  display: block;
}

.login-reward-slot-head .muted {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.pill.pill-success {
  background: rgba(47, 174, 118, 0.2);
  color: #7dffb8;
}

.pill.pill-current {
  background: rgba(216, 166, 79, 0.22);
  color: var(--accent);
}

.login-reward-unit-picker {
  margin-top: 1rem;
}

.login-reward-unit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.login-reward-unit-btn {
  min-width: 7rem;
}

.rewards-hub {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rewards-hub-header h4 {
  margin: 0.15rem 0 0;
}

.rewards-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rewards-hub-tab {
  align-items: center;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
}

.rewards-hub-tab.is-active {
  background: rgba(216, 166, 79, 0.18);
  border-color: rgba(216, 166, 79, 0.45);
  color: var(--accent);
}

.rewards-hub-tab-badge {
  background: #d84f4f;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.15rem 0.4rem;
}

.rewards-panel-intro {
  margin: 0;
}

.level-roadmap-progress {
  margin-top: 0;
}

.level-roadmap-timeline,
.rewards-daily-panel {
  display: grid;
  gap: 0.65rem;
}

.level-roadmap-slot {
  align-items: center;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  padding: 0.75rem 0.9rem;
}

.level-roadmap-slot.is-achieved {
  opacity: 0.82;
}

.level-roadmap-slot.is-next {
  border-color: rgba(216, 166, 79, 0.45);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.15);
}

.level-roadmap-slot-head {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
}

.level-roadmap-slot-num {
  align-items: center;
  background: rgba(111, 177, 224, 0.18);
  border-radius: 999px;
  color: #9fd0f0;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  height: 1.75rem;
  justify-content: center;
  width: 1.75rem;
}

.level-roadmap-slot-head strong {
  display: block;
}

.level-roadmap-slot-head .muted {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.level-roadmap-slot-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.rewards-daily-section + .rewards-daily-section {
  margin-top: 0.25rem;
}

.hud-chip.hud-boost strong,
.hud-chip.hud-boost {
  color: #7dffb8;
}

.hud-chip.hud-login-reward {
  padding: 0;
  border: none;
  background: transparent;
}

.hud-chip-button {
  background: var(--button-bg);
  border: 1px solid var(--button-danger-border);
  border-radius: 99rem;
  box-shadow: var(--button-shadow);
  color: var(--button-danger-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
}

.hud-chip-button:hover {
  background: var(--button-danger-bg);
  border-color: rgba(199, 95, 70, 0.72);
}

.login-rewards-button {
  position: relative;
}

.warfare-alert-panel.inline-alerts {
  margin-top: 0.75rem;
}

.keep-layout {
  display: grid;
  flex: 1;
  gap: 1.25rem;
  grid-template-columns: minmax(10.5rem, 0.28fr) 1fr;
  margin-top: 1rem;
  min-height: 0;
}

.keep-side-menu {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
}

.keep-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 26rem;
  min-height: 26rem;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.keep-content > .quest-panel--embedded,
.keep-content > .keep-ruler-champion-menu {
  flex: 1;
  min-height: 0;
}

.keep-content .quest-panel--embedded {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  min-height: 0;
  padding: 0;
}

.keep-content .quest-panel--embedded .modal-section-header {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.keep-content .quest-panel--embedded .quest-track-list {
  flex: 1;
  gap: 0.75rem;
  min-height: 0;
}

.keep-content .quest-panel--embedded .quest-track-section {
  padding: 0.7rem 0.8rem;
}

.keep-content .quest-panel--embedded .quest-track-header {
  margin-bottom: 0.55rem;
}

.capital-tax-stats-scroll {
  overflow-x: auto;
}

.capital-tax-stats-table {
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 100%;
  width: max-content;
}

.capital-tax-stats-table th,
.capital-tax-stats-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.capital-tax-stats-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.capital-tax-stats-table td strong {
  display: block;
}

.capital-tax-stats-table td .muted {
  display: block;
  font-size: 0.74rem;
}

.capital-tax-resource-cell {
  display: grid;
  gap: 0.1rem;
}

.capital-tax-rate {
  font-size: 0.72rem;
}

.capital-tax-stats-total-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 0.65rem;
}

.capital-tax-rate-hint {
  margin-top: 0.55rem;
}

.capital-tax-recent-block {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.capital-tax-stats-scroll--recent {
  max-height: 16rem;
  overflow-y: auto;
}

.capital-building-interface {
  max-width: min(98vw, 62rem);
}

.capital-exchange-interface .capital-exchange-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin-top: 0.75rem;
}

.capital-exchange-card {
  display: grid;
  gap: 0.55rem;
}

.capital-exchange-card-head {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.capital-research-launcher .capital-research-badge {
  font-size: 0.72rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}

.capital-research-tree-interface .research-card-list {
  display: grid;
  gap: 0.75rem;
}

.keep-side-menu button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.keep-side-menu button.active {
  color: var(--button-text);
}

.keep-menu-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0.4rem 0 0.05rem;
  text-transform: uppercase;
}

.keep-profile-card {
  align-items: center;
  background: rgba(216, 166, 79, 0.1);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 1rem;
  display: flex;
  gap: 1.15rem;
  margin: 0;
  padding: 1.15rem 1.25rem;
}

.keep-profile-card h4 {
  margin: 0.15rem 0 0;
}

.ruler-avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 999px;
  color: #1c1209;
  display: flex;
  flex: 0 0 4rem;
  font-size: 1.8rem;
  font-weight: 900;
  height: 4rem;
  justify-content: center;
  width: 4rem;
}

.ruler-avatar.has-image {
  background: rgba(23, 19, 15, 0.5);
  border: 2px solid rgba(216, 166, 79, 0.45);
  overflow: hidden;
}

.ruler-avatar img {
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  width: 100%;
}

.portrait-editor {
  margin: 0.8rem 0;
}

.keep-ruler-champion-menu {
  display: grid;
  gap: 1rem;
  margin: 0 auto;
  max-width: 28rem;
  width: 100%;
}

.keep-ruler-champion-showcase {
  display: grid;
  gap: 0.5rem;
  text-align: center;
}

.keep-ruler-champion-showcase h4 {
  margin: 0;
}

.keep-ruler-champion-showcase .hero-showroom-portrait--hero {
  margin: 0 auto;
  max-width: 18rem;
  min-height: 24rem;
  width: 100%;
}

.keep-ruler-champion-actions {
  background: rgba(248, 234, 215, 0.05);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 1rem;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.keep-ruler-champion-status {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  text-align: center;
}

.keep-ruler-champion-empty {
  margin: 0;
  text-align: center;
}

.keep-ruler-champion-select {
  display: grid;
  gap: 0.35rem;
}

.keep-ruler-champion-select span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.keep-ruler-champion-select select {
  width: 100%;
}

.keep-ruler-champion-buttons {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.keep-ruler-champion-hero-slot {
  background: rgba(248, 234, 215, 0.05);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 1rem;
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
}

.keep-ruler-champion-hero-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.keep-ruler-champion-hero-slot .building-hero-slot--compact {
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  width: 100%;
}

.keep-ruler-champion-hero-slot .hero-slot-box {
  width: 100%;
}

.social-leaderboard-tab {
  display: grid;
  gap: 0.75rem;
}

.social-leaderboard-tab .leaderboard-hub {
  margin-top: 0.25rem;
}

.portrait-upload {
  background: rgba(248, 234, 215, 0.08);
  border: 1px solid rgba(248, 234, 215, 0.16);
  border-radius: 0.65rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 0.6rem;
  padding: 0.65rem 0.85rem;
}

.portrait-upload input {
  display: none;
}

.portrait-controls {
  display: grid;
  gap: 0.65rem;
  margin: 0.8rem 0;
}

.portrait-controls label {
  color: var(--muted);
  display: grid;
  font-size: 0.85rem;
  gap: 0.35rem;
}

.portrait-controls input {
  accent-color: var(--accent);
}

.keep-management {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.8rem 0;
}

.keep-management label {
  color: var(--muted);
  display: grid;
  flex: 1;
  font-size: 0.85rem;
  gap: 0.35rem;
  min-width: 14rem;
}

.keep-management input {
  background: rgba(248, 234, 215, 0.08);
  border: 1px solid rgba(248, 234, 215, 0.16);
  border-radius: 0.55rem;
  color: var(--text);
  padding: 0.7rem;
}

.ruler-selection {
  margin: 0.8rem 0;
}

.leaderboard-empty {
  border-style: dashed;
}

.settings-field {
  color: var(--muted);
  display: grid;
  font-size: 0.85rem;
  gap: 0.35rem;
}

.settings-field select {
  background: rgba(248, 234, 215, 0.08);
  border: 1px solid rgba(248, 234, 215, 0.16);
  border-radius: 0.55rem;
  color: var(--text);
  padding: 0.7rem;
}

.settings-field option {
  background: var(--panel);
  color: var(--text);
}

.settings-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.settings-subnav button {
  min-width: auto;
}

.settings-subnav button.active {
  color: var(--button-text);
}

.settings-menu-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.9rem;
}

.settings-menu-card {
  background:
    linear-gradient(135deg, rgba(216, 166, 79, 0.1), var(--surface-menu-raised)),
    var(--surface-menu-raised);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 1rem;
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  text-align: left;
}

.settings-menu-card strong,
.settings-menu-card span {
  display: block;
}

.settings-menu-card strong {
  color: var(--accent);
}

.settings-menu-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.settings-menu-card.has-alert,
.attack-menu-subnav button.has-alert {
  border-color: rgba(220, 90, 70, 0.55);
  box-shadow: 0 0 0 1px rgba(220, 90, 70, 0.15);
}

.view-menu-card .attack-menu-button.has-incoming-alert {
  border-color: rgba(220, 90, 70, 0.65);
  box-shadow: 0 0 10px rgba(220, 90, 70, 0.2);
}

.view-menu-card .world-map-button.has-loot-goblin-alert {
  border-color: rgba(119, 183, 109, 0.65);
  box-shadow: 0 0 10px rgba(119, 183, 109, 0.22);
}

.attack-menu-subnav button {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.cheat-resource-list {
  display: grid;
  gap: 0.65rem;
}

.cheat-resource-row {
  align-items: center;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 0.55fr) minmax(12rem, 1fr);
  padding: 0.75rem;
}

.cheat-resource-row strong,
.cheat-resource-row span {
  display: block;
}

.cheat-resource-row strong {
  color: var(--accent);
}

.cheat-resource-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.cheat-resource-row input {
  background: rgba(248, 234, 215, 0.08);
  border: 1px solid rgba(248, 234, 215, 0.16);
  border-radius: 0.55rem;
  color: var(--text);
  padding: 0.7rem;
  width: 100%;
}

.cheat-resource-row.cheat-level-row {
  grid-template-columns: 1fr;
}

.cheat-inline-label {
  display: grid;
  gap: 0.35rem;
}

.cheat-inline-label span {
  color: rgba(248, 234, 215, 0.72);
  font-size: 0.85rem;
}

.patch-notes-list {
  display: grid;
  gap: 0.65rem;
}

.patch-note-card {
  background: rgba(216, 166, 79, 0.08);
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 0.85rem;
  padding: 0.8rem;
}

.patch-note-card strong,
.patch-note-card span {
  display: block;
}

.patch-note-card strong {
  color: var(--accent);
}

.patch-note-card span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.patch-note-card p {
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.wall-upgrade-card {
  margin-top: 0.8rem;
}

.owned {
  border-color: rgba(119, 183, 109, 0.8);
}

.threat {
  color: var(--danger);
  font-weight: 800;
}

.event-log {
  color: var(--muted);
  margin: 1rem 0 0;
  padding-left: 1.3rem;
}

.event-log li {
  margin: 0.35rem 0;
}

@media (max-width: 820px) and (orientation: portrait) {
  .app.is-castle-view .castle-map-shell {
    padding: 5.25rem 0.5rem 5.75rem;
  }

  .castle-place-mode-banner {
    top: 0.55rem;
  }

  .app.is-harbor-view .harbor-map-shell {
    padding: 6.5rem 0.5rem 5.5rem;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 1rem;
  }

  .app.is-castle-view {
    padding: 0;
  }

  .castle-map-center-cluster.has-layout-rail {
    align-items: stretch;
    flex-direction: column;
    width: min(100%, 22rem);
  }

  .castle-layout-mode-rail {
    flex: 0 0 auto;
    max-width: none;
    position: static;
    top: auto;
    width: 100%;
  }

  .castle-left-column {
    bottom: 0.45rem;
    left: 0.55rem;
    top: 0.55rem;
    width: min(calc(100vw - 1rem), 15rem);
  }

  .castle-resource-list .resource-tooltip {
    bottom: auto;
    left: 0;
    top: calc(100% + 0.35rem);
    transform: translateY(0.25rem);
  }

  .castle-resource-list .resource-with-tooltip:hover .resource-tooltip,
  .castle-resource-list .resource-with-tooltip.is-tooltip-open .resource-tooltip,
  .castle-resource-list .resource-with-tooltip:focus-within .resource-tooltip {
    transform: translateY(0);
  }

  .castle-top-right-panel {
    align-items: flex-end;
    left: auto;
    max-width: calc(100vw - 1rem);
    right: 0.55rem;
    top: 0.55rem;
  }

  .castle-queue-launcher,
  .castle-menu-launcher,
  .castle-minigame-launcher {
    align-self: flex-end;
  }

  .castle-hud-dropdown {
    width: min(100vw - 1.1rem, 18rem);
  }

  .castle-resource-dropdown.castle-hud-dropdown {
    width: min(100vw - 1.1rem, 13rem);
  }

  .castle-menu-dropdown,
  .castle-shop-dropdown,
  .castle-log-dropdown {
    width: min(100%, 18rem);
  }

  .castle-bottom-nav {
    bottom: 0.45rem;
    width: min(calc(100vw - 1rem), 30rem);
  }

  .castle-world-map-button {
    min-width: 8.2rem;
  }

  .hero,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-grid,
  .two-columns,
  .land-grid {
    grid-template-columns: 1fr;
  }

  .world-map {
    min-height: 56rem;
  }

  html.is-mobile-client body.is-mobile-landscape .world-map {
    height: 100dvh;
    min-height: 100dvh;
  }

  .map-hud {
    grid-template-columns: 1fr;
  }

  .map-menu-launcher {
    width: 100%;
  }

  .map-menu-dropdown {
    left: 0;
    right: 0;
    width: 100%;
  }

  .menu-button-row {
    justify-content: stretch;
  }

  .menu-button-row button,
  .menu-button-row .badge {
    flex: 1;
    min-width: 8rem;
  }

  .view-menu-card,
  .map-menu-card {
    width: 100%;
  }

  .map-resource-bar {
    justify-content: flex-start;
  }

  .map-label {
    min-width: 7.5rem;
  }

  .castle-card-header {
    flex-direction: column;
  }

  .castle-actions {
    align-items: flex-start;
  }

  .castle-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .interface-stat-grid {
    grid-template-columns: 1fr;
  }

  .castle-view-actions {
    align-items: stretch;
    justify-items: stretch;
  }

  .castle-wall-ring {
    --castle-cell-size: min(
      var(--castle-cell-max, 5.5rem),
      calc((100vw - 1.5rem) / var(--castle-ring-span-x)),
      calc((100dvh - 12rem) / var(--castle-ring-span-y))
    );
  }

  .castle-grid {
    min-height: auto;
  }

  .shop-category-grid,
  .shop-building-list,
  .settings-menu-grid {
    grid-template-columns: 1fr;
  }

  .shop-showroom-detail-layout {
    grid-template-columns: 1fr;
  }

  .shop-showroom-stage,
  .shop-showroom-scroll,
  .shop-showroom-canvas,
  .building-work-stage,
  .building-work-scroll,
  .widget-carousel-scroll {
    min-height: 18rem;
  }

  .memory-shop-detail-layout {
    grid-template-columns: 1fr;
  }

  .memory-shop-showroom-stage,
  .memory-shop-showroom-scroll,
  .memory-shop-showroom-canvas {
    min-height: 20rem;
  }

  .cheat-resource-row {
    grid-template-columns: 1fr;
  }

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

  .keep-content {
    max-height: 22rem;
    min-height: 22rem;
  }

  .keep-side-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hud-emeralds strong,
.hud-emeralds {
  color: #2fae76;
}

.glory-offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.glory-offer .army-card-header {
  margin-bottom: 0.5rem;
}

.pill.pill-glory {
  background: rgba(230, 193, 74, 0.16);
  border-color: rgba(230, 193, 74, 0.4);
  color: #f0d97a;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.leaderboard-hub {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.leaderboard-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-menu-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.leaderboard-tab.is-active {
  background: rgba(216, 166, 79, 0.18);
  border-color: rgba(216, 166, 79, 0.45);
  color: var(--accent);
}

.leaderboard-tab-rank {
  font-size: 0.78rem;
  opacity: 0.85;
}

.leaderboard-live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.leaderboard-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.7rem;
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
}

.leaderboard-row.is-player {
  background: rgba(216, 166, 79, 0.14);
  border-color: rgba(216, 166, 79, 0.4);
}

.leaderboard-rank {
  font-weight: 800;
  color: var(--accent);
  min-width: 2.4rem;
}

.leaderboard-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.leaderboard-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.leaderboard-daily-rewards {
  margin-top: 0.75rem;
}

.leaderboard-daily-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.leaderboard-daily-rewards .primary-button {
  margin-bottom: 0.85rem;
}

.leaderboard-reward-tiers {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-reward-tier {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
}

.leaderboard-reward-tier.is-current {
  border-color: rgba(216, 166, 79, 0.45);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.12);
}

.leaderboard-reward-tier strong {
  color: var(--accent);
  font-size: 0.9rem;
}

.pill.pill-emerald {
  background: rgba(47, 174, 118, 0.18);
  border-color: rgba(47, 174, 118, 0.4);
  color: #7dffb8;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.hero-card,
.hero-widget-card {
  border: 3px solid var(--hero-rank-color, #7d8a97);
  border-radius: 14px;
  padding: 0;
  background: var(--surface-menu-raised);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.hero-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.85rem;
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-card-header strong {
  display: block;
}

.hero-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-weight: 700;
  color: #1a1200;
  flex: 0 0 auto;
}

.hero-rank-C,
.hero-rank-C .hero-rank-badge,
.hero-rank-C .hero-showroom-portrait-fallback {
  --hero-rank-color: #7d8a97;
}

.hero-rank-B,
.hero-rank-B .hero-rank-badge,
.hero-rank-B .hero-showroom-portrait-fallback {
  --hero-rank-color: #4f9d69;
}

.hero-rank-A,
.hero-rank-A .hero-rank-badge,
.hero-rank-A .hero-showroom-portrait-fallback {
  --hero-rank-color: #4f79d4;
}

.hero-rank-S,
.hero-rank-S .hero-rank-badge,
.hero-rank-S .hero-showroom-portrait-fallback {
  --hero-rank-color: #d4af37;
}

.hero-rank-Z,
.hero-rank-Z .hero-rank-badge,
.hero-rank-Z .hero-showroom-portrait-fallback {
  --hero-rank-color: #9b59b6;
}

.pill.hero-rank-S,
.hero-rank-S .hero-rank-badge {
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.6);
}

.hero-assign {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.hero-assign select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.building-hero-slot {
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(138, 111, 176, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.building-hero-slot--compact {
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.4rem 0.55rem;
}

.building-hero-slot-label {
  flex-shrink: 0;
  font-size: 0.78rem;
}

.building-hero-slot-box-wrap {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

.hero-slot-box {
  align-items: center;
  background: rgba(12, 10, 18, 0.45);
  border: 2px dashed rgba(216, 194, 122, 0.35);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  min-height: 7.5rem;
  min-width: 7.5rem;
  padding: 0.55rem;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hero-slot-box:hover,
.hero-slot-box:focus-visible {
  background: rgba(138, 111, 176, 0.16);
  border-color: rgba(216, 194, 122, 0.65);
  outline: none;
  transform: translateY(-1px);
}

.hero-slot-box--compact {
  min-height: 4.5rem;
  min-width: 4.5rem;
  padding: 0.35rem;
}

.hero-slot-box--empty .hero-slot-plus {
  color: rgba(216, 194, 122, 0.85);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}

.hero-slot-box--compact.hero-slot-box--empty .hero-slot-plus {
  font-size: 1.5rem;
}

.hero-slot-box--assigned .hero-ui-icon-wrap {
  height: 4.5rem;
  width: 4.5rem;
}

.hero-slot-box--compact.hero-slot-box--assigned .hero-ui-icon-wrap {
  height: 2.8rem;
  width: 2.8rem;
}

.hero-ui-icon-wrap {
  flex-shrink: 0;
  height: 4.5rem;
  width: 4.5rem;
}

.hero-ui-icon-wrap--compact {
  height: 2.8rem;
  width: 2.8rem;
}

.hero-ui-icon-wrap--picker {
  height: 3rem;
  width: 3rem;
}

.hero-ui-icon {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hero-ui-icon-wrap--fallback {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.22)),
    var(--hero-rank-color, #7d8a97);
  border-radius: 8px;
  display: flex;
  justify-content: center;
}

.hero-ui-icon-fallback {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-ui-icon-wrap--compact .hero-ui-icon-fallback {
  font-size: 0.72rem;
}

.hero-slot-box-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 6.5rem;
  text-align: center;
}

.hero-slot-box--compact .hero-slot-box-name {
  font-size: 0.68rem;
  max-width: 4.5rem;
}

.hero-slot-box-bonus {
  font-size: 0.68rem;
  line-height: 1.2;
}

.hero-assign-picker {
  background: rgba(8, 6, 12, 0.55);
  border: 1px solid rgba(216, 194, 122, 0.18);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.55rem;
  padding: 0.75rem;
  width: 100%;
}

.building-hero-slot--compact .hero-assign-picker {
  flex: 1 1 100%;
}

.hero-assign-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 16rem;
  overflow-y: auto;
}

.hero-assign-picker-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.hero-assign-picker-row:hover,
.hero-assign-picker-row:focus-visible {
  background: rgba(138, 111, 176, 0.14);
  border-color: rgba(216, 194, 122, 0.35);
  outline: none;
}

.hero-assign-picker-row.is-active {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.hero-assign-picker-row--remove {
  border-style: dashed;
}

.hero-assign-picker-remove-icon {
  align-items: center;
  background: rgba(180, 70, 70, 0.2);
  border-radius: 999px;
  color: #f0a0a0;
  display: flex;
  font-size: 1.1rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.hero-assign-picker-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hero-assign-picker-row .hero-ui-icon-wrap {
  flex-shrink: 0;
}

.barracks-interface .building-hero-slot--compact {
  margin-top: 0.45rem;
}

.hero-specials {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: #d8c27a;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-upgrade {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-upgrade button {
  width: 100%;
}

.round-table-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0 0.25rem;
}

.round-table-interface .round-table-summon {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  min-height: min(48vh, 26rem);
  padding-top: 0.35rem;
}

.round-table-interface .round-table-summon-meta {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
}

.round-table-interface .round-table-summon-meta strong {
  display: block;
  font-size: 1rem;
}

.round-table-interface .round-table-summon-meta p {
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
}

.round-table-interface .round-table-chances {
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0;
}

.round-table-interface .hero-showroom-link-hint {
  font-size: 0.78rem;
  margin: 0;
}

.round-table-interface .round-table-summon-actions {
  margin-top: auto;
  padding-bottom: 0.75rem;
  padding-top: 2.5rem;
}

.round-table-interface .round-table-last-pull {
  border-top: 1px solid rgba(216, 166, 79, 0.14);
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.round-table-interface .round-table-last-pull-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
}

.round-table-subnav button {
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.round-table-subnav button.active {
  color: var(--button-text);
}

.hero-showroom-section {
  margin-top: 0.5rem;
}

.hero-showroom-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  margin-top: 0.75rem;
}

.hero-showroom-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-showroom-portrait {
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.28)),
    var(--surface-menu);
  border: 3px solid var(--hero-rank-color, #7d8a97);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  position: relative;
}

.hero-showroom-portrait img {
  display: block;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  width: 100%;
}

.hero-showroom-portrait--fallback {
  align-items: center;
  display: flex;
  justify-content: center;
}

.hero-showroom-portrait-fallback {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 3px solid var(--hero-rank-color, #7d8a97);
  border-radius: 50%;
  color: var(--hero-rank-color, #7d8a97);
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 700;
  height: 4.5rem;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 4.5rem;
}

.hero-showroom-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem 0.85rem;
}

.hero-showroom-head {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.hero-showroom-head strong {
  display: block;
}

.hero-showroom-lore {
  color: rgba(248, 234, 215, 0.82);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.hero-showroom-abilities {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-showroom-abilities strong {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-showroom-abilities p {
  margin: 0;
}

.hero-showroom-bonus {
  color: #9fd4a0;
  font-weight: 600;
}

.hero-showroom-no-specials {
  font-size: 0.82rem;
}

.hero-showroom-actions {
  border-top: 1px solid rgba(216, 166, 79, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
  padding-top: 0.55rem;
}

.hero-showroom-assign {
  margin-top: 0.15rem;
}

.hero-showroom-hint,
.hero-showroom-link-hint {
  font-size: 0.82rem;
  margin: 0.55rem 0 0;
}

.hero-showroom-hint code,
.hero-showroom-link-hint code {
  font-size: 0.78rem;
}

.hero-showroom-card.hero-rank-S {
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.hero-showroom-card.hero-rank-Z {
  box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.35);
}

.treasury-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.treasury-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--hero-rank-color, #b8912f);
  border-radius: 12px;
  background: var(--surface-menu-raised);
}

.treasury-item > div {
  display: flex;
  flex-direction: column;
}

.treasury-consumable-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.treasury-item.treasury-consumable-select {
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  justify-content: space-between;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.treasury-item.treasury-consumable-select:hover {
  border-color: var(--accent);
  background: var(--surface-menu-hover, var(--surface-menu-raised));
}

.treasury-item.treasury-consumable-select.is-selected {
  border-color: var(--accent);
  background: var(--surface-menu-hover, var(--surface-menu-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.treasury-count {
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.treasury-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.treasury-consumable-detail {
  margin-top: 0.75rem;
}

.treasury-consumable-detail-text {
  margin: 0.75rem 0 0;
  line-height: 1.5;
  color: var(--text-muted);
}

.treasury-newspaper-composer {
  margin-top: 0.75rem;
}

.treasury-newspaper-label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.treasury-newspaper-input {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  border: 1px solid var(--border-soft, rgba(42, 32, 24, 0.18));
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: var(--surface-menu, #fffaf2);
}

.treasury-fate-reveal {
  margin-bottom: 0.75rem;
}

@media (max-width: 700px) {
  .treasury-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Länderei-Verwaltung --- */

.modal-panel:has(.land-interface) {
  max-height: min(94vh, 54rem);
  max-width: min(96vw, 56rem);
  width: min(96vw, 56rem);
}

.modal-panel:has(.land-manage) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.land-interface {
  max-width: none;
  width: 100%;
}

.land-interface.land-manage {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 52rem);
  min-height: 0;
  overflow: hidden;
}

.land-manage-subnav {
  flex-shrink: 0;
  margin: 0.85rem 0 0.35rem;
}

.land-manage-tab-body {
  display: grid;
  flex: 1;
  gap: 0.85rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

.land-manage-stat-grid {
  flex-shrink: 0;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
}

.land-bonus-stat strong {
  color: var(--accent);
  font-size: 0.92rem;
  line-height: 1.35;
}

.land-bonus-card .land-bonus-value {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.land-build-carousel .widget-carousel-stage {
  margin-top: 0.15rem;
}

.land-build-carousel .widget-carousel-card {
  background: rgba(30, 36, 22, 0.92);
  border-color: rgba(126, 176, 79, 0.32);
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
}

.land-build-carousel .widget-carousel-card .build-chip-icon {
  height: 3.25rem;
  width: 3.25rem;
}

.land-build-carousel .widget-carousel-card .building-ui-icon-wrap--shop {
  margin-bottom: 0.3rem;
}

.land-build-carousel .widget-carousel-card strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.land-build-carousel .widget-carousel-card .muted {
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0;
}

.land-build-carousel .widget-carousel-card .stat-row {
  gap: 0.35rem;
}

.land-build-carousel .widget-carousel-card .coord-controls {
  margin-top: 0.2rem;
  padding: 0.5rem 0.55rem;
}

.land-build-carousel .widget-carousel-card .button-row {
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.land-build-carousel-card {
  display: grid;
  gap: 0.45rem;
  height: 100%;
}

.land-build-carousel-card.is-disabled {
  opacity: 0.72;
}

.land-manage-tab-panel {
  margin-top: 0;
}

.army-interface {
  max-width: 52rem;
}

.oxford-interface {
  max-width: 52rem;
}

.oxford-interface .eyebrow {
  color: #d8a64f;
}

.emerald-interface {
  max-width: 52rem;
}

.emerald-interface .eyebrow {
  color: #4fd8a6;
}

.land-build-grid {
  --land-cell-size: clamp(3rem, 12vw, 4.75rem);
  background:
    linear-gradient(rgba(126, 176, 79, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 176, 79, 0.12) 1px, transparent 1px),
    #262b1c;
  background-size:
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    calc(100% / var(--castle-width)) calc(100% / var(--castle-height)),
    auto;
  border: 2px solid rgba(96, 127, 64, 0.85);
  box-sizing: border-box;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(var(--castle-width), minmax(0, 1fr));
  grid-template-rows: repeat(var(--castle-height), minmax(0, 1fr));
  height: calc(var(--castle-height) * var(--land-cell-size));
  width: calc(var(--castle-width) * var(--land-cell-size));
  margin: 0 auto 0.75rem;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.land-build-grid .placed-building {
  cursor: pointer;
}

.land-build-grid .placed-building .building-label strong {
  -webkit-line-clamp: 1;
  font-size: clamp(0.42rem, 24cqmin, 0.62rem);
}

.land-build-grid .placed-building .building-label span {
  font-size: clamp(0.38rem, 18cqmin, 0.52rem);
}

.land-build-grid .placed-building.medium .building-label strong,
.land-build-grid .placed-building.large .building-label strong {
  -webkit-line-clamp: 2;
}

.land-selected-building {
  border-top: 1px solid rgba(248, 234, 215, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.land-build-palette {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.land-build-queue {
  border-top: 1px solid rgba(248, 234, 215, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.land-build-queue-card {
  background: rgba(23, 19, 15, 0.45);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
}

.land-build-queue-card.is-active {
  border-color: rgba(126, 176, 79, 0.55);
}

.land-build-queue-card-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.land-build-queue-card-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.land-stockpile {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.land-stock-pill {
  align-items: center;
  background: rgba(23, 19, 15, 0.45);
  border: 1px solid rgba(248, 234, 215, 0.12);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 5rem;
  padding: 0.5rem 0.75rem;
}

.land-stock-pill span {
  color: var(--muted);
  font-size: 0.78rem;
}

.land-stock-pill strong {
  font-size: 1.1rem;
}

.caravan-status {
  display: grid;
  gap: 0.4rem;
}

.march-status {
  margin-top: 0.5rem;
}

.attack-composition,
.garrison-list {
  display: grid;
  gap: 0.5rem;
}

.attack-unit-row,
.garrison-row {
  align-items: center;
  background: rgba(23, 19, 15, 0.4);
  border: 1px solid rgba(248, 234, 215, 0.1);
  border-radius: 0.75rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
}

.garrison-management {
  display: grid;
  gap: 1rem;
}

.garrison-management-section {
  border-top: 1px solid rgba(248, 234, 215, 0.08);
  display: grid;
  gap: 0.65rem;
  padding-top: 0.85rem;
}

.garrison-management-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.garrison-management-heading {
  display: grid;
  gap: 0.2rem;
}

.garrison-management-heading strong {
  font-size: 0.95rem;
}

.garrison-management-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.garrison-management-summary,
.garrison-management-badges,
.garrison-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.garrison-manage-controls {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.garrison-manage-controls input[type="number"] {
  max-width: 5rem;
}

.caravan-escort-section {
  margin-top: 0.75rem;
}

.caravan-escort-sources {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .caravan-escort-sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.caravan-escort-source {
  display: grid;
  gap: 0.5rem;
}

.caravan-escort-source > strong {
  font-size: 0.88rem;
}

.caravan-escort-hint {
  margin: 0;
}

.garrison-manage-row .icon-button {
  min-width: 2.5rem;
}

.attack-unit-row.is-empty {
  opacity: 0.55;
}

.attack-unit-row--royal {
  border-color: rgba(201, 162, 39, 0.28);
}

.attack-unit-info,
.garrison-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.attack-unit-row input {
  width: 5rem;
}

.attack-type-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attack-type-option {
  background: rgba(23, 19, 15, 0.55);
  border: 1px solid rgba(216, 166, 79, 0.2);
  border-radius: 0.75rem;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
}

.attack-type-option.is-selected {
  border-color: rgba(216, 166, 79, 0.65);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.25);
}

.attack-type-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.attack-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.attack-type-label {
  font-weight: 800;
}

.attack-type-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.siege-status-card {
  border-color: rgba(199, 95, 70, 0.35);
}

.badge-occupation {
  background: rgba(120, 72, 18, 0.2);
  border-color: rgba(216, 166, 79, 0.45);
}

.badge-siege {
  background: rgba(199, 95, 70, 0.18);
  border-color: rgba(199, 95, 70, 0.45);
}

.garrison-controls {
  display: flex;
  gap: 0.4rem;
}

.icon-button {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 0.6rem;
  box-shadow: var(--button-shadow);
  color: var(--button-text);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  height: 2.1rem;
  line-height: 1;
  min-width: 2.1rem;
  padding: 0;
  width: 2.1rem;
}

.icon-button:hover:not(:disabled) {
  background: var(--button-bg-hover);
  border-color: var(--button-border-strong);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.army-card-header {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.unit-card-heading {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  min-width: 0;
}

.unit-icon-img {
  flex-shrink: 0;
  height: 2.5rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
  width: 2.5rem;
}

.unit-icon-fallback {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 1.35rem;
  height: 2.5rem;
  justify-content: center;
  line-height: 1;
  width: 2.5rem;
}

.attack-unit-info .unit-card-heading,
.garrison-info .unit-card-heading,
.unit-training-card > .unit-card-heading {
  margin-bottom: 0.15rem;
}

.army-card-header .unit-card-heading {
  flex: 1;
}

.army-card-header .unit-card-heading + .pill,
.army-card-header .unit-card-heading + .pill + .pill {
  flex-shrink: 0;
}

.pill.pill-land {
  background: rgba(126, 176, 79, 0.16);
  border-color: rgba(126, 176, 79, 0.4);
  color: #d5efc0;
}

.hero-rank-Z,
.pill.hero-rank-Z,
.hero-rank-Z .hero-rank-badge {
  box-shadow: 0 0 0 1px rgba(155, 89, 182, 0.65);
}

.hero-unique-tag {
  background: rgba(155, 89, 182, 0.14);
  border-color: rgba(155, 89, 182, 0.45);
  color: #e8d4f5;
}

.spy-intel-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(155, 89, 182, 0.08);
  border: 1px solid rgba(155, 89, 182, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.spy-intel-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7rem) 1fr;
  gap: 0.6rem;
  align-items: start;
}

.spy-intel-row > span:first-child {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  padding-top: 0.15rem;
}

.spy-intel-band {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spy-intel-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.spy-intel-headline strong {
  color: #e8d4f5;
}

.spy-intel-range {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.spy-intel-estimate {
  color: #d7b8ef;
  font-weight: 700;
}

.spy-intel-curve {
  width: 100%;
  height: 2.4rem;
  display: block;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.18);
}

.spy-intel-caption {
  font-size: 0.72rem;
}

.pill.pill-sabotage {
  background: rgba(192, 57, 43, 0.18);
  border-color: rgba(192, 57, 43, 0.45);
  color: #f5b7b1;
}

.map-node.sabotaged::after {
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.55);
}

.pill.pill-marked-target {
  background: rgba(142, 68, 173, 0.2);
  border-color: rgba(192, 57, 43, 0.55);
  color: #f5b7b1;
}

.marked-target-card {
  border-color: rgba(142, 68, 173, 0.35);
  background: rgba(142, 68, 173, 0.08);
}

.map-node.marked-target::after {
  box-shadow:
    0 0 0 2px rgba(192, 57, 43, 0.75),
    0 0 14px rgba(142, 68, 173, 0.55);
}

.map-node.marked-target::before {
  content: "✦";
  position: absolute;
  top: -0.35rem;
  right: -0.2rem;
  font-size: 0.72rem;
  color: #e74c3c;
  text-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
  pointer-events: none;
}

.spy-ops-card {
  border-color: rgba(155, 89, 182, 0.35);
  background: rgba(155, 89, 182, 0.06);
}

.memory-game-interface .memory-game-grid {
  display: grid;
  gap: 0.28rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 0.65rem;
  max-width: 22.5rem;
}

.memory-game-interface.building-interface {
  gap: 0.42rem;
  margin-top: 0;
  overflow: auto;
  padding: 0.68rem 0.78rem;
}

.memory-game-interface .building-interface-header {
  gap: 0.45rem;
}

.memory-game-interface .building-interface-header h3 {
  font-size: 1rem;
}

.memory-game-interface .building-interface-header .muted,
.memory-game-interface .memory-game-phase .muted {
  font-size: 0.76rem;
  line-height: 1.3;
}

.memory-game-interface .castle-actions .badge {
  font-size: 0.72rem;
  padding: 0.26rem 0.48rem;
}

.memory-game-interface .interface-stat-grid {
  gap: 0.32rem;
  margin: 0.35rem 0;
}

.memory-game-interface .interface-stat-grid .castle-stat {
  padding: 0.4rem 0.5rem;
}

.memory-game-interface .interface-stat-grid .castle-stat span {
  font-size: 0.64rem;
}

.memory-game-interface .interface-stat-grid .castle-stat strong {
  font-size: 0.84rem;
}

.memory-game-interface .button-row {
  gap: 0.35rem;
}

.memory-game-interface .button-row button {
  font-size: 0.86rem;
  min-height: 2.15rem;
  padding: 0.38rem 0.72rem;
}

.memory-game-cell {
  appearance: none;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.36rem;
  color: inherit;
  cursor: default;
  font: inherit;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.memory-game-cell.is-covered {
  background: rgba(23, 19, 15, 0.88);
  cursor: pointer;
}

.memory-game-cell.is-covered:hover {
  border-color: rgba(216, 166, 79, 0.45);
}

.memory-game-cell.is-selected {
  box-shadow: 0 0 0 2px rgba(216, 166, 79, 0.75);
  border-color: rgba(216, 166, 79, 0.85);
}

.memory-game-cell.is-house.is-revealed,
.memory-game-cell.is-correct,
.memory-game-cell.is-missed {
  background: rgba(119, 183, 109, 0.12);
}

.memory-game-cell.is-correct {
  box-shadow: 0 0 0 2px rgba(119, 183, 109, 0.75);
}

.memory-game-cell.is-covered.is-revealed {
  background: rgba(119, 183, 109, 0.16);
  cursor: default;
}

.memory-game-cell.is-wrong {
  background: rgba(192, 57, 43, 0.18);
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.55);
}

.memory-game-cell.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.memory-game-cell.is-missed {
  box-shadow: 0 0 0 2px rgba(216, 166, 79, 0.65);
}

.memory-game-texture {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  inset: 0.12rem;
  position: absolute;
}

.memory-game-coord {
  bottom: 0.12rem;
  color: rgba(248, 234, 215, 0.45);
  font-size: 0.56rem;
  left: 0.16rem;
  pointer-events: none;
  position: absolute;
}

.memory-game-phase {
  display: grid;
  gap: 0.5rem;
}

.memory-game-timer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.memory-game-timer-row .pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
}

.memory-game-timer-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99rem;
  height: 0.35rem;
  overflow: hidden;
}

.memory-game-timer-fill {
  background: linear-gradient(90deg, #d8a64f, #77b76d);
  display: block;
  height: 100%;
  transition: width 250ms linear;
}

.memory-game-legend {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.72rem;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.memory-game-tabs {
  margin-bottom: 0.65rem;
}

.memory-game-interface .leaderboard-tab {
  font-size: 0.82rem;
  padding: 0.36rem 0.64rem;
}

.memory-game-shop {
  display: grid;
  gap: 0.85rem;
}

.memory-game-shop-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.memory-shop-section h4 {
  margin: 0 0 0.65rem;
}

.memory-shop-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.memory-game-interface .memory-shop-showroom-stage,
.memory-game-interface .memory-shop-showroom-scroll,
.memory-game-interface .memory-shop-showroom-canvas {
  min-height: 16rem;
}

.memory-game-shop--showroom {
  gap: 0.65rem;
}

.memory-shop-showroom-tabs {
  margin-top: 0.15rem;
}

.memory-shop-showroom-stage {
  background:
    radial-gradient(circle at 80% 20%, rgba(120, 170, 220, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(12, 10, 8, 0.96), rgba(20, 16, 12, 0.98));
  border: 1px solid rgba(120, 170, 220, 0.2);
  border-radius: 0.75rem;
  min-height: 16rem;
  overflow: hidden;
  position: relative;
}

.memory-shop-showroom-stage--empty {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 12rem;
  padding: 2rem;
}

.memory-shop-showroom-pan-hint {
  left: 0.85rem;
  margin: 0;
  position: absolute;
  top: 0.65rem;
  z-index: 2;
}

.memory-shop-showroom-scroll {
  cursor: grab;
  height: 100%;
  min-height: 16rem;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.memory-shop-showroom-scroll.is-panning {
  cursor: grabbing;
}

.memory-shop-showroom-canvas {
  height: 100%;
  min-height: 16rem;
  position: relative;
  transition: transform 0.02s linear;
  will-change: transform;
}

.memory-shop-track-card {
  background: var(--surface-menu-raised);
  border: 1px solid rgba(120, 170, 220, 0.22);
  border-radius: 12px;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 0.5rem;
  overflow: hidden;
  padding: 0.7rem;
  position: absolute;
  text-align: left;
  top: 2.4rem;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.memory-shop-track-card:hover {
  border-color: rgba(120, 170, 220, 0.45);
  transform: translateY(-2px);
}

.memory-shop-track-card.is-disabled {
  opacity: 0.72;
}

.memory-shop-offer-visual {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 5rem;
}

.memory-shop-offer-icon {
  height: 3.4rem;
  object-fit: contain;
  width: 3.4rem;
}

.memory-shop-track-meta {
  display: grid;
  gap: 0.45rem;
}

.memory-shop-track-meta strong {
  font-size: 0.88rem;
}

.memory-shop-track-cta {
  font-size: 0.82rem;
}

.memory-shop-detail-back {
  margin-bottom: 0.65rem;
}

.memory-shop-detail-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
}

.memory-shop-detail-art {
  align-items: center;
  background: rgba(12, 10, 8, 0.72);
  border: 1px solid rgba(120, 170, 220, 0.18);
  border-radius: 0.75rem;
  display: flex;
  justify-content: center;
  min-height: 9rem;
  padding: 0.7rem;
}

.memory-shop-detail-art .memory-shop-offer-icon {
  height: 4.5rem;
  width: 4.5rem;
}

.memory-shop-detail-content {
  display: grid;
  gap: 1rem;
}

.memory-shop-detail-copy h4 {
  margin: 0.2rem 0 0.45rem;
}

.modal-panel:has(.memory-game-shop--showroom) {
  max-height: min(88vh, 48rem);
  max-width: min(96vw, 64rem);
}

.pill-memory {
  background: rgba(120, 170, 220, 0.18);
  border-color: rgba(120, 170, 220, 0.35);
}

.view-menu-card .secondary-button.memory-game-alert {
  border-color: rgba(216, 166, 79, 0.65);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.25);
}

@media (max-width: 700px) {
  .land-build-palette {
    grid-template-columns: 1fr;
  }

  .spy-intel-row {
    grid-template-columns: 1fr;
  }
}

.castle-research-launcher {
  position: relative;
}

.castle-research-toggle {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  min-width: 5.5rem;
}

.quest-list {
  display: grid;
  gap: 0.75rem;
}

.quest-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
}

.quest-card.quest-completed {
  border-color: rgba(216, 166, 79, 0.45);
}

.quest-card.quest-claimed {
  opacity: 0.72;
}

.quest-card-head {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.quest-reward {
  color: var(--accent);
  font-size: 0.88rem;
  margin: 0;
}

.quest-board-interface {
  max-width: 44rem;
}

.quest-board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quest-board-tabs button {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0.45rem 0.9rem;
}

.quest-board-tabs button.active {
  background: rgba(216, 166, 79, 0.18);
  border-color: rgba(216, 166, 79, 0.55);
  color: var(--gold);
}

.quest-board-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quest-track-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quest-track-section {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.quest-track-section.quest-track-locked {
  opacity: 0.72;
}

.quest-track-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.quest-track-header > div {
  flex: 1;
  min-width: 0;
}

.quest-track-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.quest-track-lock-hint {
  margin: 0;
}

.quest-points-progress {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 1.35rem;
  overflow: hidden;
  position: relative;
}

.quest-points-progress-bar {
  background: linear-gradient(90deg, rgba(216, 166, 79, 0.55), rgba(216, 166, 79, 0.95));
  height: 100%;
  min-width: 0;
  transition: width 0.25s ease;
}

.quest-points-progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.pill-quest-points {
  background: rgba(216, 166, 79, 0.16);
  border-color: rgba(216, 166, 79, 0.45);
  color: var(--gold);
}

.quest-difficulty-pill.quest-difficulty-easy {
  background: rgba(88, 166, 98, 0.16);
  border-color: rgba(88, 166, 98, 0.45);
}

.quest-difficulty-pill.quest-difficulty-medium {
  background: rgba(88, 140, 216, 0.16);
  border-color: rgba(88, 140, 216, 0.45);
}

.quest-difficulty-pill.quest-difficulty-hard {
  background: rgba(196, 88, 88, 0.16);
  border-color: rgba(196, 88, 88, 0.45);
}

.quest-daily-progress {
  color: var(--gold);
  font-weight: 600;
}

.quest-milestone-section {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.quest-milestone-section h4 {
  margin: 0;
}

.quest-milestone-list {
  display: grid;
  gap: 0.65rem;
}

.quest-milestone-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
}

.quest-milestone-card.quest-milestone-ready {
  border-color: rgba(216, 166, 79, 0.45);
}

.quest-milestone-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.quest-daily-list {
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.quest-daily-card {
  gap: 0.3rem;
  min-height: 0;
  padding: 0.55rem 0.6rem;
}

.quest-daily-card .quest-card-head {
  gap: 0.35rem;
}

.quest-daily-card .quest-card-head strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.quest-daily-card .pill {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
}

.quest-daily-description {
  font-size: 0.72rem;
  line-height: 1.25;
  margin: 0;
}

.quest-daily-progress {
  font-size: 0.74rem;
  margin: 0;
}

.quest-daily-claim-button {
  font-size: 0.74rem;
  min-height: 1.7rem;
  padding: 0.28rem 0.45rem;
}

.quest-daily-card .quest-claimed-label {
  font-size: 0.72rem;
  margin: 0;
}

.quest-milestone-list {
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.quest-milestone-card {
  padding: 0.6rem 0.65rem;
}

.quest-milestone-card .quest-milestone-head strong {
  font-size: 0.84rem;
}

.quest-milestone-reward {
  font-size: 0.72rem;
  margin: 0;
}

.map-node.demon-castle {
  background: radial-gradient(circle at 50% 30%, #7b1f36, #2b0d18 62%, #080407);
  border-color: rgba(226, 74, 102, 0.8);
  box-shadow:
    0 0 0 2px rgba(65, 8, 21, 0.8),
    0 0 24px rgba(210, 36, 78, 0.6);
  color: #ffd6df;
  height: 80px;
  width: 80px;
  z-index: 6;
}

.map-node.demon-castle.has-map-texture {
  background: transparent;
  border: none;
  box-shadow:
    0 0 0 3px rgba(210, 36, 78, 0.22),
    0 0 22px rgba(210, 36, 78, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.45);
  height: 80px;
  width: 80px;
}

.map-node.demon-castle.has-map-texture .map-node-texture-layer {
  background-size: 115% auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.map-node.demon-castle.player-owned.has-map-texture {
  box-shadow:
    0 0 0 3px rgba(190, 95, 255, 0.28),
    0 0 26px rgba(190, 95, 255, 0.55),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.map-node.demon-castle.player-owned {
  border-color: #c879ff;
  box-shadow:
    0 0 0 2px rgba(74, 20, 96, 0.85),
    0 0 28px rgba(190, 95, 255, 0.75);
}

.demon-hud-badge {
  background: linear-gradient(145deg, rgba(96, 18, 45, 0.96), rgba(35, 7, 19, 0.98));
  border-color: rgba(218, 74, 111, 0.62);
  color: #ffd6e0;
}

.demon-hud-badge.is-cooldown {
  filter: saturate(0.65);
}

.demon-castle-shell {
  border-radius: 1.15rem;
  min-height: min(72vh, 48rem);
  overflow: hidden;
  position: relative;
}

.demon-castle-scenery {
  background:
    radial-gradient(circle at 50% 18%, rgba(155, 28, 62, 0.42), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(45, 7, 19, 0.72), transparent 58%),
    linear-gradient(180deg, #1a0810 0%, #0d0408 100%);
  inset: 0;
  position: absolute;
  z-index: 0;
}

.demon-castle-scenery.has-demon-background {
  background-color: #0d0408;
}

.demon-castle-scenery-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.demon-castle-scenery .map-scenery-image {
  object-position: center top;
}

.demon-castle-interface-stage {
  position: relative;
  z-index: 1;
}

.modal-panel:has(.demon-castle-shell) {
  max-height: min(92vh, 60rem);
  max-width: min(99vw, 72rem);
  overflow: auto;
}

.modal-panel:has(.demon-castle-shell) .building-interface {
  background:
    linear-gradient(180deg, rgba(12, 4, 8, 0.42), rgba(12, 4, 8, 0.9)),
    rgba(12, 4, 8, 0.82);
  border-color: rgba(191, 62, 91, 0.5);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  margin: 0;
}

.demon-castle-shell.has-demon-scenery .demon-castle-interface {
  backdrop-filter: blur(2px);
}

.demon-castle-interface {
  background:
    radial-gradient(circle at top right, rgba(155, 28, 62, 0.24), transparent 28rem),
    var(--surface-menu);
  border-color: rgba(191, 62, 91, 0.5);
  max-width: 64rem;
}

.demon-captive-badge {
  background: rgba(139, 30, 60, 0.24);
  border-color: rgba(220, 74, 107, 0.55);
  color: #ffc4d1;
}

.demon-section {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.demon-castle-grid {
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(rgba(131, 37, 61, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(131, 37, 61, 0.18) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(105, 15, 42, 0.55), #12070d 68%);
  background-size: calc(100% / 6) calc(100% / 6);
  border: 1px solid rgba(191, 62, 91, 0.48);
  border-radius: 0.9rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  margin-top: 1rem;
  min-height: 28rem;
  overflow: hidden;
  padding: 0.55rem;
  position: relative;
}

.demon-grid-building {
  align-items: center;
  background: linear-gradient(145deg, rgba(101, 23, 46, 0.96), rgba(39, 8, 19, 0.98));
  border: 1px solid rgba(219, 77, 111, 0.55);
  border-radius: 0.65rem;
  color: #ffd7e0;
  display: flex;
  flex-direction: column;
  grid-column: calc(var(--demon-x) + 1) / span var(--demon-w);
  grid-row: calc(var(--demon-y) + 1) / span var(--demon-h);
  justify-content: flex-end;
  margin: 0.24rem;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: center;
}

.demon-grid-building.has-texture,
.demon-grid-keep.has-texture {
  background: transparent;
  border-color: rgba(219, 77, 111, 0.35);
}

.demon-grid-building.has-texture .building-texture-layer,
.demon-grid-keep.has-texture .building-texture-layer {
  background-position: center bottom;
  background-size: cover;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
}

.demon-grid-building.is-ruin.has-texture .building-texture-layer,
.demon-grid-keep.has-texture .building-texture-layer {
  filter: grayscale(0.75) brightness(0.55) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.demon-grid-building-label {
  align-items: center;
  background: linear-gradient(to top, rgba(12, 4, 8, 0.92), rgba(12, 4, 8, 0.45) 58%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  justify-content: flex-end;
  min-height: 38%;
  padding: 0.28rem 0.35rem 0.22rem;
  pointer-events: none;
  position: relative;
  width: 100%;
  z-index: 1;
}

.demon-grid-building-label strong,
.demon-grid-building-label span {
  display: block;
  line-height: 1.15;
}

.demon-grid-building.is-ruin {
  filter: grayscale(0.7);
  opacity: 0.55;
}

.demon-grid-building span,
.demon-grid-keep span,
.demon-grid-building-label span {
  font-size: 0.7rem;
  opacity: 0.8;
}

.demon-grid-keep {
  align-items: center;
  background: radial-gradient(circle at 50% 25%, #9a2851, #2a0917 72%);
  border: 2px solid rgba(220, 91, 135, 0.72);
  border-radius: 50%;
  bottom: 0.5rem;
  color: #ffe1e8;
  display: flex;
  flex-direction: column;
  grid-column: 3 / span 2;
  grid-row: 3 / span 2;
  justify-content: flex-end;
  margin: 0.3rem;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: center;
}

.demon-grid-keep.has-texture {
  border-color: rgba(220, 91, 135, 0.45);
}

.demon-grid-keep.has-texture .building-texture-layer {
  border-radius: 50%;
}

.demon-section h4,
.demon-assault-panel h4 {
  color: #ffc0cf;
  margin: 0;
}

.demon-assault-feedback {
  border-radius: 0.45rem;
  font-weight: 600;
  margin: 0;
  padding: 0.55rem 0.7rem;
}

.demon-assault-feedback--success {
  background: rgba(58, 140, 88, 0.2);
  border: 1px solid rgba(88, 196, 120, 0.45);
  color: #b8f0c8;
}

.demon-assault-feedback--error {
  background: rgba(140, 42, 58, 0.22);
  border: 1px solid rgba(220, 88, 108, 0.45);
  color: #ffc0cf;
}

.demon-assault-feedback--pending,
.demon-assault-feedback--info {
  background: rgba(120, 88, 42, 0.18);
  border: 1px solid rgba(220, 176, 88, 0.4);
  color: #ffe2a8;
}

.demon-card-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.demon-card .quest-card-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.demon-card-icon {
  border: 1px solid rgba(171, 56, 83, 0.45);
  border-radius: 0.45rem;
  flex: 0 0 auto;
  height: 2.4rem;
  object-fit: cover;
  width: 2.4rem;
}

.demon-card {
  background: rgba(34, 10, 18, 0.78);
  border: 1px solid rgba(171, 56, 83, 0.38);
  border-radius: 0.8rem;
  display: grid;
  gap: 0.5rem;
  padding: 0.72rem;
}

.demon-card.is-locked {
  opacity: 0.64;
}

.demon-card.is-complete {
  border-color: rgba(181, 112, 224, 0.55);
}

.demon-train-row {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: 4.5rem minmax(0, 1fr);
}

.demon-train-row input,
.demon-assault-unit-row input {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  color: var(--text);
  min-width: 0;
  padding: 0.38rem 0.45rem;
}

.demon-assault-panel,
.demon-assault-units {
  display: grid;
  gap: 0.55rem;
}

.demon-assault-unit-row {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) 5rem;
}

.demon-operation-controls {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 2fr) minmax(8rem, 1fr);
}

.demon-operation-controls select {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  color: var(--text);
  min-width: 0;
  padding: 0.5rem;
}

.demon-defense-list {
  display: grid;
  gap: 0.45rem;
}

.demon-defense-row {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.demon-sacrifice-actions {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 680px) {
  .demon-castle-grid {
    min-height: 22rem;
  }

  .demon-grid-building strong,
  .demon-grid-keep strong {
    font-size: 0.72rem;
  }

  .demon-operation-controls,
  .demon-defense-row {
    grid-template-columns: 1fr;
  }
}

.capital-research-tree-interface .research-tree-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.capital-research-tree-warning {
  flex-shrink: 0;
  margin: 0 0.15rem;
}

.loot-goblin-admin-tracker .loot-goblin-tracker-tables {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  margin-top: 0.75rem;
}

.loot-goblin-tracker-subtitle {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.loot-goblin-tracker-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  width: 100%;
}

.loot-goblin-tracker-table th,
.loot-goblin-tracker-table td {
  border-bottom: 1px solid rgba(216, 166, 79, 0.14);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.loot-goblin-tracker-table th {
  color: rgba(248, 234, 215, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loot-goblin-tracker-ready td {
  color: #9fe870;
}

.loot-goblin-tracker-history-scroll {
  max-height: 14rem;
  overflow-y: auto;
}

.research-tree-interface {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.research-tree-scroll-chrome {
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.94) 0%, rgba(12, 10, 8, 0.82) 72%, rgba(12, 10, 8, 0));
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.research-tree-scroll-chrome > * {
  pointer-events: auto;
}

.research-tree-scroll-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.2rem;
}

.research-tree-scroll-header h3 {
  font-size: 1.15rem;
  margin: 0;
}

.research-tree-scroll-header .eyebrow {
  font-size: 0.68rem;
  margin-bottom: 0.1rem;
}

.research-tree-scroll-chrome .research-tree-tabs {
  margin-top: 0;
  padding: 0 0.65rem;
}

.research-tree-scroll-chrome .research-tree-toolbar {
  padding: 0.35rem 0.65rem 0.65rem;
}

.research-tree-scroll-chrome .capital-research-tree-warning {
  margin: 0 0.75rem 0.35rem;
}

.research-tree-interface-header {
  gap: 0.35rem;
  padding-bottom: 0.15rem;
}

.research-tree-interface-header h3 {
  font-size: 1.15rem;
  margin: 0;
}

.research-tree-interface-header .eyebrow {
  font-size: 0.68rem;
  margin-bottom: 0.1rem;
}

.research-tree-interface .building-interface-header {
  flex-shrink: 0;
}

.research-tree-queue-compact .research-queue {
  flex-shrink: 0;
  font-size: 0.82rem;
  margin-top: 0;
  padding: 0.45rem 0.55rem;
}

.research-tree-queue-compact .research-queue strong,
.research-tree-queue-compact .research-queue .pill {
  font-size: 0.78rem;
}

.research-tree-tabs {
  display: grid;
  flex-shrink: 0;
  gap: 0.4rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
}

.research-tree-tab {
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(216, 166, 79, 0.22);
  border-radius: 0.7rem;
  color: #f8ead7;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.6rem;
  text-align: left;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.research-tree-tab:hover {
  border-color: rgba(216, 166, 79, 0.42);
}

.research-tree-tab.active {
  background: rgba(216, 166, 79, 0.14);
  border-color: rgba(216, 166, 79, 0.62);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.18);
  color: var(--button-text);
}

.research-tree-tab-label {
  font-size: 0.82rem;
  font-weight: 800;
}

.research-tree-tab-meta {
  color: rgba(248, 234, 215, 0.72);
  font-size: 0.68rem;
  font-weight: 600;
}

.research-tree-tab.active .research-tree-tab-meta {
  color: rgba(248, 234, 215, 0.88);
}

.research-tree-stage {
  background:
    radial-gradient(circle at 20% 20%, rgba(216, 166, 79, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(12, 10, 8, 0.96), rgba(20, 16, 12, 0.98));
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 1rem;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: min(78vh, 52rem);
  overflow: hidden;
  position: relative;
}

.research-tree-stage .research-tree-scroll {
  flex: 1;
  min-height: min(78vh, 52rem);
}

.research-tree-toolbar {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 0.55rem;
  justify-content: space-between;
  padding: 0.35rem 0.65rem 0;
  z-index: 3;
}

.research-tree-pan-hint {
  font-size: 0.72rem;
  margin: 0;
  pointer-events: none;
}

.research-tree-zoom-controls {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 0.45rem;
}

.research-tree-zoom-button {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  min-width: 2rem;
  padding: 0.28rem 0.45rem;
}

.research-tree-zoom-label {
  color: #f8ead7;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 2.8rem;
  text-align: center;
}

.research-tree-scroll {
  background-color: #120f0c;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.42), rgba(12, 10, 8, 0.55)),
    url("texturen/ui/research-tree-hall.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: grab;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.research-tree-scroll.is-panning {
  cursor: grabbing;
  user-select: none;
}

.research-tree-canvas {
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 1;
}

.research-tree-node-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.research-tree-node-wrap .research-tree-node {
  pointer-events: auto;
}

.research-tree-node-label {
  color: rgba(248, 234, 215, 0.96);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 100%;
  padding: 0 0.15rem;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  word-break: break-word;
}

.research-tree-node-wrap.is-root-wrap .research-tree-node-label {
  color: rgba(216, 166, 79, 0.95);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-tree-edges {
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
}

.research-tree-edge {
  fill: none;
  stroke: rgba(120, 110, 95, 0.45);
  stroke-width: 3.5;
}

.research-tree-edge.is-lit {
  stroke: rgba(216, 140, 70, 0.95);
  stroke-width: 4.5;
  filter: drop-shadow(0 0 8px rgba(216, 140, 70, 0.45));
}

.research-tree-node {
  align-items: center;
  background: rgba(28, 24, 20, 0.92);
  border: 3px solid rgba(120, 110, 95, 0.55);
  border-radius: 999px;
  color: #f8ead7;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 0;
  position: relative;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.research-tree-node:hover {
  transform: scale(1.05);
}

.research-tree-node-ring {
  border: 2px solid transparent;
  border-radius: inherit;
  inset: 0.18rem;
  pointer-events: none;
  position: absolute;
}

.research-tree-node-icon {
  font-size: 2.15rem;
  line-height: 1;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.research-tree-node.is-major {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.research-tree-node.is-minor .research-tree-node-icon {
  font-size: 1.75rem;
  opacity: 0.95;
}

.research-tree-node.completed,
.research-tree-node.active {
  border-color: rgba(216, 166, 79, 0.95);
  box-shadow:
    0 0 0 1px rgba(216, 166, 79, 0.35),
    0 0 22px rgba(216, 140, 70, 0.35);
}

.research-tree-node.completed .research-tree-node-ring,
.research-tree-node.active .research-tree-node-ring {
  border-color: rgba(216, 166, 79, 0.55);
}

.research-tree-node.available {
  border-color: rgba(120, 170, 220, 0.85);
  box-shadow: 0 0 16px rgba(120, 170, 220, 0.25);
}

.research-tree-node.queued {
  border-color: rgba(216, 166, 79, 0.55);
}

.research-tree-node.locked {
  cursor: default;
  opacity: 0.55;
}

.research-tree-node.is-selected {
  box-shadow:
    0 0 0 4px rgba(248, 234, 215, 0.35),
    0 0 26px rgba(216, 166, 79, 0.45);
  transform: scale(1.08);
}

.research-tree-root {
  background: radial-gradient(circle at 30% 30%, rgba(216, 166, 79, 0.35), rgba(28, 24, 20, 0.95));
  border-color: rgba(216, 166, 79, 0.85);
  box-shadow: 0 0 28px rgba(216, 140, 70, 0.35);
  cursor: default;
  pointer-events: none;
}

.research-tree-root-count {
  bottom: -0.45rem;
  color: #f8ead7;
  font-size: 0.82rem;
  font-weight: 800;
  position: absolute;
  right: -0.2rem;
}

.research-tree-lane-rail {
  border-left: 1px solid rgba(216, 166, 79, 0.12);
  bottom: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 11.5rem;
  width: 10.5rem;
}

.research-tree-lane-label {
  color: rgba(248, 234, 215, 0.88);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  position: absolute;
  right: 1rem;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.research-tree-detail {
  background: rgba(18, 15, 12, 0.96);
  border-left: 1px solid rgba(216, 166, 79, 0.22);
  bottom: 0;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.45);
  font-size: 0.84rem;
  max-width: min(22rem, 34vw);
  overflow: auto;
  padding: 0.65rem 0.75rem;
  pointer-events: auto;
  position: absolute;
  right: 10.5rem;
  top: 11rem;
  width: min(22rem, 34vw);
  z-index: 6;
}

.research-tree-detail-close {
  position: absolute;
  right: 0.65rem;
  top: 0.45rem;
  z-index: 2;
}

.research-tree-detail .research-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0.35rem 0 0;
}

.research-tree-detail .research-card-header strong {
  font-size: 0.92rem;
}

.research-tree-detail .research-card-header span {
  font-size: 0.8rem;
}

.research-tree-footer {
  align-items: center;
  background: rgba(18, 15, 12, 0.92);
  border: 1px solid rgba(216, 166, 79, 0.16);
  border-radius: 0.7rem;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.55rem;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
}

.research-tree-footer-stat strong {
  font-size: 0.88rem;
}

.research-tree-footer-stat {
  display: grid;
  gap: 0.15rem;
}

.research-tree-footer-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-tree-footer-actions {
  margin-left: auto;
}

@media (max-width: 900px) {
  .research-tree-tabs {
    grid-template-columns: 1fr;
  }

  .research-tree-scroll-chrome {
    right: 0;
  }

  .research-tree-scroll-chrome .research-tree-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .research-tree-lane-rail {
    display: none;
  }

  .research-tree-detail {
    border-left: 0;
    border-top: 1px solid rgba(216, 166, 79, 0.22);
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45);
    left: 0;
    max-height: 42%;
    max-width: none;
    right: 0;
    top: auto;
    width: auto;
  }
}

.modal-panel:has(.hero-showroom-interface) {
  max-height: min(96vh, 62rem);
  max-width: min(98vw, 92rem);
}

.hero-showroom-interface {
  display: grid;
  gap: 0.85rem;
}

.hero-showroom-stage {
  background: rgba(12, 10, 8, 0.35);
  border: 1px solid rgba(216, 166, 79, 0.18);
  border-radius: 1rem;
  min-height: 38rem;
  overflow: hidden;
  position: relative;
}

.hero-showroom-pan-hint {
  left: 0.85rem;
  margin: 0;
  position: absolute;
  top: 0.65rem;
  z-index: 2;
}

.hero-showroom-scroll {
  background-color: #120f0c;
  background-image:
    linear-gradient(180deg, rgba(8, 6, 5, 0.38), rgba(12, 10, 8, 0.52)),
    url("texturen/ui/hero-showroom-hall.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: grab;
  height: 100%;
  min-height: 38rem;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.hero-showroom-scroll.is-panning {
  cursor: grabbing;
}

.hero-showroom-canvas {
  height: 100%;
  min-height: 38rem;
  position: relative;
  transition: transform 0.02s linear;
  will-change: transform;
  z-index: 1;
}

.hero-showroom-track-card {
  background: var(--surface-menu-raised);
  border: 3px solid var(--hero-rank-color, #7d8a97);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font: inherit;
  overflow: hidden;
  padding: 0;
  position: absolute;
  text-align: left;
  top: 2.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-showroom-track-card:hover {
  border-color: var(--hero-rank-color, #7d8a97);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
  filter: brightness(1.04);
  transform: translateY(-3px);
}

.hero-showroom-track-card.locked {
  opacity: 0.72;
}

.hero-showroom-track-card.shards {
  box-shadow: inset 0 0 0 1px rgba(159, 212, 160, 0.25);
}

.hero-showroom-track-card .hero-showroom-portrait {
  aspect-ratio: 3 / 4;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  flex: 1 1 auto;
  margin: 0.4rem 0.4rem 0;
  min-height: 20rem;
}

.hero-showroom-portrait--compact {
  max-height: none;
  min-height: 20rem;
}

.hero-showroom-portrait--widget {
  aspect-ratio: 3 / 4;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  flex: 0 0 auto;
  margin: 0;
  min-height: 15rem;
}

.hero-showroom-portrait--hero {
  border: 3px solid var(--hero-rank-color, #7d8a97);
  border-radius: 1rem;
  min-height: 32rem;
  overflow: hidden;
}

.hero-showroom-portrait--hero img {
  object-fit: contain;
  object-position: center bottom;
}

.hero-showroom-portrait--hero .hero-showroom-portrait-fallback {
  font-size: 2.5rem;
  height: 7rem;
  width: 7rem;
}

.hero-detail-interface .hero-showroom-portrait--hero {
  min-height: 40rem;
}

.hero-detail-interface .hero-showroom-portrait--hero .hero-showroom-portrait-fallback {
  font-size: 3.1rem;
  height: 8.75rem;
  width: 8.75rem;
}

.hero-showroom-portrait--locked img,
.hero-showroom-portrait--locked .hero-showroom-portrait-fallback {
  filter: grayscale(0.55) brightness(0.82);
}

.hero-showroom-track-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.75rem;
}

.hero-showroom-track-meta strong {
  font-size: 1rem;
  line-height: 1.2;
}

.hero-showroom-track-meta .muted {
  font-size: 0.82rem;
}

.hero-showroom-track-status {
  font-size: 0.8rem;
  margin-top: auto;
}

.hero-showroom-track-status.owned {
  color: #9fd4a0;
}

.hero-showroom-track-status.shards {
  color: #d8c27a;
}

.hero-showroom-track-status.locked {
  color: rgba(248, 234, 215, 0.55);
}

.hero-detail-interface {
  min-height: 45rem;
}

.modal-panel:has(.hero-detail-interface) {
  max-height: min(96vh, 77.5rem);
  max-width: min(98vw, 115rem);
}

.modal-panel:has(.hero-detail-interface) .building-interface h3 {
  font-size: 1.31rem;
}

.modal-panel:has(.hero-detail-interface) .building-interface .muted,
.modal-panel:has(.hero-detail-interface) .hero-showroom-abilities p,
.modal-panel:has(.hero-detail-interface) .hero-showroom-track-meta .muted {
  font-size: 1.03rem;
}

.hero-detail-header .hero-detail-back {
  margin-bottom: 0.55rem;
}

.hero-detail-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(22.5rem, 1.1fr) minmax(25rem, 1fr);
  min-height: 40rem;
}

.hero-detail-art-panel {
  background:
    radial-gradient(circle at 50% 20%, rgba(216, 166, 79, 0.1), transparent 55%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(216, 166, 79, 0.16);
  border-radius: 1rem;
  min-height: 40rem;
  overflow: hidden;
  padding: 0.95rem;
}

.hero-detail-art-panel .hero-showroom-portrait {
  height: 100%;
  min-height: 37.5rem;
}

.hero-detail-content-panel {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(216, 166, 79, 0.14);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  min-height: 40rem;
  overflow: auto;
  padding: 1.25rem 1.35rem;
}

.hero-detail-stats {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hero-detail-section > strong {
  font-size: 1.03rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-detail-interface.hero-rank-S {
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.hero-detail-interface.hero-rank-Z {
  box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.28);
}

.hero-showroom-locked-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hero-showroom-footer {
  align-items: center;
  border-top: 1px solid rgba(216, 166, 79, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.hero-showroom-footer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-showroom-footer-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-showroom-footer-label {
  color: rgba(248, 234, 215, 0.62);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-showroom-footer-ranks {
  flex: 1;
}

.hero-showroom-footer-actions {
  margin-left: auto;
}

@media (max-width: 860px) {
  .hero-detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-detail-art-panel,
  .hero-detail-content-panel,
  .hero-detail-art-panel .hero-showroom-portrait {
    min-height: 22.5rem;
  }

  .hero-detail-interface .hero-showroom-portrait--hero {
    min-height: 22.5rem;
  }
}

#wikiPopupRoot {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 1200;
}

.wiki-popup-stack {
  align-items: flex-start;
  display: flex;
  justify-content: center;
  padding: 1rem;
  padding-top: 4.5rem;
  pointer-events: none;
}

.wiki-popup-card {
  background: linear-gradient(180deg, rgba(34, 26, 18, 0.98), rgba(22, 16, 10, 0.98));
  border: 1px solid rgba(216, 166, 79, 0.55);
  border-radius: 0.75rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto 1fr;
  max-width: 28rem;
  padding: 1rem 1rem 0.9rem;
  pointer-events: auto;
  position: relative;
  width: min(92vw, 28rem);
}

.wiki-popup-close {
  background: transparent;
  border: none;
  color: rgba(248, 234, 215, 0.75);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  position: absolute;
  right: 0.55rem;
  top: 0.35rem;
}

.wiki-popup-icon {
  font-size: 2rem;
  line-height: 1;
}

.wiki-popup-eyebrow {
  color: rgba(216, 166, 79, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.15rem;
  text-transform: uppercase;
}

.wiki-popup-title {
  color: #f8ead7;
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.wiki-popup-text {
  color: rgba(248, 234, 215, 0.88);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 0.75rem;
}

.wiki-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wiki-popup-queue-hint {
  color: rgba(248, 234, 215, 0.55);
  display: block;
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.wiki-menu-badge {
  background: #c45c2c;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  justify-content: center;
  min-width: 1.1rem;
  padding: 0.08rem 0.35rem;
}

.wiki-interface .wiki-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.wiki-interface .wiki-category-tabs button {
  border-radius: 999px;
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
}

.wiki-interface .wiki-category-tabs button.active {
  color: var(--button-text);
}

.wiki-layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
}

.wiki-entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 24rem;
  overflow: auto;
}

.wiki-entry-button {
  align-items: flex-start;
  border-radius: 0.55rem;
  color: var(--button-text);
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: auto 1fr;
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.wiki-entry-button:hover {
  border-color: var(--button-border-strong);
}

.wiki-entry-button.active,
.wiki-entry-button:hover {
  border-color: rgba(216, 166, 79, 0.45);
}

.wiki-entry-button.is-unread strong::after {
  background: #c45c2c;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 0.45rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  width: 0.45rem;
}

.wiki-entry-button-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.wiki-entry-button-text strong {
  color: var(--button-text);
  font-size: 0.88rem;
}

.wiki-entry-button-text span {
  color: var(--button-text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.wiki-entry-detail {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  max-height: 24rem;
  overflow: auto;
  padding: 0.85rem 1rem;
}

.wiki-entry-detail-header {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.wiki-entry-detail-icon {
  font-size: 1.8rem;
}

.wiki-entry-detail-body {
  color: rgba(248, 234, 215, 0.9);
  font-size: 0.9rem;
  line-height: 1.55;
}

.wiki-entry-detail-body ul {
  margin: 0.5rem 0 0.5rem 1.1rem;
  padding: 0;
}

.wiki-entry-placeholder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 0.65rem;
  padding: 1rem;
}

@media (max-width: 760px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }
}

.harbor-view-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.harbor-view-screen--locked {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 2rem);
  padding: 1rem;
}

.harbor-locked-card {
  max-width: 28rem;
  text-align: center;
}

.harbor-map-shell {
  display: flex;
  flex: 1;
  justify-content: center;
  margin: 0 auto;
  min-height: 0;
  position: relative;
  width: 100%;
}

.harbor-map-shell.has-harbor-scenery {
  align-items: center;
  min-height: 100%;
}

.harbor-map-scenery.has-harbor-background {
  background-color: #2a4a62;
}

.harbor-map-scenery-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.harbor-map-scenery {
  background:
    radial-gradient(circle at 50% 100%, rgba(26, 58, 90, 0.85), transparent 55%),
    radial-gradient(circle at 18% 18%, rgba(72, 108, 148, 0.25), transparent 42%),
    linear-gradient(180deg, #4a7a52 0%, #3d6a48 18%, #2a4a62 55%, #1a3a5a 100%);
  inset: 0;
  position: absolute;
  z-index: 0;
}

.harbor-map-stage {
  align-items: center;
  display: flex;
  height: auto;
  justify-content: center;
  max-height: 100%;
  position: relative;
  width: auto;
  z-index: 1;
}

.harbor-map-shell:not(.has-harbor-scenery) .harbor-map-stage {
  height: auto;
  width: auto;
}

.harbor-build-grid {
  --land-cell-size: 44px;
  box-sizing: border-box;
  flex-shrink: 0;
  grid-template-columns: repeat(var(--castle-width), var(--land-cell-size));
  grid-template-rows: repeat(var(--castle-height), var(--land-cell-size));
  height: calc(var(--castle-height) * var(--land-cell-size));
  margin: 0 auto 0.75rem;
  max-width: 100%;
  width: calc(var(--castle-width) * var(--land-cell-size));
}

.harbor-build-grid .harbor-cell {
  aspect-ratio: 1;
  box-sizing: border-box;
  height: var(--land-cell-size);
  min-height: 0;
  min-width: 0;
  width: var(--land-cell-size);
}

.harbor-build-grid .cell-coord {
  font-size: 0.46rem;
}

.harbor-map-shell.has-harbor-scenery .harbor-build-grid {
  margin: 0 auto;
}

.harbor-build-grid .harbor-placed-building {
  z-index: 2;
}

.harbor-shop-launcher {
  position: relative;
  z-index: 15;
}

.harbor-commerce-launchers {
  align-items: flex-end;
  display: flex;
  gap: 0.45rem;
}

.harbor-shop-interface .shop-grid {
  display: grid;
  gap: 0.75rem;
}

.app.is-harbor-view {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.is-harbor-view {
  overflow: hidden;
}

.app.is-harbor-view .hero {
  display: none;
}

.app.is-harbor-view #harborPanel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.app.is-harbor-view .harbor-view-screen {
  height: 100vh;
  max-height: 100vh;
}

.app.is-harbor-view .harbor-map-shell {
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 5.25rem 0 5rem;
  width: 100%;
}

.app.is-harbor-view .harbor-map-shell.has-harbor-scenery {
  aspect-ratio: unset;
  height: 100%;
  max-height: none;
  max-width: none;
  width: 100%;
}

.app.is-harbor-view .harbor-map-scenery,
.app.is-harbor-view .harbor-map-scenery-layer {
  inset: 0;
  position: absolute;
}

.app.is-harbor-view .harbor-map-shell.has-harbor-scenery .harbor-map-stage {
  margin-top: clamp(1.5rem, 8vh, 4.5rem);
}

.harbor-build-palette {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.processed-resources-panel {
  margin-top: 0.75rem;
}

  .processed-resources-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .unit-upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .unit-upgrade-card {
    padding: 0.75rem;
    border-radius: 0.65rem;
    background: rgba(20, 24, 32, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .iron-mine-mode-row {
    margin: 0.75rem 0;
    gap: 0.5rem;
  }

.satisfaction-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  background: rgba(20, 24, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.satisfaction-panel.is-compact {
  margin-bottom: 0.75rem;
}

.satisfaction-bar-track {
  position: relative;
  height: 0.55rem;
  margin: 0.65rem 0 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.satisfaction-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8a4a4a, #c8a24a, #4a8a5a);
  transition: width 0.35s ease;
}

.satisfaction-bar-fill.is-positive {
  background: #4a8a5a;
}

.satisfaction-bar-fill.is-negative {
  background: #8a4a4a;
}

.satisfaction-bar-fill.is-neutral {
  background: #8a7a4a;
}

.processed-stock-hint {
  margin: 0.75rem 0;
}

.harbor-building-interface {
  margin-bottom: 0.75rem;
}

.harbor-building-hint {
  margin-bottom: 0.75rem;
}

.processed-resource-pill {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(20, 24, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.processed-resource-label {
  font-size: 0.82rem;
  color: var(--muted, #a8b0bc);
}

.processed-resource-rate {
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .processed-resources-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .app.is-harbor-view {
    padding: 0;
  }

  .app.is-harbor-view .harbor-map-shell {
    padding: 6.5rem 0.5rem 5.5rem;
  }
}

.kontor-stock-list {
  display: grid;
  gap: 0.65rem;
}

.kontor-stock-row {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
}

.kontor-stock-actions {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kontor-stock-actions input {
  max-width: 6rem;
}

.modal-panel:has(.harbor-kontor-interface) {
  max-height: min(80vh, 38rem);
  max-width: min(29rem, 96vw);
}

.harbor-kontor-interface.building-interface {
  gap: 0.38rem;
  margin-top: 0;
  padding: 0.58rem 0.68rem;
}

.harbor-kontor-interface .building-interface-header {
  gap: 0.4rem;
}

.harbor-kontor-interface .building-interface-header h3 {
  font-size: 1rem;
}

.harbor-kontor-interface .building-interface-header .muted {
  display: none;
}

.harbor-kontor-interface .castle-actions .badge {
  font-size: 0.72rem;
  padding: 0.24rem 0.46rem;
}

.harbor-kontor-interface .close-button {
  font-size: 0.82rem;
  min-height: 1.9rem;
  padding: 0.3rem 0.55rem;
}

.harbor-kontor-interface .kontor-stat-grid {
  gap: 0.32rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.32rem 0 0.24rem;
}

.harbor-kontor-interface .kontor-stat-grid .castle-stat {
  padding: 0.38rem 0.46rem;
}

.harbor-kontor-interface .kontor-stat-grid .castle-stat span {
  font-size: 0.64rem;
}

.harbor-kontor-interface .kontor-stat-grid .castle-stat strong {
  font-size: 0.82rem;
}

.harbor-kontor-interface .kontor-stat-next strong {
  font-size: 0.76rem;
}

.harbor-kontor-interface .kontor-stock-card,
.harbor-kontor-interface .modal-section-card {
  margin-top: 0.4rem;
  padding: 0.48rem 0.54rem;
}

.harbor-kontor-interface .kontor-section-header {
  margin-bottom: 0.36rem;
}

.harbor-kontor-interface .kontor-section-header strong {
  font-size: 0.88rem;
}

.harbor-kontor-interface .kontor-section-header span {
  font-size: 0.74rem;
  margin-top: 0;
}

.harbor-kontor-interface .kontor-stock-list {
  gap: 0.38rem;
}

.harbor-kontor-interface .kontor-stock-row {
  align-items: center;
  border-radius: 0.48rem;
  gap: 0.32rem;
  grid-template-columns: minmax(4.5rem, 1fr) auto;
  padding: 0.4rem 0.48rem;
}

.harbor-kontor-interface .kontor-stock-row > span {
  font-size: 0.78rem;
}

.harbor-kontor-interface .kontor-stock-row > strong {
  font-size: 0.84rem;
  text-align: right;
}

.harbor-kontor-interface .kontor-stock-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.28rem;
  grid-column: 1 / -1;
}

.harbor-kontor-interface .kontor-stock-actions input {
  font-size: 0.8rem;
  max-width: 4rem;
  min-height: 1.8rem;
  padding: 0.22rem 0.36rem;
}

.harbor-kontor-interface .kontor-stock-btn {
  font-size: 0.74rem;
  min-height: 1.8rem;
  padding: 0.22rem 0.44rem;
}

.harbor-kontor-interface .coord-controls {
  gap: 0.4rem;
}

.harbor-kontor-interface .coord-inputs label {
  font-size: 0.78rem;
}

.harbor-kontor-interface .coord-inputs input {
  font-size: 0.8rem;
  min-height: 1.85rem;
  padding: 0.24rem 0.4rem;
}

.harbor-kontor-interface .button-row {
  gap: 0.32rem;
}

.harbor-kontor-interface .button-row button,
.harbor-kontor-interface .primary-button,
.harbor-kontor-interface .secondary-button,
.harbor-kontor-interface .danger-button {
  font-size: 0.84rem;
  min-height: 2rem;
  padding: 0.32rem 0.62rem;
}

.harbor-kontor-interface .demolish-confirm {
  font-size: 0.84rem;
}

@media (max-width: 520px) {
  .harbor-kontor-interface .kontor-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .harbor-kontor-interface .kontor-stat-next {
    grid-column: 1 / -1;
  }
}

.harbor-trade-card,
.harbor-auction-card {
  align-items: center;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
}

.harbor-trade-card.is-own,
.harbor-auction-card.is-own {
  border-color: rgba(196, 168, 118, 0.35);
}

.harbor-trade-form,
.harbor-auction-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.harbor-trade-form label,
.harbor-auction-form label {
  display: grid;
  gap: 0.25rem;
}

.harbor-auction-bid-row {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.harbor-auction-bid-row input {
  max-width: 7rem;
}

.modal-panel:has(.harbor-auction-interface) {
  max-height: min(82vh, 40rem);
  max-width: min(29rem, 96vw);
}

.harbor-auction-interface.building-interface {
  gap: 0.38rem;
  margin-top: 0;
  padding: 0.58rem 0.68rem;
}

.harbor-auction-interface .building-interface-header {
  gap: 0.4rem;
}

.harbor-auction-interface .building-interface-header h3 {
  font-size: 1rem;
}

.harbor-auction-interface .building-interface-header .muted {
  display: none;
}

.harbor-auction-interface .castle-actions .badge {
  font-size: 0.72rem;
  padding: 0.24rem 0.46rem;
}

.harbor-auction-interface .close-button {
  font-size: 0.82rem;
  min-height: 1.9rem;
  padding: 0.3rem 0.55rem;
}

.harbor-auction-interface .auction-stat-grid {
  gap: 0.32rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.32rem 0 0.24rem;
}

.harbor-auction-interface .auction-stat-grid .castle-stat {
  padding: 0.38rem 0.46rem;
}

.harbor-auction-interface .auction-stat-grid .castle-stat span {
  font-size: 0.64rem;
}

.harbor-auction-interface .auction-stat-grid .castle-stat strong {
  font-size: 0.82rem;
}

.harbor-auction-interface .auction-create-card,
.harbor-auction-interface .auction-market-widget,
.harbor-auction-interface .modal-section-card {
  margin-top: 0.4rem;
  padding: 0.48rem 0.54rem;
}

.harbor-auction-interface .auction-section-header {
  align-items: center;
  margin-bottom: 0.36rem;
}

.harbor-auction-interface .auction-section-header strong {
  font-size: 0.88rem;
}

.harbor-auction-interface .auction-section-header span {
  font-size: 0.74rem;
  margin-top: 0;
}

.harbor-auction-interface .auction-market-count {
  font-size: 0.72rem;
  padding: 0.18rem 0.42rem;
}

.harbor-auction-interface .auction-create-form {
  gap: 0.42rem;
  margin-top: 0.4rem;
}

.harbor-auction-interface .auction-create-form label {
  font-size: 0.78rem;
  gap: 0.22rem;
}

.harbor-auction-interface .auction-create-form input,
.harbor-auction-interface .auction-create-form select {
  font-size: 0.8rem;
  min-height: 1.85rem;
  padding: 0.24rem 0.4rem;
}

.harbor-auction-interface .auction-create-form .primary-button {
  font-size: 0.84rem;
  min-height: 2rem;
  padding: 0.32rem 0.62rem;
}

.harbor-auction-interface .auction-market-widget-list {
  display: grid;
  gap: 0.38rem;
  max-height: min(30vh, 16rem);
  overflow-y: auto;
  padding-right: 0.1rem;
}

.harbor-auction-interface .auction-market-card {
  align-items: flex-start;
  border-radius: 0.48rem;
  flex-direction: column;
  gap: 0.36rem;
  padding: 0.44rem 0.52rem;
}

.harbor-auction-interface .auction-market-card-main {
  display: grid;
  gap: 0.1rem;
  width: 100%;
}

.harbor-auction-interface .auction-market-card-main strong {
  font-size: 0.82rem;
}

.harbor-auction-interface .auction-market-card-main p {
  font-size: 0.78rem;
  margin: 0;
}

.harbor-auction-interface .auction-market-card-main .muted,
.harbor-auction-interface .auction-market-own {
  font-size: 0.72rem;
}

.harbor-auction-interface .auction-market-bid-row {
  gap: 0.28rem;
  width: 100%;
}

.harbor-auction-interface .auction-market-bid-row input {
  flex: 1;
  font-size: 0.78rem;
  max-width: none;
  min-height: 1.8rem;
  padding: 0.22rem 0.36rem;
}

.harbor-auction-interface .auction-market-bid-btn {
  font-size: 0.74rem;
  min-height: 1.8rem;
  padding: 0.22rem 0.48rem;
}

.harbor-auction-interface .auction-market-empty {
  font-size: 0.78rem;
  margin: 0.18rem 0 0;
}

.harbor-auction-interface .season-point-market-card {
  display: grid;
  gap: 0.75rem;
}

.harbor-auction-interface .season-point-market-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.harbor-auction-interface .season-point-market-forms {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.harbor-auction-interface .season-point-market-form-block {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.18);
}

.harbor-auction-interface .season-point-market-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.harbor-auction-interface .season-point-market-lists {
  display: grid;
  gap: 0.65rem;
}

.harbor-auction-interface .season-point-order-card {
  align-items: center;
}

@media (max-width: 720px) {
  .harbor-auction-interface .season-point-market-forms {
    grid-template-columns: 1fr;
  }

  .harbor-auction-interface .season-point-market-form {
    grid-template-columns: 1fr;
  }
}

.harbor-auction-interface .coord-controls {
  gap: 0.4rem;
}

.harbor-auction-interface .coord-inputs label {
  font-size: 0.78rem;
}

.harbor-auction-interface .coord-inputs input {
  font-size: 0.8rem;
  min-height: 1.85rem;
  padding: 0.24rem 0.4rem;
}

.harbor-auction-interface .button-row button,
.harbor-auction-interface .primary-button,
.harbor-auction-interface .secondary-button,
.harbor-auction-interface .danger-button {
  font-size: 0.84rem;
  min-height: 2rem;
  padding: 0.32rem 0.62rem;
}

@media (max-width: 520px) {
  .harbor-auction-interface .auction-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .harbor-auction-interface .auction-stat-grid .castle-stat:last-child {
    grid-column: 1 / -1;
  }
}

.modal-panel:has(.harbor-shipyard-interface) {
  max-height: min(84vh, 44rem);
  max-width: min(40rem, 96vw);
}

.harbor-shipyard-interface.building-interface {
  gap: 0.5rem;
  margin-top: 0;
  padding: 0.95rem 1.05rem;
}

.harbor-shipyard-interface .building-interface-header h3 {
  font-size: 1.12rem;
}

.harbor-shipyard-interface .building-interface-header .muted {
  font-size: 0.88rem;
}

.harbor-shipyard-interface .castle-actions .badge {
  font-size: 0.84rem;
  padding: 0.34rem 0.6rem;
}

.harbor-shipyard-interface .interface-stat-grid .castle-stat {
  padding: 0.5rem 0.6rem;
}

.harbor-shipyard-interface .interface-stat-grid .castle-stat span {
  font-size: 0.72rem;
}

.harbor-shipyard-interface .interface-stat-grid .castle-stat strong {
  font-size: 0.92rem;
}

.harbor-shipyard-interface .modal-section-card {
  padding: 0.72rem 0.82rem;
}

.harbor-shipyard-interface .harbor-trade-card {
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
}

.harbor-shipyard-interface .harbor-trade-form {
  gap: 0.55rem;
}

.harbor-shipyard-interface .harbor-trade-form label {
  font-size: 0.88rem;
}

.harbor-shipyard-interface .harbor-trade-form input,
.harbor-shipyard-interface .harbor-trade-form select {
  font-size: 0.9rem;
  min-height: 2.05rem;
}

.harbor-shipyard-interface .button-row button,
.harbor-shipyard-interface .primary-button,
.harbor-shipyard-interface .secondary-button,
.harbor-shipyard-interface .danger-button {
  font-size: 0.9rem;
  min-height: 2.1rem;
  padding: 0.38rem 0.72rem;
}

.modal-panel:has(.harbor-alliance-interface) {
  max-height: min(86vh, 46rem);
  max-width: min(42rem, 96vw);
}

.harbor-alliance-interface.building-interface {
  gap: 0.5rem;
  margin-top: 0;
  padding: 0.95rem 1.05rem;
}

.harbor-alliance-interface .building-interface-header h3 {
  font-size: 1.12rem;
}

.harbor-alliance-interface .building-interface-header .muted {
  font-size: 0.88rem;
}

.harbor-alliance-interface .castle-actions .badge {
  font-size: 0.84rem;
  padding: 0.34rem 0.6rem;
}

.harbor-alliance-interface .interface-stat-grid .castle-stat {
  padding: 0.5rem 0.6rem;
}

.harbor-alliance-interface .interface-stat-grid .castle-stat span {
  font-size: 0.72rem;
}

.harbor-alliance-interface .interface-stat-grid .castle-stat strong {
  font-size: 0.92rem;
}

.harbor-alliance-interface .modal-section-card {
  padding: 0.72rem 0.82rem;
}

.harbor-alliance-interface .counter-hint {
  font-size: 0.9rem;
  line-height: 1.45;
}

.harbor-alliance-interface .alliance-invite-code.is-large {
  font-size: 1.25rem;
  padding: 0.52rem 0.78rem;
}

.harbor-alliance-interface .alliance-member-row {
  padding: 0.58rem 0.72rem;
}

.harbor-alliance-interface .alliance-tier-pill {
  font-size: 0.84rem;
}

.harbor-alliance-interface .button-row button,
.harbor-alliance-interface .primary-button,
.harbor-alliance-interface .secondary-button,
.harbor-alliance-interface .danger-button {
  font-size: 0.9rem;
  min-height: 2.1rem;
  padding: 0.38rem 0.72rem;
}

.university-spec-card {
  margin-top: 0.75rem;
}

.university-spec-choice-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin-top: 0.55rem;
}

.university-spec-choice {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.university-spec-choice:hover:not(:disabled) {
  border-color: rgba(212, 168, 83, 0.45);
}

.university-spec-choice:disabled,
.university-spec-choice.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.university-spec-choice-icon {
  font-size: 1.35rem;
}

.university-spec-research-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.university-spec-research-list .research-card {
  margin: 0;
}

.alliance-member-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.alliance-pyramid-list .alliance-member-row {
  margin-left: calc(var(--alliance-depth, 0) * 1.1rem);
}

.alliance-member-row {
  align-items: center;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
}

.alliance-member-row.is-active-player {
  outline: 1px solid rgba(212, 168, 83, 0.55);
}

.alliance-member-main {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.alliance-tier-pill {
  font-size: 0.78rem;
}

.alliance-tier-boss .alliance-tier-pill {
  background: rgba(180, 120, 40, 0.35);
}

.alliance-tier-minister .alliance-tier-pill {
  background: rgba(90, 120, 180, 0.35);
}

.alliance-tier-warrior .alliance-tier-pill {
  background: rgba(120, 90, 60, 0.35);
}

.alliance-tier-peasant .alliance-tier-pill {
  background: rgba(80, 110, 70, 0.35);
}

.alliance-invite-code {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0.35rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem;
}

.alliance-invite-code.is-large {
  display: inline-block;
  font-size: 1.15rem;
  margin-top: 0.35rem;
  padding: 0.45rem 0.7rem;
}

.alliance-recruit-card {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
}

.alliance-tier-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.alliance-poi-source-list {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.alliance-poi-source-row {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.4rem;
  display: grid;
  gap: 0.1rem;
  padding: 0.45rem 0.55rem;
}

.pill-poi {
  font-size: 0.74rem;
}

.profile-card-header {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.profile-character-editor {
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr;
  margin: 0.75rem 0 1rem;
}

.profile-character-preview-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
}

.profile-character-fields {
  display: grid;
  gap: 0.65rem;
}

.profile-character-swatch-group {
  display: grid;
  gap: 0.35rem;
}

.profile-character-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.profile-character-swatch {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  height: 1.5rem;
  width: 1.5rem;
  background: var(--swatch);
}

.profile-character-swatch.is-active {
  border-color: #e8c87a;
  box-shadow: 0 0 0 2px rgba(232, 200, 122, 0.35);
}

.profile-character-avatar {
  border-radius: 0.75rem;
  height: var(--pc-size);
  overflow: hidden;
  position: relative;
  width: var(--pc-size);
}

.profile-character-cloak,
.profile-character-body,
.profile-character-head,
.profile-character-hair,
.profile-character-letter {
  position: absolute;
}

.profile-character-cloak {
  background: var(--pc-cloak);
  bottom: 8%;
  height: 55%;
  left: 10%;
  right: 10%;
  border-radius: 0.35rem 0.35rem 0.2rem 0.2rem;
}

.profile-character-body {
  background: var(--pc-armor);
  bottom: 22%;
  height: 38%;
  left: 22%;
  right: 22%;
  border-radius: 0.25rem;
}

.profile-character-head {
  background: var(--pc-skin);
  border-radius: 999px;
  height: 34%;
  left: 24%;
  top: 12%;
  width: 52%;
}

.profile-character-hair {
  background: var(--pc-hair);
  border-radius: 999px 999px 0 0;
  height: 20%;
  left: 20%;
  top: 8%;
  width: 60%;
}

.profile-character-letter {
  color: rgba(255, 255, 255, 0.85);
  font-size: calc(var(--pc-size) * 0.22);
  font-weight: 700;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
}

.world-map {
  overflow: hidden;
  position: relative;
}

.world-map-zoom-controls {
  display: flex;
  gap: 0.35rem;
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 12;
}

.world-map-bottom-nav {
  bottom: 1.25rem;
  display: flex;
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  z-index: 12;
}

.world-map-castle-button {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  font-weight: 800;
  min-width: 9.5rem;
  padding: 0.7rem 1.35rem;
  pointer-events: auto;
}

.world-map-chat-overlay {
  bottom: 1rem;
  left: 1rem;
  max-width: min(22rem, 34vw);
  pointer-events: auto;
  position: absolute;
  width: 100%;
  z-index: 11;
}

.world-map-chat-overlay .castle-chat-panel {
  backdrop-filter: blur(4px);
  background: rgba(248, 240, 225, 0.94);
}

.world-map-chat-overlay .castle-chat-list {
  max-height: 9rem;
}

.world-map-chat-overlay .castle-chat-panel.is-expanded .castle-chat-list {
  max-height: min(16rem, 35vh);
}

.world-map-transform-layer,
.world-map-markers-layer {
  height: 100%;
  position: absolute;
  width: 100%;
  inset: 0;
}

.world-map-transform-layer {
  transform-origin: center center;
}

.world-map.is-detail-zoom .map-node.map-node-compact .map-label,
.world-map.is-detail-zoom .map-label-compact {
  display: flex;
}

.world-map.is-detail-zoom .map-label {
  font-size: 0.72rem;
  line-height: 1.2;
}

.building-upgrade-section {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
  width: 100%;
}

.building-upgrade-actions {
  display: block;
  width: 100%;
}

.building-upgrade-actions .building-upgrade-button,
.building-upgrade-section > .building-upgrade-button {
  width: 100%;
}

.building-upgrade-button.is-queued {
  cursor: not-allowed;
  opacity: 0.82;
}

.building-upgrade-section .building-queue-inline {
  margin-top: 0;
  width: 100%;
}

.building-upgrade-section .progress-track-compact {
  width: 100%;
}

.castle-resource-list--rows {
  gap: 0.4rem;
}

.castle-resource-list--premium {
  border-top: 1px solid rgba(120, 96, 48, 0.22);
  margin-top: 0.35rem;
  padding-top: 0.45rem;
}

.castle-resource-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 0.5rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 2rem 1fr auto;
  padding: 0.4rem 0.55rem;
  position: relative;
  width: 100%;
}

.castle-resource-row-icon {
  align-items: center;
  display: flex;
  height: 1.75rem;
  justify-content: center;
  width: 1.75rem;
}

.castle-resource-row-icon .resource-icon-img {
  height: 1.5rem;
  width: 1.5rem;
}

.castle-resource-row-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.castle-resource-row-name {
  color: rgba(42, 32, 24, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.castle-resource-row-amount {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
}

.castle-resource-row-rate {
  color: rgba(42, 32, 24, 0.58);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.castle-resource-row-rate.is-positive {
  color: rgba(58, 120, 68, 0.92);
}

.castle-resource-row-rate.is-negative {
  color: rgba(170, 70, 55, 0.92);
}

.castle-resource-list--rows .resource-tooltip {
  left: calc(100% + 0.45rem);
  top: 50%;
  transform: translateY(-50%) translateX(0.25rem);
}

.castle-resource-list--rows .resource-with-tooltip:hover .resource-tooltip,
.castle-resource-list--rows .resource-with-tooltip.is-tooltip-open .resource-tooltip,
.castle-resource-list--rows .resource-with-tooltip:focus-within .resource-tooltip {
  transform: translateY(-50%) translateX(0);
}

.building-queue .training-active.is-waiting {
  opacity: 0.72;
}

.social-root {
  bottom: 1.25rem;
  pointer-events: none;
  position: fixed;
  right: 1.25rem;
  z-index: 120;
}

.social-root > * {
  pointer-events: auto;
}

.castle-social-launcher {
  position: relative;
  z-index: 15;
}

.castle-guild-launcher {
  position: relative;
  z-index: 15;
}

.social-fab {
  align-items: center;
  background: var(--button-bg);
  border: 1px solid var(--button-border-strong);
  box-shadow: var(--button-shadow);
  color: var(--button-text);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 800;
  gap: 0.35rem;
  min-width: 5.5rem;
  position: relative;
}

.social-fab.is-open {
  background: var(--button-bg-active);
  border-color: var(--button-border-active);
  box-shadow: var(--button-shadow-active);
}

.social-fab-badge {
  background: #b33a2f;
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  min-width: 1.1rem;
  padding: 0.12rem 0.35rem;
  text-align: center;
}

.social-interface {
  color: var(--text);
  max-width: min(38rem, 100%);
  width: 100%;
}

.social-interface h3 {
  color: var(--text);
  font-size: 1rem;
  margin: 0;
}

.social-interface .building-interface-header h3 {
  font-size: 1.2rem;
}

.social-subnav {
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.social-sync-hint {
  align-items: flex-start;
  background: rgba(216, 166, 79, 0.1);
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 0.65rem;
  color: var(--text);
  display: grid;
  font-size: 0.9rem;
  gap: 0.15rem;
  line-height: 1.45;
  margin-top: 0.55rem;
  padding: 0.6rem 0.75rem;
}

.social-sync-hint-label {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.social-sync-hint-text {
  color: var(--muted);
}

.social-sync-hint.is-loading {
  background: rgba(119, 183, 109, 0.1);
  border-color: rgba(119, 183, 109, 0.28);
}

.social-sync-hint.is-online {
  background: rgba(119, 183, 109, 0.12);
  border-color: rgba(119, 183, 109, 0.35);
}

.social-sync-hint.is-online .social-sync-hint-label {
  color: #9fd89a;
}

.social-sync-hint.is-error {
  background: rgba(199, 95, 70, 0.12);
  border-color: rgba(199, 95, 70, 0.35);
  color: #f2c4b8;
}

.social-panel-body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  max-height: min(58vh, 30rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.social-section-card {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.8rem 0.85rem;
}

.social-section h3 {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 0.95rem;
  font-weight: 800;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}

.social-section-count {
  background: rgba(216, 166, 79, 0.16);
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
}

.social-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-list-item {
  align-items: center;
  background: rgba(23, 19, 15, 0.42);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  padding: 0.6rem 0.7rem;
}

.social-list-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.social-list-copy strong {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-list-copy .muted {
  color: var(--muted);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-list-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.social-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

.social-messages-layout {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(6.5rem, 7.5rem) 1fr;
  min-height: 15rem;
}

.social-thread-list {
  display: grid;
  gap: 0.25rem;
  max-height: 14rem;
  overflow-y: auto;
}

.social-thread-item {
  background: rgba(23, 19, 15, 0.42);
  border: 1px solid var(--border);
  border-radius: 0.42rem;
  color: var(--text);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 0.08rem;
  padding: 0.32rem 0.4rem;
  text-align: left;
}

.social-thread-item.is-active {
  background: rgba(216, 166, 79, 0.12);
  border-color: rgba(216, 166, 79, 0.42);
}

.social-thread-item strong {
  color: var(--text);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-thread-item .muted {
  color: var(--muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-thread-item .menu-badge {
  font-size: 0.62rem;
  margin-left: 0.15rem;
  padding: 0.12rem 0.3rem;
}

.social-dm-panel {
  background: rgba(23, 19, 15, 0.42);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  display: grid;
  gap: 0.45rem;
  grid-template-rows: auto 1fr auto;
  min-height: 15rem;
  padding: 0.55rem;
}

.social-dm-head {
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  padding-bottom: 0.35rem;
}

.social-dm-messages,
.social-guild-messages {
  display: grid;
  gap: 0.4rem;
  max-height: 12rem;
  overflow-y: auto;
}

.social-dm-bubble {
  background: rgba(46, 36, 26, 0.9);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  display: grid;
  gap: 0.12rem;
  max-width: 92%;
  padding: 0.45rem 0.55rem;
}

.social-dm-bubble.is-mine {
  background: rgba(119, 183, 109, 0.14);
  border-color: rgba(119, 183, 109, 0.35);
  justify-self: end;
}

.social-dm-author {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.social-dm-text {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.social-dm-form,
.social-inline-form {
  align-items: center;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1fr auto;
}

.social-dm-form input,
.social-inline-form input {
  background: rgba(23, 19, 15, 0.72);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.65rem;
}

.social-dm-form input::placeholder {
  color: rgba(197, 170, 139, 0.72);
}

.social-guild-head {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
}

.social-guild-head h3 {
  margin: 0;
}

.social-guild-head .muted,
.social-guild-head p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0.2rem 0 0;
}

.social-guild-head code {
  background: rgba(23, 19, 15, 0.72);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: var(--accent);
  font-size: 0.88rem;
  padding: 0.1rem 0.35rem;
}

.social-guild-chat {
  display: grid;
  gap: 0.45rem;
}

.modal-panel:has(.social-interface) {
  max-width: min(40rem, 100%);
}

@media (max-width: 720px) {
  .social-messages-layout {
    grid-template-columns: 1fr;
  }

  .social-thread-list {
    max-height: 7rem;
  }

  .social-panel-body {
    max-height: min(62vh, 28rem);
  }
}

/* Season 1 · Heaven vs Hell */
.modal-backdrop:has(.season-interface) {
  align-items: stretch;
  background: #03060f;
  justify-content: stretch;
  padding: 0;
}

.modal-panel:has(.season-interface) {
  border-radius: 0;
  height: 100dvh;
  max-height: none;
  max-width: none;
  overflow: hidden;
  width: 100%;
}

.modal-panel:has(.season-interface:not(.season-interface--faction-hall)) {
  overflow: auto;
}

.modal-panel:has(.season-interface) .building-interface {
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  min-height: 100%;
}

.modal-panel:has(.season-interface--faction-hall) {
  overflow: hidden;
}

.modal-panel:has(.season-interface--faction-hall) .building-interface {
  background: transparent;
}

.season-interface {
  background:
    radial-gradient(circle at 15% 0%, rgba(136, 198, 255, 0.12), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(225, 71, 46, 0.13), transparent 38%),
    var(--surface-menu) !important;
  border: none;
  border-color: rgba(220, 180, 95, 0.34);
  flex: 1 1 auto;
  min-height: 100%;
}

.season-interface--faction-hall {
  background: transparent !important;
  border: none;
  min-height: 100%;
  padding: 0;
}

.season-faction-hall {
  height: 100%;
  isolation: isolate;
  min-height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.season-hall-scene {
  background:
    linear-gradient(180deg, rgba(8, 18, 38, 0.08) 0%, rgba(8, 18, 38, 0.22) 58%, rgba(4, 10, 24, 0.72) 100%),
    var(--season-hall-image) center 28% / cover no-repeat;
  inset: 0;
  position: absolute;
  transform: scale(1.02);
  z-index: 0;
}

.season-hall-vignette {
  background:
    radial-gradient(ellipse at center 72%, transparent 18%, rgba(3, 8, 20, 0.45) 72%),
    linear-gradient(90deg, rgba(2, 8, 22, 0.72) 0%, transparent 18%, transparent 82%, rgba(2, 8, 22, 0.72) 100%);
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.season-hall-floor-glow {
  background: linear-gradient(180deg, transparent 45%, rgba(120, 188, 255, 0.16) 72%, rgba(216, 166, 79, 0.2) 100%);
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.season-faction-hall--heaven .season-hall-scene {
  background:
    linear-gradient(180deg, rgba(8, 18, 38, 0.04) 0%, rgba(8, 18, 38, 0.14) 52%, rgba(4, 10, 24, 0.58) 100%),
    var(--season-hall-image) center center / cover no-repeat;
}

.season-faction-hall--heaven .season-hall-vignette {
  background:
    radial-gradient(ellipse at center 68%, transparent 22%, rgba(3, 8, 20, 0.38) 78%),
    linear-gradient(90deg, rgba(2, 8, 22, 0.55) 0%, transparent 14%, transparent 86%, rgba(2, 8, 22, 0.55) 100%);
}

.season-faction-hall--hell .season-hall-scene {
  background:
    linear-gradient(180deg, rgba(18, 4, 4, 0.08) 0%, rgba(18, 4, 4, 0.22) 52%, rgba(8, 2, 2, 0.62) 100%),
    var(--season-hall-image) center center / cover no-repeat;
}

.season-faction-hall--hell .season-hall-vignette {
  background:
    radial-gradient(ellipse at center 68%, transparent 20%, rgba(12, 2, 2, 0.48) 78%),
    linear-gradient(90deg, rgba(10, 2, 2, 0.62) 0%, transparent 14%, transparent 86%, rgba(10, 2, 2, 0.62) 100%);
}

.season-faction-hall--hell .season-hall-floor-glow {
  background: linear-gradient(180deg, transparent 45%, rgba(180, 36, 28, 0.2) 72%, rgba(216, 120, 48, 0.18) 100%);
}

.season-faction-hall--hell .season-hall-header-copy h3 {
  color: #fff0ea;
}

.season-faction-hall--hell .season-hall-header-copy .eyebrow,
.season-faction-hall--hell .season-hall-countdown {
  color: rgba(255, 220, 210, 0.88);
}

.season-faction-hall--hell .season-hall-stat {
  background: rgba(28, 8, 8, 0.62);
  border-color: rgba(232, 120, 88, 0.34);
}

.season-faction-hall--hell .season-hall-stat small {
  color: rgba(255, 210, 198, 0.72);
}

.season-faction-hall--hell .season-hall-stat strong {
  color: #ffe8d8;
}

.season-faction-hall--hell .season-hall-action {
  background: linear-gradient(145deg, rgba(58, 14, 12, 0.84), rgba(20, 6, 6, 0.72));
  border-color: rgba(232, 120, 88, 0.36);
  color: #fff2ea;
}

.season-faction-hall--hell .season-hall-action:hover,
.season-faction-hall--hell .season-hall-action.is-active {
  border-color: rgba(255, 168, 96, 0.78);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 140, 72, 0.2);
}

.season-faction-hall--hell .season-hall-action small {
  color: rgba(255, 205, 188, 0.76);
}

.season-faction-hall--hell .season-hall-hero-caption {
  color: rgba(255, 220, 205, 0.84);
}

.season-faction-hall--hell .season-hall-panel {
  background: linear-gradient(180deg, rgba(28, 8, 8, 0.95), rgba(14, 4, 4, 0.97));
  border-color: rgba(232, 120, 88, 0.3);
}

.season-faction-hall--hell .season-hall-panel-header {
  border-bottom-color: rgba(232, 120, 88, 0.2);
}

.season-faction-hall--hell .season-hall-panel-header h4 {
  color: #fff0e8;
}

.season-hall-header,
.season-hall-actions,
.season-hall-hero-stage,
.season-hall-dialogue-overlay,
.season-hall-speak,
.season-hall-hero-caption,
.season-hall-panel,
.season-hall-panel-backdrop {
  position: relative;
  z-index: 2;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.season-hall-hero-stage {
  align-items: flex-end;
  bottom: 0;
  display: flex;
  height: min(78%, 34rem);
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: min(46%, 24rem);
  z-index: 1;
}

.season-faction-hall--dialogue-open .season-hall-hero-stage {
  left: 50%;
  width: min(44%, 23rem);
}

.season-hall-dialogue-overlay {
  bottom: 34%;
  left: 53%;
  max-width: min(42%, 27rem);
  pointer-events: auto;
  position: absolute;
  width: 100%;
  z-index: 3;
}

.season-hall-dialogue-overlay .season-hall-dialogue-bubble-shell {
  width: 100%;
}

.season-hall-dialogue-bubble-shell {
  background: transparent;
  position: relative;
  width: 100%;
}

.season-hall-dialogue-bubble-shell.is-advanceable {
  cursor: pointer;
}

.season-hall-dialogue-bubble-art {
  background: transparent;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
  width: 100%;
}

.season-hall-dialogue-advance {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: transparent;
  cursor: pointer;
  inset: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
  position: absolute;
  z-index: 1;
}

.season-hall-dialogue-advance:hover:not(:disabled),
.season-hall-dialogue-advance:focus-visible:not(:disabled),
.season-hall-dialogue-advance:active:not(:disabled) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  transform: none;
}

.season-hall-dialogue-bubble-shell.is-advanceable:hover .season-hall-dialogue-continue {
  color: #0a1638;
}

.season-hall-dialogue-bubble-text-layer {
  background: transparent;
  box-shadow: none;
  color: #0c1a42 !important;
  display: flex;
  flex-direction: column;
  inset: 18% 13% 22% 15%;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  text-shadow: none;
  z-index: 2;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-actions {
  pointer-events: auto;
  position: relative;
  z-index: 4;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-eyebrow {
  color: #1a3268 !important;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-quote {
  color: #0c1a42 !important;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-objective,
.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-progress {
  color: #0f224f !important;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-strength {
  color: #4a3828 !important;
}

.season-hall-dialogue-bubble-text-layer .season-hall-dialogue-continue {
  color: #1a3268 !important;
}

.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer .season-hall-dialogue-quote {
  color: #2a120c !important;
}

.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer .season-hall-dialogue-eyebrow,
.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer .season-hall-dialogue-continue {
  color: #4a1848 !important;
}

.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer .season-hall-dialogue-objective,
.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer .season-hall-dialogue-progress {
  color: #3a1438 !important;
}

.season-hall-dialogue-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  display: block;
  min-height: 0;
  padding: 0;
  position: relative;
  text-align: left;
  width: 100%;
}

.season-hall-hero-shadow {
  background:
    radial-gradient(ellipse 58% 18% at 50% 88%, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 52%, transparent 78%);
  bottom: 4%;
  filter: blur(10px);
  height: 18%;
  left: 50%;
  position: absolute;
  transform: translate(-48%, 0) scale(1.04, 0.92);
  width: 72%;
  z-index: 0;
}

.season-hall-hero-portrait {
  display: block;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  position: relative;
  width: 100%;
  z-index: 1;
}

.season-hall-speak {
  bottom: 1.15rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  left: 50%;
  min-width: min(22rem, calc(100% - 2rem));
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}

.season-hall-speak:hover:not(:disabled),
.season-hall-speak:focus-visible:not(:disabled),
.season-hall-speak:active:not(:disabled) {
  transform: translateX(-50%) !important;
}

.season-hall-speak.is-open {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(176, 214, 255, 0.35);
}

.season-hall-panel--dialogue .season-hall-panel-body {
  text-align: left;
}

.season-hall-dialogue-stage {
  align-items: flex-end;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: minmax(6.5rem, 28%) minmax(0, 1fr);
  min-height: 14rem;
}

.season-hall-dialogue-pose {
  display: block;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.45));
  height: auto;
  max-height: 15rem;
  object-fit: contain;
  object-position: left bottom;
  width: 100%;
}

.season-hall-dialogue-eyebrow {
  color: #1a3268;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.season-hall-dialogue-quote {
  color: #0c1a42;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
}

.season-hall-dialogue-objective {
  color: #0f224f;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}

.season-hall-dialogue-continue {
  align-self: flex-end;
  color: #1a3268;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-top: 0.65rem;
  text-transform: uppercase;
}

.season-hall-dialogue-quote:last-of-type {
  margin-bottom: 0.35rem;
}

.season-hall-dialogue-strength {
  color: #4a3828;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
}

.season-hall-dialogue-progress {
  color: #0f224f;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}

.season-hall-dialogue-overlay .season-hall-dialogue-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.45rem;
}

.season-hall-dialogue-action {
  min-width: min(16rem, 100%);
  pointer-events: auto;
  position: relative;
  z-index: 5;
}

.season-hall-dialogue-action:hover:not(:disabled),
.season-hall-dialogue-action:focus-visible:not(:disabled),
.season-hall-dialogue-action:active:not(:disabled) {
  transform: none;
}

.season-quest-badge {
  align-items: center;
  animation: season-attention-pulse 2.2s ease-in-out infinite;
  background: #d64b38;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  height: 1.15rem;
  justify-content: center;
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
  width: 1.15rem;
}

.season-hall-speak .season-quest-badge {
  right: -0.2rem;
  top: -0.35rem;
}

.season-hall-speak.has-quest-attention {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(216, 166, 79, 0.35);
}

.season-faction-hall--hell .season-hall-dialogue-bubble-text-layer,
.season-faction-hall--hell .season-hall-dialogue-quote {
  color: #2a0f38;
}

.season-faction-hall--hell .season-hall-dialogue-eyebrow,
.season-faction-hall--hell .season-hall-dialogue-continue {
  color: #4a1848;
}

.season-faction-hall--hell .season-hall-dialogue-objective,
.season-faction-hall--hell .season-hall-dialogue-progress {
  color: #3a1438;
}

.season-faction-hall--hell .season-hall-dialogue-bubble-inner .eyebrow {
  color: #6a2418;
}

.season-faction-hall--hell .season-hall-dialogue-quote {
  color: #2a120c;
}

.season-faction-hall--hell .season-hall-dialogue-strength,
.season-faction-hall--hell .season-hall-dialogue-progress {
  color: #4a2418;
}

.season-hall-panel--dialogue .season-hall-panel-body {
  text-align: center;
}

.season-hall-dialogue-portrait {
  border-radius: 0.85rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  display: block;
  margin: 0 auto 0.85rem;
  max-height: 14rem;
  max-width: min(12rem, 42vw);
  object-fit: contain;
  width: 100%;
}

.season-faction-hall--heaven .season-hall-hero-shadow {
  background:
    radial-gradient(ellipse 58% 18% at 50% 88%, rgba(8, 18, 42, 0.82) 0%, rgba(8, 18, 42, 0.34) 52%, transparent 78%);
}

.season-faction-hall--hell .season-hall-hero-shadow {
  background:
    radial-gradient(ellipse 58% 18% at 50% 88%, rgba(18, 4, 4, 0.82) 0%, rgba(18, 4, 4, 0.36) 52%, transparent 78%);
}

.season-faction-hall--hell .season-hall-hero-portrait {
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.62)) drop-shadow(0 8px 18px rgba(120, 24, 12, 0.28));
}

.season-faction-hall--hell .season-hall-speak {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 140, 72, 0.16);
}

.season-hall-header {
  align-items: flex-start;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 1rem 1.1rem 0.35rem;
}

.season-hall-header-copy h3 {
  color: #f6fbff;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  margin: 0.1rem 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.season-hall-header-copy .eyebrow,
.season-hall-countdown {
  color: rgba(232, 244, 255, 0.88);
  margin: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.season-hall-countdown.is-ended {
  color: #ffb0a6;
}

.season-hall-header-stats {
  display: flex;
  gap: 0.55rem;
}

.season-hall-stat {
  backdrop-filter: blur(8px);
  background: rgba(8, 20, 42, 0.55);
  border: 1px solid rgba(170, 214, 255, 0.28);
  border-radius: 0.7rem;
  display: flex;
  flex-direction: column;
  min-width: 4.6rem;
  padding: 0.4rem 0.55rem;
  text-align: center;
}

.season-hall-stat small {
  color: rgba(214, 232, 255, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.season-hall-stat strong {
  color: #fff8e8;
  font-size: 0.95rem;
}

.season-hall-close {
  flex-shrink: 0;
}

.season-hall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 0.85rem;
  position: absolute;
  top: 42%;
  transform: translateY(-42%);
  width: min(12.5rem, 24vw);
}

.season-hall-actions--left {
  left: 0.35rem;
}

.season-hall-actions--right {
  right: 0.35rem;
}

.season-hall-action {
  backdrop-filter: blur(10px);
  background: linear-gradient(145deg, rgba(18, 42, 78, 0.78), rgba(8, 18, 36, 0.62));
  border: 1px solid rgba(176, 214, 255, 0.34);
  border-radius: 0.85rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: #f4f9ff;
  cursor: pointer;
  padding: 0.7rem 0.8rem;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.season-hall-action:hover,
.season-hall-action.is-active {
  border-color: rgba(244, 210, 120, 0.72);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(244, 210, 120, 0.18);
  transform: translateX(var(--season-hall-shift, 0));
}

.season-hall-action--left:hover,
.season-hall-action--left.is-active {
  --season-hall-shift: 0.35rem;
}

.season-hall-action--right:hover,
.season-hall-action--right.is-active {
  --season-hall-shift: -0.35rem;
}

.season-hall-action-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.season-hall-action small {
  color: rgba(214, 230, 255, 0.78);
  display: block;
  font-size: 0.74rem;
  margin-top: 0.15rem;
}

.season-hall-hero-caption {
  bottom: 1rem;
  color: rgba(244, 248, 255, 0.82);
  font-size: 0.82rem;
  left: 50%;
  letter-spacing: 0.08em;
  margin: 0;
  position: absolute;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
  transform: translateX(-50%);
  width: min(28rem, 80%);
}

.season-hall-panel-backdrop {
  background: rgba(3, 8, 18, 0.42);
  inset: 0;
  position: absolute;
  z-index: 3;
}

.season-hall-panel {
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10, 22, 44, 0.94), rgba(6, 14, 30, 0.96));
  border: 1px solid rgba(176, 214, 255, 0.28);
  border-radius: 1rem;
  bottom: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  left: 50%;
  max-height: calc(100% - 7rem);
  max-width: min(44rem, calc(100% - 2rem));
  overflow: hidden;
  position: absolute;
  top: 5.25rem;
  transform: translateX(-50%);
  width: 100%;
  z-index: 4;
}

.season-hall-panel-header {
  align-items: center;
  border-bottom: 1px solid rgba(176, 214, 255, 0.18);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
}

.season-hall-panel-header h4 {
  color: #f5f9ff;
  margin: 0;
}

.season-hall-panel-body {
  margin-top: 0;
  overflow: auto;
  padding: 0.85rem 0.95rem 1rem;
}

.season-hall-back {
  white-space: nowrap;
}

.season-title-lockup,
.season-hero-summary,
.season-rift-card-head,
.season-shop-intro {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.season-title-lockup h3,
.season-title-lockup p,
.season-hero-summary h4,
.season-hero-summary p,
.season-shop-intro h4,
.season-shop-intro p {
  margin: 0;
}

.season-emblem {
  align-items: center;
  background: #28241f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
  display: inline-flex;
  flex: 0 0 2.8rem;
  height: 2.8rem;
  justify-content: center;
  position: relative;
  width: 2.8rem;
}

.season-emblem i,
.season-emblem i::before,
.season-emblem i::after {
  background: currentColor;
  content: "";
  display: block;
  position: absolute;
}

.season-emblem i {
  height: 1.45rem;
  transform: rotate(45deg);
  width: 0.28rem;
}

.season-emblem i::before {
  height: 0.28rem;
  left: -0.45rem;
  top: 0.45rem;
  width: 1.15rem;
}

.season-emblem i::after {
  border-radius: 50%;
  height: 0.48rem;
  left: -0.1rem;
  top: -0.25rem;
  width: 0.48rem;
}

.season-emblem--heaven {
  background: radial-gradient(circle, #effcff, #467fa7);
  color: #fff4b0;
}

.season-emblem--hell {
  background: radial-gradient(circle, #9c382b, #2b1111);
  color: #ffbf68;
}

.season-emblem--unbound {
  background: linear-gradient(135deg, #527f9e 48%, #6f251d 52%);
  color: #f4d99a;
}

.season-tabs {
  border-bottom: 1px solid rgba(220, 180, 95, 0.22);
  display: flex;
  gap: 0.35rem;
  margin: 1rem 0 0;
  overflow-x: auto;
  padding-bottom: 0.55rem;
}

.season-tabs button {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

.season-tabs button.active {
  background: rgba(216, 166, 79, 0.14);
  border-color: rgba(216, 166, 79, 0.4);
  color: var(--accent);
}

.season-tab-content {
  margin-top: 0.9rem;
}

.season-shop-crests {
  margin-bottom: 1rem;
}

.season-shop-crest-grid {
  display: grid;
  gap: 0.9rem;
}

.season-crest-shop-card {
  align-items: center;
  background: rgba(248, 240, 225, 0.94);
  border: 1px solid rgba(90, 70, 45, 0.24);
  border-radius: 0.85rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
  padding: 0.9rem;
}

.season-crest-shop-card.is-active {
  border-color: rgba(120, 72, 18, 0.55);
  box-shadow: 0 0 0 1px rgba(216, 166, 79, 0.35);
}

.season-crest-shop-preview {
  aspect-ratio: 1;
  background-color: rgba(20, 16, 12, 0.92);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 0.7rem;
  min-height: 7rem;
}

.season-crest-shop-copy .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.season-faction-grid,
.season-shop-grid,
.season-ranking-columns,
.season-overview-columns {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.season-daily-quests-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.season-daily-quests-intro h4 {
  margin: 0.15rem 0 0.35rem;
}

.season-daily-card .pill {
  white-space: nowrap;
}

.season-hall-action.has-quest-attention .season-quest-badge {
  margin-left: 0.35rem;
}

.season-choice-intro {
  margin: 1.35rem auto 1rem;
  max-width: 48rem;
  text-align: center;
}

.season-choice-intro h4 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  margin: 0.2rem 0 0.5rem;
}

.season-warning,
.season-auto-status,
.season-feedback {
  background: rgba(216, 166, 79, 0.1);
  border: 1px solid rgba(216, 166, 79, 0.28);
  border-radius: 0.75rem;
  margin: 0.8rem 0;
  padding: 0.7rem 0.85rem;
}

.season-auto-status {
  background: rgba(195, 54, 38, 0.13);
  border-color: rgba(232, 94, 68, 0.3);
}

.season-feedback.is-error {
  background: rgba(195, 54, 38, 0.12);
  border-color: rgba(232, 94, 68, 0.34);
  color: #ffaaa0;
}

.season-feedback.is-success {
  background: rgba(80, 166, 95, 0.12);
  border-color: rgba(110, 210, 125, 0.32);
  color: #aff0b9;
}

.season-faction-card,
.season-choice-confirm,
.season-ranking,
.season-hero-shop-card,
.season-rift-card,
.season-hero-summary {
  background: var(--surface-menu-raised);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
}

.season-panel--heaven,
.season-faction-card--heaven {
  background: linear-gradient(145deg, rgba(89, 151, 195, 0.16), rgba(255, 255, 255, 0.025));
  border-color: rgba(139, 210, 255, 0.3);
}

.season-panel--hell,
.season-faction-card--hell {
  background: linear-gradient(145deg, rgba(163, 55, 40, 0.18), rgba(255, 255, 255, 0.02));
  border-color: rgba(238, 97, 67, 0.3);
}

.season-faction-card h4,
.season-hero-shop-card h4,
.season-choice-confirm h4 {
  font-size: 1.3rem;
  margin: 0.35rem 0;
}

.season-faction-card h4 span {
  color: var(--muted);
  font-size: 0.85rem;
}

.season-faction-card .primary-button,
.season-hero-shop-card .primary-button {
  margin-top: 0.85rem;
  width: 100%;
}

.season-strength,
.season-disabled-reason {
  color: var(--muted);
  display: block;
  font-size: 0.83rem;
  margin-top: 0.65rem;
}

.season-choice-confirm {
  margin: 2rem auto;
  max-width: 36rem;
  text-align: center;
}

.season-choice-confirm .season-emblem {
  margin: 0 auto;
}

.season-hero-summary {
  justify-content: space-between;
}

.season-hero-summary > div {
  flex: 1;
}

.season-countdown {
  color: var(--accent);
  font-weight: 700;
}

.season-countdown.is-ended {
  color: #ef9084;
}

.season-stat-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0.85rem 0;
}

.season-score-card {
  align-items: center;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(5rem, auto) minmax(8rem, 1fr) minmax(5rem, auto);
  margin: 0.9rem 0;
}

.season-score-card > div:first-child,
.season-score-card > div:last-child {
  display: flex;
  flex-direction: column;
}

.season-score-card > div:last-child {
  text-align: right;
}

.season-score-track,
.season-hp-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  display: flex;
  height: 0.75rem;
  overflow: hidden;
}

.season-score-heaven {
  background: linear-gradient(90deg, #66b4e8, #dcf4ff);
}

.season-score-hell {
  background: linear-gradient(90deg, #ef765b, #8b241d);
  flex: 1;
}

.season-rift-list {
  display: grid;
  gap: 0.75rem;
}

.season-rift-card-head > div {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.season-rift-card-head > div span,
.season-rift-meta,
.season-shop-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.season-hp-track span {
  background: linear-gradient(90deg, #b53127, #ef9d63);
}

.season-rift-meta,
.season-shop-status {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
}

.season-ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.season-ranking-list li {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 2.8rem 1fr auto;
  padding: 0.65rem 0.4rem;
}

.season-ranking-list li.is-current-player {
  background: rgba(216, 166, 79, 0.13);
  border-radius: 0.55rem;
  color: var(--accent);
}

.season-rank-number {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.season-rank-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.season-shop-intro {
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.season-shop-status {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.2rem;
}

.season-empty {
  border: 1px dashed var(--border);
  border-radius: 0.8rem;
  color: var(--muted);
  padding: 1.25rem;
  text-align: center;
}

.season-chronicle {
  display: grid;
  gap: 0.7rem;
}

.season-chronicle article {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(216, 166, 79, 0.5);
  display: flex;
  gap: 0.9rem;
  padding: 0.75rem 0.85rem;
}

.season-chronicle article > span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.season-chronicle h4,
.season-chronicle p {
  margin: 0;
}

.season-chronicle p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.season-launcher {
  align-items: center;
  backdrop-filter: blur(9px);
  background: rgba(28, 24, 20, 0.9);
  border: 1px solid rgba(216, 166, 79, 0.32);
  border-radius: 0.8rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  position: relative;
}

.season-launcher--icon {
  align-items: center;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: inline-flex;
  height: 3.9rem;
  justify-content: center;
  line-height: 0;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  width: 3.9rem;
}

.season-launcher--icon:hover:not(:disabled),
.season-launcher--icon:focus-visible,
.season-launcher--icon:active:not(:disabled) {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
}

.season-launcher-icon {
  display: block;
  height: 3.9rem;
  image-rendering: pixelated;
  object-fit: contain;
  width: 3.9rem;
}

.season-launcher-icon--full {
  flex-shrink: 0;
  height: 2rem;
  width: 2rem;
}

.season-launcher.has-attention.season-launcher--icon {
  animation: season-attention-pulse 2.2s ease-in-out infinite;
}

.castle-top-right-panel .season-launcher--icon,
.map-hud .season-launcher--icon {
  align-self: flex-end;
}

.season-launcher .season-emblem {
  flex-basis: 2rem;
  height: 2rem;
  width: 2rem;
}

.season-launcher-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.season-launcher-copy small {
  color: var(--muted);
}

.season-attention-dot {
  align-items: center;
  background: #d64b38;
  border-radius: 999px;
  color: white;
  display: flex;
  font-size: 0.7rem;
  font-weight: 800;
  height: 1.15rem;
  justify-content: center;
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
  width: 1.15rem;
}

.season-launcher.has-attention {
  animation: season-attention-pulse 2.2s ease-in-out infinite;
}

@keyframes season-attention-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 166, 79, 0); }
  50% { box-shadow: 0 0 0 4px rgba(216, 166, 79, 0.13); }
}

@media (max-width: 820px) {
  .season-interface {
    min-height: 100%;
  }

  .season-faction-hall {
    min-height: 100%;
  }

  .season-hall-header {
    grid-template-columns: 1fr auto;
  }

  .season-hall-header-stats {
    display: none;
  }

  .season-hall-actions {
    gap: 0.45rem;
    top: auto;
    transform: none;
    width: min(7.2rem, 22vw);
  }

  .season-hall-actions--left {
    bottom: 3.4rem;
    top: auto;
  }

  .season-hall-actions--right {
    bottom: 3.4rem;
    top: auto;
  }

  .season-hall-action {
    padding: 0.5rem 0.55rem;
  }

  .season-hall-action-label {
    font-size: 0.82rem;
  }

  .season-hall-action small {
    display: none;
  }

  .season-hall-hero-stage {
    height: min(68%, 22rem);
    left: 50%;
    width: min(54%, 18rem);
  }

  .season-faction-hall--dialogue-open .season-hall-hero-stage {
    left: 50%;
    width: min(50%, 17rem);
  }

  .season-hall-dialogue-overlay {
    bottom: 30%;
    left: 48%;
    max-width: min(52%, 18rem);
  }

  .season-hall-speak {
    bottom: 0.75rem;
    font-size: 0.88rem;
    min-width: min(18rem, calc(100% - 1.2rem));
    padding-inline: 0.85rem;
  }

  .season-hall-speak:hover:not(:disabled),
  .season-hall-speak:focus-visible:not(:disabled),
  .season-hall-speak:active:not(:disabled) {
    transform: translateX(-50%) !important;
  }

  .season-hall-dialogue-bubble-text-layer {
    font-size: 0.88rem;
    inset: 17% 11% 21% 13%;
  }

  .season-hall-panel {
    max-width: calc(100% - 1rem);
    top: 4.5rem;
  }

  .season-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-hud .season-launcher-copy {
    display: none;
  }
}

@media (max-width: 680px) {
  .modal-backdrop:has(.season-interface) {
    align-items: stretch;
    padding: 0;
  }

  .modal-panel:has(.season-interface) {
    max-height: 100dvh;
  }

  .season-interface {
    border-radius: 0;
    min-height: 100dvh;
    padding: 0.9rem;
  }

  .season-interface-header,
  .season-hero-summary,
  .season-shop-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .season-faction-grid,
  .season-shop-grid,
  .season-ranking-columns,
  .season-overview-columns {
    grid-template-columns: 1fr;
  }

  .season-score-card {
    grid-template-columns: 1fr;
  }

  .season-score-card > div:last-child {
    text-align: left;
  }

  .season-tabs {
    margin-left: -0.9rem;
    margin-right: -0.9rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .castle-top-right-panel .season-launcher-copy {
    display: none;
  }
}

.iap-shop-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.iap-shop-card {
  display: grid;
  gap: 0.55rem;
}

.iap-shop-card--special {
  border-color: rgba(255, 196, 84, 0.45);
}

.iap-shop-badge {
  background: rgba(120, 72, 10, 0.55);
  border-color: rgba(255, 196, 84, 0.45);
  color: #ffe2a8;
  justify-self: start;
}

.iap-shop-grant-preview {
  font-size: 0.92rem;
}

.iap-shop-legal {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.prestige-badge {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 196, 84, 0.35);
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(72, 48, 8, 0.55), rgba(24, 18, 8, 0.75));
}

.prestige-badge-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.prestige-level-pill {
  background: rgba(120, 72, 10, 0.65);
  border-color: rgba(255, 196, 84, 0.55);
  color: #ffe2a8;
}

.prestige-progress {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.prestige-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9a227, #ffe2a8);
}

.prestige-progress-copy,
.prestige-crew-copy,
.prestige-benefits-copy {
  font-size: 0.88rem;
}

.prestige-benefits-details summary {
  cursor: pointer;
  font-weight: 600;
}

.prestige-benefits-table-wrap {
  overflow-x: auto;
  margin-top: 0.65rem;
}

.prestige-benefits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.prestige-benefits-table th,
.prestige-benefits-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

button.castle-crest-resource-chip,
button.castle-currency-pill.castle-currency-emerald {
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}

button.castle-crest-resource-chip--emerald:hover,
button.castle-currency-emerald:hover {
  border-color: rgba(96, 220, 168, 0.65);
  box-shadow: 0 0 0 1px rgba(96, 220, 168, 0.25);
}

