/* ============================================================================
   section_scenes.css — چارچوب و استایل «صحنه‌های تمام‌صفحهٔ» بخش‌های بازی
   ----------------------------------------------------------------------------
   نوار نیروهای مسلح، نیروی زمینی، صنعت و پژوهش، تنگه‌ها و نقشهٔ جهان را از
   فهرست متنی به یک رابط تصویری و بازی‌گونه تبدیل می‌کند. فقط نمایش است؛
   هیچ قیمت، قاعده یا عملیاتی اینجا تعریف نمی‌شود.
   ============================================================================ */

:root {
  --sc-bg: #0b121b;
  --sc-panel: #101d29;
  --sc-panel-2: #16283a;
  --sc-line: rgba(183, 205, 220, .16);
  --sc-line-2: rgba(183, 205, 220, .3);
  --sc-ink: var(--text, #edf5f7);
  --sc-muted: var(--muted, #91a6b2);
  --sc-gold: var(--gs-gold, #e5bd67);
  --sc-danger: #e2685f;
  --sc-good: #5fc4a0;
}

#scene-overlay {
  position: fixed; inset: 0; z-index: 9985;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 86% -14%, rgba(99, 182, 200, .15), transparent 30rem),
    radial-gradient(circle at 4% 108%, rgba(229, 189, 103, .1), transparent 26rem),
    var(--sc-bg);
  color: var(--sc-ink);
  animation: sc-in .24s cubic-bezier(.2, .8, .2, 1);
  overscroll-behavior: contain;
}
@keyframes sc-in { from { opacity: 0; transform: translateY(12px) scale(.99) } to { opacity: 1; transform: none } }
#scene-overlay *, #scene-overlay *::before, #scene-overlay *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------ سرتیتر */
.scene-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--sc-line);
  background: linear-gradient(180deg, #13222f, #0d1a24);
}
.scene-head__txt { flex: 1; min-width: 0; }
.scene-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.scene-head small { display: block; margin-top: 2px; font-size: 10px; color: var(--sc-muted); }
.scene-icon {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--sc-line);
  background: var(--sc-panel-2); color: #d8e4ea; font-size: 16px; line-height: 1;
}
.scene-icon:active { transform: scale(.93); }

.scene-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.scene-body::-webkit-scrollbar { width: 0; }

/* -------------------------------------------------------------------- هیرو */
.sc-hero {
  position: relative; overflow: hidden; flex: 0 0 auto;
  min-height: clamp(158px, 46vw, 226px); padding: 16px;
  border-radius: 16px; border: 1px solid var(--sc-line);
  display: flex; flex-direction: column; justify-content: flex-end;
  background-position: center; background-size: cover;
  box-shadow: 0 14px 34px #0006;
}
.sc-hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 2px; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(229, 189, 103, .75), transparent);
}
.sc-hero__veil { position: absolute; inset: 0; background: linear-gradient(158deg, rgba(11, 18, 27, .3), rgba(11, 18, 27, .95)); }
.sc-hero__scan {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 4px);
}
.sc-hero__body { position: relative; z-index: 2; }
.sc-hero__k { font-size: 10px; color: var(--sc-muted); letter-spacing: .02em; }
.sc-hero__v { font-size: 27px; font-weight: 800; line-height: 1.3; color: var(--sc-gold); }
.sc-hero__v small { font-size: 12px; font-weight: 500; color: var(--sc-muted); margin-inline-start: 4px; }
.sc-hero__t { font-size: 15px; font-weight: 800; }
.sc-hero__d { margin-top: 5px; font-size: 10.5px; line-height: 1.8; color: var(--sc-muted); max-width: 42ch; }
.sc-hero__row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 11px; }
.sc-mini { font-size: 10px; color: var(--sc-muted); }
.sc-mini b { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--sc-ink); }

/* ------------------------------------------------------------------- تب‌ها */
.sc-tabs {
  display: flex; gap: 5px; padding: 5px; flex: 0 0 auto;
  background: #0f1c26; border: 1px solid var(--sc-line); border-radius: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.sc-tabs::-webkit-scrollbar { display: none; }
.sc-tabs { scroll-snap-type: x proximity; }
.sc-tabs button {
  flex: 1 0 auto; min-height: 36px; padding: 0 15px; scroll-snap-align: center;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--sc-muted); font-size: 11.5px; font-weight: 700; white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s;
}
.sc-tabs button:active { color: var(--sc-ink); }
.sc-tabs button.active {
  background: var(--sc-panel-2); color: var(--sc-gold);
  box-shadow: inset 0 0 0 1px var(--sc-line), 0 0 14px rgba(229, 189, 103, .14);
}

/* ------------------------------------------------------------- شبکهٔ کارت‌ها */
.sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.sc-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 0; text-align: start; color: inherit;
  border-radius: 14px; border: 1px solid var(--sc-line);
  background: linear-gradient(160deg, var(--sc-panel-2), var(--sc-panel));
  box-shadow: 0 10px 22px #0005;
  animation: sc-rise .34s cubic-bezier(.2, .8, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 32ms);
}
@keyframes sc-rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.sc-card:active { transform: scale(.975); border-color: var(--sc-line-2); }
.sc-card__art {
  position: relative; height: 88px; flex: 0 0 auto;
  background-position: center; background-size: cover;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sc-card:active .sc-card__art { transform: scale(1.06); }
.sc-card__art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 18, 27, .15), rgba(11, 18, 27, .92)); }
.sc-card__mark {
  position: absolute; inset-inline-start: 9px; bottom: -14px; z-index: 3;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px; background: #0f1c26; border: 1px solid var(--sc-line-2); font-size: 16px;
}
.sc-card__body { padding: 16px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sc-card__name { font-size: 11.5px; font-weight: 700; line-height: 1.5; }
.sc-card__amt { font-size: 17px; font-weight: 800; color: var(--sc-gold); line-height: 1.2; }
.sc-card__amt small { font-size: 9.5px; font-weight: 500; color: var(--sc-muted); margin-inline-start: 3px; }
.sc-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 4px; font-size: 9.5px; color: var(--sc-muted); }
.sc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 99px;
  background: rgba(229, 189, 103, .12); color: var(--sc-gold);
  border: 1px solid rgba(229, 189, 103, .26); font-size: 9px; font-weight: 700;
}
.sc-chip--off { background: rgba(226, 104, 95, .12); color: var(--sc-danger); border-color: rgba(226, 104, 95, .3); }
.sc-chip--ok { background: rgba(95, 196, 160, .12); color: var(--sc-good); border-color: rgba(95, 196, 160, .3); }
.sc-bar { height: 5px; border-radius: 99px; background: #0b1620; overflow: hidden; }
.sc-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #b98f3f, var(--sc-gold)); transition: width .3s; }

/* ------------------------------------------------------------------ ردیف‌ها */
.sc-rows { display: flex; flex-direction: column; gap: 9px; }
.sc-row {
  display: flex; align-items: center; gap: 11px; padding: 11px;
  border-radius: 14px; border: 1px solid var(--sc-line);
  background: linear-gradient(150deg, var(--sc-panel-2), var(--sc-panel));
  animation: sc-rise .34s cubic-bezier(.2, .8, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.sc-row:active { transform: scale(.985); }
.sc-row__mark {
  width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 12px; background: #0f1c26; border: 1px solid var(--sc-line); font-size: 18px;
}
.sc-row__txt { flex: 1; min-width: 0; }
.sc-row__txt b { display: block; font-size: 12px; font-weight: 700; }
.sc-row__txt small { display: block; margin-top: 3px; font-size: 9.5px; color: var(--sc-muted); line-height: 1.6; }
.sc-row__val { flex: 0 0 auto; text-align: end; font-size: 12px; font-weight: 800; color: var(--sc-gold); }
.sc-row__val small { display: block; margin-top: 2px; font-size: 9px; font-weight: 500; color: var(--sc-muted); }

/* --------------------------------------------------------------- نقشهٔ جهان */
.sc-map {
  position: relative; height: 300px; flex: 0 0 auto;
  border-radius: 16px; border: 1px solid var(--sc-line-2); overflow: hidden;
  background: url('/assets/img/age_of_ashes_command.webp') center/cover no-repeat, #08161c;
  box-shadow: inset 0 0 48px #0009, 0 12px 28px #0006;
}
.sc-map__grid { position: absolute; inset: 0; opacity: .28; background:
  repeating-linear-gradient(90deg, rgba(140, 200, 220, .16) 0 1px, transparent 1px 34px),
  repeating-linear-gradient(0deg, rgba(140, 200, 220, .16) 0 1px, transparent 1px 34px); }
.sc-map__dot {
  position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  padding: 0; appearance: none; -webkit-appearance: none; cursor: pointer;
  border-radius: 50%; border: 1.5px solid #0b121b;
  background: var(--sc-muted); box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
  transition: transform .18s;
}
.sc-map__dot.is-self { background: var(--sc-gold); box-shadow: 0 0 0 4px rgba(229, 189, 103, .22); }
.sc-map__dot.is-available { background: var(--sc-good); }
.sc-map__dot.is-active { background: #d96b5f; }
.sc-map__dot.is-recent { background: #e0a33c; animation: sc-pulse 1.6s infinite; }
.sc-map__dot.is-protected { background: #6f8296; }
.sc-map__dot.is-picked { transform: scale(1.7); box-shadow: 0 0 0 6px rgba(229, 189, 103, .3); }
.sc-map__dot:active { transform: scale(1.5); }
@keyframes sc-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(224, 163, 60, .25) } 50% { box-shadow: 0 0 0 9px rgba(224, 163, 60, .05) } }
.sc-map__legend {
  position: absolute; inset-inline: 8px; bottom: 8px; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 5px 10px;
  padding: 7px 9px; border-radius: 11px;
  background: rgba(8, 16, 22, .82); border: 1px solid var(--sc-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 9px; color: var(--sc-muted);
}
.sc-map__legend span { display: inline-flex; align-items: center; gap: 5px; }
.sc-map__legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sc-map__picked {
  position: absolute; inset-inline-start: 8px; top: 8px; z-index: 3;
  padding: 6px 10px; border-radius: 10px; font-size: 10px; font-weight: 700;
  background: rgba(8, 16, 22, .85); border: 1px solid rgba(229, 189, 103, .35); color: var(--sc-gold);
}

/* نقشهٔ تعاملی کرهٔ جهان */
.sc-world-globe-host { display:block; width:100%; min-width:0; margin:12px 0 18px; }

/* -------------------------------------------------------------- متن و دکمه */
.sc-note { margin: 0; font-size: 10px; line-height: 1.95; color: var(--sc-muted); text-align: center; }
.sc-empty {
  padding: 26px 16px; text-align: center; font-size: 11px; line-height: 1.9; color: var(--sc-muted);
  border: 1px dashed var(--sc-line); border-radius: 14px; background: rgba(15, 28, 38, .6);
}
.sc-btn {
  min-height: 46px; width: 100%; border: 0; border-radius: 13px;
  background: linear-gradient(150deg, #e8cd96, #b98f3f); color: #14202a;
  font-size: 12.5px; font-weight: 800;
}
.sc-btn:active { transform: scale(.98); }
.sc-btn--ghost { background: transparent; color: var(--sc-ink); border: 1px solid var(--sc-line-2); }
.sc-btn:disabled { opacity: .5; }

/* ------------------------------------------------------------------- اسپینر */
.sc-loader { display: grid; place-items: center; padding: 34px 0; }
.sc-loader i {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(183, 205, 220, .18); border-top-color: var(--sc-gold);
  animation: sc-spin .8s linear infinite;
}
@keyframes sc-spin { to { transform: rotate(360deg) } }
.sc-skel { height: 92px; border-radius: 14px; background: linear-gradient(100deg, #101d29 30%, #16283a 50%, #101d29 70%); background-size: 240% 100%; animation: sc-shim 1.2s infinite; }
@keyframes sc-shim { from { background-position: 140% 0 } to { background-position: -40% 0 } }

/* ------------------------------------------------------------------- اعلان */
.sc-toast {
  position: fixed; inset-inline: 16px; bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 10050; padding: 12px 15px; border-radius: 13px;
  background: #17293a; border: 1px solid var(--sc-line-2);
  color: var(--sc-ink); font-size: 11.5px; line-height: 1.7; text-align: center;
  box-shadow: 0 16px 40px #0009;
  animation: sc-toast-in .26s cubic-bezier(.2, .85, .2, 1);
}
.sc-toast.error { background: #3a1f1e; border-color: rgba(226, 104, 95, .45); }
@keyframes sc-toast-in { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

/* --------------------------------------------------------------- شیت پایین */
.scene-sheet-backdrop { position: fixed; inset: 0; z-index: 10020; background: rgba(4, 9, 14, .68); animation: sc-fade .2s; }
@keyframes sc-fade { from { opacity: 0 } to { opacity: 1 } }
.scene-sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10030;
  max-width: 560px; margin: 0 auto;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #16283a, #0d1a24);
  border-top: 1px solid var(--sc-line-2);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 50px #000a;
  animation: sc-sheet-in .3s cubic-bezier(.2, .85, .2, 1);
  max-height: 82dvh; overflow-y: auto;
}
@keyframes sc-sheet-in { from { transform: translateY(100%) } to { transform: none } }
.scene-sheet__grip { width: 42px; height: 4px; margin: 4px auto 12px; border-radius: 99px; background: var(--sc-line-2); }
.scene-sheet__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.scene-sheet__head b { flex: 1; font-size: 13.5px; }
.scene-sheet__x {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--sc-line);
  background: #0f1c26; color: var(--sc-ink); font-size: 17px; line-height: 1;
}
.scene-sheet__body { display: flex; flex-direction: column; gap: 11px; margin-bottom: 14px; }
.scene-sheet__art { height: 104px; border-radius: 13px; background-position: center; background-size: cover; border: 1px solid var(--sc-line); }

.sc-stepper { display: flex; align-items: center; gap: 10px; }
.sc-stepper button {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px;
  border: 1px solid var(--sc-line); background: var(--sc-panel-2); color: var(--sc-ink); font-size: 20px; line-height: 1;
}
.sc-stepper button:active { transform: scale(.94); }
.sc-stepper input {
  flex: 1; min-width: 0; height: 46px; text-align: center;
  border-radius: 13px; border: 1px solid var(--sc-line);
  background: #0b1620; color: var(--sc-gold);
  font-size: 17px; font-weight: 800; font-family: inherit;
  -moz-appearance: textfield;
}
.sc-stepper input::-webkit-outer-spin-button, .sc-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sc-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.sc-quick button {
  min-height: 36px; border-radius: 10px; border: 1px solid var(--sc-line);
  background: #0f1c26; color: var(--sc-muted); font-size: 11px; font-weight: 700;
}
.sc-quick button:active { background: var(--sc-panel-2); color: var(--sc-gold); }
.sc-kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--sc-muted); }
.sc-kv b { font-size: 13px; color: var(--sc-ink); }
.sc-kv.is-total { padding-top: 9px; border-top: 1px solid var(--sc-line); }
.sc-kv.is-total b { color: var(--sc-gold); }

@media (min-width: 560px) {
  .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #scene-overlay, .sc-card, .sc-row, .sc-toast, .scene-sheet { animation: none !important; }
  .sc-map__dot.is-recent { animation: none; }
}
