/* =========================================================
   NUSANTARA: FAJAR KERAJAAN
   Antarmuka kayu, batu, dan cahaya emas.
   ========================================================= */

:root {
  --ink: #06100c;
  --ink-2: #091913;
  --ink-3: #0d231b;
  --panel: rgba(8, 21, 16, 0.94);
  --panel-soft: rgba(13, 30, 23, 0.82);
  --parchment: #ebe3d0;
  --paper: #d8cfba;
  --muted: #aab5a5;
  --muted-dark: #849181;
  --gold: #e2bd6c;
  --gold-light: #f5dea1;
  --gold-deep: #a97d3b;
  --jade: #52c1a5;
  --jade-deep: #23735f;
  --danger: #df7764;
  --warning: #e1ae66;
  --line: rgba(218, 188, 123, 0.22);
  --line-soft: rgba(218, 188, 123, 0.12);
  --shadow: rgba(0, 0, 0, 0.52);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", "Trebuchet MS", "Gill Sans", Verdana, sans-serif;
  --dock-h: 208px;
  --top-h: 62px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 1px solid var(--gold-light);
  outline-offset: 2px;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #06100c;
  cursor: default;
  z-index: 0;
}

#game.is-targeting {
  cursor: crosshair;
}

#game.is-panning {
  cursor: grabbing;
}

#app::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    linear-gradient(180deg, rgba(3, 8, 6, 0.14), transparent 14%, transparent 78%, rgba(2, 7, 5, 0.18)),
    radial-gradient(ellipse at 50% 45%, transparent 48%, rgba(2, 7, 5, 0.16) 100%);
}

/* =========================================================
   HUD
   ========================================================= */

.hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  animation: hudReveal 0.7s ease both;
}

.hud > * {
  pointer-events: none;
}

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

@keyframes hudReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 22px);
  padding: 8px clamp(14px, 1.8vw, 28px) 10px;
  background:
    linear-gradient(180deg, rgba(3, 10, 7, 0.98) 0%, rgba(4, 13, 9, 0.92) 58%, rgba(4, 13, 9, 0.55) 100%);
  pointer-events: auto;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(219, 184, 114, 0.36) 18%, rgba(219, 184, 114, 0.1) 72%, transparent);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 196px;
}

.crest {
  color: var(--gold);
  display: grid;
  place-items: center;
}

.crest .ico {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 5px rgba(226, 189, 108, 0.12));
}

.crest-small {
  width: 38px;
  height: 44px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.24em;
  color: var(--parchment);
  white-space: nowrap;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(82, 193, 165, 0.11), 0 0 8px rgba(82, 193, 165, 0.45);
}

.resource-rail {
  display: flex;
  align-items: stretch;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 0;
}

.res-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 76px;
  height: 42px;
  padding: 3px 9px 3px 5px;
  border: 1px solid rgba(216, 189, 128, 0.14);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(28, 48, 37, 0.42), rgba(7, 18, 13, 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 245, 216, 0.035);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.res-card:hover {
  border-color: rgba(220, 190, 126, 0.35);
  background: linear-gradient(180deg, rgba(38, 60, 46, 0.48), rgba(8, 21, 15, 0.6));
}

.res-icon {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 46% 38%, rgba(255, 255, 255, 0.07), rgba(4, 12, 9, 0.42) 72%);
  border: 1px solid rgba(255, 242, 206, 0.07);
}

.res-icon .ico {
  width: 17px;
  height: 17px;
  stroke-width: 1.5;
}

.res-food .res-icon { color: #ebc469; }
.res-wood .res-icon { color: #c28e55; }
.res-gold .res-icon { color: #f0d067; }
.res-stone .res-icon { color: #b5bcb1; }
.res-pop .res-icon { color: #8adac0; }

.res-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
  min-width: 0;
}

.res-value {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f1e8d4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.res-label {
  font-size: 8.2px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
  white-space: nowrap;
}

.pop-sep {
  margin: 0 1px;
  color: var(--muted-dark);
  font-weight: 400;
}

.res-pop {
  min-width: 85px;
  padding-right: 8px;
}

.pop-meter {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.pop-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2d8b74, #70d4b9);
  transition: width 0.3s ease, background 0.3s ease;
}

.pop-meter span.is-full {
  background: linear-gradient(90deg, #a75f3a, #e1a665);
}

.top-mission {
  flex: 1 1 auto;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(219, 199, 157, 0.56);
}

.top-mission > .ico {
  width: 14px;
  height: 14px;
  color: rgba(226, 189, 108, 0.52);
}

.mission-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mission-copy span {
  font-size: 7px;
  letter-spacing: 0.18em;
  color: rgba(189, 188, 165, 0.54);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-copy strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(239, 222, 184, 0.8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.age-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 2px 12px;
  border-left: 1px solid rgba(219, 187, 122, 0.18);
}

.age-seal {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 12px;
  color: var(--gold-light);
  background:
    linear-gradient(145deg, rgba(226, 189, 108, 0.17), rgba(10, 24, 17, 0.28)),
    radial-gradient(circle, transparent 54%, rgba(226, 189, 108, 0.22) 56%, transparent 59%);
  border: 1px solid rgba(226, 189, 108, 0.34);
  box-shadow: inset 0 0 0 3px rgba(7, 18, 13, 0.72);
}

.age-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  white-space: nowrap;
}

.age-copy span {
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: var(--muted-dark);
}

.age-copy strong {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--paper);
}

.age-pips {
  display: flex;
  gap: 3px;
  margin-left: 2px;
}

.age-pips i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(240, 225, 190, 0.14);
}

.age-pips i.active {
  background: var(--gold);
  box-shadow: 0 0 5px rgba(226, 189, 108, 0.45);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(218, 188, 123, 0.15);
  border-radius: 3px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(28, 48, 37, 0.38), rgba(7, 18, 13, 0.48));
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-btn .ico {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--gold-light);
  border-color: rgba(226, 193, 124, 0.4);
  background: linear-gradient(180deg, rgba(40, 64, 49, 0.5), rgba(9, 23, 16, 0.58));
}

.icon-btn.is-muted {
  color: #756e60;
}

.speed-btn {
  width: auto;
  min-width: 48px;
  padding: 0 7px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* =========================================================
   Kartu misi
   ========================================================= */

.objective-card {
  position: absolute;
  top: calc(var(--top-h) + 13px);
  right: 18px;
  width: 318px;
  padding: 14px 16px 13px;
  border: 1px solid rgba(215, 184, 119, 0.2);
  border-radius: 4px;
  background:
    linear-gradient(138deg, rgba(22, 42, 31, 0.9), rgba(5, 14, 10, 0.94) 64%),
    radial-gradient(circle at 100% 0, rgba(226, 189, 108, 0.05), transparent 55%);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 244, 210, 0.035);
  backdrop-filter: blur(6px);
}

.objective-card::before,
.objective-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(226, 189, 108, 0.45);
  border-style: solid;
  pointer-events: none;
}

.objective-card::before {
  left: 5px;
  top: 5px;
  border-width: 1px 0 0 1px;
}

.objective-card::after {
  right: 5px;
  bottom: 5px;
  border-width: 0 1px 1px 0;
}

.objective-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kicker {
  font-size: 8px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.objective-tag {
  padding: 2px 5px;
  border: 1px solid rgba(220, 185, 112, 0.21);
  border-radius: 2px;
  font-size: 7px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.objective-card h2 {
  margin: 9px 0 5px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: var(--parchment);
}

.objective-card > p {
  margin: 0 0 11px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.objective-bar {
  position: relative;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 245, 220, 0.07);
  border: 1px solid rgba(255, 244, 214, 0.06);
}

.objective-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9b372e, #dd765d 55%, #f0bb7c);
  transition: width 0.4s ease;
}

.objective-bar.is-unknown span {
  width: 100% !important;
  background: repeating-linear-gradient(115deg, rgba(224, 190, 123, 0.14) 0 5px, rgba(224, 190, 123, 0.03) 5px 10px);
}

.objective-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 8.5px;
  color: var(--muted-dark);
}

.objective-meta strong {
  color: var(--paper);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.objective-rule {
  height: 1px;
  margin: 11px 0 9px;
  background: linear-gradient(90deg, rgba(220, 185, 120, 0.22), transparent);
}

.objective-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.objective-hint .ico {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--gold);
}

.objective-hint p {
  margin: 0;
  font-size: 10.2px;
  line-height: 1.55;
  color: #b2bbaa;
}

/* =========================================================
   Toast, mode, jeda
   ========================================================= */

.toast-stack {
  position: absolute;
  top: calc(var(--top-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 32;
  width: min(440px, 64vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 9px 13px 9px 9px;
  border: 1px solid rgba(218, 187, 121, 0.22);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  background: linear-gradient(100deg, rgba(13, 29, 21, 0.98), rgba(7, 18, 13, 0.95));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 247, 220, 0.04);
  opacity: 0;
  transform: translateY(-7px) scale(0.985);
  transition: opacity 0.34s ease, transform 0.34s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(226, 189, 108, 0.07);
  border: 1px solid rgba(226, 189, 108, 0.15);
}

.toast-icon .ico {
  width: 15px;
  height: 15px;
}

.toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toast-copy strong {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--parchment);
}

.toast-copy p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--muted);
}

.toast-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 189, 108, 0.28), transparent 70%);
}

.toast-good { border-left-color: var(--jade); }
.toast-good .toast-icon { color: var(--jade); border-color: rgba(82, 193, 165, 0.2); background: rgba(82, 193, 165, 0.07); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger .toast-icon { color: var(--danger); border-color: rgba(223, 119, 100, 0.25); background: rgba(223, 119, 100, 0.08); }
.toast-danger .toast-copy strong { color: #f0c1b4; }

.mode-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 28px);
  transform: translateX(-50%);
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(232, 200, 134, 0.35);
  border-radius: 3px;
  background: rgba(9, 22, 16, 0.95);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--paper);
  pointer-events: none;
}

.mode-banner .ico {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.mode-banner kbd {
  margin-left: 4px;
}

.placement-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 28px);
  transform: translateX(-50%);
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
  padding: 8px 13px 8px 8px;
  border: 1px solid rgba(226, 195, 130, 0.32);
  border-radius: 4px;
  background: rgba(8, 21, 15, 0.96);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.placement-banner.is-invalid {
  border-color: rgba(222, 117, 99, 0.48);
}

.placement-swatch {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 3px;
  background-color: rgba(255, 247, 226, 0.03);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid rgba(255, 241, 203, 0.08);
}

.placement-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.placement-copy strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  color: var(--parchment);
}

.placement-copy span {
  font-size: 8.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.placement-cost {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

.pause-badge {
  position: fixed;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 19px 34px;
  border: 1px solid rgba(224, 190, 123, 0.24);
  background: rgba(7, 18, 13, 0.9);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.pause-badge .ico {
  width: 19px;
  height: 19px;
  color: var(--gold);
  margin-bottom: 4px;
}

.pause-badge span {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.pause-badge small {
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.age-flash {
  position: fixed;
  left: 0;
  right: 0;
  top: 37%;
  z-index: 36;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  background: radial-gradient(ellipse at center, rgba(6, 15, 11, 0.72), transparent 58%);
  padding: 28px 0;
}

.age-flash.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.age-flash-rule {
  width: min(340px, 40vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 199, 132, 0.68), transparent);
}

.age-flash > span {
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--gold);
}

.age-flash h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: 0.2em;
  color: var(--gold-light);
  text-shadow: 0 2px 25px rgba(226, 189, 108, 0.25);
}

.age-flash p {
  margin: 3px 0 0;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* =========================================================
   Dock bawah
   ========================================================= */

.command-dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: var(--dock-h);
  display: grid;
  grid-template-columns: 201px minmax(300px, 356px) minmax(0, 1fr);
  gap: 10px;
  z-index: 25;
  pointer-events: auto;
}

.panel {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(214, 181, 112, 0.23);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(17, 35, 26, 0.95), rgba(6, 16, 11, 0.97) 72%),
    radial-gradient(circle at 20% 0, rgba(92, 134, 107, 0.07), transparent 45%);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 245, 215, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 208, 145, 0.46) 22%, rgba(238, 208, 145, 0.16) 76%, transparent);
  pointer-events: none;
}

.panel-head {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(217, 185, 121, 0.12);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(231, 206, 154, 0.88);
  background: linear-gradient(180deg, rgba(255, 244, 215, 0.025), transparent);
}

.map-coord {
  font-size: 7px;
  letter-spacing: 0.1em;
  color: var(--muted-dark);
}

/* Peta mini */
.minimap-panel {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.minimap-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 6px 7px 0;
  border: 1px solid rgba(218, 187, 121, 0.18);
  background: #061411;
  overflow: hidden;
  cursor: pointer;
}

#minimap {
  display: block;
  width: 100%;
  height: 100%;
  background: #061411;
}

.minimap-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 245, 215, 0.045), transparent 38%),
    radial-gradient(ellipse at center, transparent 52%, rgba(1, 7, 4, 0.42) 100%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.28);
}

.minimap-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.minimap-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(232, 201, 133, 0.6);
  border-style: solid;
  pointer-events: none;
}

.minimap-corner.tl { left: 3px; top: 3px; border-width: 1px 0 0 1px; }
.minimap-corner.tr { right: 3px; top: 3px; border-width: 1px 1px 0 0; }
.minimap-corner.bl { left: 3px; bottom: 3px; border-width: 0 0 1px 1px; }
.minimap-corner.br { right: 3px; bottom: 3px; border-width: 0 1px 1px 0; }

.minimap-compass {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 7px;
  color: rgba(227, 199, 137, 0.66);
  border: 1px solid rgba(227, 199, 137, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.minimap-foot {
  height: 31px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 8px 4px;
}

.idle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 23px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.015em;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.idle-btn .ico {
  width: 12px;
  height: 12px;
  color: var(--muted-dark);
}

.idle-btn b {
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 600;
  color: var(--paper);
  background: rgba(255, 243, 214, 0.07);
}

.idle-btn:hover {
  color: var(--parchment);
  border-color: rgba(218, 188, 123, 0.18);
  background: rgba(255, 247, 225, 0.035);
}

.idle-btn.has-idle {
  color: var(--gold-light);
}

.idle-btn.has-idle .ico {
  color: var(--gold);
  animation: idlePulse 1.7s ease infinite;
}

.idle-btn.has-idle b {
  color: #15210f;
  background: var(--gold);
}

@keyframes idlePulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.mini-age {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.mini-age > span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 7px;
  color: var(--gold);
  border: 1px solid rgba(222, 189, 121, 0.25);
}

.mini-age div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.mini-age small {
  font-size: 5.8px;
  letter-spacing: 0.15em;
  color: var(--muted-dark);
}

.mini-age strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 8.5px;
  color: var(--paper);
  white-space: nowrap;
}

/* Panel seleksi */
.selection-panel {
  padding: 10px;
}

.selection-empty {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 4px 4px 2px;
}

.empty-crest {
  width: 54px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: rgba(226, 189, 108, 0.55);
  border: 1px solid rgba(225, 191, 121, 0.12);
  border-radius: 3px;
  background: radial-gradient(circle, rgba(226, 189, 108, 0.06), transparent 65%);
}

.empty-crest .ico {
  width: 28px;
  height: 34px;
}

.empty-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.empty-copy h2 {
  margin: 5px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  color: var(--parchment);
}

.empty-copy p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  color: var(--muted);
}

.empty-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  font-size: 7.5px;
  color: var(--muted-dark);
}

.empty-tips span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.selection-detail {
  height: 100%;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.portrait-frame {
  position: relative;
  width: 106px;
  height: 100%;
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(218, 187, 121, 0.22);
  background:
    radial-gradient(ellipse at 50% 72%, rgba(60, 105, 78, 0.24), transparent 64%),
    linear-gradient(160deg, rgba(30, 52, 38, 0.55), rgba(6, 17, 12, 0.8));
  overflow: hidden;
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(237, 207, 144, 0.08);
  pointer-events: none;
}

#portrait {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 104px;
  display: block;
}

.portrait-tier {
  position: absolute;
  left: 6px;
  top: 5px;
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: rgba(232, 202, 140, 0.68);
  text-shadow: 0 1px 4px #000;
}

.portrait-owner {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(218, 187, 121, 0.14);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: var(--jade);
  text-align: center;
}

.portrait-owner.is-enemy {
  color: var(--danger);
}

.selection-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1px 1px 0 0;
}

.sel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kicker {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-count {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid rgba(218, 187, 121, 0.2);
  border-radius: 2px;
  color: var(--gold-light);
  flex: 0 0 auto;
}

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

.selection-copy h2 {
  margin: 4px 0 3px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.005em;
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-copy > p {
  margin: 0 0 6px;
  font-size: 9.4px;
  line-height: 1.38;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 24px;
}

.health-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.health-bar {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 244, 214, 0.08);
  border: 1px solid rgba(255, 244, 214, 0.05);
  overflow: hidden;
}

.health-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2b8e77, #58c0a5);
  transition: width 0.25s ease, background 0.25s ease;
}

.health-bar span.is-low {
  background: linear-gradient(90deg, #9e3f31, #dc735c);
}

.health-value {
  flex: 0 0 auto;
  font-size: 7.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
  max-height: 48px;
  overflow: hidden;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(218, 187, 121, 0.11);
  border-radius: 2px;
  background: rgba(255, 245, 216, 0.025);
  font-size: 7.7px;
  color: var(--muted-dark);
  white-space: nowrap;
}

.stat-chip .ico {
  width: 9px;
  height: 9px;
  color: rgba(225, 192, 126, 0.66);
}

.stat-chip b {
  font-size: 8.2px;
  font-weight: 500;
  color: var(--paper);
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  margin-top: auto;
  padding-top: 4px;
}

.queue-row.is-empty {
  visibility: hidden;
}

.queue-label {
  font-size: 6.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin-right: 2px;
}

.queue-item {
  position: relative;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(219, 187, 120, 0.15);
  border-radius: 2px;
  background: rgba(255, 246, 222, 0.025);
  overflow: hidden;
}

.queue-item.current {
  border-color: rgba(234, 202, 136, 0.42);
}

.queue-art {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
}

.queue-art img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.queue-art .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.queue-progress {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 2px;
  background: rgba(0, 0, 0, 0.4);
}

.queue-progress span {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 0.12s linear;
}

.queue-progress span.is-waiting {
  background: var(--danger);
}

/* Panel perintah */
.command-panel {
  display: flex;
  flex-direction: column;
}

.command-panel::after {
  content: "ARUNIKA";
  position: absolute;
  right: 20px;
  bottom: 27px;
  z-index: 0;
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  letter-spacing: 0.18em;
  color: rgba(231, 207, 155, 0.035);
  pointer-events: none;
  white-space: nowrap;
}

.command-panel > * {
  position: relative;
  z-index: 1;
}

.command-head {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 11px;
}

.command-sub {
  color: var(--muted-dark);
  font-size: 8.3px;
  letter-spacing: 0.06em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
  text-align: right;
}

.command-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 66px;
  align-content: start;
  gap: 6px;
  padding: 8px 9px 4px;
  overflow: hidden auto;
}

.command-grid::-webkit-scrollbar {
  width: 4px;
}

.command-grid::-webkit-scrollbar-thumb {
  background: rgba(220, 187, 120, 0.25);
}

.cmd-btn {
  position: relative;
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
  height: 66px;
  padding: 6px 7px;
  border: 1px solid rgba(218, 187, 121, 0.15);
  border-radius: 3px;
  background:
    linear-gradient(155deg, rgba(42, 67, 50, 0.35), rgba(7, 18, 13, 0.48) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 243, 213, 0.04);
  color: var(--paper);
  text-align: left;
  transition: border-color 0.17s ease, background 0.17s ease, transform 0.17s ease;
}

.cmd-btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 243, 213, 0.025);
  border-radius: 1px;
  pointer-events: none;
}

.cmd-btn:hover {
  border-color: rgba(227, 195, 128, 0.42);
  background:
    linear-gradient(155deg, rgba(55, 84, 62, 0.48), rgba(10, 24, 17, 0.62) 72%);
  transform: translateY(-1px);
}

.cmd-btn.is-active {
  border-color: rgba(232, 201, 137, 0.52);
  box-shadow: inset 0 0 0 1px rgba(232, 201, 137, 0.12), 0 0 16px rgba(226, 189, 108, 0.06);
}

.cmd-icon {
  grid-row: 1 / span 2;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: radial-gradient(ellipse at 50% 70%, rgba(66, 103, 80, 0.22), transparent 70%);
}

.cmd-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.cmd-icon .ico {
  width: 20px;
  height: 20px;
  color: rgba(233, 203, 140, 0.76);
}

.cmd-name {
  align-self: end;
  font-size: 9.8px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: #e7dfca;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cmd-cost {
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  min-height: 11px;
  font-size: 7.8px;
  color: #a7b19e;
}

.cmd-cost-empty {
  opacity: 0.35;
}

.cost-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  white-space: nowrap;
}

.cost-item .ico {
  width: 9px;
  height: 9px;
  color: rgba(227, 200, 138, 0.75);
}

.cost-item b {
  font-weight: 500;
  font-size: 8.2px;
  color: #d5c7a9;
}

.cost-item em {
  font-style: normal;
  margin-left: 1px;
  color: var(--muted-dark);
}

.cost-item.is-missing b,
.cost-item.is-missing em {
  color: #d27c69;
}

.cost-item.is-missing .ico {
  color: #b45d4e;
}

.cmd-hotkey {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  min-width: 15px;
  height: 14px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218, 187, 121, 0.16);
  border-radius: 2px;
  font-size: 7px;
  color: rgba(230, 206, 161, 0.72);
  background: rgba(4, 13, 9, 0.6);
}

.cmd-lock {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: none;
  color: rgba(230, 207, 168, 0.5);
}

.cmd-lock .ico {
  width: 9px;
  height: 9px;
}

.cmd-btn.is-disabled {
  opacity: 0.48;
  filter: saturate(0.55);
  cursor: not-allowed;
}

.cmd-btn.is-disabled:hover {
  transform: none;
  border-color: rgba(218, 187, 121, 0.2);
  background: linear-gradient(155deg, rgba(42, 67, 50, 0.35), rgba(7, 18, 13, 0.48) 72%);
}

.cmd-btn.is-disabled .cmd-lock {
  display: block;
}

.command-placeholder {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 18px;
  color: var(--muted-dark);
  text-align: center;
}

.command-placeholder .ico {
  width: 22px;
  height: 22px;
  color: rgba(226, 189, 108, 0.4);
}

.command-placeholder p {
  margin: 0;
  max-width: 320px;
  font-size: 9px;
  line-height: 1.45;
}

.command-hints {
  flex: 0 0 auto;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 11px 4px;
  border-top: 1px solid rgba(218, 187, 121, 0.07);
  font-size: 7.7px;
  letter-spacing: 0.015em;
  color: var(--muted-dark);
  white-space: nowrap;
  overflow: hidden;
}

.command-hints span {
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border: 1px solid rgba(219, 187, 120, 0.23);
  border-bottom-color: rgba(219, 187, 120, 0.12);
  border-radius: 2px;
  background: rgba(255, 245, 218, 0.035);
  color: rgba(230, 211, 170, 0.86);
  font-family: var(--sans);
  font-size: 7px;
  line-height: 1;
}

/* =========================================================
   Tooltip
   ========================================================= */

.cursor-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  width: max-content;
  max-width: 286px;
  padding: 11px 13px;
  border: 1px solid rgba(220, 188, 121, 0.32);
  border-radius: 3px;
  background:
    linear-gradient(145deg, rgba(18, 37, 27, 0.98), rgba(5, 14, 10, 0.99));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 246, 220, 0.05);
  pointer-events: none;
  color: var(--paper);
  font-size: 10px;
  line-height: 1.45;
  will-change: transform;
}

.tt-kicker {
  font-size: 6.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}

.tt-title {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--parchment);
}

.tt-body {
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.5;
  color: #a9b2a2;
}

.tt-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(218, 187, 121, 0.08);
  font-size: 8.5px;
  color: var(--muted-dark);
}

.tt-stat b {
  color: var(--paper);
  font-weight: 500;
  text-align: right;
}

.tt-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(218, 187, 121, 0.1);
  font-size: 8px;
  color: var(--muted-dark);
}

.tt-cost > span {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 6.5px;
}

.tt-cost .cost-item {
  gap: 3px;
}

.tt-cost .cost-item .ico {
  width: 10px;
  height: 10px;
}

.tt-cost .cost-item em {
  display: none;
}

.tt-warning {
  margin-top: 8px;
  padding: 5px 7px;
  border-left: 2px solid var(--danger);
  background: rgba(206, 100, 84, 0.08);
  font-size: 8px;
  line-height: 1.4;
  color: #e3ab9e;
}

/* =========================================================
   Menu utama
   ========================================================= */

.screen-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.52s ease, visibility 0.52s ease;
}

.screen-menu.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.screen-menu.is-returning {
  animation: menuReturn 0.55s ease both;
}

@keyframes menuReturn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.menu-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 72% 56%, rgba(42, 74, 50, 0.16), transparent 38%),
    linear-gradient(90deg, rgba(2, 7, 5, 0.98) 0%, rgba(2, 8, 5, 0.96) 27%, rgba(3, 10, 7, 0.83) 46%, rgba(3, 10, 7, 0.38) 63%, rgba(3, 10, 7, 0.08) 78%, rgba(2, 8, 5, 0.5) 100%),
    linear-gradient(180deg, rgba(3, 9, 6, 0.74), transparent 28%, transparent 68%, rgba(2, 7, 4, 0.82));
  pointer-events: none;
}

.menu-wash::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 44%;
  background:
    repeating-linear-gradient(90deg, transparent 0 65px, rgba(227, 195, 126, 0.035) 65px 66px),
    radial-gradient(ellipse at 30% 42%, rgba(203, 174, 105, 0.055), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.55;
}

.menu-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px clamp(28px, 4.2vw, 66px);
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.crest-menu {
  width: 38px;
  height: 45px;
}

.menu-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-brand strong {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--paper);
}

.menu-brand span {
  font-size: 7px;
  letter-spacing: 0.23em;
  color: var(--gold);
}

.menu-meta {
  text-align: right;
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.2em;
  color: rgba(217, 207, 183, 0.65);
}

.menu-meta span {
  color: var(--muted-dark);
}

.menu-main {
  position: absolute;
  z-index: 3;
  left: clamp(30px, 7vw, 112px);
  top: 50%;
  width: min(630px, 47vw);
  transform: translateY(-50%);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 7.5px;
  letter-spacing: 0.3em;
  color: rgba(229, 199, 136, 0.84);
  white-space: nowrap;
}

.eyebrow span {
  display: block;
  width: 24px;
  height: 1px;
  background: rgba(226, 189, 108, 0.34);
}

.game-title {
  margin: 15px 0 0 -4px;
  font-family: var(--serif);
  font-size: clamp(62px, 8.2vw, 122px);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.065em;
  color: #f1e9d8;
  text-shadow: 0 8px 35px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.game-title span {
  display: inline;
}

.game-title em {
  display: inline;
  font-style: normal;
  color: var(--gold);
  text-shadow: 0 0 35px rgba(226, 189, 108, 0.1);
}

.title-ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  margin-top: 12px;
}

.title-ornament i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 189, 108, 0.38), transparent);
}

.title-ornament i:last-child {
  background: linear-gradient(90deg, transparent, rgba(226, 189, 108, 0.38));
}

.title-ornament .ico {
  width: 13px;
  height: 16px;
  color: rgba(226, 189, 108, 0.7);
}

.title-sub {
  margin-top: 11px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.52em;
  color: var(--muted);
  white-space: nowrap;
}

.title-sub b {
  font-weight: 400;
  color: var(--gold);
}

.menu-lede {
  max-width: 500px;
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: #a5ad9e;
}

.difficulty-block {
  margin-top: clamp(18px, 2.4vh, 27px);
  max-width: 512px;
}

.difficulty-label {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 7px;
}

.difficulty-label span {
  font-size: 7px;
  letter-spacing: 0.24em;
  color: rgba(222, 198, 149, 0.8);
}

.difficulty-label b {
  font-size: 7px;
  letter-spacing: 0.1em;
  font-weight: 400;
  color: var(--muted-dark);
}

.difficulty-picker {
  display: flex;
  gap: 6px;
}

.difficulty-option {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 51px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(218, 187, 121, 0.15);
  border-radius: 3px;
  background: linear-gradient(150deg, rgba(24, 43, 32, 0.48), rgba(5, 14, 10, 0.46));
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.difficulty-option:hover {
  border-color: rgba(229, 197, 129, 0.36);
  background: linear-gradient(150deg, rgba(35, 59, 43, 0.6), rgba(7, 19, 13, 0.56));
  transform: translateY(-1px);
}

.difficulty-option.active {
  border-color: rgba(232, 199, 129, 0.62);
  background:
    linear-gradient(150deg, rgba(70, 63, 38, 0.62), rgba(16, 27, 18, 0.7));
  box-shadow: inset 0 0 0 1px rgba(233, 203, 139, 0.08);
}

.diff-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 8px;
  color: var(--muted);
  border: 1px solid rgba(218, 187, 121, 0.23);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.difficulty-option.active .diff-mark {
  color: #17200f;
  background: var(--gold);
  border-color: var(--gold-light);
}

.diff-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.diff-copy strong {
  font-size: 10px;
  font-weight: 500;
  color: var(--paper);
  white-space: nowrap;
}

.diff-copy small {
  font-size: 7.5px;
  color: var(--muted-dark);
  white-space: nowrap;
}

.diff-check {
  position: absolute;
  right: 6px;
  top: 6px;
  color: var(--gold);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.diff-check .ico {
  width: 9px;
  height: 9px;
}

.difficulty-option.active .diff-check {
  opacity: 1;
  transform: scale(1);
}

.difficulty-desc {
  min-height: 15px;
  margin: 6px 0 0;
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted-dark);
}

.menu-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: clamp(16px, 2.2vh, 24px);
}

.start-btn {
  position: relative;
  width: min(390px, 100%);
  height: 61px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 17px 5px 8px;
  border: 1px solid rgba(250, 226, 168, 0.48);
  border-radius: 3px;
  background:
    linear-gradient(112deg, #e5c985 0%, #d6ae61 42%, #b78743 100%);
  color: #1b2114;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 251, 231, 0.5);
  text-align: left;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
}

.start-btn::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(66, 49, 23, 0.24);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
  pointer-events: none;
}

.start-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 17px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 251, 231, 0.55);
}

.start-seal {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(44, 36, 18, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 43% 38%, rgba(255, 250, 229, 0.22), rgba(57, 45, 22, 0.17));
  color: #3a2d16;
}

.start-seal .ico {
  width: 18px;
  height: 18px;
}

.start-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.start-copy strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.start-copy small {
  font-size: 6.5px;
  letter-spacing: 0.13em;
  color: rgba(37, 39, 24, 0.65);
  white-space: nowrap;
}

.start-arrow {
  margin-left: auto;
  color: rgba(48, 39, 20, 0.62);
}

.start-arrow .ico {
  width: 19px;
  height: 19px;
}

.menu-secondary {
  display: flex;
  gap: 8px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(218, 187, 121, 0.14);
  border-radius: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ghost-btn .ico {
  width: 12px;
  height: 12px;
  color: var(--muted-dark);
}

.ghost-btn:hover {
  color: var(--paper);
  border-color: rgba(226, 193, 126, 0.3);
  background: rgba(255, 246, 222, 0.035);
}

.menu-dossier {
  position: absolute;
  right: clamp(28px, 4vw, 64px);
  bottom: 82px;
  z-index: 4;
  width: 252px;
  padding: 14px 16px;
  border: 1px solid rgba(216, 184, 118, 0.17);
  border-left-color: rgba(225, 191, 124, 0.44);
  background: linear-gradient(150deg, rgba(9, 21, 15, 0.74), rgba(5, 13, 9, 0.78));
  backdrop-filter: blur(5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.dossier-eyebrow {
  font-size: 6.5px;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.menu-dossier h3 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  color: var(--paper);
}

.menu-dossier p {
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}

.dossier-stats {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(218, 187, 121, 0.1);
  font-size: 7px;
  letter-spacing: 0.04em;
  color: var(--muted-dark);
}

.dossier-stats span {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.dossier-stats b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--gold-light);
}

.menu-bottom {
  position: absolute;
  z-index: 4;
  left: clamp(30px, 7vw, 112px);
  right: clamp(28px, 4vw, 64px);
  bottom: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(218, 187, 121, 0.1);
  font-size: 6.5px;
  letter-spacing: 0.15em;
  color: var(--muted-dark);
}

.menu-bottom > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.menu-bottom .status-dot {
  width: 4px;
  height: 4px;
}

/* =========================================================
   Modal
   ========================================================= */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(4, 12, 8, 0.52), rgba(1, 5, 3, 0.83) 75%),
    rgba(2, 7, 4, 0.54);
  backdrop-filter: blur(6px) saturate(0.8);
  animation: backdropIn 0.28s ease both;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100vw - 36px));
  max-height: min(84vh, 820px);
  overflow: auto;
  border: 1px solid rgba(220, 187, 119, 0.36);
  border-radius: 4px;
  background:
    linear-gradient(155deg, rgba(19, 37, 27, 0.99), rgba(5, 15, 10, 0.995) 58%),
    radial-gradient(circle at 18% 0%, rgba(226, 189, 108, 0.08), transparent 38%);
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 246, 220, 0.07),
    inset 0 0 0 1px rgba(255, 244, 213, 0.02);
  animation: modalIn 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-thumb {
  background: rgba(222, 190, 124, 0.23);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal::before,
.modal::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-color: rgba(230, 200, 137, 0.5);
  border-style: solid;
  pointer-events: none;
}

.modal::before {
  left: 8px;
  top: 8px;
  border-width: 1px 0 0 1px;
}

.modal::after {
  right: 8px;
  bottom: 8px;
  border-width: 0 1px 1px 0;
}

.modal-help {
  width: min(890px, 92vw);
}

.modal-head {
  position: relative;
  padding: 24px 30px 17px;
  border-bottom: 1px solid rgba(218, 187, 121, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 244, 215, 0.035), transparent),
    radial-gradient(ellipse at 8% 0, rgba(226, 189, 108, 0.08), transparent 48%);
}

.modal-kicker {
  font-size: 7px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.modal-head h2,
.help-body h3,
.end-banner h2 {
  font-family: var(--serif);
}

.modal-head h2 {
  margin: 7px 0 4px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--parchment);
}

.modal-head p {
  max-width: 560px;
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  right: 19px;
  top: 19px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218, 187, 121, 0.15);
  border-radius: 2px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--gold-light);
  border-color: rgba(225, 192, 126, 0.4);
}

.modal-close .ico {
  width: 13px;
  height: 13px;
}

.modal-body {
  padding: 19px 30px 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 30px 24px;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 2px;
  font-size: 9px;
  letter-spacing: 0.055em;
  transition: all 0.2s ease;
}

.btn-primary {
  border: 1px solid rgba(246, 218, 155, 0.48);
  background: linear-gradient(120deg, #ddbd78, #bc8e48);
  color: #1d2414;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 252, 237, 0.38);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid rgba(219, 187, 121, 0.25);
  background: rgba(255, 244, 215, 0.035);
  color: var(--paper);
}

.btn-secondary:hover {
  border-color: rgba(228, 195, 128, 0.46);
  background: rgba(255, 247, 222, 0.06);
}

.btn-ghost {
  border: 1px solid transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--paper);
  background: rgba(255, 247, 223, 0.04);
}

.btn-primary .ico,
.btn-secondary .ico,
.btn-ghost .ico {
  width: 14px;
  height: 14px;
}

.pause-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid rgba(218, 187, 121, 0.12);
  background: rgba(218, 187, 121, 0.1);
}

.pause-summary > div {
  padding: 9px 11px;
  background: rgba(6, 18, 12, 0.94);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pause-summary span {
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: var(--muted-dark);
}

.pause-summary b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  color: var(--paper);
}

.pause-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pause-actions .btn-primary {
  grid-column: 1 / -1;
  height: 42px;
}

.pause-actions .btn-secondary,
.pause-actions .btn-ghost {
  height: 37px;
}

.pause-actions .btn-ghost {
  grid-column: 1 / -1;
}

.modal-keys {
  display: flex;
  gap: 15px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(218, 187, 121, 0.09);
  font-size: 7.5px;
  color: var(--muted-dark);
}

.modal-keys span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Panduan */
.help-body {
  padding-top: 18px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.help-section h3 {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 400;
  color: var(--gold-light);
}

.help-section h3::after {
  content: "";
  display: block;
  width: 26px;
  height: 1px;
  margin-top: 7px;
  background: rgba(226, 189, 108, 0.36);
}

.help-entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-entry b {
  display: block;
  font-size: 8.8px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--paper);
}

.help-entry p {
  margin: 3px 0 0;
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--muted);
}

.help-controls {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(218, 187, 121, 0.1);
}

.key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  border-bottom: 1px solid rgba(218, 187, 121, 0.055);
  font-size: 8.5px;
  color: var(--muted);
}

.key-row kbd {
  min-width: 62px;
  height: 19px;
  padding: 0 5px;
  font-size: 7px;
  color: var(--gold-light);
  border-color: rgba(218, 187, 121, 0.2);
  background: rgba(255, 245, 218, 0.03);
}

.help-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 17px;
  padding: 9px 11px;
  border: 1px solid rgba(218, 187, 121, 0.1);
  background: rgba(255, 246, 222, 0.025);
}

.help-note .ico {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--gold);
}

.help-note p {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Tentang */
.about-body {
  position: relative;
  padding-top: 23px;
}

.about-seal {
  position: absolute;
  right: 30px;
  top: 15px;
  width: 44px;
  height: 52px;
  opacity: 0.3;
  color: var(--gold);
}

.about-lede {
  max-width: 530px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.6;
  color: var(--paper);
}

.about-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid rgba(218, 187, 121, 0.1);
  border-bottom: 1px solid rgba(218, 187, 121, 0.1);
}

.about-columns h3 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  color: var(--gold-light);
}

.about-columns p,
.about-fine {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.55;
  color: var(--muted);
}

.about-fine {
  margin-top: 15px;
  color: var(--muted-dark);
}

/* Akhir pertandingan */
.modal-end {
  width: min(680px, calc(100vw - 36px));
}

.end-banner {
  position: relative;
  padding: 27px 34px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(218, 187, 121, 0.13);
  background:
    radial-gradient(ellipse at 50% 0, rgba(226, 189, 108, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(255, 247, 221, 0.025), transparent);
}

.end-banner.is-defeat {
  background:
    radial-gradient(ellipse at 50% 0, rgba(199, 93, 76, 0.13), transparent 56%),
    linear-gradient(180deg, rgba(255, 230, 221, 0.02), transparent);
}

.end-seal {
  width: 48px;
  height: 48px;
  margin: 0 auto 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 199, 131, 0.4);
  border-radius: 50%;
  color: var(--gold-light);
  background: radial-gradient(circle, rgba(226, 189, 108, 0.15), transparent 68%);
  box-shadow: 0 0 26px rgba(226, 189, 108, 0.08);
}

.end-banner.is-defeat .end-seal {
  border-color: rgba(213, 113, 95, 0.4);
  color: #e9a695;
  background: radial-gradient(circle, rgba(194, 87, 69, 0.16), transparent 68%);
}

.end-seal .ico {
  width: 22px;
  height: 22px;
}

.end-banner h2 {
  margin: 6px 0 7px;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--parchment);
}

.end-banner p {
  max-width: 510px;
  margin: 0 auto;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted);
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 20px 30px 0;
  border: 1px solid rgba(218, 187, 121, 0.11);
  background: rgba(218, 187, 121, 0.08);
}

.end-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  background: rgba(7, 19, 13, 0.96);
}

.end-stat span {
  font-size: 6.5px;
  letter-spacing: 0.13em;
  color: var(--muted-dark);
}

.end-stat b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--gold-light);
  line-height: 1;
}

.end-stat small {
  font-size: 6.5px;
  color: var(--muted-dark);
  white-space: nowrap;
}

.end-detail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin: 14px 30px 0;
  font-size: 8px;
  color: var(--muted-dark);
}

.end-detail b {
  color: var(--paper);
  font-weight: 500;
}

.end-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 20px 30px 27px;
}

.end-actions .btn-primary,
.end-actions .btn-secondary {
  min-width: 148px;
  height: 39px;
}

/* =========================================================
   Layar pembuka / fallback
   ========================================================= */

.screen-fade {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #020604;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #06100c;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
}

/* =========================================================
   Responsif
   ========================================================= */

@media (max-width: 1500px) {
  :root { --dock-h: 198px; }
  .topbar { gap: 13px; padding-left: 18px; padding-right: 18px; }
  .brand-lockup { min-width: 176px; }
  .brand-title { font-size: 14px; }
  .res-card { min-width: 68px; padding-right: 7px; }
  .res-value { font-size: 13px; }
  .age-badge { padding-left: 9px; padding-right: 8px; }
  .command-dock { grid-template-columns: 195px minmax(280px, 336px) minmax(0, 1fr); }
  .command-grid { grid-auto-rows: 62px; }
  .cmd-btn { height: 62px; }
  .selection-copy h2 { font-size: 18px; }
}

@media (max-width: 1280px) {
  :root { --dock-h: 196px; }
  .objective-card { display: none; }
  .top-mission { justify-content: flex-end; padding-right: 4px; }
  .mission-copy span { display: none; }
  .brand-lockup { min-width: 160px; }
  .brand-title { font-size: 13px; letter-spacing: 0.2em; }
  .res-card { min-width: 64px; gap: 5px; padding-left: 4px; }
  .res-icon { width: 24px; height: 24px; }
  .res-icon .ico { width: 15px; height: 15px; }
  .res-label { font-size: 6.8px; }
  .age-copy { display: none; }
  .age-badge { padding: 2px 8px; gap: 5px; }
  .age-seal { width: 28px; height: 28px; }
  .command-dock { grid-template-columns: 187px minmax(270px, 320px) minmax(0, 1fr); gap: 8px; }
  .command-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 60px; padding-left: 8px; padding-right: 8px; }
  .cmd-btn { height: 60px; }
  .command-hints { gap: 9px; font-size: 6.5px; }
  .menu-dossier { width: 220px; bottom: 76px; }
  .game-title { font-size: clamp(58px, 8vw, 104px); }
  .menu-main { width: min(600px, 51vw); }
}

@media (max-width: 1100px) {
  :root { --dock-h: 190px; --top-h: 58px; }
  .top-mission { display: none; }
  .brand-lockup { min-width: 142px; }
  .brand-sub { display: none; }
  .resource-rail { gap: 3px; }
  .res-card { min-width: 56px; height: 36px; }
  .res-label { display: none; }
  .res-copy { gap: 0; }
  .res-pop { min-width: 72px; }
  .age-badge { display: none; }
  .command-dock { grid-template-columns: 164px 282px minmax(0, 1fr); left: 9px; right: 9px; bottom: 9px; }
  .selection-panel { padding: 8px; }
  .portrait-frame { width: 92px; }
  #portrait { height: 92px; }
  .comps .selection-copy h2 { font-size: 17px; }
  .selection-copy > p { display: none; }
  .command-hints { display: none; }
  .command-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 58px; padding: 7px; gap: 5px; }
  .cmd-btn { height: 58px; grid-template-columns: 28px minmax(0, 1fr); column-gap: 4px; padding: 4px 5px; }
  .cmd-icon { width: 28px; height: 28px; }
  .cmd-icon img { width: 30px; height: 30px; }
  .cmd-name { font-size: 8px; }
  .cmd-cost { font-size: 6.5px; }
  .cost-item .ico { width: 8px; height: 8px; }
  .cost-item b { font-size: 7px; }
  .minimap-foot { padding-left: 5px; padding-right: 5px; }
  .idle-btn span { display: none; }
  .mini-age div { display: none; }
  .menu-main { width: min(560px, 58vw); }
  .menu-dossier { display: none; }
  .help-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .menu-main { width: calc(100vw - 60px); max-width: 560px; }
  .menu-dossier, .menu-meta { display: none; }
  .game-title { font-size: 74px; }
  .menu-bottom > span:last-child { display: none; }
  .command-dock { grid-template-columns: 142px minmax(0, 1fr); }
  .selection-panel { display: none; }
  .topbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  .res-card { min-width: 50px; }
  .res-icon { display: none; }
  .res-copy { padding-left: 3px; }
  .top-actions { margin-left: 4px; }
  .command-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .end-stats { grid-template-columns: 1fr 1fr; }
  .end-detail { gap: 8px 14px; }
  .about-columns { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
  .key-grid { grid-template-columns: 1fr; }
}

@media (max-height: 790px) {
  :root { --dock-h: 184px; --top-h: 58px; }
  .topbar { padding-top: 5px; padding-bottom: 7px; }
  .crest-small { width: 32px; height: 38px; }
  .res-card { height: 36px; }
  .command-grid { grid-auto-rows: 57px; padding-top: 6px; }
  .cmd-btn { height: 57px; }
  .portrait-frame { width: 98px; }
  #portrait { height: 96px; }
  .selection-copy > p { -webkit-line-clamp: 1; min-height: 12px; }
  .menu-main { top: 51%; }
  .game-title { font-size: clamp(52px, 7.5vw, 98px); margin-top: 11px; }
  .menu-lede { margin-top: 11px; line-height: 1.55; font-size: 10.5px; }
  .difficulty-block { margin-top: 15px; }
  .difficulty-option { height: 45px; }
  .menu-cta { margin-top: 14px; }
  .start-btn { height: 54px; }
  .start-seal { width: 38px; height: 38px; }
  .start-copy strong { font-size: 14px; }
  .menu-dossier { bottom: 66px; }
  .menu-bottom { bottom: 16px; }
  .modal { max-height: 90vh; }
  .command-hints { height: 18px; }
}

@media (max-height: 680px) {
  :root { --dock-h: 172px; }
  .game-title { font-size: 62px; }
  .menu-lede { display: none; }
  .title-ornament { margin-top: 8px; }
  .difficulty-block { margin-top: 12px; }
  .menu-cta { margin-top: 12px; }
  .command-grid { grid-auto-rows: 52px; }
  .cmd-btn { height: 52px; }
  .selection-copy > p { display: none; }
  .command-hints { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

