/* Hydrovalve: Pipe Flow — Steampunk Brass Rail 16:9 Desktop Stylesheet (100% Offline, ZERO Google Fonts, ZERO backdrop-filter blur) */

:root {
  --font-display: 'Bahnschrift', 'Impact', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --ink-dark: #1E1713;
  --ink-cream: #FAF0D7;
  --brass-gold: #E6A93B;
  --brass-deep: #6E471E;
  --copper-glow: #DA9A59;
  --slate-bg: #263338;
  --sage-accent: #80C29D;
  --danger-red: #C83E37;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #1A1614;
  color: var(--ink-cream);
  font-family: var(--font-body);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* ==================== HEROIC NO-BOX TITLE SCREEN ==================== */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: url('../assets/art/title_bg.jpg') center center / cover no-repeat;
  overflow: hidden;
}

.title-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(20, 15, 10, 0.14) 0%, rgba(16, 12, 8, 0.58) 100%);
  pointer-events: none;
}

.title-corner-dock {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
}

.title-corner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  min-width: 46px;
  padding: 0 10px;
  color: var(--ink-cream);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  overflow: visible !important;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
}

.title-corner-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

/* Strictly transparent floating hero cluster (ZERO login-box background or border!) */
.title-hero-stage {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 24px 36px;
  background: transparent;
  border: none;
}

#title-hero-wrap {
  position: relative;
  width: clamp(148px, 17vw, 224px);
  height: clamp(148px, 17vw, 224px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
}

#title-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.title-logo {
  font-family: 'Arial Black', 'Impact', 'Trebuchet MS', sans-serif;
  font-size: clamp(46px, 6.2vw, 84px);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.04;
  color: #FFF6DC;
  paint-order: stroke fill;
  -webkit-text-stroke: 8px #2B1A0D;
  text-shadow: 0 7px 0 #1E1208, 0 14px 26px rgba(0, 0, 0, 0.65);
  text-align: center;
  background: transparent;
  border: none;
}

.title-sub {
  font-family: 'Arial Black', 'Impact', 'Trebuchet MS', sans-serif;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #FFE082;
  paint-order: stroke fill;
  -webkit-text-stroke: 5px #2B1A0D;
  text-shadow: 0 4px 0 #1E1208, 0 6px 14px rgba(0, 0, 0, 0.55);
}

#title-loader {
  width: min(360px, 76vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.load-bar-track {
  width: 100%;
  height: 30px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
}

#title-load-fill {
  height: 100%;
  width: 0%;
  transition: width 0.12s ease-out;
  min-width: 16px;
}

.load-meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #FFF7DF;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.85);
}

/* Harmonize UI Vault v2.2 Tactile 9-slice PNG borders (zero rectangular inset-box bleed outside rounded brass corners!) */
.uiv-steampunk_brass_rail-frame-modal,
.uiv-steampunk_brass_rail-ribbon-header,
.uiv-steampunk_brass_rail-hud-pill,
.uiv-steampunk_brass_rail-slot-tile,
.uiv-steampunk_brass_rail-btn-primary,
.uiv-steampunk_brass_rail-btn-secondary,
.uiv-steampunk_brass_rail-btn-danger,
.uiv-steampunk_brass_rail-btn-disabled,
.uiv-steampunk_brass_rail-card-common,
.uiv-steampunk_brass_rail-card-rare,
.uiv-steampunk_brass_rail-card-epic,
.uiv-steampunk_brass_rail-tab-active {
  box-shadow: none;
}

/* Symmetric gleaming brass caps on all HUD pills */
.uiv-steampunk_brass_rail-hud-pill {
  border-width: 6px 14px 6px 14px;
  border-image-width: 6px 14px 6px 14px;
}

/* Crisp high-contrast bright cream lettering with dark outline on amber/teal brass buttons */
.uiv-steampunk_brass_rail-btn-primary,
.uiv-steampunk_brass_rail-btn-secondary {
  color: #FFF9E8 !important;
  paint-order: stroke fill;
  -webkit-text-stroke: 2.4px #1E140B;
  text-shadow: 0 2px 0 #1E140B;
}

#btn-title-play {
  margin-top: 8px;
  min-width: 248px;
  min-height: 66px;
  padding: 4px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Arial Black', 'Impact', 'Trebuchet MS', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #FFF9E8;
  paint-order: stroke fill;
  -webkit-text-stroke: 3.5px #221409;
  text-shadow: 0 3px 0 #221409;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}

/* ==================== FULL-BLEED GAMEPLAY STAGE ==================== */
#game-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: url('../assets/art/arena_bg.jpg') center center / cover no-repeat;
}

#game-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 52% 50%, rgba(24, 18, 12, 0.06) 24%, rgba(18, 13, 8, 0.42) 100%);
  pointer-events: none;
  z-index: 0;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

#cutin-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 65;
  pointer-events: none;
  display: none;
}

#ui-motion-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 70;
  pointer-events: none;
  display: none;
}

/* ==================== FLOATING HUD (pointer-events: none wrapper!) ==================== */
#hud-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 16px 12px;
}

#hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-height: 48px;
}

.hud-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.hud-pill-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 8px;
  color: #FAF0D7;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 800;
  white-space: nowrap;
  overflow: visible !important;
}

.hud-pill-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.hud-pill-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.hud-stat-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 6px;
  color: #FAF0D7;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-stat-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-stat-sub {
  color: #FFD773;
  font-size: 13px;
}

.hud-icon-btn {
  pointer-events: auto;
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  flex-shrink: 0;
}

/* Adjust border-image thickness cleanly on compact 46px icon tiles so icons fill 62%+ */
.hud-icon-btn.uiv-steampunk_brass_rail-slot-tile {
  border-width: 7px;
  border-image-width: 7px;
}

.hud-icon-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.notify-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #E8382F;
  border: 2px solid #FFF4D2;
  z-index: 30;
  pointer-events: none;
}

/* Floating compact objective & live diagnostic bar directly beneath top HUD */
#hud-subbar {
  position: fixed;
  top: 60px;
  left: 16px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.obj-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(28, 22, 18, 0.82);
  border: 1.5px solid #B87333;
  color: #FAF0D7;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1.5px solid #B87333;
}

.status-ready { background: rgba(34, 49, 55, 0.86); color: #FFE39E; }
.status-flow  { background: rgba(15, 76, 110, 0.90); color: #9BEFFF; border-color: #28C7FA; }
.status-ok    { background: rgba(20, 88, 52, 0.92); color: #B2FFD6; border-color: #3CE38A; }
.status-err   { background: rgba(128, 28, 24, 0.92); color: #FFD2CC; border-color: #FF6B5A; }

.ticket-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(36, 26, 18, 0.88);
  border: 1.5px solid #E6A93B;
  color: #FFE8A3;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ticket-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Construct Parts Tray (only visible in Pack 2 Construct levels) */
#construct-tray {
  pointer-events: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(30, 23, 19, 0.86);
  border: 2px solid #C98B38;
  margin-bottom: 6px;
}

.tray-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #FFD97D;
  margin-right: 4px;
}

.construct-btn {
  position: relative;
  width: 66px;
  height: 66px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
}

.construct-btn.uiv-steampunk_brass_rail-slot-tile {
  border-width: 8px;
  border-image-width: 8px;
}

.construct-btn.selected {
  outline: 3px solid #FFD859;
  outline-offset: 2px;
}

/* Compact Bottom Booster & Valve Dock (74x74px boosters, 62% icon fill, overflow: visible!) */
#hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  pointer-events: none;
}

.bottom-dock-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px;
}

.tool-btn {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  flex-shrink: 0;
}

.tool-btn.uiv-steampunk_brass_rail-slot-tile {
  border-width: 7px;
  border-image-width: 7px;
}

.tool-ico {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}

.tool-key {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 5px;
  background: #2B1F16;
  border: 1.5px solid #E6A93B;
  color: #FFF4D2;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
}

.tool-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 10px;
  background: #C83E37;
  border: 1.5px solid #FFF4D2;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
}

#btn-open-valve {
  min-width: 196px;
  height: 62px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #FFF9E8;
  overflow: visible !important;
}

#btn-open-valve.uiv-steampunk_brass_rail-btn-primary {
  border-width: 10px 36px 10px 36px;
  border-image-width: 10px 36px 10px 36px;
}

/* ==================== VISUAL SPOTLIGHT FTUE (ZERO BLOCKING SCRIM!) ==================== */
#ftue-overlay {
  position: fixed;
  inset: 0;
  z-index: 32;
  pointer-events: none;
}

#tut-spotlight {
  position: fixed;
  border-radius: 14px;
  border: 4px solid #FFD859;
  box-shadow: 0 0 0 4px rgba(255, 216, 89, 0.35);
  animation: tutPulse 1.1s ease-in-out infinite;
  pointer-events: none;
}

#tut-hand {
  position: fixed;
  width: 48px;
  height: 48px;
  pointer-events: none;
  animation: tutTap 0.95s ease-in-out infinite;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.65));
}

#tut-pill {
  position: fixed;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 16px;
  background: #231912;
  border: 2px solid #F2BE4E;
  color: #FFF4D2;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

#btn-ftue-skip {
  position: fixed;
  top: 64px;
  right: 18px;
  pointer-events: auto;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #FFF9E8;
}

#btn-ftue-skip.uiv-steampunk_brass_rail-btn-secondary {
  border-width: 8px 20px 8px 14px;
  border-image-width: 8px 20px 8px 14px;
}

@keyframes tutPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.08); opacity: 0.65; }
}

@keyframes tutTap {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8px, -8px) scale(0.92); }
}

/* ==================== FLEX-SCROLL STEAMPUNK MODALS (ZERO CLIP AT 720P!) ==================== */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 12, 8, 0.76);
  padding: 18px;
}

.modal-card {
  width: min(920px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink-dark);
}

.modal-card.uiv-steampunk_brass_rail-frame-modal {
  border-width: 24px 26px 24px 26px;
  border-image-width: 24px 26px 24px 26px;
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 10px;
}

.modal-ribbon {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #FFF5DA;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
}

.modal-ribbon.uiv-steampunk_brass_rail-ribbon-header {
  border-width: 6px 34px 10px 34px;
  border-image-width: 6px 34px 10px 34px;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.modal-help-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #8A5820;
  background: #F4DFB4;
  color: #1E1713;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-x {
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-x img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 10px;
}

.modal-footer {
  flex: 0 0 auto;
  padding: 8px 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Tabs & Grids */
.modal-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.tab-btn {
  min-width: 140px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.tab-btn.uiv-steampunk_brass_rail-btn-secondary {
  border-width: 8px 20px 8px 14px;
  border-image-width: 8px 20px 8px 14px;
}

.modal-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

.modal-grid > * {
  min-width: 0;
  max-width: 100%;
}

.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-1 { grid-template-columns: minmax(0, 320px); justify-content: center; }

/* Anti-SaaS 60/25/15 Illustrated Cards */
.shop-card, .upgrade-card, .quest-card, .pack-card, .season-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px;
  min-height: 205px;
  color: var(--ink-dark);
  overflow: visible !important;
}

.shop-card.uiv-steampunk_brass_rail-card-common,
.upgrade-card.uiv-steampunk_brass_rail-card-common,
.quest-card.uiv-steampunk_brass_rail-card-common,
.pack-card.uiv-steampunk_brass_rail-card-common,
.season-card.uiv-steampunk_brass_rail-card-common,
.shop-card.uiv-steampunk_brass_rail-card-rare,
.upgrade-card.uiv-steampunk_brass_rail-card-rare,
.quest-card.uiv-steampunk_brass_rail-card-rare,
.pack-card.uiv-steampunk_brass_rail-card-rare,
.season-card.uiv-steampunk_brass_rail-card-rare,
.shop-card.uiv-steampunk_brass_rail-card-epic,
.upgrade-card.uiv-steampunk_brass_rail-card-epic,
.quest-card.uiv-steampunk_brass_rail-card-epic,
.pack-card.uiv-steampunk_brass_rail-card-epic,
.season-card.uiv-steampunk_brass_rail-card-epic {
  border-width: 12px;
  border-image-width: 12px;
}

.card-gold-accent {
  outline: 2px solid rgba(230, 169, 59, 0.72);
  outline-offset: -3px;
}

.thumb-box {
  width: 100%;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.thumb-img {
  width: 100%;
  height: 100%;
  max-width: 122px;
  max-height: 112px;
  object-fit: contain;
}

.lbl-name {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 900;
  color: #1E1713;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.cur-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #1E1713;
}

.cur-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.stat-pill {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(42, 34, 30, 0.14);
  color: #2B1F16;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.cta-btn {
  width: 100%;
  min-height: 40px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.cta-btn.uiv-steampunk_brass_rail-btn-primary,
.cta-btn.uiv-steampunk_brass_rail-btn-secondary,
.cta-btn.uiv-steampunk_brass_rail-btn-disabled {
  border-width: 8px 18px 8px 18px;
  border-image-width: 8px 18px 8px 18px;
}

.cta-btn .cur-chip {
  color: #FFF9E8;
}

.cta-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-tag, .lv-tag {
  position: absolute;
  top: -10px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: #FFF9E6;
  z-index: 6;
  pointer-events: none;
}

.badge-starter { background: #2E8B8B; }
.badge-popular { background: #D97706; }
.badge-best    { background: #C83E37; }
.lv-tag        { background: #3E3026; border: 1.5px solid #E6A93B; }

/* Inline Level-Select Strip inside PACKS cards (#4008) & Mastery Rank Banner (#4004) */
.pack-lv-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 1px 0 2px;
}

.pack-lv-btn {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid #8A5820;
  background: #E8D5AF;
  color: #2B1F16;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 90ms ease, filter 110ms ease;
}

.pack-lv-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.pack-lv-btn.cleared {
  background: #D99B32;
  border-color: #6B4214;
  color: #FFF9E6;
}

.pack-lv-btn.current {
  background: #2E8B8B;
  border-color: #FFF4D2;
  color: #FFFFFF;
  outline: 1.5px solid #2E8B8B;
}

.pack-archive-btn {
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid #8A5820;
  background: #3A2C22;
  color: #FFE49E;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.pack-archive-btn:hover {
  filter: brightness(1.12);
}

.mastery-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(42, 34, 30, 0.12);
  border: 1px solid rgba(138, 84, 32, 0.35);
}

/* Settings, Guide, Victory, Exit */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px 8px;
}

.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(42, 34, 30, 0.1);
}

.setting-lbl {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #1E1713;
}

.setting-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-toggle {
  min-width: 72px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}

.mini-toggle.uiv-steampunk_brass_rail-btn-primary,
.mini-toggle.uiv-steampunk_brass_rail-btn-secondary,
.mini-toggle.uiv-steampunk_brass_rail-btn-danger {
  border-width: 7px 14px;
  border-image-width: 7px 14px;
}

.setting-lang-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(42, 34, 30, 0.08);
}

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

.lang-chip {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
}

.lang-chip.uiv-steampunk_brass_rail-btn-secondary {
  border-width: 7px 14px;
  border-image-width: 7px 14px;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-actions > button {
  min-width: 146px;
  height: 46px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}

.footer-actions > button.uiv-steampunk_brass_rail-btn-primary,
.footer-actions > button.uiv-steampunk_brass_rail-btn-secondary,
.footer-actions > button.uiv-steampunk_brass_rail-btn-danger {
  border-width: 8px 22px;
  border-image-width: 8px 22px;
}

.footer-balance {
  padding: 4px 14px;
  border-radius: 14px;
  background: rgba(42, 34, 30, 0.14);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.footer-seasons-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.footer-claim-all {
  min-width: 156px;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.footer-claim-all.uiv-steampunk_brass_rail-btn-primary,
.footer-claim-all.uiv-steampunk_brass_rail-btn-disabled {
  border-width: 8px 20px;
  border-image-width: 8px 20px;
}

.vip-pill {
  background: #8A5420;
  color: #FFF4D2;
  border: 1px solid #FFD859;
}

.ver-chip {
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(42, 34, 30, 0.14);
  color: #4A3728;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.reset-confirm-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(200, 62, 55, 0.14);
  border: 1.5px solid #C83E37;
}

.reset-confirm-msg {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #7D1E19;
}

.reset-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vic-double-btn {
  min-width: 224px;
  height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}

.vic-double-btn.uiv-steampunk_brass_rail-btn-primary,
.vic-double-btn.uiv-steampunk_brass_rail-btn-disabled {
  border-width: 8px 22px;
  border-image-width: 8px 22px;
}

.vic-double-btn .cur-chip {
  color: #FFF9E8;
}

/* 3-Icon Visual Flow Guide */
.guide-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 6px;
}

.guide-step {
  width: 185px;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
}

.guide-step.uiv-steampunk_brass_rail-card-common {
  border-width: 12px;
  border-image-width: 12px;
}

.guide-art {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.guide-lbl {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #1E1713;
  text-align: center;
}

.guide-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.guide-arrow-svg {
  width: 28px;
  height: 24px;
  display: block;
}

/* Victory / Exit / Chest */
.victory-banner, .exit-clean {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 10px;
}

.vic-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.vic-star {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.vic-star.dim {
  opacity: 0.25;
  filter: grayscale(1);
}

.vic-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.vic-chip {
  padding: 6px 16px;
  border-radius: 14px;
  background: rgba(42, 34, 30, 0.14);
}

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

.exit-headline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #1E1713;
  text-align: center;
  margin-bottom: 10px;
}

/* Toast Notification */
#toast-banner {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 95;
  padding: 8px 20px;
  border-radius: 16px;
  background: #231912;
  border: 2px solid #E6A93B;
  color: #FFF4D2;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* Preview-Only [DEV F2] Panel */
#dev-f2-pill {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 90;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(24, 24, 34, 0.85);
  border: 1px solid #E6A93B;
  color: #FFD773;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#debug-panel {
  position: fixed;
  bottom: 44px;
  right: 10px;
  z-index: 92;
  width: 196px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(24, 20, 18, 0.94);
  border: 2px solid #E6A93B;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dbg-head {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: #FFD773;
  text-align: center;
}

#debug-panel button {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #B87333;
  background: #352920;
  color: #FAF0D7;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Compact 1280x720 & Narrow Viewport Safeguards */
@media (max-width: 1360px) {
  #hud-top { gap: 5px; }
  .hud-group { gap: 5px; }
  .hud-pill-btn { height: 40px; font-size: 13px; padding: 0 5px; }
  .hud-pill-btn > span { max-width: 132px; }
  .hud-stat-pill { height: 40px; font-size: 13px; padding: 0 4px; }
  .hud-icon-btn { width: 42px; height: 42px; }
  .hud-icon-btn img { width: 25px; height: 25px; }
  .tool-btn { width: 70px; height: 70px; }
  .tool-ico { width: 38px; height: 38px; }
  .pack-lv-btn { width: 25px; height: 22px; font-size: 11px; }
  .mastery-banner { margin-bottom: 6px; padding: 3px 8px; gap: 6px; }
  #btn-open-valve { min-width: 172px; height: 56px; font-size: 16px; }
  .thumb-box { height: 74px; }
  .thumb-img { max-height: 74px; max-width: 96px; }
  .shop-card, .upgrade-card, .quest-card, .pack-card, .season-card { min-height: 162px; gap: 4px; }
  .tab-btn { min-width: 112px; height: 36px; font-size: 13px; padding: 0 8px; }
}

@media (max-height: 780px) {
  .thumb-box { height: 72px; }
  .thumb-img { max-height: 72px; max-width: 96px; }
  .shop-card, .upgrade-card, .quest-card, .pack-card, .season-card { min-height: 158px; gap: 4px; padding: 5px; }
  .cta-btn { min-height: 36px; font-size: 13px; }
  .modal-tabs { margin-bottom: 8px; gap: 8px; }
  .tab-btn { min-width: 112px; height: 36px; font-size: 13px; }
  .settings-panel { gap: 5px; padding: 2px 6px; }
  .setting-line { padding: 4px 10px; }
  .mini-toggle { height: 32px; }
  .lang-chip { height: 33px; }
  .reset-confirm-box { padding: 5px 10px; }
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-strip { flex-direction: column; }
  .guide-arrow { transform: rotate(90deg); }
}
