/**
 * ============================================================================
 * FOUR QUARTERS: SOVEREIGN DOMINION — MOBILE GAME ENGINE STYLESHEET
 * Dedicated, bespoke mobile-first architecture for smartphones (Not desktop responsive).
 * Built with touch ergonomics, safe-area insets, floating trays & gesture navigation.
 * ============================================================================
 */

:root {
  --font-display: 'Cinzel', 'Cairo', serif, sans-serif;
  --font-body: 'Amiri', 'El Messiri', serif, sans-serif;
  --font-arabic: 'Cairo', 'El Messiri', sans-serif;

  /* Imperial Color Palette */
  --obsidian-deep: #070503;
  --obsidian-card: #120e0a;
  --obsidian-elevated: #1a140e;
  --obsidian-border: rgba(200, 157, 84, 0.3);
  --brass-main: #c89d54;
  --brass-bright: #fde047;
  --brass-dark: #6e4b16;
  --ivory-bright: #fffdf5;
  --ivory-dim: #c5bca8;
  --crimson-main: #e11d48;
  --azure-main: #2563eb;
  --emerald-main: #059669;
  --solar-main: #d97706;

  /* Mobile Ergonomics */
  --safe-top: max(8px, env(safe-area-inset-top));
  --safe-bottom: max(10px, env(safe-area-inset-bottom));
  --safe-left: max(8px, env(safe-area-inset-left));
  --safe-right: max(8px, env(safe-area-inset-right));
  --touch-min: 44px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: fixed;
  background: var(--obsidian-deep);
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.3;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body[dir="rtl"] {
  font-family: var(--font-arabic);
}

/* ==========================================================================
   AMBIENT FX CANVAS (Ember Sparks)
   ========================================================================== */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   FULLSCREEN MOBILE GAME VIEWPORT
   ========================================================================== */
.mobile-app-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1b2a 0%, #060913 100%);
  touch-action: none;
}

.world-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 3;
  touch-action: none;
  user-select: none;
}

.mobile-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.mobile-viewport-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85);
  z-index: 5;
}

/* ==========================================================================
   FLOATING TOP STATUS ISLAND (DYNAMIC CROWN RIBBON)
   ========================================================================== */
.mobile-top-island {
  position: absolute;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
}

.top-island-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(14, 11, 8, 0.95);
  border: 1px solid var(--brass-main);
  border-radius: 8px;
  padding: 5px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85);
}

.island-sovereign {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-shrink: 1;
}

.island-crest {
  width: 26px;
  height: 28px;
  border: 1.5px solid var(--brass-bright);
  clip-path: polygon(50% 0%, 100% 15%, 100% 68%, 50% 100%, 0% 68%, 0% 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.island-meta {
  min-width: 0;
  overflow: hidden;
  line-height: 1.1;
}

.island-name {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--ivory-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.island-title {
  font-size: 0.62rem;
  color: var(--ivory-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.island-phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #3d2a0d 0%, #1f1506 100%);
  border: 1px solid var(--brass-bright);
  color: var(--brass-bright);
  font-size: 0.70rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.25);
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, filter 0.12s ease;
}

.island-phase-pill:active {
  transform: scale(0.95);
  filter: brightness(1.25);
}

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

.btn-island-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--obsidian-card);
  border: 1px solid var(--obsidian-border);
  border-radius: 6px;
  color: var(--ivory-bright);
  font-size: 0.70rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease;
  padding: 0;
}

.btn-island-icon:active {
  transform: scale(0.92);
  border-color: var(--brass-bright);
}

/* Secondary Treasury & Season Row in Top Island */
.top-island-resources {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(10, 8, 5, 0.94);
  border: 1px solid rgba(200, 157, 84, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.70rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.top-island-resources::-webkit-scrollbar {
  display: none;
}

.m-res-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  font-weight: 700;
}

.m-res-item strong {
  font-weight: 900;
  color: #fff;
}

.m-res-gold strong {
  color: #fde047;
}

.m-res-season {
  border: 1px solid var(--season-color, #4ade80);
  color: var(--season-color, #4ade80);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   FLOATING BOTTOM ACTION DECK (MOBILE COMMAND CENTER)
   ========================================================================== */
.mobile-action-deck {
  position: absolute;
  bottom: var(--safe-bottom);
  left: var(--safe-left);
  right: var(--safe-right);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

/* Primary Turn / Phase Action Button (Giant Thumb Touch Target) */
.mobile-primary-cta {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #d4a349 0%, #8e621c 100%);
  border: 1.5px solid #fde047;
  border-radius: 8px;
  color: #0c0803;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 18px rgba(212, 163, 73, 0.45), 0 2px 4px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.mobile-primary-cta:active {
  transform: scale(0.97);
  filter: brightness(1.15);
}

.mobile-primary-cta.auto-muster-cta {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.45);
}

.mobile-primary-cta.combat-assault-cta {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border-color: #fca5a5;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.55);
}

.mobile-secondary-cta {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.mobile-secondary-cta:active {
  transform: scale(0.98);
  border-color: var(--brass-bright);
  color: #ffffff;
  background: rgba(30, 41, 59, 0.98);
}

/* 5-Button Thumb Hub Navigation Bar */
.mobile-thumb-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(14, 11, 8, 0.96);
  border: 1px solid var(--brass-main);
  border-radius: 10px;
  padding: 4px 5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.9);
}

.thumb-tab-btn {
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ivory-dim);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
}

.thumb-tab-btn .tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.thumb-tab-btn:active,
.thumb-tab-btn.active-tab {
  background: rgba(200, 157, 84, 0.18);
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

.thumb-tab-btn .tab-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  background: #e11d48;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 8px;
}

/* ==========================================================================
   SLIDE-UP PROVINCE ACTION SHEET (TAPPED PROVINCE CONTROLS)
   ========================================================================== */
.mobile-action-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: linear-gradient(180deg, #18120c 0%, #0d0a07 100%);
  border-top: 2px solid var(--brass-main);
  border-radius: 16px 16px 0 0;
  padding: 8px 14px var(--safe-bottom) 14px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.95);
  transform: translateY(105%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-action-sheet.sheet-open {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 44px;
  height: 4px;
  background: rgba(200, 157, 84, 0.4);
  border-radius: 3px;
  margin: 0 auto 4px auto;
  flex-shrink: 0;
}

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

.sheet-prov-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sheet-emblem {
  width: 32px;
  height: 32px;
  background: var(--obsidian-card);
  border: 1px solid var(--brass-main);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sheet-title-box {
  min-width: 0;
}

.sheet-prov-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--brass-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-prov-meta {
  font-size: 0.68rem;
  color: var(--ivory-mid);
}

.sheet-close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--obsidian-border);
  border-radius: 50%;
  color: var(--ivory-dim);
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar {
  display: none;
}

/* Muster Controls inside Sheet */
.sheet-muster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 6px;
}

.btn-sheet-action {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--obsidian-elevated);
  border: 1px solid var(--brass-main);
  border-radius: 6px;
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn-sheet-action:active {
  transform: scale(0.95);
  border-color: var(--brass-bright);
}

.btn-sheet-gold {
  background: linear-gradient(180deg, #d4a349 0%, #8e621c 100%);
  border-color: #fde047;
  color: #0a0703;
  font-weight: 900;
}

/* Quick Provincial Works Bar in Sheet */
.sheet-works-row {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.sheet-works-row::-webkit-scrollbar {
  display: none;
}

.btn-work-pill {
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--obsidian-border);
  border-radius: 4px;
  color: var(--ivory-bright);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.btn-work-pill:active:not(:disabled) {
  border-color: var(--brass-bright);
  background: rgba(200, 157, 84, 0.2);
}

.btn-work-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Battle Duel Versus Card inside Sheet */
.sheet-duel-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(225, 29, 72, 0.4);
  border-radius: 8px;
  padding: 8px;
}

.duel-combatants {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: center;
}

.duel-combatant {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.combatant-army {
  font-size: 1.4rem;
  font-weight: 900;
  font-family: var(--font-display);
}

.combatant-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ivory-dim);
}

.duel-vs-badge {
  font-size: 0.82rem;
  font-weight: 900;
  color: #f87171;
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid #f87171;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.duel-odds-bar {
  width: 100%;
  height: 6px;
  background: #374151;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.duel-odds-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  transition: width 0.3s ease;
}

.duel-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duel-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
}

.duel-range-slider {
  width: 100%;
  height: 28px;
  accent-color: var(--brass-bright);
}

.btn-launch-assault {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #e11d48 0%, #9f1239 100%);
  border: 1.5px solid #fda4af;
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.90rem;
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.5);
  cursor: pointer;
}

.btn-launch-assault:active {
  transform: scale(0.97);
}

/* ==========================================================================
   SLIDE-UP MODAL TRAY (STANDINGS / CHRONICLE / REALMS / BAZAAR)
   ========================================================================== */
.mobile-drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(180deg, #18120c 0%, #0d0a07 100%);
  border-top: 2px solid var(--brass-main);
  border-radius: 16px 16px 0 0;
  padding: 8px 14px var(--safe-bottom) 14px;
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.98);
  transform: translateY(105%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-sheet.drawer-open {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--obsidian-border);
  padding-bottom: 6px;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.drawer-content {
  overflow-y: auto;
  max-height: 68dvh;
  scrollbar-width: thin;
  scrollbar-color: var(--brass-main) transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Standings Card in Mobile Drawer */
.m-kingdom-card {
  background: #110d09;
  border: 1px solid var(--obsidian-border);
  border-left: 3px solid var(--k-color, var(--brass-main));
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-kingdom-card.active-turn {
  border-color: var(--brass-bright);
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.3);
}

.m-kc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-kc-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-kc-crest {
  width: 20px;
  height: 22px;
  clip-path: polygon(50% 0%, 100% 15%, 100% 68%, 50% 100%, 0% 68%, 0% 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.70rem;
}

.m-kc-name {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 900;
  color: #fff;
}

.m-kc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 5px;
  border-radius: 4px;
  text-align: center;
}

.m-kc-val {
  font-weight: 900;
  font-size: 0.74rem;
}

.m-kc-lbl {
  font-size: 0.54rem;
  color: var(--ivory-dim);
}

.m-kc-power-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
}

.m-kc-power-fill {
  height: 100%;
  border-radius: 2px;
}

/* Chronicle List in Drawer */
.m-chronicle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.m-chronicle-item {
  background: #110d09;
  border-left: 3px solid var(--brass-main);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  line-height: 1.25;
}

/* ==========================================================================
   MOBILE TITLE SCREEN (VERTICAL HERO MONOLITH)
   ========================================================================== */
.mobile-title-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 25%, #1f160e 0%, #080604 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) var(--safe-left) calc(var(--safe-bottom) + 12px) var(--safe-right);
  overflow-y: auto;
}

.screen-hidden,
.mobile-title-screen.screen-hidden {
  display: none !important;
}

.m-title-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-top: 10px;
}

.m-crest-box {
  width: 64px;
  height: 64px;
}

.m-main-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--brass-bright);
  text-shadow: 0 2px 10px rgba(253, 224, 71, 0.35);
  line-height: 1.1;
}

.m-sub-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ivory-dim);
  letter-spacing: 2px;
}

.m-title-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.m-menu-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(180deg, #221a12 0%, #120e0a 100%);
  border: 1px solid var(--brass-main);
  border-radius: 8px;
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.m-menu-btn:active {
  transform: scale(0.97);
  border-color: var(--brass-bright);
}

.m-menu-story {
  border-color: #a855f7;
  background: linear-gradient(180deg, #3b1b59 0%, #1e0d2e 100%);
}

.m-menu-gold {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #3d2a0d 0%, #1f1506 100%);
  color: var(--brass-bright);
}

.m-menu-tag {
  font-size: 0.62rem;
  font-weight: 900;
  background: var(--brass-bright);
  color: #0c0803;
  padding: 1px 5px;
  border-radius: 4px;
}

.m-settings-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-m-setting {
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--obsidian-border);
  border-radius: 6px;
  color: var(--ivory-dim);
  font-size: 0.70rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-m-setting:active {
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

/* ==========================================================================
   MOBILE STORY MODE SAGA SCREEN & CUTSCENES
   ========================================================================== */
.mobile-story-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #080604;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) var(--safe-left) var(--safe-bottom) var(--safe-right);
  overflow-y: auto;
}

.mobile-story-screen.screen-hidden {
  display: none !important;
}

.m-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--obsidian-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.m-story-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-story-card {
  background: #120e0a;
  border: 1px solid var(--obsidian-border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.m-story-card.selected {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #271e14 0%, #120e0a 100%);
}

.m-story-portrait {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--brass-main);
  overflow: hidden;
  flex-shrink: 0;
}

.m-story-info {
  flex: 1;
  min-width: 0;
}

.m-story-title {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.m-story-sub {
  font-size: 0.70rem;
  color: var(--ivory-dim);
}

/* Story Cutscene Visual Novel Stage */
.m-cutscene-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.m-cutscene-portrait {
  width: 90px;
  height: 90px;
  border: 2px solid var(--brass-bright);
  border-radius: 8px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}

.m-dialogue-card {
  background: rgba(18, 14, 10, 0.95);
  border: 1px solid var(--brass-main);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-speaker-badge {
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.m-dialogue-body {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ivory-bright);
}

.m-choices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-choice-btn {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--obsidian-elevated);
  border: 1px solid var(--brass-main);
  border-radius: 6px;
  color: var(--ivory-bright);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
}

.m-choice-btn:active {
  border-color: var(--brass-bright);
  background: #2b1f13;
}

/* ==========================================================================
   TOAST TICKER & SYSTEM NOTIFICATIONS
   ========================================================================== */
.mobile-toast {
  position: absolute;
  top: calc(var(--safe-top) + 85px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 60;
  background: rgba(14, 11, 8, 0.95);
  border: 1px solid var(--brass-main);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brass-bright);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   CONQUEST ADVANCE & SEALS TRAY CARDS
   ========================================================================== */
.conquest-advance-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(14, 11, 8, 0.95);
  border: 1.5px solid var(--brass-bright);
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.25);
}

.m-seals-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-seals-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 157, 84, 0.25);
  border-radius: 6px;
  padding: 6px 10px;
}

.m-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 48dvh;
  overflow-y: auto;
  padding: 2px;
}

.m-seal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, #18130e 0%, #0d0a07 100%);
  border: 1px solid rgba(200, 157, 84, 0.35);
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.m-seal-card:active {
  transform: scale(0.96);
}

.m-seal-card.seal-selected {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #2c1e0e 0%, #171109 100%);
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.35);
  transform: translateY(-2px);
}

.m-seal-icon {
  font-size: 1.5rem;
  line-height: 1.1;
  margin-bottom: 2px;
}

.m-seal-corps {
  font-size: 0.70rem;
  font-weight: 900;
  color: var(--brass-bright);
  text-transform: uppercase;
}

.m-seal-prov {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ivory-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.m-seal-realm {
  font-size: 0.60rem;
  color: var(--ivory-dim);
}

.m-seals-actions-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-island-fit:active,
.btn-island-mode:active {
  background: rgba(200, 157, 84, 0.3);
}

/* ==========================================================================
   LANDSCAPE & ULTRA-COMPACT SCREEN ADAPTATION
   ========================================================================== */
@media (orientation: landscape) and (max-height: 600px) {
  .mobile-top-island {
    top: 4px;
    left: var(--safe-left);
    right: var(--safe-right);
    gap: 2px;
  }

  .top-island-primary {
    padding: 3px 8px;
  }

  .island-sovereign {
    gap: 5px;
  }

  .island-crest {
    width: 20px;
    height: 22px;
  }

  .island-name {
    font-size: 0.68rem;
  }

  .island-title {
    font-size: 0.55rem;
  }

  .top-island-resources {
    display: none;
  }

  .mobile-action-deck {
    bottom: 4px;
    left: var(--safe-left);
    right: var(--safe-right);
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .mobile-primary-cta {
    height: 38px;
    font-size: 0.76rem;
    flex: 1.2;
  }

  .mobile-thumb-bar {
    flex: 2;
    padding: 2px 4px;
  }

  .thumb-tab-btn {
    height: 34px;
    font-size: 0.55rem;
  }

  .thumb-tab-btn .tab-icon {
    font-size: 0.85rem;
  }

  .mobile-action-sheet {
    max-height: 75dvh;
    padding: 6px 12px 10px 12px;
  }

  .m-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 42dvh;
  }
}

