/* ====================================================
   BANDA SAPULUAH RTS — Style (Age of Empires feel)
   ==================================================== */

:root {
  --hud-bg:       #1a1208;
  --hud-border:   #4a3a18;
  --hud-stone:    #2a2010;
  --gold:         #c8a030;
  --gold-lit:     #f0c860;
  --gold-dim:     #7a6020;
  --text:         #e8d8a0;
  --text-dim:     #9a8a60;
  --red:          #c83020;
  --green:        #409030;
  --btn-bg:       #2e2010;
  --btn-hover:    #3e3018;
  --btn-border:   #5a4520;
  --btn-active:   #c8a030;
  /* Wood grain texture (CSS only, no image needed) */
  --wood-grain: repeating-linear-gradient(
    92deg,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px,
    transparent 4px, transparent 11px,
    rgba(255,255,255,0.025) 11px, rgba(255,255,255,0.025) 12px
  );
  --wood-base: linear-gradient(180deg, #1e1509 0%, #2a1c0a 40%, #1a1006 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  font-family: 'Georgia', 'Times New Roman', serif;
  overflow: hidden;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* ── GAME ROOT ── */
#gameRoot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ── TOP RESOURCE BAR ── */
#topBar {
  position: relative;
  z-index: 200;
  height: 36px;
  background: var(--wood-base), var(--wood-grain);
  border-bottom: 2px solid #6a4a1a;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.9), inset 0 -1px 0 rgba(200,160,48,0.1);
}

.res-group {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid rgba(74,58,24,0.5);
  height: 100%;
  gap: 5px;
}

.res-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.res-val {
  font-size: 13px;
  font-weight: bold;
  color: var(--gold-lit);
  min-width: 36px;
  font-family: 'Arial Narrow', Arial, sans-serif;
  letter-spacing: 0.03em;
}

.res-label {
  font-size: 9px;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

#popDisplay {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--gold-dim);
}

#popDisplay span { color: var(--gold); font-weight: bold; font-size: 13px; }

#nagariName {
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-left: 1px solid rgba(74,58,24,0.5);
  padding-left: 10px;
}

#btnProfil, #btnFullscreen {
  padding: 2px 8px;
  font-size: 16px;
  background: none;
  border: 1px solid rgba(74,58,24,0.4);
  border-radius: 4px;
  color: var(--gold-dim);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.6;
  transition: border-color .2s, background .2s;
  flex-shrink: 0;
}
#btnProfil { margin-left: auto; }
#btnProfil:hover, #btnFullscreen:hover { border-color: var(--gold-dim); background: rgba(74,58,24,0.25); }

/* ── MAP AREA ── */
#mapArea {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

#mapContainer {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: default;
}

#worldLayer {
  position: absolute;
  top: 0; left: 0;
  width: 1536px;
  pointer-events: none;
  will-change: transform;
  transform-origin: 0 0;
}

#worldMap {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
}

#worldMap img {
  position: absolute;
  display: block;
  width: 1536px;
  height: 1024px;
  pointer-events: none;
}

/* ── LAYERS ── */
#fogLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

#fogCanvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 20;
}

#baseLayer {
  position: absolute;
  top: 0; left: 0;
  width: 1536px;
  z-index: 10;
  pointer-events: auto;
}

/* ── SHIP ── */
#ship {
  position: absolute;
  width: 65px;
  transform: translate(-50%, -50%);
  z-index: 18;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.7));
  transition: left 0.05s linear, top 0.05s linear;
}

/* ── NAGARI LABELS ── */
.nagari {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
  cursor: pointer;
  pointer-events: auto;
}

.nagari-label {
  background: rgba(10, 6, 0, 0.82);
  border: 1px solid rgba(200,160,48,0.35);
  padding: 4px 9px;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.08em;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nagari:hover .nagari-label {
  background: rgba(200,160,48,0.18);
  border-color: var(--gold);
  color: var(--gold-lit);
}

.nagari-dot {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: var(--gold-dim);
  border-radius: 50%;
  border: 1px solid var(--gold);
  pointer-events: none;
}

/* ── UNITS ── */
.unit {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 12;
  cursor: pointer;
  pointer-events: auto;
  transition: left 0.03s linear, top 0.03s linear;
}

.unit img {
  display: block;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.7));
  pointer-events: none;
}

.unit.selected .unit-ring {
  display: block;
}

.unit-ring {
  display: none;
  position: absolute;
  left: 50%; bottom: 0;
  width: 44px; height: 20px;
  transform: translate(-50%, 50%);
  border: 2px solid #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,255,136,0.6), 0 0 18px rgba(0,255,136,0.3);
  pointer-events: none;
}

.unit-hp-bar {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(0,0,0,0.5);
  pointer-events: none;
}

.unit-hp-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.3s;
}

.unit-hp-fill.low { background: var(--red); }

/* Walk bobbing animation */
.unit.walking img {
  animation: unitWalk 0.35s steps(1) infinite;
}

@keyframes unitWalk {
  0%   { transform: translateY(0px); }
  25%  { transform: translateY(-2px) scaleX(var(--flip,1)); }
  50%  { transform: translateY(0px); }
  75%  { transform: translateY(-1px) scaleX(var(--flip,1)); }
  100% { transform: translateY(0px); }
}

.unit img { transition: transform 0.1s; }
.unit.face-left img  { transform: scaleX(-1); }
.unit.face-right img { transform: scaleX(1); }

/* Idle indicator — flashing ! badge */
@keyframes idleBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity:1; }
  50%       { transform: translateX(-50%) translateY(-4px); opacity:0.7; }
}
.unit.unit-idle::after {
  content: '!';
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%);
  background: #f0a000; color: #1a0800;
  font-size: 9px; font-weight: 900;
  border-radius: 50%; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  animation: idleBounce 1s ease-in-out infinite;
  pointer-events: none; z-index: 60;
}

/* Rally flag */
.rally-flag { font-size: 16px; line-height: 1; user-select: none; }

/* Garrison badge */
.garrison-badge {
  position: absolute; top: -10px; right: -4px;
  background: #1a3060; color: #a0c8ff;
  font-size: 9px; font-weight: bold;
  padding: 1px 4px; border-radius: 8px;
  border: 1px solid #4060a0;
  pointer-events: none; z-index: 20;
}

/* ── BUILDINGS ── */
.building {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 8;
  cursor: pointer;
  pointer-events: auto;
  isolation: isolate;
}

.building img {
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.7));
  pointer-events: none;
}

.building.selected img {
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.7)) drop-shadow(0 0 8px rgba(0,255,136,0.6));
}

.build-progress-bar {
  position: absolute;
  left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: 60px; height: 6px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(200,160,48,0.3);
  display: none;
}

.building.building-progress .build-progress-bar { display: block; }

.build-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.2s;
}

/* ── SELECTION BOX ── */
#selectionBox {
  position: absolute;
  border: 1px solid #00ff88;
  background: rgba(0,255,136,0.06);
  pointer-events: none;
  z-index: 50;
  display: none;
}

/* ── MOVE MARKER ── */
.move-marker {
  position: absolute;
  width: 20px; height: 20px;
  transform: translate(-50%, -50%);
  z-index: 30;
  pointer-events: none;
  animation: moveMarkerFade 0.7s ease-out forwards;
}

.move-marker::before, .move-marker::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #00ff88;
  border-radius: 50%;
}

.move-marker::after {
  animation: moveMarkerPulse 0.7s ease-out forwards;
}

@keyframes moveMarkerFade { to { opacity: 0; transform: translate(-50%,-50%) scale(1.4); } }
@keyframes moveMarkerPulse { to { transform: scale(2); opacity: 0; } }

/* ── BOTTOM HUD ── */
#bottomHUD {
  position: relative;
  z-index: 200;
  height: 160px;
  background: var(--wood-base), var(--wood-grain);
  border-top: 2px solid #6a4a1a;
  display: flex;
  flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.95), inset 0 1px 0 rgba(200,160,48,0.15);
}

/* LEFT — Unit portrait + info */
#infoPanel {
  width: 220px;
  flex-shrink: 0;
  border-right: 2px solid #5a3e10;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
  background: var(--wood-base), var(--wood-grain);
}

#portrait {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: 2px solid var(--hud-border);
  background: #0a0800;
  overflow: hidden;
  position: relative;
}

#portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

#portrait-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--gold-dim);
}

#infoContent {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

#infoName {
  font-size: 12px;
  color: var(--gold-lit);
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#infoType {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#infoHpBar {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(74,58,24,0.6);
  margin-top: 2px;
}

#infoHpFill {
  height: 100%;
  background: var(--green);
  transition: width 0.3s;
}

#infoStats {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}

.info-row { display: flex; align-items: center; gap: 4px; }

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

/* CENTER — Commands */
#commandPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  gap: 8px;
  padding: 8px;
  border-right: 2px solid #5a3e10;
  background: repeating-linear-gradient(
    88deg,
    transparent 0px, transparent 5px,
    rgba(0,0,0,0.04) 5px, rgba(0,0,0,0.04) 6px
  );
}

.cmd-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Inner button grid inside cmd-grid (used for default build mode) */
.cmd-inner-grid {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  grid-auto-rows: 44px;
  gap: 4px;
}

/* Build menu tab bar */
.build-tabs {
  display: flex;
  width: 284px;
  gap: 2px;
}

.build-tab {
  flex: 1;
  height: 22px;
  padding: 0 2px;
  background: rgba(14,9,2,0.8);
  border: 1px solid rgba(58,40,8,0.7);
  color: #6a5030;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.build-tab.active {
  background: rgba(90,64,32,0.5);
  border-color: var(--gold);
  color: var(--gold);
}

.build-tab:hover:not(.active) {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
}

.cmd-btn {
  width: 44px;
  height: 44px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
  color: var(--text);
  position: relative;
}

.cmd-btn:hover {
  background: var(--btn-hover);
  border-color: var(--gold);
  color: var(--gold-lit);
}

.cmd-btn:active, .cmd-btn.active {
  background: rgba(200,160,48,0.12);
  border-color: var(--gold);
  box-shadow: inset 0 0 8px rgba(200,160,48,0.3);
}

.cmd-btn-label {
  font-size: 8px;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  margin-top: 1px;
  text-align: center;
  line-height: 1;
}

.cmd-btn[data-hotkey]::after {
  content: attr(data-hotkey);
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 7px;
  color: rgba(200,160,48,0.4);
}

/* RIGHT — Minimap */
#minimapPanel {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--hud-border);
  background: #0a0800;
}

#minimapCanvas {
  display: block;
  width: 100%;
  height: 120px;
  background: #0d1520;
  border-bottom: 1px solid var(--hud-border);
  cursor: pointer;
}

#minimapBtns {
  display: flex;
  height: 38px;
  border-top: 1px solid var(--hud-border);
}

.minimap-btn {
  flex: 1;
  background: var(--btn-bg);
  border: none;
  border-right: 1px solid var(--hud-border);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.minimap-btn:last-child { border-right: none; }
.minimap-btn:hover { background: var(--btn-hover); color: var(--gold); }

/* ── NOTIFICATION TOASTS ── */
#notifArea {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.notif {
  background: rgba(10,8,0,0.92);
  border: 1px solid rgba(200,160,48,0.3);
  padding: 5px 16px;
  font-size: 12px;
  color: var(--gold-lit);
  letter-spacing: 0.08em;
  animation: notifIn 0.2s ease, notifOut 0.4s ease 3.6s forwards;
  white-space: nowrap;
}

.notif.warn  { border-color: rgba(200,80,30,0.5); color: #e07040; }
.notif.green { border-color: rgba(60,160,60,0.4); color: #80d060; }
.notif.event { border-color: rgba(200,160,48,0.5); color: var(--gold-lit); }

@keyframes notifIn  { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes notifOut { to   { opacity:0; transform:translateY(-6px); } }

/* ── CINEMATIC DIALOG ── */
#dialogBox {
  position: fixed;
  bottom: 168px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  max-width: 680px;
  width: 90%;
  background: rgba(10,8,0,0.92);
  border: 1px solid rgba(200,160,48,0.25);
  border-top: 2px solid rgba(200,160,48,0.4);
  padding: 14px 20px 12px;
  display: none;
}

.dialog-speaker {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.dialog-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 8px;
  font-style: italic;
}

.dialog-next {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(200,160,48,0.35);
  text-align: right;
  animation: blinkText 1.5s ease infinite;
}

@keyframes blinkText { 0%,100% { opacity:0.3; } 50% { opacity:1; } }

/* ── INTRO SCREEN ── */
#introScreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#introScreen img.intro-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: sepia(0.3) brightness(0.85);
}

/* vignette overlay */
#introScreen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%,
    transparent 30%,
    rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

.intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 480px;
  animation: introFadeIn 1.2s ease both;
}

@keyframes introFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro-eyebrow {
  font-size: 9px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(200,160,48,0.55);
  margin-bottom: 10px;
}

.intro-title {
  font-family: 'Times New Roman', serif;
  font-size: 3.2rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-shadow: 0 0 60px rgba(200,160,48,0.45), 0 0 120px rgba(200,160,48,0.15);
  margin-bottom: 4px;
  line-height: 1.05;
}

.intro-sub {
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(200,160,48,0.45);
  margin-bottom: 0;
}

.intro-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(200,160,48,0.5), transparent);
  margin: 20px auto;
}

.intro-desc {
  font-size: 13px;
  font-style: italic;
  color: rgba(232,216,160,0.62);
  line-height: 1.8;
  margin-bottom: 32px;
}

.intro-btn {
  display: inline-block;
  padding: 13px 36px;
  border: 1px solid rgba(200,160,48,0.55);
  background: rgba(200,160,48,0.07);
  color: var(--gold);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
  margin-bottom: 28px;
}

.intro-btn:hover {
  background: rgba(200,160,48,0.15);
  border-color: var(--gold);
  color: var(--gold-lit);
  box-shadow: 0 0 28px rgba(200,160,48,0.18);
}

/* player info strip */
.intro-player {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 11px;
  color: rgba(138,154,176,0.42);
  font-family: 'Times New Roman', serif;
  letter-spacing: 0.06em;
}

.intro-player-sep {
  opacity: 0.4;
}

.intro-logout-btn {
  background: none;
  border: none;
  color: rgba(138,154,176,0.35);
  font-size: 11px;
  font-family: 'Times New Roman', serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s;
}

.intro-logout-btn:hover {
  color: rgba(200,160,48,0.55);
}

/* ── TOOLTIP ── */
.tooltip {
  position: fixed;
  background: rgba(10,8,0,0.95);
  border: 1px solid var(--hud-border);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
  display: none;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* ── RESPONSIVE — Portrait mobile ── */
@media (max-width: 768px) {
  #bottomHUD { height: 140px; }
  .cmd-inner-grid { grid-template-columns: repeat(4, 44px); grid-auto-rows: 44px; }
  .cmd-btn { width: 44px; height: 44px; font-size: 14px; }
  .build-tabs { width: 188px; }
  .build-tab { font-size: 7.5px; }
  #infoPanel { width: 190px; }
  #minimapPanel { width: 130px; }
  #minimapCanvas { height: 100px; }
  .intro-title { font-size: 2.2rem; }
  .intro-content { padding: 2rem 1.5rem; }
}

/* ── RESPONSIVE — Landscape mobile (phone in landscape) ── */
@media (max-height: 480px) and (orientation: landscape) {
  /* Top bar — satu baris padat */
  #topBar { height: 28px; gap: 0; }
  .res-group { padding: 0 5px; gap: 3px; }
  .res-icon { font-size: 11px; width: 14px; }
  .res-val { font-size: 11px; min-width: 26px; }
  .res-label { display: none; }
  #nagariName { font-size: 9px; padding-left: 6px; }
  #btnProfil, #btnFullscreen { font-size: 13px; padding: 0 6px; }
  #popDisplay { font-size: 10px; padding: 0 6px; }

  /* Bottom HUD — satu baris tipis */
  #bottomHUD { height: 68px; }

  /* Info panel — kompak horizontal */
  #infoPanel {
    width: 108px;
    padding: 4px 6px;
    flex-direction: row;
    align-items: center;
    gap: 5px;
  }
  #portrait { width: 44px; height: 44px; flex-shrink: 0; }
  #portrait-placeholder { font-size: 20px; }
  .info-row-top { flex-direction: row; align-items: center; gap: 5px; }
  #infoContent { gap: 2px; }
  #infoName { font-size: 9px; }
  #infoType { display: none; }
  #infoStats { display: none; }
  #infoHpBar { height: 5px; }

  /* Command panel — single scrollable row */
  #commandPanel { padding: 3px 4px; gap: 2px; }
  .cmd-grid { width: 100%; gap: 2px; }
  .build-tabs { width: 100%; height: 16px; gap: 1px; }
  .build-tab { height: 16px; font-size: 7px; }
  .cmd-inner-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 3px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    height: 50px;
  }
  .cmd-inner-grid::-webkit-scrollbar { display: none; }
  .cmd-btn {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    font-size: 22px;
  }
  .cmd-btn-label { display: none; }
  .cmd-btn[data-hotkey]::after { display: none; }

  /* Minimap panel — tombol saja, tanpa canvas */
  #minimapPanel { width: 68px; flex-direction: column; }
  #minimapCanvas { display: none; }
  #minimapBtns {
    height: 100%;
    flex-direction: column;
    border-top: none;
  }
  .minimap-btn {
    flex: 1;
    font-size: 17px;
    border-right: none;
    border-bottom: 1px solid var(--hud-border);
  }
  .minimap-btn:last-child { border-bottom: none; }

  /* Objectives panel */
  #objectivesPanel { top: 34px; right: 6px; font-size: 10px; }
  #chapterTitle { font-size: 9px; }
}

/* ── OBJECTIVES PANEL ── */
#objectivesPanel {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(10,7,2,0.88);
  border: 1px solid #4a3a18;
  border-radius: 4px;
  padding: 8px 12px;
  min-width: 200px;
  max-width: 260px;
  z-index: 120;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

#chapterTitle {
  font-size: 0.65rem;
  color: #7a6020;
  letter-spacing: .15em;
  text-transform: uppercase;
  border-bottom: 1px solid #3a2a10;
  padding-bottom: 5px;
  margin-bottom: 7px;
}

.obj-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 0.75rem;
  color: #c8b870;
  transition: color 0.3s;
}

.obj-item.obj-done { color: #60a040; }
.obj-check { font-size: 0.8rem; flex-shrink: 0; width: 14px; }
.obj-label { line-height: 1.3; }

/* ── BUILDING HP BAR ── */
.building-hp-bar {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 4px;
  background: rgba(0,0,0,0.6);
  border-radius: 2px;
  display: none;
}

.building:hover .building-hp-bar,
.building.selected .building-hp-bar { display: block; }

.building-hp-fill {
  height: 100%;
  background: #40a020;
  border-radius: 2px;
  transition: width 0.2s, background 0.3s;
}

/* ── ENEMY UNITS ── */
.enemy-unit { z-index: 25; }

.enemy-ring {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translate(-50%, 50%);
  width: 32px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(200,48,30,0);
  pointer-events: none;
}

.enemy-unit.selected .enemy-ring,
.enemy-unit:hover .enemy-ring {
  border-color: rgba(200,48,30,0.8);
}

.enemy-hp-fill {
  background: #c83020 !important;
}

/* ── FX CANVAS ── */
#fxCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 51;
}

/* ── BUILDING FIRE ── */
.bld-fire {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 36px;
  pointer-events: none;
  z-index: 5;
}
.bld-fire::before {
  content: '';
  position: absolute;
  bottom: 0; left: 4px;
  width: 20px; height: 30px;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(ellipse at 50% 100%, #ff6600, #ff2200 50%, transparent 85%);
  animation: fireFlicker 0.25s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
.bld-fire::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 9px;
  width: 10px; height: 18px;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(ellipse at 50% 100%, #ffe060, #ff9900 60%, transparent 85%);
  animation: fireFlicker 0.2s ease-in-out infinite alternate-reverse;
  transform-origin: bottom center;
}
@keyframes fireFlicker {
  0%   { transform: scaleX(1)    scaleY(1);    }
  100% { transform: scaleX(0.82) scaleY(1.12) translateY(-3px); }
}

/* ── ANIMATIONS ── */
@keyframes dustFade {
  0%   { opacity: 1; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(2); }
}

@keyframes projFade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── FENCE / PAGAR ── */
.fence-segment {
  position: absolute;
  pointer-events: all;
  z-index: 18;
  transition: opacity 0.3s;
}

.fence-segment:hover {
  filter: brightness(1.4);
}

.fence-segment.fence-selected {
  filter: brightness(1.6) drop-shadow(0 0 4px #f0c860);
  outline: none;
}

/* ── NAGARI LOCK / COMPLETE STATES ── */
.nagari.nagari-locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

.nagari.nagari-locked .nagari-dot {
  background: #3a3030;
  border-color: #5a4040;
}

.nagari.nagari-locked .nagari-label {
  color: #5a4840;
  border-color: rgba(90,72,64,0.4);
}

.nagari.nagari-completed .nagari-dot {
  background: #40a030;
  border-color: #60c050;
  box-shadow: 0 0 6px rgba(64,160,48,0.6);
}

.nagari.nagari-completed .nagari-label::after {
  content: ' ✓';
  color: #60c050;
  font-size: 10px;
}

/* ── CHAPTER SELECT OVERLAY ── */
#chapterSelectOverlay {
  position: fixed;
  inset: 0;
  background: rgba(4,8,2,0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  gap: 0;
  backdrop-filter: blur(2px);
}

#chapterSelectOverlay.visible { display: flex; }

.cso-eyebrow {
  font-size: 0.62rem;
  color: #4a7030;
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cso-title {
  font-family: Georgia, serif;
  font-size: 2rem;
  color: #c8a030;
  letter-spacing: .15em;
  text-align: center;
  line-height: 1.1;
}

.cso-subtitle {
  font-size: 0.8rem;
  color: #7a6040;
  letter-spacing: .12em;
  margin-top: 6px;
  margin-bottom: 24px;
}

.cso-objectives {
  background: rgba(10,8,2,0.7);
  border: 1px solid #3a2a10;
  padding: 14px 24px;
  min-width: 280px;
  max-width: 360px;
  margin-bottom: 24px;
}

.cso-obj-header {
  font-size: 0.6rem;
  color: #5a4820;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cso-obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.78rem;
  color: #b0a060;
  border-bottom: 1px solid rgba(58,42,16,0.4);
}

.cso-obj-item:last-child { border-bottom: none; }
.cso-obj-icon { color: #c8a030; width: 12px; flex-shrink: 0; }

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

.cso-btn-primary {
  padding: 13px 48px;
  background: #0a1a06;
  border: 2px solid #c8a030;
  color: #c8a030;
  font-family: Georgia, serif;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: .12em;
  transition: all 0.2s;
}

.cso-btn-primary:hover {
  background: rgba(200,160,48,0.12);
  color: #f0c840;
}

.cso-btn-secondary {
  padding: 7px 24px;
  background: transparent;
  border: 1px solid #3a2a10;
  color: #5a4820;
  font-family: Georgia, serif;
  font-size: 0.8rem;
  cursor: pointer;
  letter-spacing: .08em;
  transition: color 0.2s;
}

.cso-btn-secondary:hover { color: #9a8040; }

.cso-btn-resume {
  padding: 13px 48px;
  background: #06180a;
  border: 2px solid #40a060;
  color: #60d080;
  font-family: Georgia, serif;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: .12em;
  transition: all 0.2s;
  font-size: 0.88rem;
}
.cso-btn-resume:hover {
  background: rgba(64,160,96,0.15);
  color: #80f0a0;
}

/* ── LOADING SCREEN ── */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: #040802;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
  transition: opacity 0.5s ease;
}
#loadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-title {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  color: #c8a030;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.loading-bar-wrap {
  width: 200px;
  height: 3px;
  background: rgba(200,160,48,0.15);
  border-radius: 2px;
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  background: #c8a030;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}
.loading-sub {
  font-size: 0.72rem;
  color: #5a4820;
  letter-spacing: .12em;
}

/* ── OBJ PROGRESS ── */
.obj-progress {
  margin-left: auto;
  font-size: 0.68rem;
  color: #7a6838;
  font-family: monospace;
  flex-shrink: 0;
}

/* ── RESEARCH PANEL ── */
#researchPanel {
  position: fixed;
  inset: 0;
  background: rgba(4,6,2,0.94);
  display: none;
  flex-direction: column;
  z-index: 8500;
  backdrop-filter: blur(3px);
}

#researchPanel.visible { display: flex; }

.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
  border-bottom: 1px solid #3a2a10;
}

.rp-title {
  font-family: Georgia, serif;
  font-size: 1rem;
  color: #c8a030;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.rp-close {
  background: transparent;
  border: 1px solid #3a2a10;
  color: #7a6020;
  font-size: 1rem;
  width: 32px; height: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.rp-close:hover { color: #c8a030; border-color: #c8a030; }

.rp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.rp-card {
  background: rgba(12,9,2,0.8);
  border: 1px solid #3a2a10;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}

.rp-card:hover { border-color: #5a4020; }
.rp-card.maxed { opacity: 0.55; }

.rp-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.rp-name {
  font-family: Georgia, serif;
  font-size: 0.9rem;
  color: #c8a030;
  letter-spacing: .06em;
}

.rp-maxlv {
  font-size: 0.65rem;
  color: #5a4820;
  letter-spacing: .12em;
}

.rp-levels {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.rp-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid #5a4020;
  background: #1a1206;
}

.rp-dot.filled {
  background: #c8a030;
  border-color: #f0c840;
  box-shadow: 0 0 4px rgba(200,160,48,0.5);
}

.rp-desc {
  font-size: 0.75rem;
  color: #9a8860;
  line-height: 1.4;
  min-height: 32px;
}

.rp-desc .next-effect {
  color: #70c060;
  font-size: 0.72rem;
}

.rp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.rp-cost {
  font-size: 0.7rem;
  color: #7a6030;
  letter-spacing: .04em;
}

.rp-btn {
  padding: 6px 16px;
  background: #0a1606;
  border: 1px solid #c8a030;
  color: #c8a030;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  cursor: pointer;
  letter-spacing: .08em;
  transition: all 0.18s;
}

.rp-btn:hover:not(:disabled) {
  background: rgba(200,160,48,0.15);
  color: #f0c840;
}

.rp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #3a2a10;
  color: #5a4020;
}

.rp-btn.maxed-btn {
  border-color: #3a5028;
  color: #4a7038;
  background: transparent;
  cursor: default;
}

/* ── SHORTCUT HELP PANEL ─────────────────────────────── */
#shortcutHelp {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: rgba(6, 10, 4, 0.97);
  border: 1px solid #c8a030;
  box-shadow: 0 0 40px rgba(200,160,48,0.25), inset 0 0 60px rgba(0,0,0,0.6);
  color: #d4b870;
  font-family: Georgia, serif;
  min-width: 580px;
  max-width: 90vw;
}

.sh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(200,160,48,0.3);
  font-size: 0.85rem;
  letter-spacing: .12em;
  color: #f0c840;
}

.sh-close {
  background: none;
  border: 1px solid rgba(200,160,48,0.4);
  color: #c8a030;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 8px;
  line-height: 1.4;
}
.sh-close:hover { background: rgba(200,160,48,0.12); }

.sh-body {
  display: flex;
  gap: 0;
  padding: 12px 0 8px;
}

.sh-col {
  flex: 1;
  padding: 0 16px;
}
.sh-col + .sh-col {
  border-left: 1px solid rgba(200,160,48,0.15);
}

.sh-section {
  font-size: 0.65rem;
  letter-spacing: .14em;
  color: #8a7040;
  text-transform: uppercase;
  margin: 8px 0 5px;
}
.sh-section:first-child { margin-top: 0; }

.sh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
  font-size: 0.78rem;
  color: #c0a860;
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 1px 6px;
  background: rgba(200,160,48,0.1);
  border: 1px solid rgba(200,160,48,0.35);
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.75rem;
  color: #f0c840;
  text-align: center;
  flex-shrink: 0;
}

/* ── WAVE INDICATOR ──────────────────────────────────── */
#waveIndicator {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(8, 5, 2, 0.90);
  border: 1px solid #4a3a18;
  border-radius: 4px;
  padding: 8px 12px;
  min-width: 185px;
  z-index: 120;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.7);
  transition: border-color 0.3s;
}
#waveIndicator.wave-warn    { border-color: #b07820; }
#waveIndicator.wave-critical{ border-color: #cc3020; animation: waveAlertPulse 0.6s ease-in-out infinite alternate; }
#waveIndicator.wave-attack  { border-color: #cc2010; animation: waveAlertPulse 0.4s ease-in-out infinite alternate; }
#waveIndicator.wave-clear   { border-color: #385028; }

@keyframes waveAlertPulse {
  from { box-shadow: 0 2px 12px rgba(0,0,0,0.7); }
  to   { box-shadow: 0 0 20px rgba(200,40,10,0.55), 0 2px 12px rgba(0,0,0,0.5); }
}

.wi-header {
  font-size: 0.65rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #8a7040;
  border-bottom: 1px solid #2a1e08;
  padding-bottom: 5px;
  margin-bottom: 6px;
}
#waveIndicator.wave-critical .wi-header,
#waveIndicator.wave-attack   .wi-header { color: #cc5030; }
#waveIndicator.wave-clear    .wi-header { color: #4a7040; }

.wi-countdown {
  font-size: 1.6rem;
  font-family: Georgia, serif;
  color: #d4b050;
  line-height: 1.1;
  letter-spacing: .02em;
}
#waveIndicator.wave-warn     .wi-countdown { color: #d07828; }
#waveIndicator.wave-critical .wi-countdown { color: #cc4020; }

.wi-attack-label {
  font-size: 1.1rem;
  font-family: Georgia, serif;
  color: #d03015;
  letter-spacing: .08em;
  line-height: 1.2;
}

.wi-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin: 5px 0 6px;
  overflow: hidden;
}
.wi-fill {
  height: 100%;
  background: linear-gradient(to right, #4a6030, #c8a030);
  border-radius: 2px;
  transition: width 0.8s linear;
}
#waveIndicator.wave-warn     .wi-fill { background: linear-gradient(to right, #804010, #c87020); }
#waveIndicator.wave-critical .wi-fill { background: linear-gradient(to right, #601010, #c83020); }

.wi-troops {
  font-size: 0.72rem;
  color: #7a6840;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#waveIndicator.wave-attack .wi-troops { color: #9a5030; }

.wi-done {
  font-size: 0.9rem;
  color: #4a7040;
  font-family: Georgia, serif;
  letter-spacing: .04em;
}

/* ── RESOURCE NODES ─────────────────────────────────────────── */
.res-node {
  position: absolute;
  font-size: 26px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  line-height: 1;
  transition: opacity 0.3s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  transform: translate(-50%, -50%);
  z-index: 10;
}
.res-node:hover {
  filter: drop-shadow(0 0 6px rgba(200,160,48,0.8)) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.res-node.depleting {
  opacity: 0.4;
  pointer-events: none;
}
.res-node.selected-node {
  filter: drop-shadow(0 0 8px #f0c840) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ── TRAINING QUEUE ─────────────────────────────────────────── */
.train-progress {
  height: 3px;
  background: rgba(200,160,48,0.2);
  border-radius: 2px;
  margin-top: 3px;
  width: 100%;
}
.train-fill {
  height: 100%;
  background: #c8a030;
  border-radius: 2px;
  transition: width 0.5s linear;
}

/* ── FENCE POST ─────────────────────────────────────── */
.fence-post {
  position: absolute;
  z-index: 22;
  pointer-events: none;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ── INTRO CINEMATIC ──────────────────────────────────── */
#introCinematic {
  position: fixed;
  inset: 0;
  z-index: 9990;
  overflow: hidden;
  background: #020a04;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease;
}
.ic-bg {
  position: absolute;
  inset: -4px;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.25) saturate(0.5);
  transform: scale(1.06);
}
.ic-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 60%, transparent 30%, rgba(2,8,2,0.88) 100%),
    radial-gradient(ellipse at 25% 15%, rgba(180,130,30,0.08) 0%, transparent 60%);
  z-index: 1;
}
.ic-hills-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  z-index: 2;
  pointer-events: none;
}
.ic-chapter-label {
  position: absolute;
  top: 24px;
  left: 36px;
  z-index: 10;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(200,160,48,0.55);
  opacity: 0;
  animation: icFadeIn 0.5s ease 0.4s forwards;
}
.ic-text {
  position: relative;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  margin-bottom: 10vh;
}
.ic-eyebrow {
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #a07030;
  opacity: 0;
  animation: icFadeUp 0.6s ease 0.7s forwards;
  margin-bottom: 14px;
}
.ic-title {
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f0d060;
  text-shadow: 0 2px 24px rgba(200,140,20,0.7), 0 0 80px rgba(180,120,10,0.25);
  opacity: 0;
  animation: icFadeUp 0.9s ease 1.1s forwards;
  line-height: 1.05;
}
.ic-divider {
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c8a030, transparent);
  margin: 16px auto 14px;
  opacity: 0;
  animation: icFadeIn 0.5s ease 1.5s forwards;
}
.ic-subtitle {
  font-size: clamp(14px, 2vw, 20px);
  letter-spacing: 0.2em;
  color: #c0a060;
  opacity: 0;
  animation: icFadeUp 0.6s ease 1.8s forwards;
}
@keyframes icFadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes icFadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}

/* Marching group */
.ic-chars {
  position: absolute;
  bottom: 22%;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 8;
  pointer-events: none;
}
.ic-char {
  position: absolute;
  bottom: 0;
  animation: icMarch linear forwards;
}
.ic-char-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: icBounce 0.38s ease-in-out infinite;
  transform-origin: bottom center;
}
.ic-char img {
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.9)) brightness(0.95);
}
@keyframes icMarch {
  from { transform: translateX(115vw) translateY(-3vh); }
  to   { transform: translateX(-20vw) translateY(7vh); }
}
@keyframes icBounce {
  0%,100% { transform: translateY(0px) scaleX(-1); }
  50%      { transform: translateY(-5px) scaleX(-1); }
}

/* Dust puff — follows same X trajectory as marching group but slower */
.ic-dustpuff {
  position: absolute;
  bottom: 23%;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(150,110,50,0.35);
  pointer-events: none;
  z-index: 7;
  animation: icDust linear forwards;
}
@keyframes icDust {
  0%   { transform: translateX(115vw) scale(0.6); opacity:0; }
  10%  { opacity: 0.5; }
  80%  { opacity: 0.2; }
  100% { transform: translateX(-25vw) scale(4); opacity:0; }
}

/* Progress bar at bottom */
.ic-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #c8a030, #f0d060);
  z-index: 10;
  width: 0%;
  transition: width linear;
}

/* Skip button */
.ic-skip {
  position: absolute;
  bottom: 20px;
  right: 28px;
  z-index: 11;
  background: rgba(20,14,4,0.75);
  border: 1px solid rgba(200,160,48,0.4);
  color: #a08030;
  padding: 7px 18px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  transition: all 0.2s;
  opacity: 0;
  animation: icFadeIn 0.4s ease 1s forwards;
}
.ic-skip:hover {
  background: rgba(50,35,5,0.9);
  border-color: #c8a030;
  color: #f0d060;
}

/* ── ROTATE HINT ── */
#rotateHint {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 6, 2, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rotate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #c8a030;
  text-align: center;
}
.rotate-icon {
  font-size: 3.5rem;
  animation: spin90 1.6s ease-in-out infinite;
}
@keyframes spin90 {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(90deg); }
  100% { transform: rotate(90deg); }
}
.rotate-text {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: #a08040;
  line-height: 1.5;
}
.rotate-text strong { color: #c8a030; }
.rotate-fs-btn {
  margin-top: 8px;
  padding: 10px 28px;
  background: #1a1005;
  border: 1px solid #c8a030;
  color: #c8a030;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 2px;
}
