:root {
  --bg: #0D1622;
  --panel: #162436;
  --panel-hi: #1F324A;
  --ink: #EAF2FA;
  --muted: #8EA3B7;
  --gold: #F5B324;
  --red: #D2263A;
  --ok: #2E9E5B;
  --ok-hi: #38B86C;
  --blue: #1E5CA8;
  --blue-hi: #2C76CF;
  --purple: #7E45C4;
  --border: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(245, 179, 36, 0.45);
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; /* No vertical or horizontal page scrolling */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

/* Fullscreen Viewport & Main Game Container */
.game-viewport {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #090E17;
}

.game-box {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 2px 4px;
  padding-left: max(4px, env(safe-area-inset-left));
  padding-right: max(4px, env(safe-area-inset-right));
  padding-bottom: max(2px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
  gap: 2px;
  position: relative;
}

/* Top In-Game HUD */
.hud {
  width: 100%;
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 8px;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}
.hud-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hud-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hud-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: Bungee, Impact, sans-serif;
  font-size: 13px;
  color: #FF5C6C;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #0F1A28;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-weight: 800;
  font-size: 11.5px;
  color: var(--ink);
}
.stat b {
  font-family: Bungee, sans-serif;
  font-size: 12px;
  color: #fff;
}
.coin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,0.3);
}
.hp {
  width: 44px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.hp i {
  display: block;
  height: 100%;
  background: #FF4757;
  transition: width 0.2s;
}

/* Common Buttons */
.btn {
  font: 800 12px Nunito, system-ui, sans-serif;
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  color: #fff;
  background: var(--ok);
  box-shadow: 0 1.5px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s, background-color 0.12s;
  user-select: none;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.35);
}
.btn:disabled {
  background: #4B5A68;
  cursor: default;
  opacity: 0.65;
}
.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn.gold {
  background: var(--gold);
  color: #2A1B00;
}
.icon-btn {
  padding: 2px 6px;
  font-size: 12px;
  min-width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.start-btn {
  background: var(--ok);
  font-weight: 800;
  padding: 4px 11px;
  font-size: 12px;
}
.start-btn:not(:disabled):hover {
  background: var(--ok-hi);
}
.shop-btn {
  padding: 4px 10px;
  font-size: 12px;
}

/* Center Game Stage */
/* Center Game Stage */
.stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  background: #000;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* In-Stage Message Toast Banner */
.stage-msg {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 22, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
}
.stage-msg.bad {
  color: #FF666B;
  border-color: rgba(255, 102, 107, 0.5);
  background: rgba(40, 12, 18, 0.92);
}

/* Floating Bottom Dock (Floating Island Overlay) */
.dock {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: calc(100% - 16px);
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 8px 4px;
  background: rgba(11, 19, 32, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 25;
  transition: transform 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.15), opacity 0.22s ease;
}

.dock.collapsed {
  transform: translateX(-50%) translateY(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 22px;
}

.tab-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tab-btn {
  font: 800 11px Nunito, sans-serif;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  background: #0F1A28;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.12s;
}

.tab-btn[aria-selected="true"] {
  background: var(--blue-hi);
  color: #fff;
  border-color: #fff;
}

.dock-info {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.dock-info b {
  color: var(--gold);
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.erase-btn {
  padding: 2px 7px;
  font-size: 11px;
  border: 1px solid rgba(255, 100, 100, 0.35);
  color: #FF8585;
  background: rgba(255, 80, 80, 0.1);
  border-radius: 5px;
}

.dock-hide-btn {
  padding: 2px 7px;
  font-size: 11px;
  color: #94A3B8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s;
}
.dock-hide-btn:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.25);
}

/* Floating Collapsed Pill Trigger: Diposisikan di pojok kiri bawah (area spawn hero kolom 0-1 yang tidak bisa dibangun)
   sehingga tidak pernah menutupi petak permainan mana pun (kolom 2-19) */
.dock-pill-btn {
  position: absolute;
  bottom: max(6px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  transform: translateY(0);
  z-index: 24;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(15, 26, 40, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  font: 800 12px Nunito, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(56, 189, 248, 0.2);
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
  user-select: none;
}
.dock-pill-btn.visible {
  display: inline-flex;
  animation: popIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.dock-pill-btn:hover {
  background: rgba(27, 43, 64, 0.98);
  border-color: #38BDF8;
  transform: translateY(-2px);
}
.dock-pill-icon {
  font-size: 13px;
}
.dock-pill-badge {
  font-size: 10.5px;
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 800;
}

/* Horizontal Scrolling Item Tray */
.tray {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 1px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  width: 100%;
}
.tray::-webkit-scrollbar {
  height: 3px;
}
.tray::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Compact Arsenal & Terrain Cards */
.card {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 74px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  color: #fff;
  text-align: left;
  background: var(--blue);
  background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 8px 8px;
  font: 800 11px/1.1 Nunito, system-ui, sans-serif;
  transition: transform 0.1s, background-color 0.12s, border-color 0.12s;
  user-select: none;
}
.card.terrain {
  background: #1B583A;
}
.card.terrain[aria-pressed="true"] {
  background: #278054;
}
.card svg {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.card-name {
  font-weight: 800;
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.card .cost {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #FFE78A;
  white-space: nowrap;
}
.card .cost i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}
.card[aria-pressed="true"] {
  border-color: #fff;
  background-color: var(--blue-hi);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.card.poor {
  opacity: 0.55;
}
.card.locked {
  background: #3B4755;
  background-image: none;
  cursor: default;
  opacity: 0.65;
}
.card.locked .cost {
  color: #9FB2C6;
}
.card.new {
  animation: pop 0.5s ease 2;
}
@keyframes pop {
  50% { transform: translateY(-2px) scale(1.03); }
}

/* Modals & Dialogs */
.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 22, 0.78);
  padding: 10px;
  overflow: auto;
  backdrop-filter: blur(4px);
}
.overlay[hidden] {
  display: none;
}
.sheet {
  background: #1B3D6B;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  max-width: 440px;
  width: 100%;
  max-height: calc(100% - 16px);
  overflow: auto;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.sheet h2 {
  font-family: Bungee, Impact, sans-serif;
  font-size: 18px;
  margin: 0 0 6px;
}
.sheet p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.35;
}
.poster {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #F3E3C3;
  color: #3A2A1A;
  border-radius: 8px;
  padding: 6px;
  margin: 0 0 6px;
  border: 2px dashed #8B5A2B;
}
.brief-intel {
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.45);
  border-radius: 8px;
  padding: 7px 9px;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
}
.brief-intel ul {
  margin: 4px 0 0;
  padding-left: 16px;
}
.brief-intel li {
  margin: 1px 0;
}
.poster img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: #E8D2A6;
  border-radius: 6px;
}
.poster b {
  display: block;
  font-family: Bungee, Impact, sans-serif;
  font-size: 12px;
  margin-bottom: 1px;
}
.poster span {
  font-size: 11px;
  line-height: 1.2;
  display: block;
}

/* Shop Modal */
.shop-sheet {
  background: #14202E;
  color: #E4ECF4;
  border-radius: 12px;
  padding: 14px;
  max-width: 600px;
  width: 100%;
  max-height: calc(100% - 16px);
  overflow: auto;
  border: 2px solid var(--gold);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 16px 16px;
}
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.shop-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 16px;
  color: var(--gold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}
.shop-tab-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: 800 12px Nunito, sans-serif;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.shop-tab-btn[aria-selected="true"] {
  background: var(--blue);
  color: #fff;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 7px;
}
.shop-card {
  background: #1C2B3E;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-card.owned {
  border-color: var(--ok);
}
.shop-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.shop-card-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}
.shop-card-name {
  font-family: Bungee, sans-serif;
  font-size: 11.5px;
  color: #fff;
  line-height: 1.2;
}
.shop-card-desc {
  font-size: 11px;
  color: #9FB3C8;
  line-height: 1.25;
  flex: 1;
}
.shop-card-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.badge-owned {
  background: var(--ok);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
}

/* Portrait Orientation Prompt */
.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 16, 26, 0.94);
  color: #fff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 14px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.rotate-icon {
  font-size: 44px;
  animation: spin-phone 2.5s ease-in-out infinite;
}
@keyframes spin-phone {
  0% { transform: rotate(0deg); }
  30% { transform: rotate(-90deg); }
  75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
.rotate-sub {
  max-width: 320px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Responsive Rules */
/* Wajib landscape: perangkat sentuh posisi tegak ditutup layar putar (tanpa opsi lanjut tegak) */
@media (orientation: portrait) and (pointer: coarse), (orientation: portrait) and (max-width: 600px) {
  .rotate-hint {
    display: flex;
  }
}

@media (max-width: 680px), (orientation: landscape) and (max-height: 500px) {
  .logo-text { display: none; }
  .hud {
    gap: 3px;
    padding: 2px 4px;
    padding-left: max(6px, env(safe-area-inset-left));
    padding-right: max(6px, env(safe-area-inset-right));
  }
  .stat { padding: 2px 4px; font-size: 11px; }
  .btn { padding: 3px 8px; font-size: 11px; }
}

/* HP landscape: bar atas dirampingkan & baki mengambang ultra-compact */
@media (orientation: landscape) and (max-height: 500px) {
  .game-box {
    padding: 1px 3px;
    padding-left: max(4px, env(safe-area-inset-left));
    padding-right: max(4px, env(safe-area-inset-right));
    padding-bottom: max(2px, env(safe-area-inset-bottom));
    gap: 2px;
  }
  .hud { height: 28px; min-height: 28px; }
  .icon-btn { height: 23px; min-width: 23px; }
  .dock {
    bottom: 3px;
    padding: 2px 6px 3px;
    max-width: min(640px, calc(100% - 8px));
  }
  .dock-top { height: 20px; gap: 4px; }
  .tab-btn { padding: 1px 5px; font-size: 10px; }
  .dock-info { font-size: 10px; }
  .dock-actions .btn { padding: 1px 5px; font-size: 10px; }
  .tray { gap: 4px; padding: 1px 0; }
  .card {
    height: 32px;
    min-width: 66px;
    padding: 1px 5px;
    gap: 4px;
    font-size: 10px;
  }
  .card svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }
  .card-name { font-size: 10px; }
  .card .cost { font-size: 9.5px; }
  .dock-pill-btn {
    bottom: max(4px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    padding: 3px 10px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.new { animation: none; }
  .rotate-icon { animation: none; }
}

/* Enemy Intel Modal & Cards */
.intel-hud-btn {
  font: 800 11px Nunito, sans-serif;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38BDF8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.12s;
}
.intel-hud-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
}
.intel-sheet {
  background: #121A26;
  color: #E4ECF4;
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 680px;
  width: 95%;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  border: 2px solid #38BDF8;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75);
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
}
.intel-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 15px;
  color: #38BDF8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.intel-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.intel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.intel-nav-btns {
  display: flex;
  gap: 4px;
}
.intel-nav-btn {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.intel-badge {
  font-family: Nunito, sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.intel-badge.active {
  background: rgba(224, 72, 63, 0.25);
  border: 1px solid #E0483F;
  color: #FF7B72;
}
.intel-badge.next {
  background: rgba(43, 163, 154, 0.25);
  border: 1px solid #2BA39A;
  color: #5EEAD4;
}
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 2px;
}
.intel-card {
  background: #1A2636;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.intel-card.boss-card {
  border-color: #F59E0B;
  background: linear-gradient(145deg, #241D2B, #1B2433);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.intel-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.intel-avatar-box {
  width: 44px;
  height: 44px;
  background: #111A24;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.intel-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.intel-head-text {
  flex: 1;
  min-width: 0;
}
.intel-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.intel-name {
  font-family: Bungee, Impact, sans-serif;
  font-size: 12.5px;
  color: #fff;
}
.intel-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}
.intel-tag.boss {
  background: #EF4444;
  color: #fff;
  letter-spacing: 0.5px;
}
.intel-tag.pct {
  background: rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
}
.intel-role {
  font-size: 10.5px;
  color: #38BDF8;
  font-weight: 800;
}
.intel-stats-mini {
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: #94A3B8;
  margin-top: 2px;
}
.intel-stats-mini b {
  color: #E2E8F0;
}
.intel-desc {
  font-size: 11px;
  line-height: 1.25;
  color: #CBD5E1;
}
.intel-tactic-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 3px solid #38BDF8;
}
.boss-card .intel-tactic-box {
  border-left-color: #F59E0B;
}
.tactic-label {
  color: #FFE27A;
}
.intel-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Weapon Placement Confirmation Dialog */
.confirm-dialog {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: 90%;
  max-width: 360px;
  pointer-events: auto;
  animation: popIn 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.confirm-card {
  background: rgba(18, 26, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.confirm-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 13px;
  color: #FFE27A;
  letter-spacing: 0.3px;
}
.confirm-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.confirm-close:hover {
  color: #fff;
}
.confirm-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.confirm-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}
.confirm-badge.cost {
  background: rgba(245, 195, 59, 0.2);
  color: #FDE047;
  border: 1px solid rgba(245, 195, 59, 0.4);
}
.confirm-badge.coord {
  background: rgba(148, 163, 184, 0.2);
  color: #E2E8F0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.confirm-badge.radius {
  background: rgba(56, 189, 248, 0.2);
  color: #7DD3FC;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.confirm-note {
  font-size: 10.5px;
  color: #94A3B8;
  line-height: 1.25;
}
.confirm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #E2E8F0;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.confirm-checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
  cursor: pointer;
}
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}
.confirm-actions .btn {
  padding: 5px 12px;
  font-size: 12px;
}
.place-mode-btn {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}
.place-mode-btn.active {
  background: rgba(245, 195, 59, 0.2);
  color: var(--gold);
  border-color: var(--gold);
}

/* Debug & Sandbox Modal */
.debug-overlay {
  z-index: 120;
}
.debug-sheet {
  background: #0E1624;
  color: #E2E8F0;
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 640px;
  width: 95%;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  border: 2px solid #8B5CF6;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
  background-image: linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.debug-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(139, 92, 246, 0.25);
  padding-bottom: 6px;
}
.debug-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.debug-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 15px;
  color: #C4B5FD;
  margin: 0;
}
.debug-subtitle {
  font-size: 10.5px;
  color: #94A3B8;
}
.debug-close-btn {
  font-size: 16px;
  padding: 2px 8px;
  line-height: 1;
}
.debug-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.debug-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.debug-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.debug-section-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 12px;
  color: #FDE047;
}
.debug-count-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}
.debug-label {
  font-size: 11px;
  color: #CBD5E1;
}
.debug-count-btns {
  display: flex;
  gap: 3px;
}
.debug-count-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.debug-count-btn.active {
  background: #8B5CF6;
  border-color: #A78BFA;
  color: #fff;
}
.debug-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}
.debug-hero-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  color: #fff;
  transition: all 0.15s;
}
.debug-hero-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8B5CF6;
  transform: translateY(-1px);
}
.debug-hero-btn:active {
  transform: scale(0.97);
}
.debug-hero-btn.boss {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
}
.debug-hero-btn.boss:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: #F59E0B;
}
.debug-hero-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.debug-hero-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.debug-hero-name {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #F1F5F9;
}
.debug-hero-sub {
  font-size: 9.5px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debug-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 6px;
}
.debug-btn {
  font-size: 11px;
  padding: 5px 8px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
}
.debug-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
}
.debug-btn.bad {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}
.debug-btn.bad:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #EF4444;
}
.debug-btn.active {
  background: #3B82F6;
  border-color: #60A5FA;
  color: #fff;
}
.debug-wave-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.debug-wave-btn {
  flex: 1 1 calc(10% - 5px);
  min-width: 48px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7DD3FC;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
.debug-wave-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38BDF8;
  color: #fff;
}
.debug-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.debug-hint {
  font-size: 10px;
  color: #94A3B8;
}
.debug-hud-btn {
  color: #C4B5FD !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
  background: rgba(139, 92, 246, 0.15) !important;
}


/* ===== Menu Utama ===== */
[hidden] { display: none !important; }

.menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background:
    repeating-linear-gradient(0deg, rgba(191, 227, 255, 0.04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(191, 227, 255, 0.04) 0 1px, transparent 1px 32px),
    linear-gradient(160deg, rgba(10, 25, 48, 0.95), rgba(5, 10, 20, 0.97));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.menu-card {
  position: relative;
  display: flex;
  width: min(890px, 96vw);
  height: min(440px, 94vh);
  background: linear-gradient(145deg, #0B132B 0%, #152238 50%, #0D162A 100%);
  border-radius: 22px;
  border: 2px solid #F59E0B;
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 45px rgba(245, 158, 11, 0.25);
  overflow: hidden;
  animation: menuIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.menu-card::before, .menu-card::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid #FACC15;
  pointer-events: none;
  z-index: 10;
}
.menu-card::before { top: 8px; left: 8px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.menu-card::after { bottom: 8px; right: 8px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

@keyframes menuIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Sisi Kiri: Karya Seni Heroik SVG */
.menu-hero-side {
  flex: 0 0 46%;
  position: relative;
  background: radial-gradient(circle at 50% 30%, rgba(37, 99, 235, 0.5) 0%, rgba(15, 23, 42, 0.95) 75%);
  border-right: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.menu-hero-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sisi Kanan: Pusat Tindakan & Tombol */
.menu-actions-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px 10px 16px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-head {
  margin-bottom: 3px;
}
.menu-game-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 29px;
  line-height: 1;
  background: linear-gradient(180deg, #FFFBEB 0%, #FDE047 35%, #F59E0B 75%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2.5px 0 #78350F) drop-shadow(0 5px 12px rgba(0,0,0,0.6));
  letter-spacing: 0.5px;
  margin: 0;
}
.menu-subtitle {
  font-size: 11px;
  line-height: 1.35;
  color: #94A3B8;
  font-weight: 700;
  margin: 2px 0 0;
}

.menu-body-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0;
}

/* Tombol Utama Utama (Hero CTA) */
.btn-hero-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 13px;
  background: linear-gradient(180deg, #22C55E 0%, #16A34A 55%, #15803D 100%);
  border: none;
  border-top: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 0 #14532D, 0 8px 18px rgba(22, 163, 74, 0.45);
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  overflow: hidden;
  text-decoration: none;
}
.btn-hero-play::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}
.btn-hero-play:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 5.5px 0 #14532D, 0 10px 22px rgba(22, 163, 74, 0.6);
}
.btn-hero-play:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #14532D, 0 3px 8px rgba(22, 163, 74, 0.3);
}

.btn-hero-play.continue {
  background: linear-gradient(180deg, #EAB308 0%, #CA8A04 55%, #A16207 100%);
  box-shadow: 0 4px 0 #713F12, 0 8px 18px rgba(202, 138, 4, 0.45);
}
.btn-hero-play.continue:hover {
  box-shadow: 0 5.5px 0 #713F12, 0 10px 22px rgba(202, 138, 4, 0.6);
}
.btn-hero-play.continue:active {
  box-shadow: 0 1px 0 #713F12, 0 3px 8px rgba(202, 138, 4, 0.3);
}

.btn-hero-play-main {
  display: flex;
  align-items: center;
  gap: 11px;
}
.btn-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 14px;
}
.btn-hero-text {
  text-align: left;
}
.btn-hero-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-shadow: 0 1.5px 3px rgba(0,0,0,0.4);
}
.btn-hero-sub {
  font-size: 10px;
  font-weight: 800;
  color: #DCFCE7;
  opacity: 0.92;
}
.btn-hero-play.continue .btn-hero-sub {
  color: #FEF08A;
}
.btn-hero-arrow {
  font-size: 18px;
  font-weight: 900;
  opacity: 0.85;
}

/* Grid Mode Permainan (2 Kolom) */
.modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.mode-card-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.mode-card-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
  pointer-events: none;
}
.mode-card-btn.raja {
  background: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%);
  border-color: rgba(232, 121, 249, 0.4);
  box-shadow: 0 3px 0 #581C87, 0 4px 12px rgba(124, 58, 237, 0.35);
}
.mode-card-btn.raja:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4.5px 0 #581C87, 0 6px 16px rgba(124, 58, 237, 0.5);
}
.mode-card-btn.arch {
  background: linear-gradient(135deg, #0284C7 0%, #0D9488 100%);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 3px 0 #075985, 0 4px 12px rgba(2, 132, 199, 0.35);
}
.mode-card-btn.arch:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4.5px 0 #075985, 0 6px 16px rgba(2, 132, 199, 0.5);
}
.mode-card-btn:active {
  transform: translateY(1.5px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.mode-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.mode-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mode-card-title {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mode-card-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  white-space: nowrap;
}
.mode-badge-new {
  background: #FACC15;
  color: #3A2A00;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* Tombol Fort Khusus (Benteng PvP) */
.fort-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.fort-pill-btn {
  background: linear-gradient(135deg, #1E3A8A 0%, #4338CA 100%);
  border: 1.5px solid #60A5FA;
  border-radius: 9px;
  padding: 6px 10px;
  color: #EFF6FF;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.fort-pill-btn:hover {
  background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
  border-color: #93C5FD;
}

/* Baris Tutorial & Latihan (Ringkas & Bersih) */
.tutorials-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.tut-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 7px 10px;
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tut-pill-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(250, 204, 21, 0.6);
  color: #fff;
}
.tut-pill-btn.suggest {
  border-color: #FACC15;
  color: #FEF08A;
  background: rgba(120, 80, 10, 0.4);
  box-shadow: 0 0 0 1px #FACC15;
  animation: suggestPulse 1.8s ease-in-out infinite;
}

.menu-badge {
  background: #FDE047;
  color: #3A2A00;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 5px;
}

/* Footer Menu */
.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #64748B;
  font-weight: 700;
  gap: 6px;
}
.menu-footer-guard {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94A3B8;
  white-space: nowrap;
}
.menu-footer-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #CBD5E1;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.footer-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #FDE047;
  color: #fff;
}
.footer-btn.ios {
  background: rgba(30, 58, 138, 0.85);
  border-color: #60A5FA;
  color: #DBEAFE;
}

/* Animasi Rotasi Roda Gigi SVG */
@keyframes spinCw { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spinCcw { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
.gear-anim-cw { transform-box: fill-box; transform-origin: center; animation: spinCw 24s linear infinite; }
.gear-anim-ccw { transform-box: fill-box; transform-origin: center; animation: spinCcw 32s linear infinite; }

@keyframes suggestPulse {
  0%, 100% { box-shadow: 0 0 0 1px #FACC15, 0 0 0 0 rgba(253, 224, 71, 0.55); }
  50% { box-shadow: 0 0 0 1px #FACC15, 0 0 0 6px rgba(253, 224, 71, 0); }
}

/* Adaptasi Layar Kecil / Lanskap HP */
@media (max-height: 480px), (max-width: 720px) {
  .menu-card { width: min(840px, 98vw); height: min(390px, 96vh); }
  .menu-hero-side { flex-basis: 40%; }
  .menu-actions-side { padding: 10px 14px 8px 12px; }
  .menu-game-title { font-size: 22px; }
  .menu-subtitle { font-size: 9.5px; }
  .btn-hero-play { padding: 7px 12px; border-radius: 10px; }
  .btn-hero-icon { width: 24px; height: 24px; font-size: 11px; }
  .btn-hero-title { font-size: 13.5px; }
  .btn-hero-sub { font-size: 8.5px; }
  .mode-card-btn { padding: 5px 8px; border-radius: 9px; gap: 6px; }
  .mode-card-icon { font-size: 17px; }
  .mode-card-title { font-size: 11.5px; }
  .mode-card-sub { font-size: 8.5px; }
  .tut-pill-btn { padding: 4px 6px; font-size: 9.5px; border-radius: 8px; }
  .menu-badge { font-size: 8px; padding: 1px 4px; margin-left: 3px; }
  .menu-footer-guard { display: none; }
  .menu-footer { justify-content: center; }
  .footer-btn { padding: 2px 5px; font-size: 9px; }
}

@media (max-width: 520px) {
  .menu-hero-side { display: none; }
}

/* ===== Tutorial Interaktif ===== */
.tut-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
}
.tut-block {
  position: fixed;
  background: rgba(6, 10, 20, 0.62);
  pointer-events: auto;
}
.tut-block.clear {
  background: transparent;
  pointer-events: none;
}
.tut-shield {
  position: fixed;
  pointer-events: auto;
}
.tut-ring {
  position: fixed;
  border: 3px solid #FDE047;
  border-radius: 9px;
  pointer-events: none;
  animation: tutRing 1.1s ease-in-out infinite;
}
@keyframes tutRing {
  0%, 100% { box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.35), 0 0 16px rgba(253, 224, 71, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(253, 224, 71, 0.12), 0 0 26px rgba(253, 224, 71, 0.85); }
}
.tut-hand {
  position: fixed;
  font-size: 28px;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
  animation: tutHand 0.9s ease-in-out infinite;
}
@keyframes tutHand { 50% { transform: translateY(8px); } }
.tut-coach {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(540px, 94vw);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #F7F1E3;
  color: #2A2118;
  border: 3px solid #1E1A24;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.tut-coach.at-top { top: 44px; }
.tut-coach.at-bottom { bottom: 12px; }
.tut-coach.at-center { top: 50%; transform: translate(-50%, -50%); }
.tut-coach.at-corner { top: 44px; width: min(420px, 90vw); opacity: 0.96; }
.tut-coach.pop { animation: tutPop 0.28s ease-out; }
.tut-coach.at-center.pop { animation: tutPopCenter 0.28s ease-out; }
@keyframes tutPop { from { transform: translateX(-50%) scale(0.94); } to { transform: translateX(-50%) scale(1); } }
@keyframes tutPopCenter { from { transform: translate(-50%, -50%) scale(0.94); } to { transform: translate(-50%, -50%) scale(1); } }
.tut-face {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #FFE3A3;
  border: 2px solid #1E1A24;
  object-fit: contain;
  padding: 2px;
}
.tut-bulb {
  position: absolute;
  left: 50px;
  top: -12px;
  font-size: 20px;
  display: none;
  animation: logoFloat 1.4s ease-in-out infinite;
}
.tut-coach.idea .tut-bulb { display: block; }
.tut-body { flex: 1; min-width: 0; }
.tut-name {
  font-family: Bungee, Impact, sans-serif;
  font-size: 12px;
  color: #1C4E8A;
  margin-bottom: 2px;
}
.tut-prog {
  font-family: Nunito, sans-serif;
  font-weight: 800;
  font-size: 11px;
  color: #8A7A66;
  margin-left: 4px;
}
.tut-text { font-size: 14px; line-height: 1.4; }
.tut-text b { color: #B45309; }
.tut-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.tut-skip {
  background: none;
  border: 0;
  padding: 0;
  font: 700 12px Nunito, sans-serif;
  color: #7A6A56;
  text-decoration: underline;
  cursor: pointer;
}
.tut-btns { display: flex; gap: 6px; margin-left: auto; }
.tut-btn { font-size: 13px; padding: 6px 12px; }
.tut-btn.ghost { background: #3B4F68; color: #fff; }

@media (max-height: 500px) {
  .tut-coach { padding: 6px 9px; gap: 8px; border-width: 2px; }
  .tut-coach.at-top, .tut-coach.at-corner { top: 38px; }
  .tut-face { flex-basis: 42px; width: 42px; height: 42px; }
  .tut-text { font-size: 12.5px; line-height: 1.3; }
  .tut-actions { margin-top: 5px; }
  .tut-hand { font-size: 22px; }
}

/* ===== Tutorial Mode Raja Theme ===== */
.tut-coach.raja {
  background: linear-gradient(145deg, #1E1738 0%, #2A1B4E 60%, #17112B 100%);
  color: #F1F5F9;
  border: 2.5px solid #FFD24A;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 210, 74, 0.25);
}
.tut-coach.raja .tut-face {
  background: #2D1E4E;
  border-color: #FFD24A;
}
.tut-coach.raja .tut-name {
  color: #FFD24A;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.tut-coach.raja .tut-prog {
  background: rgba(255, 210, 74, 0.2);
  color: #FDE68A;
  border: 1px solid rgba(255, 210, 74, 0.4);
  padding: 1px 6px;
  border-radius: 999px;
}
.tut-coach.raja .tut-text b {
  color: #FDE047;
}
.tut-coach.raja .tut-skip {
  color: #CBD5E1;
}
.tut-coach.raja .tut-skip:hover {
  color: #FFD24A;
}
.tut-coach.raja .tut-btn {
  background: linear-gradient(135deg, #EAB308, #CA8A04);
  color: #1F1300;
  font-weight: 800;
  border-color: #FEF08A;
}
.tut-coach.raja .tut-btn:hover {
  background: linear-gradient(135deg, #FACC15, #EAB308);
}
.tut-coach.raja .tut-btn.ghost {
  background: rgba(88, 28, 135, 0.75);
  color: #F3E8FF;
  border-color: rgba(216, 180, 254, 0.4);
}
.tut-coach.raja .tut-btn.ghost:hover {
  background: rgba(107, 33, 168, 0.9);
  color: #fff;
}

.menu-btn.tutorial.raja {
  background: linear-gradient(135deg, #6D28D9, #92400E) !important;
  border-color: rgba(253, 224, 71, 0.45);
}
.menu-btn.tutorial.raja:hover {
  background: linear-gradient(135deg, #7C3AED, #B45309) !important;
  border-color: #FDE047;
}
.menu-btn.tutorial.raja.suggest {
  box-shadow: 0 0 0 2px #FDE047, 0 4px 14px rgba(253, 224, 71, 0.35);
}

.rj-tut-btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rj-tut-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Tombol musik: dicoret saat mati */
.music-btn { position: relative; }
.music-btn.off { opacity: .55; }
.music-btn.off::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 50%;
  height: 2px; background: #FF6B6B; transform: rotate(-35deg); border-radius: 2px;
}
.menu-foot { flex-wrap: wrap; gap: 6px; }

/* ================= MODE RAJA ================= */
.menu-btn.raja { background: linear-gradient(135deg, #7C3AED, #B45309) !important; }
.menu-badge.new { background: #FFD24A; }
.rj-hud-title { display: none; font-family: Bungee, Impact, sans-serif; font-size: 13px; color: #FFD24A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
body.raja-mode .rj-hud-title { display: inline-block; }
body.raja-mode #startBtn, body.raja-mode #shopBtn, body.raja-mode #intelBtn, body.raja-mode .wave-stat,
body.raja-mode:not(.duel-mek) .gold-stat, body.raja-mode:not(.duel-mek) #dock, body.raja-mode:not(.duel-mek) .dock, body.raja-mode:not(.duel-mek) #dockPillBtn,
body.raja-mode #lotExpand, body.raja-mode .lot-expand { display: none !important; }
body.raja-mode canvas { cursor: default; }

.raja-ui { position: absolute; inset: 0; pointer-events: none; z-index: 20; font-family: system-ui, sans-serif; color: #fff; }
.raja-ui[hidden] { display: none; }
.raja-ui button { pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.raja-ui kbd { font: 700 9px/1 system-ui, sans-serif; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 1px 3px; }
.raja-ui.rj-touch kbd { display: none; }

.rj-top { position: absolute; top: 6px; left: 8px; right: 8px; display: flex; align-items: flex-start; gap: 8px; }
.rj-stat, .rj-crown { background: rgba(14,20,34,.72); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rj-stat #rjLives { color: #FF6B6B; letter-spacing: 1px; }
.rj-timer { color: #BAE6FD; font-variant-numeric: tabular-nums; }
.rj-crown { flex-direction: column; align-items: stretch; gap: 3px; min-width: 76px; }
.rj-crown b { color: #FFD24A; }
.rj-crown span { height: 5px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; }
.rj-crown i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #F59E0B, #FFD24A); }
.rj-cards { display: flex; gap: 5px; margin: 0 auto; }
.rj-card { position: relative; width: 50px; height: 54px; padding: 0; border-radius: 9px; border: 2px solid #FFD24A; background: rgba(40,24,70,.82); cursor: pointer; overflow: hidden; }
.rj-card img { width: 40px; height: 40px; display: block; margin: 1px auto 0; }
.rj-card .rj-cost { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 10px; font-weight: 800; color: #FFD24A; text-shadow: 0 1px 0 #000; }
.rj-card kbd { position: absolute; top: 2px; left: 2px; }
.rj-card.poor { filter: grayscale(.85) brightness(.7); border-color: #64748B; }
.rj-card:active { transform: scale(.94); }
.rj-log-btn { background: rgba(14,20,34,.72); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; font-size: 12px; font-weight: 700; padding: 5px 9px; cursor: pointer; }

.rj-log { position: absolute; top: 66px; right: 8px; width: 220px; max-height: calc(100% - 150px); overflow: auto; pointer-events: auto;
  background: rgba(14,20,34,.86); border: 1px solid rgba(255,210,74,.4); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; line-height: 1.35; }
.rj-log[hidden] { display: none; }
.rj-log-h { font-family: Bungee, Impact, sans-serif; color: #FFD24A; font-size: 12px; margin-bottom: 4px; }
.rj-log-stats { display: flex; gap: 8px; color: #CBD5E1; }
.rj-log-stats b, .rj-log-known b { color: #fff; }
.rj-log-known { margin: 3px 0; color: #FDE68A; }
.rj-log-sub { margin-top: 6px; color: #94A3B8; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.rj-log-row { display: grid; grid-template-columns: 78px 1fr 18px; gap: 5px; align-items: center; margin-top: 3px; }
.rj-log-row i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #EF4444, #F97316); }
.rj-log-row b { text-align: right; }
.rj-log-feed { color: #E2E8F0; margin-top: 2px; font-size: 10.5px; }
.rj-log-empty { color: #94A3B8; margin-top: 4px; }

.rj-skills { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: flex-end; gap: 6px; }
.rj-sk { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(30,41,59,.78); color: #fff; font-size: 20px; padding: 0; cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.rj-sk span { position: relative; z-index: 2; line-height: 1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; transition: filter 0.16s ease, opacity 0.16s ease; }
.rj-sk span svg { width: 68%; height: 68%; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); pointer-events: none; }
.rj-sk kbd { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); z-index: 4; transition: opacity 0.15s ease; }
.rj-sk .rj-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(15,23,42,.75) 0%, rgba(2,6,23,.92) 100%); z-index: 3; pointer-events: none; border-top: 1.5px solid rgba(56,189,248,.65); box-shadow: 0 0 8px rgba(56,189,248,.35); }
.rj-sk .rj-cd-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: Bungee, Impact, system-ui, sans-serif; font-size: 20px; font-weight: 800; color: #FFFFFF; text-shadow: 0 2px 4px #000, 0 0 10px rgba(0,0,0,.95), 0 0 16px rgba(254,240,138,.6); letter-spacing: -0.5px; z-index: 5; pointer-events: none; opacity: 0; transform: scale(0.85); transition: opacity 0.15s ease, transform 0.15s ease; }
.rj-sk.cooling { border-color: rgba(148,163,184,.35) !important; }
.rj-sk.cooling span { filter: grayscale(0.85) brightness(0.38); opacity: 0.45; }
.rj-sk.cooling kbd { opacity: 0.2; }
.rj-sk.cooling .rj-cd-num { opacity: 1; transform: scale(1); }
.rj-sk.just-ready { animation: rjSkillReady 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes rjSkillReady {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,215,0,.95), inset 0 0 0 2px #FFFFFF; border-color: #FFFFFF; }
  35% { transform: scale(1.18); box-shadow: 0 0 24px 6px rgba(255,215,0,.9), inset 0 0 14px rgba(255,255,255,.95); border-color: #FEF08A; }
  100% { transform: scale(1); box-shadow: 0 4px 14px rgba(0,0,0,.55); }
}
.rj-sk:active { transform: scale(.92); }
.rj-sk.noaim { opacity: .55; }
.rj-ult { border-color: #FFD24A; }
.rj-ult .rj-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, rgba(245,158,11,.75), rgba(255,210,74,.45)); z-index: 1; }
.rj-ult.ready { animation: rjReady 1s ease-in-out infinite; }
@keyframes rjReady { 0%,100% { box-shadow: 0 0 0 0 rgba(255,210,74,.7); } 50% { box-shadow: 0 0 0 8px rgba(255,210,74,0); } }
.rj-jump { display: none !important; }
.rj-pad { display: none; }

/* Kontrol sentuh: pad kiri, tombol besar kanan */
.raja-ui.rj-touch .rj-pad { display: block; position: absolute; left: 0; bottom: 0; width: 44%; height: 72%; pointer-events: auto; touch-action: none; }
.rj-base { position: absolute; left: 14px; bottom: 14px; width: 110px; height: 110px; border-radius: 50%; opacity: .22; transition: opacity .15s;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0 40%, rgba(255,255,255,.16) 41% 100%); border: 2px solid rgba(255,255,255,.45); }
.rj-pad.active .rj-base { opacity: .9; transition: none; bottom: auto; }
.rj-knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255,255,255,.55); border: 2px solid rgba(255,255,255,.85); pointer-events: none; }
.rj-base::before, .rj-base::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent; }
.rj-base::before { left: 6px; border-right: 8px solid rgba(255,255,255,.6); border-left-width: 0; }
.rj-base::after { right: 6px; border-left: 8px solid rgba(255,255,255,.6); border-right-width: 0; }

/* Klaster tombol aksi kanan: tata letak lengkung ergonomis */
.raja-ui.rj-touch .rj-skills {
  display: grid;
  grid-template-columns: 64px 64px 82px;
  grid-template-rows: 64px 82px;
  gap: 8px;
  align-items: center;
  justify-items: center;
  right: 14px;
  bottom: 12px;
  opacity: 1;
}
.raja-ui.rj-touch .rj-sk {
  opacity: 0.95;
  border-width: 2.5px;
  border-color: rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 35% 30%, rgba(55, 65, 81, 0.92) 0%, rgba(17, 24, 39, 0.96) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.25);
  transition: transform 0.08s ease, filter 0.08s ease;
}
.raja-ui.rj-touch .rj-sk::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: auto;
}
.raja-ui.rj-touch .rj-sk:active {
  transform: scale(0.92);
  filter: brightness(1.2);
}
.raja-ui.rj-touch .rj-sk.rj-s2 {
  grid-column: 1;
  grid-row: 1;
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.raja-ui.rj-touch .rj-sk.rj-s1 {
  grid-column: 2;
  grid-row: 1;
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.raja-ui.rj-touch .rj-sk.rj-ult {
  grid-column: 3;
  grid-row: 1;
  width: 60px;
  height: 60px;
  font-size: 26px;
  border-color: #FFD24A;
  background: radial-gradient(circle at 38% 32%, #B45309 0%, #78350F 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(245, 158, 11, 0.45);
}
.raja-ui.rj-touch .rj-sk.rj-s0 {
  grid-column: 2;
  grid-row: 2;
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.raja-ui.rj-touch .rj-cd-num {
  font-size: 24px;
}
.raja-ui.rj-touch .rj-jump {
  display: flex !important;
  grid-column: 3;
  grid-row: 2;
  width: 82px;
  height: 82px;
  font-size: 36px;
  background: radial-gradient(circle at 38% 32%, #22C55E 0%, #15803D 100%);
  border-color: #BBF7D0;
  border-width: 3px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(34, 197, 94, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}
.raja-ui.rj-touch .rj-jump:active {
  transform: scale(0.92);
  background: radial-gradient(circle at 38% 32%, #16A34A 0%, #14532D 100%);
}
.rj-card img { transform: scale(1.35) translateY(6%); }
.sheet.rj-sheet { max-width: 580px; }

/* Layar pilih tahap */
.rj-beta { font-size: 11px; background: #FFD24A; color: #3A2A00; border-radius: 999px; padding: 2px 7px; vertical-align: middle; font-family: system-ui, sans-serif; }
.rj-help { margin: 4px 0 10px; padding-left: 18px; font-size: 12px; line-height: 1.45; }
.rj-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.rj-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; background: linear-gradient(135deg, #6D28D9, #92400E); text-align: left; }
.rj-stage span { font-size: 11px; font-weight: 600; opacity: .9; }
.rj-stage.locked { background: #334155; opacity: .6; cursor: not-allowed; }
.rj-end-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; font-size: 12.5px; margin: 6px 0 8px; }
.rj-end-cause { color: #FCA5A5; }

/* HP landscape pendek */
@media (orientation: landscape) and (max-height: 500px) {
  .rj-top { top: 4px; left: 6px; right: 6px; gap: 5px; }
  .rj-stat, .rj-crown { font-size: 10.5px; padding: 3px 6px; }
  .rj-crown { min-width: 60px; }
  .rj-card { width: 40px; height: 44px; border-radius: 7px; }
  .rj-card img { width: 32px; height: 32px; }
  .rj-card .rj-cost { font-size: 9px; }
  .rj-log-btn span { display: none; }
  .rj-log { top: 52px; width: 190px; max-height: calc(100% - 64px); font-size: 10.5px; }
  .raja-ui.rj-touch .rj-skills {
    grid-template-columns: 58px 58px 78px;
    grid-template-rows: 58px 78px;
    gap: 7px;
    right: 10px;
    bottom: 8px;
  }
  .raja-ui.rj-touch .rj-sk.rj-s2,
  .raja-ui.rj-touch .rj-sk.rj-s1,
  .raja-ui.rj-touch .rj-sk.rj-s0 {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }
  .raja-ui.rj-touch .rj-sk.rj-ult {
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
  .raja-ui.rj-touch .rj-jump {
    width: 78px;
    height: 78px;
    font-size: 34px;
  }
  .rj-base { width: 96px; height: 96px; left: 10px; bottom: 8px; }
  .rj-knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .sheet.rj-sheet { padding: 10px 14px; }
  .sheet.rj-sheet p, .rj-help { font-size: 11.5px; }
}

body.raja-mode .stage-msg { top: 66px; }
@media (orientation: landscape) and (max-height: 500px) { body.raja-mode .stage-msg { top: 52px; font-size: 10px; } }

/* ================= MODE RAJA MVP 2 ================= */
.menu-fort { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-fort[hidden] { display: none; }
.menu-btn.fort { background: linear-gradient(135deg, #1D4ED8, #7C3AED) !important; font-size: 14px; padding: 8px 10px; }

.rj-orders { display: flex; gap: 3px; }
.rj-ord { position: relative; width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(14,20,34,.72); color: #fff; font-size: 16px; padding: 0; cursor: pointer; }
.rj-ord.on { border-color: #FFD24A; background: rgba(120,80,10,.8); box-shadow: 0 0 0 2px rgba(255,210,74,.35); }
.rj-ord kbd { position: absolute; bottom: -3px; right: -3px; }

.rj-coach { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); max-width: min(560px, 80%); pointer-events: auto;
  background: rgba(30,27,75,.93); border: 2px solid #FFD24A; border-radius: 12px; padding: 7px 10px 7px 12px; font-size: 13px; line-height: 1.35;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: rjCoachIn .35s ease-out; }
.rj-coach[hidden] { display: none; }
.rj-coach-n { background: #FFD24A; color: #3A2A00; font-weight: 800; font-size: 11px; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.rj-coach-skip { margin-left: auto; background: transparent; color: #CBD5E1; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; font-size: 11px; padding: 3px 7px; cursor: pointer; white-space: nowrap; }
@keyframes rjCoachIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.rj-replay { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(220,38,38,.85); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 1px; border-radius: 999px; padding: 4px 12px; animation: rjBlink 1.2s ease-in-out infinite; }
.rj-replay[hidden] { display: none; }
@keyframes rjBlink { 50% { opacity: .55; } }
.raja-ui.rj-replaying .rj-skills, .raja-ui.rj-replaying .rj-pad, .raja-ui.rj-replaying .rj-cards, .raja-ui.rj-replaying .rj-orders { opacity: .35; pointer-events: none; }

.rj-sk.armed { border-color: #FFD24A; box-shadow: 0 0 0 3px rgba(255,210,74,.45); }
.raja-ui.rj-touch .rj-s2 { grid-column: 1; grid-row: 2; }
.raja-ui.rj-touch .rj-s1 { grid-column: 2; grid-row: 2; }
.raja-ui.rj-touch .rj-s0 { grid-column: 3; grid-row: 2; }

/* Layar pilih: skill & kode */
.rj-sub-h { font-family: Bungee, Impact, sans-serif; font-size: 12px; color: #FFD24A; margin: 8px 0 5px; }
.rj-sub-h span { font-family: system-ui, sans-serif; color: #E2E8F0; font-size: 11px; font-weight: 600; margin-left: 6px; }
.rj-skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rj-skill-chip { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(15,23,42,.6); color: #E2E8F0; border: 1.5px solid rgba(255,255,255,.25); border-radius: 9px; padding: 6px 8px; font-size: 11.5px; cursor: pointer; text-align: left; }
.rj-skill-chip span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; background: rgba(30,41,59,.75); border-radius: 6px; border: 1px solid rgba(255,255,255,.18); padding: 2px; }
.rj-skill-chip span svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.rj-skill-chip b { font-weight: 700; flex: 1; }
.rj-skill-chip.on { border-color: #FFD24A; background: rgba(120,80,10,.55); color: #fff; }
.rj-skill-chip.on span { border-color: #FFD24A; background: rgba(245,158,11,.25); }
.rj-skill-chip i { position: absolute; top: -6px; right: -5px; background: #FFD24A; color: #3A2A00; font-style: normal; font-weight: 800; font-size: 10px; border-radius: 999px; padding: 1px 5px; }
.rj-stages { grid-template-columns: repeat(5, 1fr) !important; }
.rj-stage em { font-style: normal; color: #FFD24A; font-size: 12px; letter-spacing: 1px; }
.rj-stage.need3, #rjCodePlay.need3 { opacity: .5; }
.rj-code-row { display: flex; gap: 6px; }
.rj-code-in { flex: 1; min-width: 0; background: rgba(15,23,42,.7); color: #fff; border: 1.5px solid rgba(255,255,255,.3); border-radius: 8px; padding: 7px 9px; font: 12px ui-monospace, monospace; }
.rj-code-in.bad { border-color: #F87171; }
.rj-code { width: 100%; box-sizing: border-box; background: rgba(15,23,42,.7); color: #FDE68A; border: 1.5px solid rgba(255,255,255,.3); border-radius: 8px; padding: 8px; font: 12px/1.4 ui-monospace, monospace; resize: none; word-break: break-all; }
.rj-end-stars { font-size: 30px; color: #FFD24A; letter-spacing: 4px; text-shadow: 0 2px 0 rgba(0,0,0,.4); margin: 2px 0 4px; }
.rj-end-goals { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: #94A3B8; margin-bottom: 6px; }
.rj-end-goals .on { color: #FDE68A; }
.rj-end-btns { display: flex; gap: 8px; flex-wrap: wrap; }

@media (orientation: landscape) and (max-height: 500px) {
  .rj-ord { width: 30px; height: 30px; font-size: 14px; }
  .rj-coach { top: 54px; font-size: 11.5px; padding: 5px 8px; }
  .rj-skill-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .rj-skill-chip { padding: 4px 6px; font-size: 10.5px; gap: 6px; }
  .rj-skill-chip span { width: 22px; height: 22px; padding: 1px; }
  .raja-ui.rj-touch .rj-cd-num { font-size: 21px; }
  .rj-stage { padding: 6px 7px; }
  .rj-stage b { font-size: 12px; }
  .rj-stage span { font-size: 10px; }
  .menu-btn.fort { font-size: 12px; padding: 6px 8px; }
}
@media (max-width: 760px) {
  .rj-cards { gap: 3px; }
}

body.rj-coaching .stage-msg { display: none !important; }

/* ================= DUNIA LEBAR, KAMERA & ARSITEK PVP ================= */
.mini-map { position: absolute; left: 8px; top: 8px; width: 200px; height: 30px; z-index: 18; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.55); box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; touch-action: none; }
.mini-map[hidden] { display: none; }
body.raja-mode .mini-map { left: 50%; top: auto; bottom: 8px; transform: translateX(-50%); width: 220px; }
.cam-edge { position: absolute; top: 40%; z-index: 18; width: 34px; height: 58px; border: 1.5px solid rgba(255,255,255,.45); background: rgba(14,20,34,.55); color: #fff; font-size: 18px; cursor: pointer; touch-action: none; }
.cam-edge.left { left: 4px; border-radius: 0 10px 10px 0; }
.cam-edge.right { right: 4px; border-radius: 10px 0 0 10px; }
.cam-edge[hidden] { display: none; }

.arch-btn, .arch-league { display: none !important; }
body.arch-mode .arch-btn { display: inline-flex !important; }
body.arch-mode .arch-league { display: inline-block !important; font-weight: 800; font-size: 12px; color: #FDE68A; background: rgba(14,20,34,.6); border: 1px solid rgba(255,210,74,.4); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
body.arch-mode #startBtn, body.arch-mode #shopBtn, body.arch-mode #intelBtn, body.arch-mode .wave-stat { display: none !important; }
#archPubBtn.ok { box-shadow: 0 0 0 2px #4ADE80; }

.menu-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-btn.arch { background: linear-gradient(135deg, #0F766E, #1D4ED8) !important; }

.rj-leagues { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rj-league { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; background: linear-gradient(135deg, #1E3A8A, #6D28D9); text-align: left; }
.rj-league span { font-size: 13px; font-weight: 800; color: #FDE68A; }
.rj-league em { font-style: normal; font-size: 11px; opacity: .85; }
.rj-wide-bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.15); overflow: hidden; }
.rj-wide-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22C55E, #FACC15); }

.rj-shop { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow: auto; }
.rj-shop-row { display: grid; grid-template-columns: 34px 1fr 30px 28px 26px 28px; align-items: center; gap: 6px; background: rgba(15,23,42,.55); border-radius: 8px; padding: 3px 6px; }
.rj-shop-row img { width: 34px; height: 34px; transform: scale(1.3); }
.rj-shop-name { display: flex; flex-direction: column; min-width: 0; }
.rj-shop-name b { font-size: 12.5px; }
.rj-shop-name span { font-size: 10.5px; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rj-shop-row em { font-style: normal; font-weight: 800; color: #FDE68A; font-size: 12px; }
.rj-qty { width: 28px; height: 28px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.4); background: rgba(30,41,59,.9); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; padding: 0; }
.rj-n { text-align: center; font-size: 14px; }
.rj-shop-total { display: flex; justify-content: space-between; margin: 6px 2px 0; font-size: 13px; }
.rj-shop-total b.bad { color: #F87171; }
.rj-end-ok { color: #4ADE80; font-weight: 700; }
.rj-end-army { color: #CBD5E1; }
.raja-ui.rj-army .rj-crown { min-width: 92px; }

@media (orientation: landscape) and (max-height: 500px) {
  .mini-map { width: 150px; height: 24px; left: 6px; top: 6px; }
  body.raja-mode .mini-map { width: 160px; bottom: 4px; }
  .cam-edge { width: 28px; height: 46px; font-size: 15px; }
  body.arch-mode .arch-league { font-size: 10.5px; padding: 2px 6px; }
  .rj-leagues { gap: 6px; }
  .rj-league { padding: 7px; }
  .rj-shop { max-height: 36vh; }
  .rj-shop-row { grid-template-columns: 28px 1fr 26px 26px 22px 26px; padding: 2px 5px; }
  .rj-shop-row img { width: 28px; height: 28px; }
  .rj-shop-name span { display: none; }
  .rj-qty { width: 26px; height: 26px; }
}

.rj-replay { top: 66px; bottom: auto; }
@media (orientation: landscape) and (max-height: 500px) { .rj-replay { top: 52px; font-size: 10.5px; } }

/* ---------- Tombol perluas lapak (menempel di sisi kiri lapak) & tombol geser ---------- */
.lot-expand { position: absolute; left: 0; top: 0; z-index: 17; display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; will-change: transform; }
.lot-expand[hidden] { display: none; }
.lot-add { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 9px 6px; min-width: 84px;
  border: 2px dashed #FDE68A; border-radius: 12px; background: rgba(120,72,10,.82); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); animation: lotPulse 2.2s ease-in-out infinite; }
.lot-add i { font-style: normal; font-size: 22px; line-height: 1; color: #FDE68A; font-weight: 900; }
.lot-add b { font-size: 12px; white-space: nowrap; }
.lot-add span { font-size: 10.5px; color: #FDE68A; white-space: nowrap; }
.lot-add:hover { background: rgba(150,92,14,.92); }
.lot-add.poor { filter: grayscale(.7); animation: none; }
.lot-add:disabled { filter: grayscale(1); opacity: .6; animation: none; cursor: default; }
.lot-sub { pointer-events: auto; width: 34px; height: 26px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.5); background: rgba(14,20,34,.75); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
.lot-sub[hidden] { display: none; }
.lot-min {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(14, 20, 34, 0.78);
  color: #CBD5E1;
  font: 700 10.5px Nunito, sans-serif;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.lot-min:hover { color: #fff; background: rgba(14, 20, 34, 0.95); border-color: #fff; }
.lot-expand.collapsed .lot-add, .lot-expand.collapsed .lot-sub { display: none !important; }
.lot-expand.collapsed .lot-min {
  background: rgba(120, 72, 10, 0.92);
  border: 1.5px dashed #FDE68A;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #FDE68A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.lot-expand.collapsed .lot-min::after { content: " ＋ Lapak"; }
@keyframes lotPulse { 0%,100% { box-shadow: 0 4px 14px rgba(0,0,0,.45), 0 0 0 0 rgba(253,230,138,.55); } 50% { box-shadow: 0 4px 14px rgba(0,0,0,.45), 0 0 0 8px rgba(253,230,138,0); } }

.pan-btn { position: absolute; left: 8px; top: 46px; z-index: 18; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 54px; height: 54px; border-radius: 14px; border: 2px solid rgba(255,255,255,.7); background: rgba(14,20,34,.82); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.45); touch-action: none; }
.pan-btn span { font-size: 10px; font-weight: 800; letter-spacing: .3px; }
.pan-btn[hidden] { display: none; }
.pan-btn.on { background: #F59E0B; border-color: #FEF3C7; color: #1F1300; box-shadow: 0 0 0 4px rgba(245,158,11,.35), 0 4px 12px rgba(0,0,0,.45); }
body.panning #cv { cursor: grab; }
body.grabbing #cv { cursor: grabbing; }
body.panning .cam-edge { display: none; }

@media (orientation: landscape) and (max-height: 500px) {
  .lot-add { min-width: 70px; padding: 5px 7px 4px; }
  .lot-add i { font-size: 18px; }
  .lot-add b { font-size: 10.5px; }
  .lot-add span { font-size: 9.5px; }
  .pan-btn { top: 36px; left: 6px; width: 46px; height: 46px; font-size: 20px; border-radius: 12px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  body:not(.raja-mode) .mini-map { top: 32px; }
  .pan-btn { top: 62px; }
}

/* ---------- Regu pasukan (6 dari 13) ---------- */
.rj-troop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 5px; }
.rj-troop-chip { position: relative; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 5px; align-items: center; text-align: left;
  background: rgba(15,23,42,.6); color: #E2E8F0; border: 1.5px solid rgba(255,255,255,.25); border-radius: 9px; padding: 4px 6px; cursor: pointer; }
.rj-troop-chip img { grid-row: 1 / 3; width: 26px; height: 26px; transform: scale(1.35); }
.rj-troop-chip b { font-size: 10.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rj-troop-chip span { font-size: 10px; color: #FDE68A; }
.rj-troop-chip.on { border-color: #FFD24A; background: rgba(120,80,10,.55); color: #fff; }
.rj-troop-chip i { position: absolute; top: -6px; right: -5px; background: #FFD24A; color: #3A2A00; font-style: normal; font-weight: 800; font-size: 10px; border-radius: 999px; padding: 1px 5px; }
.rj-shop-row.on { background: rgba(120,80,10,.45); }
.rj-shop-total b.full { color: #FDE68A; }
@media (orientation: landscape) and (max-height: 500px) {
  .rj-troop-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; }
  .rj-troop-chip { padding: 3px 5px; }
  .rj-troop-chip b { font-size: 9.5px; }
}

/* ---------- Gelembung info (tahan tombol skill / kartu pasukan) ---------- */
.rj-info { position: absolute; z-index: 30; width: 230px; pointer-events: none; background: rgba(15,12,40,.95); border: 2px solid #FFD24A; border-radius: 12px;
  padding: 8px 10px; color: #E2E8F0; font-size: 11.5px; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,.55); animation: rjInfoIn .18s ease-out; }
.rj-info[hidden] { display: none; }
.rj-info-h { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.rj-info-h b { font-family: Bungee, Impact, sans-serif; font-size: 13px; color: #FFD24A; font-weight: 400; }
.rj-info-h i, .rj-info-h img { width: 28px; height: 28px; flex: 0 0 28px; display: flex; }
.rj-info-h i svg { width: 28px; height: 28px; }
.rj-info-h img { transform: scale(1.3); }
.rj-info p { margin: 0 0 5px; }
.rj-info span { display: block; font-size: 10.5px; color: #FDE68A; }
@keyframes rjInfoIn { from { opacity: 0; transform: translateY(4px) scale(.96); } to { opacity: 1; transform: none; } }
@media (orientation: landscape) and (max-height: 500px) {
  .rj-info { width: 200px; font-size: 10.5px; padding: 6px 8px; }
}

/* ---------- Panduan Layar Penuh iOS / iPhone ---------- */
#iosFsModal {
  z-index: 400;
}
.ios-fs-sheet {
  max-width: 440px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1.5px solid rgba(254, 224, 71, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(234, 179, 8, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
}
.ios-fs-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
}
.ios-fs-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #F1F5F9;
  line-height: 1.45;
}
.ios-fs-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FACC15;
  color: #0F172A;
  font-weight: 800;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ios-fs-icon {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 2px;
}
.ios-pwa-btn {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.8) 0%, rgba(67, 56, 202, 0.8) 100%) !important;
  border: 1.5px solid #60A5FA !important;
  font-size: 11.5px !important;
  padding: 6px 10px !important;
  margin-top: 3px !important;
  color: #EFF6FF !important;
}


/* =================== MENU UTAMA (adegan penuh layar) =================== */
.menu.mn { padding: 0; display: block; overflow: hidden; background: #081430; backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu.mn[hidden] { display: none; }
.mn-scene { position: absolute; inset: 0; }
.mn-scene-svg { width: 100%; height: 100%; display: block; }
.mn-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,10,28,.82) 0%, rgba(6,10,28,.62) 32%, rgba(6,10,28,.18) 52%, rgba(6,10,28,0) 64%),
              radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.45), transparent 60%); }

.mn-ui { position: absolute; top: 0; bottom: 0; left: max(18px, 4.5vw); width: min(560px, 48vw);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(8px, 2.6vh, 20px); }

/* Logo */
.mn-logo { width: 100%; max-width: 540px; }
.mn-logo-svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); }
.mn-logo-tilt { transform-origin: 320px 100px; animation: mnLogoFloat 5s ease-in-out infinite; }
.mn-lamp { animation: mnLamp 1.1s steps(1) infinite; }
.mn-lamp.b { animation-delay: .55s; }

/* Tombol utama: bentuk miring bersudut, bukan kotak */
.mn-main { display: flex; flex-direction: column; gap: clamp(6px, 1.6vh, 12px); align-items: flex-start; }
.mn-play { position: relative; isolation: isolate; display: flex; align-items: center; gap: clamp(8px, 1.6vw, 14px);
  width: min(100%, 470px); height: clamp(50px, 14vh, 80px); padding: 0 clamp(18px, 3vw, 34px) 0 clamp(8px, 1.2vw, 12px);
  border: 0; background: none; color: #fff; cursor: pointer; text-align: left;
  filter: drop-shadow(0 5px 0 #052E16) drop-shadow(0 12px 20px rgba(0,0,0,.45));
  transition: transform .15s ease, filter .15s ease; }
.mn-play::before, .mn-play::after { content: ""; position: absolute; z-index: -2;
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.mn-play::before { inset: 0; background: #052E16; }
.mn-play::after { inset: 3px; z-index: -1; background: linear-gradient(180deg, #86EFAC 0%, #22C55E 38%, #16A34A 70%, #166534 100%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35); }
.mn-play-ico { flex: 0 0 auto; width: clamp(36px, 10vh, 58px); height: clamp(36px, 10vh, 58px); animation: mnPulse 2.2s ease-in-out infinite; }
.mn-play-ico svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.mn-play-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.mn-play-txt b { font-family: Bungee, Impact, sans-serif; font-weight: 400; font-size: clamp(18px, 5.4vh, 32px); letter-spacing: .5px;
  text-shadow: 0 3px 0 rgba(5,46,22,.8); }
.mn-play-txt small { font: 800 clamp(10px, 2.6vh, 14px) Nunito, system-ui, sans-serif; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-shine { position: absolute; inset: 3px; z-index: -1; pointer-events: none; overflow: hidden;
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.mn-shine::before { content: ""; position: absolute; top: -20%; bottom: -20%; width: 28%; left: -40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg); animation: mnShine 3.4s ease-in-out infinite; }
.mn-play:hover { transform: translateY(-2px) scale(1.015); }
.mn-play:active { transform: translateY(3px); filter: drop-shadow(0 2px 0 #052E16) drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.mn-play.cont { filter: drop-shadow(0 5px 0 #431407) drop-shadow(0 12px 20px rgba(0,0,0,.45)); }
.mn-play.cont::before { background: #431407; }
.mn-play.cont::after { background: linear-gradient(180deg, #FED7AA 0%, #FB923C 38%, #EA580C 70%, #9A3412 100%); }
.mn-play.cont .mn-play-txt b { text-shadow: 0 3px 0 rgba(67,20,7,.8); }
.mn-play.alt { width: min(78%, 360px); height: clamp(38px, 10vh, 56px); }
.mn-play.alt .mn-play-ico { width: clamp(28px, 7.5vh, 42px); height: clamp(28px, 7.5vh, 42px); animation: none; }
.mn-play.alt .mn-play-txt b { font-size: clamp(14px, 4vh, 22px); }
.mn-play.alt .mn-play-txt small { display: none; }

/* Medali mode: cakram bulat berbingkai emas + pita label */
.mn-medals { display: flex; gap: clamp(6px, 1.6vw, 18px); flex-wrap: nowrap; }
.mn-medal { --c1: #A855F7; --c2: #6B21A8; --rib: #581C87; position: relative; display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: #fff; width: clamp(66px, 11vw, 112px); }
.mn-medal[data-tone="arch"] { --c1: #2DD4BF; --c2: #0F766E; --rib: #115E59; }
.mn-medal[data-tone="tut"] { --c1: #60A5FA; --c2: #1D4ED8; --rib: #1E3A8A; }
.mn-medal[data-tone="tutraja"] { --c1: #FBBF24; --c2: #B45309; --rib: #92400E; }
.mn-disc { position: relative; z-index: 1; display: grid; place-items: center; width: clamp(42px, 12.5vh, 78px); height: clamp(42px, 12.5vh, 78px); border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.55), transparent 42%), radial-gradient(circle at 50% 60%, var(--c1), var(--c2));
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), 0 0 0 3px #1E1A24, 0 0 0 6px #FACC15, 0 0 0 8.5px #1E1A24, 0 8px 14px rgba(0,0,0,.45);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
.mn-disc svg { width: 64%; height: 64%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }
.mn-rib { position: relative; z-index: 2; margin-top: -9px; padding: 3px 13px 4px; background: var(--rib); color: #fff; white-space: nowrap;
  font: 800 clamp(9.5px, 2.4vh, 13px) Nunito, system-ui, sans-serif; letter-spacing: .2px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%, 7px 50%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.2); }
.mn-tag { position: absolute; z-index: 3; top: -4px; right: 2px; font: 800 9px Nunito, system-ui, sans-serif; font-style: normal; letter-spacing: .5px;
  background: #EF4444; color: #fff; border: 2px solid #1E1A24; border-radius: 999px; padding: 1px 6px; animation: mnBadge 1.6s ease-in-out infinite; }
.mn-tag[hidden] { display: none; }
.mn-medal:hover .mn-disc { transform: translateY(-4px) rotate(-8deg) scale(1.07); box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), 0 0 0 3px #1E1A24, 0 0 0 6px #FDE68A, 0 0 0 8.5px #1E1A24, 0 0 22px var(--c1), 0 10px 16px rgba(0,0,0,.45); }
.mn-medal:active .mn-disc { transform: translateY(2px) scale(.96); }
.mn-medal.suggest .mn-disc { animation: mnSuggest 1.8s ease-in-out infinite; }

.mn-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mn-chips[hidden], .mn-chip[hidden] { display: none; }
.mn-chip { font: 800 clamp(10.5px, 2.6vh, 13px) Nunito, system-ui, sans-serif; color: #fff; cursor: pointer; padding: 6px 13px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.5); background: rgba(30,27,75,.75); backdrop-filter: blur(3px); align-self: flex-start; }
.mn-chip:hover { background: rgba(67,56,202,.85); }
.mn-chip.gold { background: linear-gradient(180deg, #FBBF24, #D97706); color: #1F1300; border-color: #1E1A24; }

/* Tombol bulat pojok kanan atas: suara, musik, tips iPhone */
.mn-corner { position: absolute; top: max(12px, 2.4vh); right: max(12px, 1.6vw); display: flex; gap: 8px; }
.mn-round { width: clamp(34px, 9vh, 46px); height: clamp(34px, 9vh, 46px); border-radius: 50%; padding: 7px; cursor: pointer;
  background: rgba(8,14,34,.6); border: 2px solid rgba(255,255,255,.5); backdrop-filter: blur(4px); transition: transform .15s; }
.mn-round[hidden] { display: none; }
.mn-round:hover { transform: scale(1.08); }
.mn-round svg { width: 100%; height: 100%; display: block; }
.mn-round .mn-slash { display: none; }
.mn-round.off .mn-slash { display: inline; }
.mn-round.off .mn-wave { display: none; }
.mn-round.off { opacity: .7; }

/* Animasi masuk */
.menu.mn:not([hidden]) .mn-logo { animation: mnDrop .75s cubic-bezier(.2,1.5,.4,1) both; }
.menu.mn:not([hidden]) .mn-main > * { animation: mnSlide .55s cubic-bezier(.2,1.2,.4,1) both; animation-delay: .18s; }
.menu.mn:not([hidden]) .mn-medal { animation: mnPop .5s cubic-bezier(.3,1.7,.5,1) both; }
.menu.mn:not([hidden]) .mn-medal:nth-child(1) { animation-delay: .32s; }
.menu.mn:not([hidden]) .mn-medal:nth-child(2) { animation-delay: .4s; }
.menu.mn:not([hidden]) .mn-medal:nth-child(3) { animation-delay: .48s; }
.menu.mn:not([hidden]) .mn-medal:nth-child(4) { animation-delay: .56s; }

/* ---- Animasi adegan ---- */
.mn-stars circle { animation: mnTwinkle 3.2s ease-in-out infinite; }
.mn-sun { animation: mnSunPulse 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mn-cloud { animation: mnDrift 40s linear infinite; }
.mn-cloud.c2 { animation-duration: 55s; animation-delay: -20s; }
.mn-cloud.c3 { animation-duration: 48s; animation-delay: -35s; }
.mn-gear { transform-box: fill-box; transform-origin: center; animation: mnSpin 16s linear infinite; }
.mn-gear.small { animation-duration: 9s; animation-direction: reverse; }
.mn-flag { transform-box: fill-box; transform-origin: left center; animation: mnFlag 1.4s ease-in-out infinite alternate; }
.mn-flame { transform-box: fill-box; transform-origin: 50% 90%; animation: mnFlicker .28s ease-in-out infinite alternate; }
.mn-flame.b { animation-delay: -.14s; }
.mn-coin { animation: mnCoin 1.6s ease-in-out infinite; }

.mn-mech { animation: mnBob 2.8s ease-in-out infinite; }
.mn-head { animation: mnHead 7s ease-in-out infinite; }
.mn-arm { animation: mnArm 7s ease-in-out infinite; }
.mn-plan { animation: mnPlan 2.4s ease-in-out infinite; }
.mn-eyes { transform-box: fill-box; transform-origin: center; animation: mnBlink 4.6s infinite; }
.mn-stache { transform-box: fill-box; transform-origin: center; animation: mnStache 3.5s ease-in-out infinite; }
.mn-brows { animation: mnBrows 7s ease-in-out infinite; }
.mn-bulb { opacity: 0; animation: mnBulb 7s ease-in-out infinite; }

.mn-march { animation: mnMarch 12s linear infinite; }
.mn-hero-body { animation: mnStep .36s ease-in-out infinite alternate; }
.mn-leg { transform-box: fill-box; transform-origin: top center; animation: mnLeg .36s ease-in-out infinite alternate; }
.mn-leg.b { animation-direction: alternate-reverse; }
.mn-spring { transform-box: fill-box; transform-origin: bottom center; animation: mnSpring 4s linear infinite; }
.mn-boing { opacity: 0; animation: mnBoing 4s linear infinite; }

@keyframes mnLogoFloat { 0%, 100% { transform: rotate(-2.5deg) translateY(0); } 50% { transform: rotate(-1.5deg) translateY(-4px); } }
@keyframes mnLamp { 0% { fill: #FDE68A; } 50% { fill: #F97316; } }
@keyframes mnPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes mnShine { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }
@keyframes mnBadge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes mnSuggest { 0%, 100% { box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), 0 0 0 3px #1E1A24, 0 0 0 6px #FACC15, 0 0 0 8.5px #1E1A24, 0 0 0 8.5px rgba(250,204,21,.6); }
  50% { box-shadow: inset 0 -5px 0 rgba(0,0,0,.28), 0 0 0 3px #1E1A24, 0 0 0 6px #FACC15, 0 0 0 8.5px #1E1A24, 0 0 0 18px rgba(250,204,21,0); } }
@keyframes mnDrop { from { opacity: 0; transform: translateY(-40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes mnSlide { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes mnPop { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes mnTwinkle { 0%, 100% { opacity: .9; } 50% { opacity: .2; } }
@keyframes mnSunPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes mnDrift { from { transform: translateX(-300px); } to { transform: translateX(1700px); } }
@keyframes mnSpin { to { transform: rotate(360deg); } }
@keyframes mnFlag { from { transform: skewY(-3deg) scaleX(.96); } to { transform: skewY(4deg) scaleX(1.02); } }
@keyframes mnFlicker { from { transform: scale(.85, 1.05); opacity: .85; } to { transform: scale(1.1, .92); opacity: 1; } }
@keyframes mnCoin { 0%, 100% { transform: translate(690px, 760px) scaleX(1); } 50% { transform: translate(690px, 748px) scaleX(.3); } }
@keyframes mnBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
/* Kepala: menatap pahlawan (menoleh ke kiri atas) lalu menunduk membaca blueprint */
@keyframes mnHead { 0%, 40% { transform: rotate(-7deg); } 48%, 70% { transform: rotate(11deg) translateY(4px); } 78%, 100% { transform: rotate(-7deg); } }
@keyframes mnArm { 0%, 6% { transform: rotate(0); } 10% { transform: rotate(-10deg); } 14% { transform: rotate(4deg); } 18% { transform: rotate(-8deg); } 22%, 40% { transform: rotate(0); }
  48%, 70% { transform: rotate(24deg); } 78%, 100% { transform: rotate(0); } }
@keyframes mnPlan { 0%, 100% { transform: rotate(0) skewY(0); } 50% { transform: rotate(-1.5deg) skewY(1.2deg); } }
@keyframes mnBlink { 0%, 44%, 48%, 92%, 96%, 100% { transform: scaleY(1); } 46%, 94% { transform: scaleY(.1); } }
@keyframes mnStache { 0%, 100% { transform: rotate(0) scaleX(1); } 45% { transform: rotate(-3deg) scaleX(1.04); } 55% { transform: rotate(3deg) scaleX(1.04); } }
@keyframes mnBrows { 0%, 40% { transform: translateY(0); } 48%, 70% { transform: translateY(4px); } 72% { transform: translateY(-5px); } 80%, 100% { transform: translateY(0); } }
@keyframes mnBulb { 0%, 70% { opacity: 0; transform: translate(70px, -310px) scale(.4); } 74% { opacity: 1; transform: translate(70px, -338px) scale(1.15); }
  78%, 88% { opacity: 1; transform: translate(70px, -330px) scale(1); } 94%, 100% { opacity: 0; transform: translate(70px, -350px) scale(.8); } }
/* Pahlawan berjalan ke menara (x 1000), terlontar pegas, lalu kembali dari kiri */
@keyframes mnMarch {
  0% { transform: translate(-160px, 0); opacity: 0; }
  3% { opacity: 1; }
  72% { transform: translate(1082px, 0) rotate(0); }
  75% { transform: translate(1098px, 10px) rotate(0); }
  86% { transform: translate(840px, -520px) rotate(-340deg); opacity: 1; }
  87%, 100% { transform: translate(780px, -600px) rotate(-360deg); opacity: 0; } }
@keyframes mnStep { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes mnLeg { from { transform: rotate(18deg); } to { transform: rotate(-18deg); } }
@keyframes mnSpring { 0%, 14% { transform: scaleY(1); } 18% { transform: scaleY(.45); } 22% { transform: scaleY(1.35); } 28%, 100% { transform: scaleY(1); } }
@keyframes mnBoing { 0%, 17% { opacity: 0; transform: translateY(20px) scale(.6); } 21% { opacity: 1; transform: translateY(0) scale(1.15); } 32% { opacity: 1; transform: translateY(-10px) scale(1); } 38%, 100% { opacity: 0; transform: translateY(-20px) scale(1); } }

/* HP landscape: lebih rapat */
@media (orientation: landscape) and (max-height: 500px) {
  .mn-ui { left: max(12px, 3vw); width: min(420px, 54vw); gap: 8px; }
  .mn-logo { max-width: 390px; }
  .mn-medal { width: clamp(58px, 12vw, 84px); }
  .mn-rib { padding: 2px 9px 3px; }
  .mn-corner { top: 8px; right: 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu.mn *, .menu.mn *::before { animation: none !important; transition: none !important; }
  .mn-bulb, .mn-boing { opacity: 0; }
}

/* Raja di adegan menu: jubah berkibar, pedang diacungkan, teriak SERBU! */
.mn-king { animation: mnKBob 2.4s ease-in-out infinite; }
.mn-cape { animation: mnCape 1.3s ease-in-out infinite alternate; }
.mn-karm { animation: mnKArm 4s ease-in-out infinite; }
.mn-khead { animation: mnKHead 4s ease-in-out infinite; }
.mn-keyes { transform-box: fill-box; transform-origin: center; animation: mnBlink 5.2s infinite; animation-delay: -1.3s; }
.mn-glint { transform-box: fill-box; transform-origin: center; animation: mnGlint 2.2s ease-in-out infinite; }
.mn-glint.b { animation-delay: -1.1s; }
.mn-shout { opacity: 0; animation: mnShout 4s ease-in-out infinite; }
.mn-vs { animation: mnVs 2.6s ease-in-out infinite; }
@keyframes mnKBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes mnCape { from { transform: skewX(-5deg) scaleX(.97); } to { transform: skewX(6deg) scaleX(1.04); } }
@keyframes mnKArm { 0%, 20% { transform: rotate(0); } 30% { transform: rotate(-28deg); } 36% { transform: rotate(-20deg); } 42% { transform: rotate(-30deg); } 58%, 100% { transform: rotate(0); } }
@keyframes mnKHead { 0%, 20% { transform: rotate(0); } 30%, 50% { transform: rotate(-8deg); } 60%, 100% { transform: rotate(0); } }
@keyframes mnGlint { 0%, 60%, 100% { opacity: 0; transform: scale(.3); } 75% { opacity: 1; transform: scale(1.2); } }
@keyframes mnShout { 0%, 24% { opacity: 0; transform: translate(78px, -290px) scale(.5); } 30% { opacity: 1; transform: translate(78px, -304px) scale(1.1); }
  34%, 52% { opacity: 1; transform: translate(78px, -300px) scale(1); } 60%, 100% { opacity: 0; transform: translate(78px, -312px) scale(.9); } }
@keyframes mnVs { 0%, 100% { transform: translate(357px, 66px) rotate(-4deg) scale(1); } 50% { transform: translate(357px, 66px) rotate(4deg) scale(1.08); } }

/* ================= MODAL PILIHAN TUTORIAL ================= */
.tut-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 22, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px;
  animation: tutFadeIn 0.2s ease-out;
}
.tut-modal-overlay[hidden] {
  display: none !important;
}
.tut-sheet {
  position: relative;
  background: linear-gradient(165deg, #101B36 0%, #080E20 100%);
  border: 2px solid #38BDF8;
  box-shadow: 0 0 0 1px #050A18, 0 16px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: clamp(12px, 3vh, 18px) clamp(14px, 3vw, 22px);
  width: 100%;
  max-width: min(600px, 94vw);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 14px);
  animation: tutPopIn 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.tut-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}
.tut-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tut-title {
  font-family: Bungee, Impact, sans-serif;
  font-size: clamp(15px, 3.6vh, 20px);
  color: #FDE047;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
  margin: 0;
}
.tut-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #CBD5E1;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.tut-close:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: #EF4444;
  color: #fff;
  transform: scale(1.06);
}
.tut-lead {
  font-size: clamp(11px, 2.2vh, 12.5px);
  color: #94A3B8;
  margin: 0;
  line-height: 1.35;
}
.tut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2.4vw, 16px);
}
.tut-card {
  position: relative;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: clamp(10px, 2.4vh, 14px) clamp(10px, 2vw, 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.4, 1), border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.tut-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}
.tut-card:active {
  transform: translateY(1px) scale(0.98);
}
.tut-card.mek {
  --glow: rgba(56, 189, 248, 0.4);
}
.tut-card.mek:hover {
  border-color: #38BDF8;
  box-shadow: 0 0 18px var(--glow), 0 10px 24px rgba(0, 0, 0, 0.6);
}
.tut-card.raja {
  --glow: rgba(245, 158, 11, 0.4);
}
.tut-card.raja:hover {
  border-color: #F59E0B;
  box-shadow: 0 0 18px var(--glow), 0 10px 24px rgba(0, 0, 0, 0.6);
}
.tut-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 800 9px Nunito, system-ui, sans-serif;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.tut-card-badge.done {
  background: #065F46;
  color: #6EE7B7;
  border: 1px solid #10B981;
}
.tut-card-badge.new {
  background: #DC2626;
  color: #fff;
  border: 1px solid #F87171;
  animation: mnBadge 1.6s ease-in-out infinite;
}
.tut-card-art {
  width: clamp(48px, 11vh, 60px);
  height: clamp(48px, 11vh, 60px);
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}
.tut-card-art svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}
.tut-role {
  font: 800 9.5px Nunito, system-ui, sans-serif;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.tut-card.mek .tut-role {
  background: rgba(14, 165, 233, 0.22);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.tut-card.raja .tut-role {
  background: rgba(245, 158, 11, 0.22);
  color: #FDE047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.tut-name {
  font-family: Bungee, Impact, sans-serif;
  font-size: clamp(13px, 2.7vh, 16px);
  color: #fff;
  letter-spacing: 0.3px;
  margin: 2px 0;
}
.tut-desc {
  font-size: clamp(10.5px, 2.1vh, 11.5px);
  line-height: 1.35;
  color: #CBD5E1;
  margin: 0;
}
.tut-play-pill {
  margin-top: 4px;
  font: 800 clamp(10px, 2.2vh, 11.5px) Nunito, system-ui, sans-serif;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.tut-card.mek .tut-play-pill {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border: 1.5px solid #38BDF8;
}
.tut-card.raja .tut-play-pill {
  background: linear-gradient(135deg, #7C3AED, #92400E);
  border: 1.5px solid #F59E0B;
}
.tut-card:hover .tut-play-pill {
  transform: scale(1.05);
}
@keyframes tutFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes tutPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tut-sheet { padding: 10px 14px; gap: 8px; }
  .tut-card { padding: 6px 10px; gap: 3px; }
  .tut-card-art { width: 40px; height: 40px; }
  .tut-desc { font-size: 10px; }
}

/* ================= ONLINE PVP (Fase A: Serbu Benteng) ================= */
.sheet.ol-sheet { max-width: 620px; max-height: calc(100vh - 24px); overflow: auto; }
.ol-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.ol-prof { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(15,23,42,.55); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 6px 10px; margin: 2px 0 10px; font-size: 13px; }
.ol-prof .ol-rt { color: #FDE68A; }
.ol-mini { background: rgba(30,41,59,.9); color: #E2E8F0; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; font-size: 11.5px; font-weight: 700; padding: 4px 8px; cursor: pointer; }
.ol-prof .ol-mini { margin-left: auto; }
.ol-mini:hover { border-color: #FFD24A; color: #fff; }
.ol-warn { color: #FCA5A5; font-size: 12.5px; }
.ol-msg { min-height: 16px; font-size: 12px; color: #FDE68A; margin: 6px 0 0; }
.ol-load { color: #94A3B8; font-size: 12.5px; text-align: center; padding: 10px 0; }
.ol-in { font: 700 13px Nunito, system-ui, sans-serif; letter-spacing: .3px; }

.ol-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ol-mode { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; color: #fff; cursor: pointer;
  border: 2px solid rgba(255,255,255,.22); border-radius: 16px; padding: 14px 14px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .12s, box-shadow .12s; }
.ol-mode:hover { transform: translateY(-2px); }
.ol-mode:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.ol-mode b { font: 400 17px Bungee, Impact, sans-serif; letter-spacing: .5px; }
.ol-mode small { font-size: 11.5px; line-height: 1.35; opacity: .9; }
.ol-mode-ico { font-size: 34px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.ol-async { background: linear-gradient(145deg, #B45309, #7C2D12 60%, #4C1D95); border-color: #FBBF24; }
.ol-live { background: linear-gradient(145deg, #1E3A8A, #312E81); opacity: .72; }
.ol-mode::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.ol-soon { font: 800 9px Nunito, system-ui, sans-serif; font-style: normal; background: #FFD24A; color: #3A2A00; border-radius: 999px; padding: 2px 6px; vertical-align: middle; letter-spacing: .5px; }

.ol-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.ol-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; color: #fff; cursor: pointer; border: 2px solid rgba(255,255,255,.22); border-radius: 14px; padding: 12px 6px 10px; box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .12s; }
.ol-tile:hover { transform: translateY(-2px); }
.ol-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.ol-tile span { font-size: 30px; line-height: 1.1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.ol-tile b { font: 400 12.5px Bungee, Impact, sans-serif; }
.ol-tile small { font-size: 10.5px; line-height: 1.25; opacity: .85; }
.t-build { background: linear-gradient(160deg, #0E7490, #1E3A8A); }
.t-browse { background: linear-gradient(160deg, #B45309, #7C2D12); border-color: #FBBF24; }
.t-mine { background: linear-gradient(160deg, #15803D, #14532D); }
.t-top { background: linear-gradient(160deg, #7C3AED, #4C1D95); }
.ol-badge { position: absolute; top: -7px; right: -5px; min-width: 20px; height: 20px; border-radius: 999px; background: #EF4444; color: #fff; font: 800 11px/20px Nunito, system-ui, sans-serif; font-style: normal; box-shadow: 0 0 0 2px #fff; animation: olPulse 1.4s ease-in-out infinite; }
.ol-badge[hidden] { display: none; }
@keyframes olPulse { 50% { transform: scale(1.15); } }

.ol-filters { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ol-filters > div { display: flex; gap: 4px; }
.ol-chip { background: rgba(15,23,42,.6); color: #CBD5E1; border: 1.5px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.ol-chip.on { background: #FFD24A; border-color: #FFD24A; color: #3A2A00; }

.ol-list { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.ol-row { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 8px; background: rgba(15,23,42,.6); border: 1.5px solid rgba(255,255,255,.1); border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.ol-row:hover { border-color: rgba(255,210,74,.6); }
.ol-row-main { min-width: 0; display: flex; flex-direction: column; }
.ol-row-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-row-main span { font-size: 11px; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-lg { font-style: normal; font-size: 22px; text-align: center; }
.ol-rt { font-style: normal; font-weight: 800; font-size: 12px; color: #FDE68A; white-space: nowrap; }
.ol-go { padding: 6px 12px; font-size: 13px; }
.ol-t { font: 800 9px Nunito, system-ui, sans-serif; font-style: normal; letter-spacing: .4px; border-radius: 999px; padding: 1px 6px; vertical-align: middle; background: rgba(148,163,184,.3); color: #E2E8F0; }
.ol-t.mine { background: #2563EB; color: #fff; }
.ol-t.won { background: #16A34A; color: #fff; }
.ol-t.try { background: #92400E; color: #FDE68A; }
.ol-t.new { background: #EF4444; color: #fff; }

.ol-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 6px; }
.ol-stats span { background: rgba(15,23,42,.6); border-radius: 9px; padding: 6px 4px; text-align: center; font-size: 11px; color: #94A3B8; display: flex; flex-direction: column; }
.ol-stats b { color: #fff; font-size: 16px; }
.ol-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ol-scroll { max-height: 34vh; overflow: auto; }
.ol-arow { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 6px; font-size: 12px; padding: 4px 6px; border-radius: 7px; background: rgba(15,23,42,.45); margin-bottom: 3px; }
.ol-arow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ol-arow small { color: #94A3B8; font-weight: 600; }
.ol-arow em { font-style: normal; color: #CBD5E1; font-size: 11px; white-space: nowrap; }
.ol-arow.won em { color: #FCA5A5; }
.ol-arow.lost em { color: #86EFAC; }
.ol-arow.me { background: rgba(120,80,10,.55); outline: 1.5px solid #FFD24A; }
.ol-arow .ol-mini { padding: 2px 7px; }
.ol-rank { text-align: center; }
.ol-old { color: #FCA5A5; }
.ol-del { color: #FCA5A5 !important; }
.ol-endres { font-size: 12.5px; color: #CBD5E1; background: rgba(15,23,42,.55); border-radius: 8px; padding: 6px 9px; }
.ol-endres.up { color: #86EFAC; }
.ol-endres.down { color: #FCA5A5; }

@media (max-width: 640px), (orientation: landscape) and (max-height: 500px) {
  .ol-tiles { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .ol-tile { padding: 8px 4px 7px; }
  .ol-tile span { font-size: 24px; }
  .ol-tile small { display: none; }
  .ol-mode { padding: 10px; }
  .ol-mode-ico { font-size: 26px; }
  .ol-mode b { font-size: 14px; }
  .ol-mode small { font-size: 10.5px; }
  .ol-list { max-height: 50vh; }
  .ol-stats b { font-size: 14px; }
}
@media (max-width: 520px) {
  .ol-modes, .ol-cols { grid-template-columns: 1fr; }
  .ol-tiles { grid-template-columns: 1fr 1fr; }
  .ol-row { grid-template-columns: 26px 1fr auto; }
  .ol-row .ol-rt { display: none; }
}
.rj-qty:disabled { opacity: .35; cursor: default; }
.rj-qty.no { opacity: .45; }
.rj-shop { overscroll-behavior: contain; }
.rj-shop-row .rj-qty { touch-action: manipulation; }
.rj-shop-note { min-height: 15px; margin: 2px 2px 0 !important; font-size: 11.5px !important; color: #FCA5A5; }
.rj-shop-note.flash { animation: rjNote .35s ease-out; }
@keyframes rjNote { from { transform: translateX(-4px); } 40% { transform: translateX(4px); } to { transform: none; } }
.rj-shop-tools { display: flex; align-items: center; gap: 6px; margin: 0 0 5px; }
.rj-shop-tools span { margin-left: auto; font-size: 10.5px; color: #94A3B8; }
.rj-shop-tools [hidden] { display: none; }
.rj-qty { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ol-prev { margin: 4px 0 8px; }
.ol-prev canvas { display: block; width: 100%; height: auto; border-radius: 10px; border: 2px solid rgba(255,255,255,.2); }
.ol-prev span { display: block; font-size: 11px; color: #CBD5E1; margin-top: 3px; }
@media (orientation: landscape) and (max-height: 500px) { .ol-prev canvas { max-height: 90px; object-fit: contain; } }
.ol-proof { display: flex; flex-direction: column; gap: 3px; background: rgba(15,23,42,.55); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 7px 10px; margin: 0 0 8px; font-size: 12px; color: #CBD5E1; }
.ol-proof .ok { color: #86EFAC; }
.ol-proof .hot { color: #FCA5A5; }
.ol-proof .lock { color: #FDE68A; font-size: 11px; }
.ol-mini.ol-lock { opacity: .75; }
.rj-restart { margin-left: 4px; }
.raja-ui.rj-replaying .rj-restart { display: none; }
.sc-code { font: 400 34px Bungee, Impact, sans-serif; letter-spacing: 4px; text-align: center; color: #FDE68A; background: rgba(15,23,42,.6); border: 2px dashed rgba(253,230,138,.5); border-radius: 12px; padding: 8px; margin: 6px 0 10px; }
.ol-arow.sc-row { grid-template-columns: 1fr auto auto; }

/* ================= DUEL LANGSUNG (B1: Mekanik live) ================= */
.duel-bar { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 19; display: flex; align-items: center; gap: 10px; background: rgba(14,20,34,.85); border: 2px solid #FFD24A; border-radius: 999px; padding: 5px 8px 5px 14px; font-size: 12.5px; color: #E2E8F0; box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap; }
.duel-bar[hidden] { display: none; }
.duel-bar > b { font: 400 15px Bungee, Impact, sans-serif; color: #FDE68A; }
.duel-bar .btn { padding: 5px 12px; font-size: 13px; }
body.duel-mek .duel-bar { top: 8px; left: auto; right: 8px; transform: none; padding: 4px 12px; }
body.duel-mek #rajaUI .rj-pad, body.duel-mek #rajaUI .rj-skills, body.duel-mek #rajaUI .rj-cards,
body.duel-mek #rajaUI .rj-orders, body.duel-mek #rajaUI .rj-restart, body.duel-mek #rajaUI .rj-coach { display: none !important; }
body.duel-mek .tab-btn[data-tab="terrain"], body.duel-mek #confirmToggleBtn,
body.duel-mek .card[data-tool="portal"], body.duel-mek .card[data-tool="kraken"] { display: none !important; }
body.duel-mek canvas { cursor: crosshair; }
body.duel-prep #archTestBtn, body.duel-prep #archPubBtn { display: none !important; }
@media (orientation: landscape) and (max-height: 500px) {
  .duel-bar { top: 50px; font-size: 11px; gap: 6px; }
  .duel-bar > b { font-size: 13px; }
  body.duel-mek .duel-bar { top: 4px; right: 6px; padding: 3px 10px; }
  body.duel-mek .duel-bar > b { display: none; }
}
body.duel-mek #rajaUI .rj-log, body.duel-mek #rajaUI .rj-log-btn { display: none !important; }

/* Lobby Duel (B2) */
.dl-code { font: 400 42px Bungee, Impact, sans-serif; letter-spacing: 8px; text-align: center; color: #FDE68A; background: rgba(15,23,42,.6); border: 2px dashed rgba(253,230,138,.5); border-radius: 14px; padding: 4px 8px; margin: 4px 0 6px; }
.dl-share { justify-content: center !important; margin-top: 0 !important; }
.dl-code-in { font: 400 22px Bungee, Impact, sans-serif !important; letter-spacing: 6px; text-transform: uppercase; text-align: center; }
.dl-slots { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 10px 0 8px; }
.dl-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(15,23,42,.6); border: 2px solid rgba(255,255,255,.18); border-radius: 12px; padding: 8px 6px; min-height: 92px; text-align: center; }
.dl-slot.me { border-color: #60A5FA; }
.dl-slot.empty { border-style: dashed; opacity: .75; }
.dl-slot b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-slot small { font-size: 11px; color: #94A3B8; }
.dl-slot i { font-style: normal; font-size: 12px; font-weight: 800; color: #86EFAC; min-height: 16px; }
.dl-av { font-size: 26px; line-height: 1.1; }
.dl-vs { font: 400 20px Bungee, Impact, sans-serif; color: #F87171; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.dl-net { text-align: center; font-size: 12.5px; padding: 6px 8px; border-radius: 9px; background: rgba(15,23,42,.55); }
.dl-net.ok { color: #86EFAC; }
.dl-net.fail, .dl-net.err { color: #FCA5A5; }
.dl-ping.good { color: #86EFAC; } .dl-ping.mid { color: #FDE68A; } .dl-ping.bad { color: #FCA5A5; }
.dl-emo { display: flex; justify-content: center; gap: 6px; margin: 8px 0 0; }
.dl-emo button { font-size: 22px; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.25); background: rgba(30,41,59,.9); cursor: pointer; }
.dl-emo button:active { transform: scale(.9); }
.dl-pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dl-pop { position: absolute; right: 22%; bottom: 30%; font-size: 46px; animation: dlPop 1.6s ease-out forwards; }
.dl-pop.mine { left: 22%; right: auto; }
@keyframes dlPop { 0% { transform: scale(.3); opacity: 0; } 15% { transform: scale(1.25); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }
.sheet.ol-sheet { position: relative; }
@media (orientation: landscape) and (max-height: 500px) {
  .dl-code { font-size: 30px; }
  .dl-slot { min-height: 70px; padding: 5px; }
  .dl-av { font-size: 20px; }
  .dl-emo button { width: 36px; height: 36px; font-size: 18px; }
}

/* Duel online (B3) */
.dn-wait { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 25; background: rgba(14,20,34,.88); border: 2px solid #FDE68A; border-radius: 14px; padding: 10px 18px; font-weight: 800; color: #FDE68A; animation: rjBlink 1.2s ease-in-out infinite; pointer-events: none; }
.dn-wait[hidden] { display: none; }
body.duel-net #rajaUI .rj-restart, body.duel-net #speedBtn { display: none !important; }
