/* ==========================================================================
   RUBY PAGODA — OFFICIAL BURMESE PAGODA GOLD, MOGOK RUBY & OBSIDIAN THEME
   100% Crisp Unblurred Background Law: ZERO blur(), ZERO full-screen scrims!
   ========================================================================== */

:root {
  --obsidian-deep: #0F0F14;
  --pagoda-night: #1C1624;
  --pagoda-gold: #FFD700;
  --burmese-brass: #D4AF37;
  --mogok-ruby: #E11D48;
  --ruby-deep: #BE123C;
  --ruby-shadow: #881337;
  --imperial-jade: #10B981;
  --jade-deep: #059669;
  --ivory-text: #FDFBF7;
  --warm-sand: #E2D9C8;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ivory-text);
  /* 100% CRISP UNBLURRED BACKGROUND LAW */
  background: url('bg.jpg') center/cover no-repeat fixed;
}

/* ==========================================================================
   SCREEN ARCHITECTURE (SEPARATE ROUTES)
   ========================================================================== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   LUXURY OBSIDIAN & GOLD DOUBLE-BORDERED CARDS
   ========================================================================== */
.pagoda-card {
  background: rgba(15, 15, 20, 0.92);
  border: 2px solid var(--pagoda-gold);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--ruby-shadow), 0 12px 28px rgba(0, 0, 0, 0.85);
  padding: 18px;
  position: relative;
}

.pagoda-card-compact {
  background: rgba(15, 15, 20, 0.94);
  border-bottom: 2px solid var(--pagoda-gold);
  box-shadow: 0 4px 0 var(--ruby-shadow);
}

/* Typography Helpers */
.gold-text { color: var(--pagoda-gold); }
.ruby-text { color: #FB7185; }
.jade-text { color: #34D399; }

/* ==========================================================================
   SCREEN 1: ROYAL SANCTUARY WELCOME GATE
   ========================================================================== */
.welcome-scroll-wrap {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.welcome-card {
  max-width: 430px;
  width: 100%;
  text-align: center;
  padding: 26px 20px;
  border-width: 2.5px;
}

.dynasty-crest-ribbon {
  display: inline-block;
  background: linear-gradient(90deg, var(--ruby-deep), var(--mogok-ruby), var(--ruby-deep));
  border: 1px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.logo-halo-wrap {
  width: 118px;
  height: 118px;
  margin: 0 auto 14px;
  border-radius: 24px;
  border: 3px solid var(--pagoda-gold);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.45), 0 4px 0 var(--ruby-shadow);
  overflow: hidden;
  background: var(--obsidian-deep);
}

.brand-logo-hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--pagoda-gold);
  letter-spacing: 2px;
  text-shadow: 0 2px 0 var(--ruby-shadow), 0 4px 12px rgba(0, 0, 0, 0.9);
  margin-bottom: 4px;
}

.game-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--warm-sand);
}

.gold-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  color: var(--pagoda-gold);
  font-size: 0.85rem;
}

.gold-divider::before,
.gold-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pagoda-gold), transparent);
  margin: 0 10px;
}

.lore-paragraph {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--warm-sand);
  margin-bottom: 16px;
}

.welcome-feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.feature-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid;
}

.gold-pill {
  background: rgba(255, 215, 0, 0.14);
  border-color: var(--pagoda-gold);
  color: var(--pagoda-gold);
}

.ruby-pill {
  background: rgba(225, 29, 72, 0.2);
  border-color: var(--mogok-ruby);
  color: #FDA4AF;
}

.jade-pill {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--imperial-jade);
  color: #6EE7B7;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.cta-btn-gold {
  width: 100%;
  background: linear-gradient(180deg, #FFE55C 0%, var(--pagoda-gold) 45%, #B8860B 100%);
  color: var(--obsidian-deep);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 14px 18px;
  border: 2px solid #FFF3B0;
  border-radius: 12px;
  box-shadow: 0 5px 0 #785204, 0 8px 18px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.cta-btn-gold:active {
  transform: translateY(3px);
}

.cta-btn-ruby-gold {
  width: 100%;
  background: linear-gradient(180deg, var(--mogok-ruby) 0%, var(--ruby-deep) 65%, #7F1D1D 100%);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  border: 2px solid var(--pagoda-gold);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: 0 5px 0 #4C0519, 0 8px 20px rgba(225, 29, 72, 0.45);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: transform 0.1s ease;
}

.cta-btn-ruby-gold:active {
  transform: translateY(3px);
}

.cta-main-line {
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.cta-sub-line {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ivory-text);
  opacity: 0.92;
}

.secondary-obsidian-btn {
  background: var(--pagoda-night);
  color: var(--warm-sand);
  border: 1.5px solid var(--burmese-brass);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.full-width-btn {
  width: 100%;
}

/* ==========================================================================
   SCREEN 2: IMPERIAL SANCTUARY LOBBY HUB
   ========================================================================== */
.lobby-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  z-index: 10;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-mini {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid var(--pagoda-gold);
  object-fit: cover;
}

.brand-mini-text {
  display: flex;
  flex-direction: column;
}

.brand-mini-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--pagoda-gold);
  letter-spacing: 0.8px;
}

.brand-mini-rank {
  font-size: 0.72rem;
  color: #34D399;
  font-weight: 700;
}

.treasury-pills {
  display: flex;
  align-items: center;
  gap: 7px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--pagoda-night);
  border: 1.5px solid var(--burmese-brass);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.ruby-dot { color: var(--mogok-ruby); font-size: 0.95rem; }
.jade-dot { color: var(--imperial-jade); font-size: 0.95rem; }

.icon-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pagoda-night);
  border: 1.5px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.hero-expedition-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-corner-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.stage-preview-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--pagoda-gold);
  margin-bottom: 5px;
}

.stage-preview-desc {
  font-size: 0.83rem;
  color: var(--warm-sand);
  line-height: 1.45;
  margin-bottom: 12px;
}

.stage-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-chip {
  background: var(--pagoda-night);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--warm-sand);
  letter-spacing: 0.5px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
}

/* Royal Dynasty Expedition Standings */
.standings-card {
  padding: 14px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--pagoda-gold);
}

.section-badge {
  font-size: 0.66rem;
  font-weight: 800;
  background: var(--ruby-deep);
  color: var(--pagoda-gold);
  border: 1px solid var(--pagoda-gold);
  padding: 2px 8px;
  border-radius: 99px;
}

.standings-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.standing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pagoda-night);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.standing-row.player-highlight {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.32), rgba(255, 215, 0, 0.18));
  border: 1.5px solid var(--pagoda-gold);
}

.standing-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.standing-rank {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--pagoda-gold);
  width: 24px;
}

.standing-name {
  font-weight: 700;
  color: var(--ivory-text);
}

.standing-score {
  font-family: var(--font-display);
  font-weight: 800;
  color: #34D399;
}

/* 4 Main Navigation Hub Cards */
.lobby-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 12px;
}

.hub-nav-card {
  background: rgba(15, 15, 20, 0.94);
  border: 2px solid var(--pagoda-gold);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ruby-shadow);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  color: var(--ivory-text);
  transition: transform 0.1s ease;
}

.hub-nav-card:active {
  transform: translateY(2px);
}

.hub-nav-icon {
  font-size: 1.45rem;
}

.hub-nav-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--pagoda-gold);
  line-height: 1.25;
}

.hub-nav-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--warm-sand);
  margin-top: 2px;
}

/* ==========================================================================
   SCREEN 3: SEPARATE FULLSCREEN PAGODA GAMEPLAY ARENA
   ========================================================================== */
.arena-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 20, 0.95);
  border-bottom: 2px solid var(--pagoda-gold);
  padding: 8px 10px;
  gap: 8px;
  z-index: 10;
}

.hud-action-btn {
  background: var(--pagoda-night);
  border: 1.5px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.arena-center-stats {
  flex: 1;
  text-align: center;
}

.arena-stage-banner {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--pagoda-gold);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.arena-counters-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arena-stat {
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--pagoda-night);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.gold-stat strong { color: var(--pagoda-gold); }
.ruby-stat strong { color: #FB7185; }
.jade-stat strong { color: #34D399; }
.shield-stat strong { color: #60A5FA; }

.hud-roar-btn {
  background: linear-gradient(180deg, var(--mogok-ruby), var(--ruby-deep));
  border: 2px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.8);
}

.hud-roar-btn:disabled {
  background: #27272A;
  border-color: #52525B;
  color: #A1A1AA;
  box-shadow: none;
  cursor: not-allowed;
}

/* Boss Health Bar */
.boss-bar-container {
  background: rgba(15, 15, 20, 0.94);
  border-bottom: 1.5px solid var(--mogok-ruby);
  padding: 5px 14px;
}

.boss-bar-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: #FDA4AF;
  margin-bottom: 3px;
}

.boss-hp-track {
  width: 100%;
  height: 8px;
  background: #27121B;
  border-radius: 99px;
  border: 1px solid var(--pagoda-gold);
  overflow: hidden;
}

.boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--mogok-ruby), var(--pagoda-gold));
  transition: width 0.2s ease;
}

/* Canvas Arena */
.canvas-stage-wrap {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

#pagoda-canvas {
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 20, 0.86);
  border: 2px solid var(--pagoda-gold);
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.85);
  touch-action: none;
  display: block;
}

.arena-controls-bar {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 8px;
  padding: 8px 12px 12px;
  background: rgba(15, 15, 20, 0.95);
  border-top: 2px solid var(--pagoda-gold);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.temple-ctrl-btn {
  background: var(--pagoda-night);
  border: 2px solid var(--burmese-brass);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 12px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.temple-ctrl-btn:active {
  background: rgba(255, 215, 0, 0.22);
}

.primary-ctrl-btn {
  background: linear-gradient(180deg, var(--mogok-ruby), var(--ruby-deep));
  border-color: var(--pagoda-gold);
  color: var(--pagoda-gold);
}

/* ==========================================================================
   MODALS (30 STAGES, RELIC SHOP, ACHIEVEMENTS, SETTINGS & LEGAL)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.hidden {
  display: none !important;
}

.modal-window {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 215, 0, 0.4);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--pagoda-gold);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ruby-deep);
  border: 1.5px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-weight: 900;
  cursor: pointer;
}

.modal-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Chapter Tabs & 30 Stages Grid */
.chapter-tabs,
.settings-tabs,
.legal-sub-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chapter-tab,
.settings-tab,
.legal-doc-btn {
  flex: 1;
  background: var(--pagoda-night);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  color: var(--warm-sand);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.chapter-tab.active,
.settings-tab.active,
.legal-doc-btn.active {
  background: linear-gradient(180deg, var(--mogok-ruby), var(--ruby-deep));
  border-color: var(--pagoda-gold);
  color: var(--pagoda-gold);
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stage-node-card {
  background: var(--pagoda-night);
  border: 1.5px solid var(--burmese-brass);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.stage-node-card.locked {
  opacity: 0.52;
  border-color: #3F3F46;
  cursor: not-allowed;
}

.stage-node-card.boss-stage {
  border-color: var(--mogok-ruby);
  background: linear-gradient(180deg, #27101C, var(--pagoda-night));
}

.stage-node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-num-badge {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--pagoda-gold);
}

.stage-stars-display {
  color: var(--pagoda-gold);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.stage-node-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ivory-text);
}

.stage-node-sub {
  font-size: 0.68rem;
  color: var(--warm-sand);
}

/* Chinthe Relic Shop */
.shop-treasury-banner {
  display: flex;
  justify-content: space-around;
  background: var(--pagoda-night);
  border: 1px solid var(--pagoda-gold);
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.shop-list,
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-item-card,
.ach-item-card {
  background: var(--pagoda-night);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shop-item-info {
  flex: 1;
}

.shop-item-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--pagoda-gold);
}

.shop-item-desc {
  font-size: 0.75rem;
  color: var(--warm-sand);
  margin: 3px 0 6px;
}

.shop-level-pips {
  display: flex;
  gap: 4px;
}

.lvl-pip {
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: #3F3F46;
}

.lvl-pip.filled {
  background: var(--pagoda-gold);
}

.buy-relic-btn {
  background: linear-gradient(180deg, #FFE55C, var(--pagoda-gold));
  color: var(--obsidian-deep);
  border: 1.5px solid #FFF;
  border-radius: 9px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  min-width: 92px;
  text-align: center;
}

.buy-relic-btn:disabled {
  background: #3F3F46;
  color: #A1A1AA;
  border-color: #52525B;
  cursor: not-allowed;
}

/* Achievements */
.ach-item-card.unlocked {
  border-color: var(--imperial-jade);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), var(--pagoda-night));
}

.ach-badge-pill {
  padding: 5px 10px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
}

.ach-badge-pill.done {
  background: var(--jade-deep);
  color: #FFF;
  border: 1px solid var(--pagoda-gold);
}

.ach-badge-pill.pending {
  background: #27272A;
  color: #A1A1AA;
}

/* Settings, Support, Rate & Legal */
.settings-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.settings-pane.active {
  display: flex;
}

.about-app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pagoda-night);
  border: 1.5px solid var(--pagoda-gold);
  border-radius: 12px;
  padding: 12px;
}

.about-logo {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 2px solid var(--pagoda-gold);
  object-fit: cover;
}

.version-badge {
  font-size: 0.78rem;
  color: var(--warm-sand);
  font-weight: 700;
  margin-top: 2px;
}

.engine-status-badge {
  font-size: 0.72rem;
  color: #34D399;
  font-weight: 700;
  margin-top: 3px;
}

.settings-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pagoda-night);
  border: 1px solid rgba(255, 215, 0, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.small-gold-btn {
  background: var(--pagoda-gold);
  color: var(--obsidian-deep);
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.help-guide-box,
.rate-card-box,
.share-card-box,
.legal-document-box {
  background: var(--pagoda-night);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  padding: 12px;
}

.help-list {
  padding-left: 18px;
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--warm-sand);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Support Form */
.pagoda-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pagoda-gold);
}

.pagoda-input,
.pagoda-textarea {
  width: 100%;
  background: var(--obsidian-deep);
  border: 1.5px solid var(--burmese-brass);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--ivory-text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  user-select: text;
}

.support-confirm-banner {
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid var(--imperial-jade);
  color: #6EE7B7;
  padding: 10px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.ticket-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.ticket-entry {
  background: var(--obsidian-deep);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.74rem;
}

/* Rating & Share */
.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.star-pick-btn {
  background: var(--obsidian-deep);
  border: 1.5px solid var(--burmese-brass);
  color: #52525B;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
}

.star-pick-btn.active {
  color: var(--pagoda-gold);
  border-color: var(--pagoda-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.invite-code-banner {
  background: var(--obsidian-deep);
  border: 2px dashed var(--pagoda-gold);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  color: var(--pagoda-gold);
  margin: 10px 0;
  letter-spacing: 1.5px;
}

.confirm-inline-text {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #34D399;
  text-align: center;
}

.muted-note {
  font-size: 0.78rem;
  color: var(--warm-sand);
  line-height: 1.45;
}

/* Legal Documents */
.legal-document-box {
  display: none;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--warm-sand);
}

.legal-document-box.active {
  display: block;
}

.legal-document-box h4 {
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  margin: 10px 0 4px;
  font-size: 0.84rem;
}

.legal-meta {
  font-size: 0.7rem;
  color: #FDA4AF;
  margin-bottom: 8px;
}

/* Outcome Modal */
.outcome-window {
  text-align: center;
  align-items: center;
}

.outcome-desc {
  font-size: 0.84rem;
  color: var(--warm-sand);
  margin: 6px 0 12px;
}

.outcome-stars {
  font-size: 2.2rem;
  color: var(--pagoda-gold);
  letter-spacing: 6px;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.7);
  margin-bottom: 14px;
}

.outcome-rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
}

.reward-box {
  background: var(--pagoda-night);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reward-label {
  font-size: 0.65rem;
  color: var(--warm-sand);
  font-weight: 700;
}

.reward-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
}

.outcome-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Toast Notification */
.pagoda-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--obsidian-deep);
  border: 2px solid var(--pagoda-gold);
  color: var(--pagoda-gold);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.9);
  z-index: 250;
  text-align: center;
  max-width: 90vw;
}


/* ==========================================================================
   STRICT MOBILE PORTRAIT FRAME & TOUCH OPTIMIZATION (PHONE-ONLY VIEWPORT)
   ========================================================================== */
html {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto !important;
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

#app-shell,
#app-root,
.screen {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

canvas {
  touch-action: none;
  display: block;
}
