/* Vaultbreak Skyrun 3D — Offline Commercial Cyber PCB Terminal Stylesheet
 * 100% Offline MS Store WebView2 Safe · ZERO external URLs · ZERO backdrop-filter blur
 * 720p & 1080p 9-Language Anti-Overflow · Round 5 Booster Proportions · Anti-SaaS 60/25/15 Modals
 */

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

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #04070A;
  color: #E8F6F2;
  font-family: var(--uiv-font-display, 'Segoe UI', sans-serif);
  user-select: none;
}

.is-hidden {
  display: none !important;
}

/* Full-Bleed 100vw x 100vh 3D Viewport + Layered FX Canvases */
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

#vfx-2d-canvas,
#vfx-3d-canvas,
#cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
#vfx-2d-canvas { z-index: 12; }
#vfx-3d-canvas { z-index: 13; }
#cutin-canvas  { z-index: 45; }

/* ============================================================================
 * TITLE SCREEN (Unboxed Cyber-Vault Title + Live Portrait, Disposed on Play!)
 * ============================================================================ */
#title-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px 34px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(12, 32, 54, 0.35), rgba(4, 7, 10, 0.86) 78%),
    url('../assets/art/title_bg.jpg') center / cover no-repeat;
}

.title-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.title-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #63D3DC;
}

.title-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  max-width: 920px;
}

#title-hero-stage {
  position: relative;
  width: clamp(190px, 22vh, 270px);
  height: clamp(190px, 22vh, 270px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 245, 212, 0.32));
}

.title-main-heading {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 62px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  text-shadow: 0 4px 0 #091322, 0 0 22px rgba(70, 224, 138, 0.55);
  line-height: 1.05;
}

.title-tagline {
  margin: 0;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: clamp(12.5px, 1.1vw, 15px);
  letter-spacing: 0.14em;
  color: #63D3DC;
}

#title-course-pills {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.title-course-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 13px;
  border-width: 5px 8px !important;
  border-image-width: 5px 8px !important;
  flex-shrink: 0;
}

.pill-stars {
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 12px;
  color: #FFB23E;
}

/* Main Menu PLAY CTA — Clean, high-contrast, ZERO attachSlotBorder! */
#btn-play-game {
  min-width: 240px;
  height: 62px;
  padding: 0 38px;
  font-size: 24px;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ============================================================================
 * FLOATING CORNER GAMEPLAY HUD (720p & 1080p Zero-Overflow Border-Width Lock!)
 * ============================================================================ */
#gameplay-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 14px 12px;
}

.hud-top-bar {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-cluster {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

/* CRITICAL 720p BORDER-WIDTH RULE */
.hud-pill,
.hud-nav-btn,
#btn-quit-game {
  border-width: 5px 8px !important;
  border-image-width: 5px 8px !important;
  flex-shrink: 0;
  white-space: nowrap;
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--uiv-font-hud, 13.5px);
  line-height: 1;
}

.hud-chip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-nav-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-num {
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #E8F6F2;
}

.hud-timer-pill {
  gap: 10px;
  padding: 0 14px;
}

#hud-timer-val {
  color: #46E08A;
  font-size: 16px;
}

#hud-course-name {
  color: #63D3DC;
  font-size: 13px;
}

#hud-tier-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--uiv-font-body, Consolas, monospace);
}

#hud-split-delta {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 6px;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 18px;
  font-weight: 800;
  z-index: 25;
  pointer-events: none;
  background: rgba(8, 16, 26, 0.92);
  border: 2px solid #46E08A;
}
#hud-split-delta.split-ahead { color: #46E08A; border-color: #46E08A; }
#hud-split-delta.split-behind { color: #FF4F4F; border-color: #FF4F4F; }

#hud-toast {
  position: fixed;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  background: rgba(10, 20, 32, 0.94);
  border: 2px solid #63D3DC;
  border-radius: 6px;
  color: #E8F6F2;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  z-index: 60;
  pointer-events: none;
}

/* 3-Icon Visual Guide Popover (?) */
#guide-popover {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 28;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}

.guide-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.guide-cell img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ============================================================================
 * BOTTOM COMPACT ROUND 5 BOOSTER BAR (68-84px tall, icon >= 58%, overflow:visible)
 * ============================================================================ */
.hud-bottom-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

#ftue-bar {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  background: rgba(9, 19, 30, 0.92);
  border: 2px solid #46E08A;
  border-radius: 8px;
  font-size: 13px;
  color: #E8F6F2;
}

#btn-tut-skip {
  border-width: 4px 6px !important;
  border-image-width: 4px 6px !important;
  padding: 3px 10px;
  font-size: 12px;
}

#booster-dock {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

/* Round 5 Booster Law: height 76px (68px @ 720p), direct child img.booster-icon 44px FIRST */
.booster-btn {
  position: relative;
  overflow: visible !important;
  width: 92px;
  height: 76px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-width: 6px 6px !important;
  border-image-width: 6px 6px !important;
  flex-shrink: 0;
}

.booster-btn > img.booster-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}

.booster-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #E8F6F2;
  line-height: 1;
  white-space: nowrap;
}

.booster-key {
  position: absolute;
  top: -8px;
  left: -6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #0B1117;
  border: 1px solid #63D3DC;
  color: #63D3DC;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.booster-cost-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #142234;
  border: 1px solid #FFB23E;
  color: #FFB23E;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  pointer-events: none;
}

.booster-chip {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.booster-btn.is-armed {
  outline: 2px solid #46E08A;
  outline-offset: 2px;
}

/* ============================================================================
 * ANTI-SAAS 60/25/15 VISUAL-FIRST MODAL SHELL
 * ============================================================================ */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 8, 14, 0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#active-modal-card {
  width: min(1040px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 16px;
  overflow: hidden;
}

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

#modal-title-text {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #46E08A;
}

#btn-modal-close {
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#btn-modal-close img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

#modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px;
}

.vt-btn {
  position: relative;
  transition: transform 95ms cubic-bezier(0.22, 1.4, 0.36, 1), filter 120ms ease;
  box-shadow: inset 0 1px 0 var(--uiv-bevel-hi), inset 0 -2px 0 var(--uiv-bevel-lo);
  transform-origin: center center;
}
.vt-btn:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.vt-btn:active:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(2px) scale(var(--uiv-press-sx, 0.965), var(--uiv-press-sy, 0.935));
}
.vt-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.42) brightness(0.84);
  transform: none !important;
}

.vt-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.vt-tab {
  border-width: 5px 8px !important;
  border-image-width: 5px 8px !important;
  padding: 6px 14px;
  font-size: 13.5px;
}

.vt-grid {
  display: grid;
  gap: 12px;
}
.vt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vt-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vt-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Outer Modal Card (.vault-tile) — >= 55% Artwork, <= 3-word Title, 0 Prose Walls */
.vault-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0D1622;
  border-radius: 6px;
  padding: 8px;
  gap: 6px;
  min-height: 224px;
  overflow: visible;
}

.vt-art {
  position: relative;
  width: 100%;
  height: 126px;
  border-radius: 4px;
  background: radial-gradient(circle at 50% 45%, #162940, #09111B 82%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vt-art-img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.vt-art-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vt-art-emblem {
  position: absolute;
  width: 44px;
  height: 44px;
  bottom: 6px;
  right: 6px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.vt-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(6, 12, 20, 0.88);
  border: 1px solid #63D3DC;
  color: #63D3DC;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 12px;
  font-weight: 800;
}

.vt-badge-gold {
  border-color: #FFB23E;
  color: #FFB23E;
}

.vt-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.vt-title {
  font-size: 14px;
  font-weight: 800;
  color: #E8F6F2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vt-stat {
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 12.5px;
  color: #63D3DC;
}

.vt-chips {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 13px;
  font-weight: 800;
  color: #FFB23E;
}

.vt-chip-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.vt-dim { opacity: 0.28; filter: grayscale(1); }

.vt-dual-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.vt-subchip.vt-done {
  opacity: 0.45;
  text-decoration: line-through;
}

.vt-cta {
  width: 100%;
  height: 36px;
  border-width: 5px 8px !important;
  border-image-width: 5px 8px !important;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vt-strip {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-width: 8px !important;
  border-image-width: 8px !important;
}

.vt-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vt-strip-art {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.vt-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vt-gift-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vt-input {
  height: 36px;
  width: 168px;
  padding: 0 10px;
  background: #060C14;
  border: 2px solid #46E08A;
  border-radius: 4px;
  color: #E8F6F2;
  font-family: var(--uiv-font-body, Consolas, monospace);
  font-size: 13px;
  text-transform: uppercase;
}

.vt-btn-chip {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.vt-exit-art {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

/* Settings Modal */
.stg-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stg-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-width: 10px !important;
  border-image-width: 10px !important;
}

.stg-head {
  font-size: 14px;
  color: #63D3DC;
  letter-spacing: 0.06em;
}

.stg-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stg-lbl {
  min-width: 86px;
  font-size: 13.5px;
}

.stg-slider {
  flex: 1;
  accent-color: #46E08A;
}

.stg-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stg-lang-btn {
  border-width: 5px 8px !important;
  border-image-width: 5px 8px !important;
  height: 36px;
  font-size: 13px;
}

/* Preview-Only [DEV F2] Drawer */
#dev-drawer {
  position: fixed;
  top: 58px;
  left: 14px;
  z-index: 55;
  background: rgba(6, 11, 18, 0.96);
  border: 2px solid #FFB23E;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 340px;
  pointer-events: auto;
}

#dev-drawer button {
  padding: 5px 8px;
  font-size: 12px;
  background: #142234;
  color: #FFB23E;
  border: 1px solid #FFB23E;
  border-radius: 4px;
  cursor: pointer;
}

/* ============================================================================
 * 1280x720 RESPONSIVE COMPRESSION (ZERO OVERFLOW ACROSS ALL 9 LANGUAGES!)
 * ============================================================================ */
@media (max-width: 1366px), (max-height: 768px) {
  #gameplay-hud { padding: 8px 10px 10px; }
  .hud-top-bar { gap: 4px; }
  .hud-cluster { gap: 4px; }
  .hud-pill,
  .hud-nav-btn,
  #btn-quit-game {
    height: 34px;
    padding: 0 7px;
    gap: 4px;
    font-size: 12.5px;
  }
  .hud-chip-icon,
  .hud-nav-icon {
    width: 17px;
    height: 17px;
  }
  .booster-btn {
    width: 82px;
    height: 68px;
  }
  .booster-btn > img.booster-icon {
    width: 38px;
    height: 38px;
  }
  .vault-tile { min-height: 196px; padding: 6px; }
  .vt-art { height: 106px; }
}
