/**
 * tokens.css — Design token variables & UI component styles for Life Journey.
 * Sesuai panduan di docs/UI-DESIGN-RULES.md dan STYLE-BIBLE.md.
 */

:root {
  /* === Primary palette tokens === */
  --color-cream-light:    #F7EEDA;
  --color-cream-mid:      #E9D8B4;
  --color-green-light:    #A5BE93;
  --color-green-mid:      #6F9262;
  --color-green-dark:     #44603F;
  --color-brown-light:    #C9A27A;
  --color-brown-mid:      #9A6F4C;
  --color-brown-dark:     #5E3F2A;
  --color-navy-mid:       #34456B;
  --color-navy-dark:      #1F2A44;
  --color-navy-deepest:   #121A2E;
  --color-terracotta:     #C0654A;
  --color-terracotta-dark:#9E4A33;
  --color-gold:           #D9A441;

  /* === Extended palette === */
  --color-grey-light:     #9AA0AA;
  --color-dark-brown:     #2A1F1A;
  --color-off-white:      #FBF6EA;
  --color-tan:            #B8A88A;
  --color-dark-green:     #3D5236;
  --color-deep-navy:      #28344F;
  --color-burnt:          #8B4A36;
  --color-amber:          #C4832E;
  --color-grey-blue:      #7A8090;
  --color-parchment:      #F0E4C8;
  --color-forest:         #4A6B40;
  --color-midnight:       #162038;
  --color-sand:           #E8C9A8;
  --color-sienna:         #6B4A30;
  --color-sage:           #8B9680;
  --color-wheat:          #D4B890;
  --color-khaki:          #A09060;
  --color-slate:          #505860;

  /* === Semantic tokens === */
  --color-bg-primary:     var(--color-navy-deepest);
  --color-bg-panel:       var(--color-navy-dark);
  --color-bg-card:        var(--color-navy-mid);
  --color-bg-hud:         rgba(18, 26, 46, 0.94);
  --color-text-primary:   var(--color-off-white);
  --color-text-secondary: var(--color-cream-light);
  --color-text-muted:     var(--color-tan);
  --color-text-disabled:  var(--color-grey-light);
  --color-accent:         var(--color-gold);
  --color-accent-hover:   var(--color-amber);
  --color-danger:         var(--color-terracotta);
  --color-success:        var(--color-green-mid);
  --color-warning:        var(--color-gold);
  --color-border:         var(--color-navy-mid);
  --color-border-bright:  var(--color-gold);

  /* === Spacing === */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* === Font === */
  --font-ui:   'Nunito', system-ui, -apple-system, sans-serif;
  --font-mono: 'Courier New', monospace;

  /* === Radius === */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg: 16px;

  /* === Transitions === */
  --transition-fast: 120ms ease;
  --transition-mid:  240ms ease;
}

/* === Global reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  overflow: hidden;
  user-select: none;
}

/* ========================================================
   HUD (Heads-Up Display)
   ======================================================== */
.lj-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 50;
}

.lj-hud > * {
  pointer-events: auto;
}

/* ========================================================
   HARVEST MOON-STYLE UNIFIED STATUS DASHBOARD WIDGET
   ======================================================== */
.hm-status-widget {
  display: inline-flex;
  flex-direction: column;
  position: relative;
  background: #C46814;
  border: 2px solid #E89E44;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  padding: 6px 5px 5px 5px;
  gap: 4px;
  width: 224px;
  flex-shrink: 0;
  transition: opacity 0.25s ease;
}

.hm-status-widget:hover {
  opacity: 0.35;
}

/* Day tab on top of the widget */
.hm-day-tab {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1.5px solid #C46814;
  border-radius: 4px;
  padding: 1px 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.hm-day-text {
  font-size: 10px;
  font-weight: 800;
  color: #8C4008;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Main inner box */
.hm-main-box {
  display: flex;
  gap: 5px;
  margin-top: 2px;
  background: #DE852C;
  border: 1.5px solid #8C4008;
  border-radius: 4px;
  padding: 4px;
}

/* Left column: Sky dial box */
.hm-sky-box {
  width: 52px;
  height: 80px;
  border-radius: 3px;
  border: 1.5px solid #8C4008;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #3A7BD5 0%, #00D2FF 100%);
}

.hm-sky-box.sky-pagi {
  background: linear-gradient(180deg, #E89E44 0%, #4A88B8 100%);
}
.hm-sky-box.sky-siang {
  background: linear-gradient(180deg, #2A72BA 0%, #68BFF5 100%);
}
.hm-sky-box.sky-sore {
  background: linear-gradient(180deg, #BA4A20 0%, #E8902A 70%, #203048 100%);
}
.hm-sky-box.sky-malam {
  background: linear-gradient(180deg, #0A1024 0%, #162444 100%);
}

.hm-sky-marker {
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  transition: transform 0.3s ease;
}

.hm-sky-arrow {
  font-size: 11px;
  color: #D9A441;
  line-height: 1;
  font-weight: 900;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8));
}

/* Right column: Inset info boxes */
.hm-info-column {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  min-width: 0;
}

.hm-inset-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #8C4008;
  border-radius: 3px;
  padding: 1px 4px;
  height: 18px;
  gap: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hm-icon-img {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hm-date-text {
  font-size: 10px;
  font-weight: 700;
  color: #1A2033;
  white-space: nowrap;
}

.hm-time-text {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #1A2033;
  letter-spacing: 0.3px;
}

.hm-period-badge {
  font-size: 8px;
  font-weight: 800;
  color: #8C4008;
  background: #F7EEDA;
  border-radius: 2px;
  padding: 0 3px;
  margin-left: auto;
  border: 1px solid #D9A441;
}

.hm-cash-text, .hm-savings-text {
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #1A2033;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fuel / Bensin Bar directly below the box */
.hm-fuel-bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1.5px solid #8C4008;
  border-radius: 4px;
  padding: 2px 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hm-fuel-icon {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hm-fuel-track {
  flex-grow: 1;
  height: 11px;
  background: #D4CAB8;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  border: 1px solid #8C4008;
}

.hm-fuel-fill {
  height: 100%;
  background: #4ADE80;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.hm-fuel-fill.warning {
  background: #FACC15;
}

.hm-fuel-fill.danger {
  background: #F87171;
}

.hm-fuel-text {
  font-size: 8px;
  font-weight: 900;
  color: #121A2E;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Mission badge */
.hud-mission-badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-stats {
  flex-shrink: 0;
}

/* Badge komponen status */
.hud-badge {
  display: flex;
  align-items: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  gap: 5px;
  white-space: nowrap;
}

.hud-icon {
  font-size: 14px;
  line-height: 1;
}

.hud-icon-img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-icon-img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}

.card-icon-img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  vertical-align: middle;
  flex-shrink: 0;
}

.hud-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--color-navy-dark);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.tag-cash {
  color: var(--color-gold);
  border-color: rgba(217, 164, 65, 0.5);
}

.tag-savings {
  color: var(--color-green-light);
  border-color: rgba(165, 190, 147, 0.5);
}

.tag-gas {
  color: var(--color-amber);
  border-color: rgba(196, 131, 46, 0.5);
}

.tag-clock {
  color: var(--color-cream-light);
}

.tag-mission {
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.hud-btn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 4px 10px;
  white-space: nowrap;
}

.hud-label {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.hud-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}

.hud-val-cash, .hud-val-savings {
  color: var(--color-accent);
}

/* Fuel Bar di HUD */
.hud-gas-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-gas-bar {
  width: 44px;
  height: 6px;
  background: var(--color-navy-dark);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.hud-gas-fill {
  height: 100%;
  background: var(--color-success);
  transition: width var(--transition-fast), background-color var(--transition-fast);
}

.hud-gas-fill.warning {
  background: var(--color-warning);
}

.hud-gas-fill.danger {
  background: var(--color-danger);
}

/* Center group: Clock & Mission */
.hud-center {
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
}

/* ========================================================
   HARVEST MOON-INSPIRED TIME WIDGET & BAR WAKTU
   ======================================================== */
.hud-time-widget {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  gap: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Sky Dial Box (Left side, inspired by Harvest Moon sky gauge) */
.time-sky-box {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  border: 1px solid var(--color-border-bright);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #3A7BD5 0%, #00D2FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.time-sky-marker {
  font-size: 13px;
  line-height: 1;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

/* Sky gradient variations */
.time-sky-box.sky-pagi {
  background: linear-gradient(180deg, #E89E44 0%, #4A88B8 100%);
}
.time-sky-box.sky-siang {
  background: linear-gradient(180deg, #2A72BA 0%, #68BFF5 100%);
}
.time-sky-box.sky-sore {
  background: linear-gradient(180deg, #BA4A20 0%, #E8902A 70%, #203048 100%);
}
.time-sky-box.sky-malam {
  background: linear-gradient(180deg, #0A1024 0%, #162444 100%);
}

/* Info stack */
.time-info-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-row-top {
  display: flex;
  align-items: center;
  gap: 5px;
}

.time-day-pill {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--color-gold);
  color: var(--color-navy-deepest);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.time-date-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-cream-light);
  white-space: nowrap;
}

.time-row-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Digital clock box with clean inset */
.time-digital-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-navy-deepest);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 1px 5px;
}

.time-digital-val {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.time-colon-pulse {
  animation: colonBlink 1s infinite steps(1);
}

@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.time-period-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
  background: var(--color-navy-dark);
  color: var(--color-gold);
  border: 1px solid rgba(217, 164, 65, 0.4);
  text-transform: uppercase;
}

/* Visual 24h Time Bar (Bar Waktu yang berjalan) */
.time-bar-track {
  width: 52px;
  height: 6px;
  background: var(--color-navy-deepest);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  position: relative;
}

.time-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #D9A441, #6F9262, #4A88B8);
  transition: width 0.3s ease;
}

.clock-badge {
  color: var(--color-text-secondary);
  font-weight: 700;
  white-space: nowrap;
}

.mission-badge {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-color: var(--color-accent);
}

.hud-val-mission {
  color: var(--color-cream-light);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animasi Misi Selesai (Rule 77) */
.hud-mission-badge.mission-complete-anim {
  animation: missionPulse 1.2s ease-out;
  border-color: #D9A441 !important;
  box-shadow: 0 0 8px rgba(217, 164, 65, 0.6);
}

@keyframes missionPulse {
  0% { transform: scale(1.0); }
  25% { transform: scale(1.08); background-color: #2F3E60; }
  50% { transform: scale(1.04); }
  100% { transform: scale(1.0); }
}

/* Nav group: Tombol aksi HUD */
.hud-nav {
  gap: 6px;
  flex-shrink: 0;
}

/* ========================================================
   Buttons (.lj-btn & .btn aliases)
   ======================================================== */
.lj-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.lj-btn:hover, .btn:hover {
  transform: translateY(-1px);
}

.lj-btn:active, .btn:active {
  transform: translateY(1px);
}

.lj-btn:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lj-btn:disabled, .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Variants */
.lj-btn.primary, .btn.btn-primary, .btn-primary {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border-color: var(--color-amber);
}

.lj-btn.primary:hover:not(:disabled), .btn.btn-primary:hover:not(:disabled), .btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.lj-btn.secondary, .btn.btn-secondary, .btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.lj-btn.secondary:hover:not(:disabled), .btn.btn-secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
  background: var(--color-border);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.lj-btn.tertiary, .btn.btn-tertiary, .btn-tertiary {
  background: var(--color-navy-dark);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.lj-btn.tertiary:hover:not(:disabled), .btn.btn-tertiary:hover:not(:disabled), .btn-tertiary:hover:not(:disabled) {
  background: var(--color-bg-card);
  color: var(--color-accent);
}

.lj-btn.danger, .btn.btn-negative, .btn.btn-danger, .btn-negative, .btn-danger {
  background: var(--color-bg-card);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.lj-btn.danger:hover:not(:disabled), .btn.btn-negative:hover:not(:disabled), .btn.btn-danger:hover:not(:disabled), .btn-negative:hover:not(:disabled), .btn-danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: var(--color-off-white);
}

.lj-btn.ghost, .btn.ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding: 4px 8px;
}

.lj-btn.ghost:hover:not(:disabled), .btn.ghost:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.lj-btn.btn-sm, .btn.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* ========================================================
   Modal & Panels (.lj-modal-backdrop, .lj-panel)
   ======================================================== */
.lj-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 26, 46, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  backdrop-filter: blur(3px);
  animation: fadeIn var(--transition-fast);
}

.lj-panel {
  background: var(--color-bg-panel);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  color: var(--color-text-primary);
  max-width: 540px;
  width: 90%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--transition-fast);
}

.cashbook-panel {
  max-width: 620px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.panel-title {
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-close:hover {
  background: var(--color-danger);
  color: var(--color-off-white);
}

.panel-body, .shop-body, .budget-body, .settings-body, .credits-body {
  overflow-y: auto;
  flex: 1;
}

/* ========================================================
   Cashbook Cards & Tables
   ======================================================== */
.cashbook-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.card-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cashbook-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.lj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lj-table th, .lj-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.lj-table th {
  background: var(--color-navy-deepest);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}

.lj-table tbody tr:hover {
  background: rgba(52, 69, 107, 0.4);
}

/* Text helpers */
.text-positive {
  color: var(--color-success) !important;
}

.text-negative {
  color: var(--color-danger) !important;
}

.text-primary {
  color: var(--color-accent) !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ========================================================
   Shop Items List
   ======================================================== */
.shop-item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.shop-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.shop-item-card:hover {
  border-color: var(--color-accent);
  background: rgba(52, 69, 107, 0.9);
}

.shop-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-item-name {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 600;
}

.shop-item-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}

.shop-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.shop-section h3 {
  color: var(--color-accent);
  font-size: 13px;
}

/* ========================================================
   NPC Interaction Dialog (.lj-npc-dialog)
   ======================================================== */
.lj-npc-dialog-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 26, 46, 0.45);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 24px;
  z-index: 300;
  animation: fadeIn var(--transition-fast);
}

.lj-npc-dialog {
  background: var(--color-bg-panel);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  width: 480px;
  max-width: 90%;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: slideUp var(--transition-fast);
}

.npc-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
}

.npc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-card);
  border: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-accent);
}

.npc-meta {
  flex: 1;
}

.npc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
}

.npc-title {
  font-size: 11px;
  color: var(--color-text-muted);
}

.npc-dialog-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: rgba(18, 26, 46, 0.4);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
}

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

.npc-choice-btn {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
}

.npc-choice-btn:hover {
  background: var(--color-border);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ========================================================
   Form Inputs & Misc
   ======================================================== */
.input-field {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.input-field:focus {
  border-color: var(--color-accent);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.form-group label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.btn-group {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.settings-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-sm);
}

.settings-section h3 {
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.settings-toast {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.settings-toast.success {
  background: rgba(111, 146, 98, 0.25);
  color: var(--color-green-light);
  border: 1px solid var(--color-green-mid);
}

.settings-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.settings-guide-list {
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.settings-body p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.settings-body h3 {
  font-size: 13px;
  color: var(--color-accent);
  margin-top: var(--space-sm);
  margin-bottom: 4px;
}

.credits-body {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.credits-body h3 {
  font-size: 13px;
  color: var(--color-accent);
  margin-top: var(--space-sm);
  margin-bottom: 4px;
}

.credits-body ul {
  padding-left: 20px;
  margin-bottom: var(--space-sm);
}

.decision-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.decision-choices .choice-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  justify-content: flex-start;
}

.learning-tag {
  display: inline-block;
  background: var(--color-bg-card);
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: var(--space-xs);
}

.decision-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========================================================
   LIGHT MODE THEME OVERRIDE
   Applied when <body> has class "lj-light"
   ======================================================== */
body.lj-light {
  --color-bg-primary:   #EAE6DE;
  --color-bg-panel:     #F5F0E8;
  --color-bg-card:      #FFFFFF;
  --color-bg-hud:       rgba(240, 234, 214, 0.97);
  --color-text-primary: #1A2033;
  --color-text-secondary: #2C3A54;
  --color-text-muted:   #5A6070;
  --color-text-disabled:#9AA0AA;
  --color-border:       #C4BAA4;
  --color-border-bright:#9A6F4C;
  --color-bg-primary:   #EAE6DE;
  --color-navy-dark:    #E0D8C8;
  --color-navy-mid:     #D4CAB8;
  --color-navy-deepest: #C8BEA8;
  background: #EAE6DE;
  color: #1A2033;
}

body.lj-light .lj-hud {
  border-bottom-color: #C4BAA4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

body.lj-light .hud-badge {
  background: #FFFFFF;
  border-color: #C4BAA4;
  color: #1A2033;
}

body.lj-light .hud-tag {
  background: #EAE6DE;
  color: #5A6070;
  border-color: #C4BAA4;
}

body.lj-light .hud-val {
  color: #1A2033;
}

body.lj-light .hud-val-cash,
body.lj-light .hud-val-savings {
  color: #9A6F4C;
}

body.lj-light .lj-btn.secondary,
body.lj-light .btn.btn-secondary {
  background: #FFFFFF;
  border-color: #C4BAA4;
  color: #2C3A54;
}

body.lj-light .lj-btn.secondary:hover,
body.lj-light .btn.btn-secondary:hover {
  background: #F0E8D8;
}

body.lj-light .lj-panel {
  background: #F5F0E8;
  border-color: #C4BAA4;
  color: #1A2033;
}

body.lj-light .panel-header {
  border-bottom-color: #C4BAA4;
}

body.lj-light .panel-title {
  color: #1A2033;
}

body.lj-light .settings-section h3,
body.lj-light .settings-section {
  border-color: #C4BAA4;
  color: #2C3A54;
}

body.lj-light .settings-row {
  border-color: #D4CAB8;
}

body.lj-light .settings-row-label {
  color: #2C3A54;
}

body.lj-light .lj-modal-backdrop {
  background: rgba(100, 90, 80, 0.55);
}

body.lj-light .lj-table th {
  background: #EAE6DE;
  color: #2C3A54;
  border-color: #C4BAA4;
}

body.lj-light .lj-table td {
  border-color: #D4CAB8;
  color: #1A2033;
}

body.lj-light .lj-table tr:hover td {
  background: #F0E8D8;
}

body.lj-light .hud-time-widget {
  background: #FFFFFF;
  border-color: #C4832E;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.lj-light .time-digital-box {
  background: #EAE6DE;
  border-color: #C4BAA4;
}

body.lj-light .time-digital-val {
  color: #1A2033;
}

body.lj-light .time-date-text {
  color: #2C3A54;
}

body.lj-light .time-bar-track {
  background: #EAE6DE;
  border-color: #C4BAA4;
}

/* TimeSkip Overlay (Rule 72 §5) */
.timeskip-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 15, 26, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.timeskip-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.timeskip-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.timeskip-card {
  background: var(--color-navy-dark, #1B2838);
  border: 3px solid var(--color-gold, #D9A441);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  text-align: center;
  animation: timeskipPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes timeskipPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.timeskip-icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.timeskip-title {
  color: var(--color-gold, #D9A441);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  font-family: inherit;
}

.timeskip-time {
  color: #F7EEDA;
  font-size: 0.95rem;
  font-weight: 600;
}

.timeskip-cost {
  background: rgba(192, 101, 74, 0.2);
  color: #E28D75;
  border: 1px solid rgba(192, 101, 74, 0.5);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
}

.timeskip-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.timeskip-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--color-gold, #D9A441);
  transition: width 0.8s ease-in-out;
}

/* ========================================================
   Rule 71 — Dialogue System with Portraits CSS
   ======================================================== */
.dialogue-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.dialogue-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.dialogue-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.dialogue-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 26, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1;
}

.dialogue-stage {
  position: absolute;
  inset: 0;
  bottom: 170px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 40px;
  z-index: 2;
  pointer-events: none;
}

.dialogue-portrait-wrap {
  width: 192px;
  height: 256px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 150ms ease, filter 150ms ease;
  will-change: transform, filter;
}

.dialogue-portrait-wrap.portrait-right {
  transform: scaleX(-1);
}

.dialogue-portrait-wrap.speaker-active {
  filter: brightness(1) saturate(1);
  transform: translateY(-6px);
}

.dialogue-portrait-wrap.portrait-right.speaker-active {
  filter: brightness(1) saturate(1);
  transform: scaleX(-1) translateY(-6px);
}

.dialogue-portrait-wrap.speaker-inactive {
  filter: brightness(0.55) saturate(0.70);
  transform: translateY(0);
}

.dialogue-portrait-wrap.portrait-right.speaker-inactive {
  filter: brightness(0.55) saturate(0.70);
  transform: scaleX(-1) translateY(0);
}

.portrait-box {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.portrait-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1F2A44 0%, #121A2E 100%);
  border: 3px solid #D9A441;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #F7EEDA;
  font-family: monospace;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Choices Menu (Above Dialogue Box) */
.dialogue-box-container {
  position: relative;
  z-index: 10;
  max-width: 880px;
  width: calc(100% - 32px);
  margin: 0 auto 20px auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialogue-choices-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-end;
  max-width: 460px;
  width: 100%;
  animation: choiceFadeIn 0.2s ease-out;
}

@keyframes choiceFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialogue-choice-btn {
  background: #1B2838;
  border: 2px solid #34456B;
  color: #F7EEDA;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.dialogue-choice-btn:hover,
.dialogue-choice-btn.selected {
  background: #253952;
  border-color: #D9A441;
  color: #FFDE6A;
  transform: translateX(-4px);
}

.dialogue-choice-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #3A3A3A;
  background: #151C28;
  transform: none;
}

.choice-number {
  color: #D9A441;
  font-weight: 700;
  font-family: monospace;
}

.choice-label {
  flex: 1;
}

.choice-disabled-reason {
  font-size: 0.8rem;
  color: #C0654A;
  font-style: italic;
}

/* Dialogue Main Box */
.dialogue-box {
  position: relative;
  background: #172233;
  border: 3px solid #D9A441;
  box-shadow: 0 8px 28px rgba(0,0,0,0.7), inset 0 0 12px rgba(0,0,0,0.5);
  border-radius: 6px;
  padding: 16px 20px;
  min-height: 90px;
  cursor: pointer;
}

.dialogue-nameplate {
  position: absolute;
  top: -16px;
  background: #121A2E;
  border: 2px solid #D9A441;
  border-radius: 4px;
  color: #D9A441;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 2px 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.dialogue-nameplate.side-player {
  left: 20px;
  border-color: #4A88B8;
  color: #79BAEC;
}

.dialogue-nameplate.side-npc {
  right: 20px;
  border-color: #D9A441;
  color: #FFDE6A;
}

.dialogue-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 60px;
}

.dialogue-text {
  color: #F7EEDA;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.dialogue-prompt-hint {
  align-self: flex-end;
  color: #D9A441;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 6px;
  animation: promptPulse 1.2s infinite ease-in-out;
}

@keyframes promptPulse {
  0%, 100% { opacity: 0.6; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(2px); }
}

@media (max-width: 768px) {
  .dialogue-portrait-wrap {
    width: 140px;
    height: 186px;
  }
  .dialogue-stage {
    padding: 0 16px;
    bottom: 160px;
  }
  .dialogue-text {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   HOTBAR INVENTARIS & BAR ENERGI (RULE 74)
   ========================================================================== */
.hm-energy-bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.hm-energy-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hm-energy-track {
  flex: 1;
  height: 8px;
  background: var(--color-navy-deepest, #0A0F1A);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--color-border, #34456B);
  position: relative;
  transition: box-shadow 0.3s ease;
}

@keyframes energyPulseWarn {
  0% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.8); }
  50% { box-shadow: 0 0 10px 3px rgba(217, 164, 65, 0.95); }
  100% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0); }
}

.hm-energy-track.pulse-warn {
  animation: energyPulseWarn 1.2s ease-in-out;
}

.hm-energy-fill {
  height: 100%;
  background-color: #6F9262;
  transition: width 0.3s ease, background-color 0.3s ease;
  position: relative;
}

.hm-energy-fill.danger {
  background-color: #C0654A !important;
}

.hm-energy-text {
  position: absolute;
  right: 4px;
  top: -2px;
  font-size: 8px;
  font-weight: 700;
  color: #F7EEDA;
  text-shadow: 0 0 2px #000;
  line-height: 10px;
}

.hud-hotbar-container {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1000;
  padding: 6px 10px;
  background: rgba(31, 42, 68, 0.92);
  border: 2px solid #D9A441;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(10, 15, 26, 0.6);
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

.hotbar-slot {
  position: relative;
  width: 44px;
  height: 44px;
  background: #F7EEDA;
  border: 2px solid #34456B;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.hotbar-slot:hover,
.hotbar-slot:focus-visible {
  border-color: #D9A441;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(217, 164, 65, 0.4);
}

.hotbar-slot.has-item:active {
  transform: scale(0.95);
}

.hotbar-slot-key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: bold;
  color: #34456B;
  pointer-events: none;
  font-family: monospace;
}

.hotbar-slot-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

.hotbar-slot-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #C0654A;
  color: #F7EEDA;
  font-size: 10px;
  font-weight: bold;
  border-radius: 3px;
  padding: 0 4px;
  line-height: 14px;
  pointer-events: none;
}

.hotbar-tooltip {
  position: fixed;
  transform: translateX(-50%);
  background: #1F2A44;
  color: #F7EEDA;
  border: 1px solid #D9A441;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  pointer-events: none;
  z-index: 10000;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hotbar-backpack-btn {
  position: relative;
  width: 44px;
  height: 44px;
  background: #2A3654;
  border: 2px solid #D9A441;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.12s ease, background-color 0.12s ease;
  margin-left: 6px;
}

.hotbar-backpack-btn:hover,
.hotbar-backpack-btn:focus-visible {
  background: #34456B;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(217, 164, 65, 0.4);
}

.hotbar-backpack-btn .hotbar-slot-key {
  color: #D9A441;
}

.hotbar-backpack-btn .backpack-count-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #D9A441;
  color: #1F2A44;
  font-size: 10px;
  font-weight: bold;
  border-radius: 10px;
  padding: 0 5px;
  line-height: 14px;
  border: 1px solid #1F2A44;
}

/* Item Action Popup (Rule 80 §4) */
.item-action-popup {
  position: fixed;
  background: #1F2A44;
  border: 2px solid #D9A441;
  border-radius: 8px;
  padding: 10px 14px;
  z-index: 10005;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 170px;
  color: #F7EEDA;
  font-family: inherit;
}

.item-action-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #34456B;
  padding-bottom: 6px;
}

.item-action-icon {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.item-action-title {
  font-size: 12px;
  font-weight: bold;
  color: #F7EEDA;
}

.item-action-info {
  font-size: 11px;
  color: #A5BE93;
}

.item-action-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-action-btn {
  background: #34456B;
  color: #F7EEDA;
  border: 1px solid #445988;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}

.item-action-btn:hover:not(:disabled) {
  background: #D9A441;
  color: #1F2A44;
}

.item-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.item-action-btn.btn-discard {
  border-color: #C0654A;
  color: #F78E72;
}

.item-action-btn.btn-discard:hover:not(:disabled) {
  background: #C0654A;
  color: #F7EEDA;
}

/* Backpack Modal Panel (Rule 80 §3) */
.backpack-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(2px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.backpack-modal-panel {
  background: #1F2A44;
  border: 2px solid #D9A441;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  width: 320px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backpack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #34456B;
  padding-bottom: 8px;
}

.backpack-title {
  font-size: 14px;
  font-weight: bold;
  color: #D9A441;
  display: flex;
  align-items: center;
  gap: 6px;
}

.backpack-capacity-badge {
  font-size: 11px;
  color: #A4B2C8;
}

.backpack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 6px 0;
}

.backpack-slot {
  position: relative;
  width: 48px;
  height: 48px;
  background: #2A3654;
  border: 1px solid #34456B;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.backpack-slot:hover {
  border-color: #D9A441;
  background: #34456B;
}

.backpack-slot.empty {
  border-style: dashed;
  opacity: 0.6;
}

.backpack-close-btn {
  align-self: flex-end;
  background: #34456B;
  color: #F7EEDA;
  border: 1px solid #445988;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
}

.backpack-close-btn:hover {
  background: #D9A441;
  color: #1F2A44;
}

/* ========================================================
   Shop & Vendor Panel (Rule 79)
   ======================================================== */
.shop-modal-panel {
  max-width: 780px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.shop-body-layout {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-top: 8px;
}

.shop-vendor-col {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(31, 42, 68, 0.7);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #34456B;
  box-sizing: border-box;
}

.shop-vendor-nameplate {
  text-align: center;
  border-bottom: 1px solid #34456B;
  padding-bottom: 6px;
  width: 100%;
}

.shop-vendor-name {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #D9A441;
}

.shop-vendor-role {
  display: block;
  font-size: 10px;
  color: #A4B2C8;
  margin-top: 2px;
}

.shop-vendor-portrait-wrap {
  width: 140px;
  height: 186px;
  border: 2px solid #34456B;
  border-radius: 6px;
  background: #121A2E;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.shop-vendor-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-vendor-placeholder {
  color: #A4B2C8;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding: 8px;
}

.shop-vendor-speech {
  background: #1F2A44;
  border: 1px solid #D9A441;
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.shop-vendor-speech::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #D9A441 transparent;
}

.shop-vendor-speech-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #F7EEDA;
  word-wrap: break-word;
}

.shop-content-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.shop-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(42, 54, 84, 0.6);
  border: 1px solid #34456B;
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
}

.shop-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid #34456B;
  margin-top: 8px;
}

.shop-btn-done {
  background: #2A3654;
  color: #F7EEDA;
  border: 1px solid #D9A441;
  border-radius: 4px;
  padding: 6px 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shop-btn-done:hover {
  background: #D9A441;
  color: #1F2A44;
}

.shop-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(42, 54, 84, 0.6);
  border: 1px solid #34456B;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.shop-vendor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-vendor-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #D9A441;
  image-rendering: pixelated;
  background: #1F2A44;
}

.shop-cash-badge {
  color: #D9A441;
  font-weight: bold;
  font-size: 13px;
}

.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #34456B;
  padding-bottom: 6px;
  overflow-x: auto;
}

.shop-tab-btn {
  background: #2A3654;
  color: #A4B2C8;
  border: 1px solid #34456B;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.shop-tab-btn.active {
  background: #D9A441;
  color: #1F2A44;
  border-color: #D9A441;
}

.shop-items-container {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  max-height: 48vh;
}

.shop-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2A3654;
  border: 1px solid #34456B;
  border-radius: 6px;
  padding: 8px 12px;
  gap: 10px;
}

.shop-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.shop-item-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-item-name {
  font-size: 12px;
  font-weight: bold;
  color: #F7EEDA;
}

.shop-item-desc {
  font-size: 11px;
  color: #A5BE93;
}

.shop-item-price {
  font-size: 12px;
  font-weight: bold;
  color: #D9A441;
}

.shop-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-qty-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1F2A44;
  border: 1px solid #34456B;
  border-radius: 4px;
  padding: 2px 4px;
}

.shop-qty-btn {
  background: transparent;
  border: none;
  color: #D9A441;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-qty-text {
  font-size: 12px;
  min-width: 16px;
  text-align: center;
  color: #F7EEDA;
}

.shop-mode-select {
  background: #1F2A44;
  color: #F7EEDA;
  border: 1px solid #34456B;
  border-radius: 4px;
  font-size: 10px;
  padding: 3px 6px;
}

.shop-buy-btn {
  background: #6F9262;
  color: #F7EEDA;
  border: 1px solid #82A974;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.shop-buy-btn:hover:not(:disabled) {
  background: #7DA470;
  border-color: #D9A441;
}

.shop-buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #4A566E;
  border-color: #34456B;
}

.shop-fuel-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.shop-fuel-btn {
  background: #2A3654;
  border: 1px solid #D9A441;
  border-radius: 6px;
  padding: 10px;
  color: #F7EEDA;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.shop-fuel-btn:hover:not(:disabled) {
  background: #34456B;
  border-color: #F7EEDA;
}

.shop-fuel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-fuel-btn-price {
  color: #D9A441;
  font-size: 11px;
}

@media (max-width: 600px) {
  .hud-hotbar-container {
    bottom: 8px;
    gap: 4px;
    padding: 4px 6px;
  }
  .hotbar-slot {
    width: 36px;
    height: 36px;
  }
  .hotbar-slot-icon {
    width: 22px;
    height: 22px;
  }
}




/* ========================================================
   Tutorial & Story Guidance System (Rule 82)
   ======================================================== */
.tutorial-objective-card {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 440px;
  max-width: 90vw;
  background: rgba(31, 42, 68, 0.96);
  border: 2px solid #D9A441;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
  z-index: 1200;
  color: #F7EEDA;
  padding: 8px 12px;
  font-family: inherit;
  transition: all 0.2s ease;
  pointer-events: auto;
}

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

.tutorial-step-badge {
  background: #D9A441;
  color: #121A2E;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tutorial-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #F7EEDA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tutorial-btn-toggle {
  background: transparent;
  border: none;
  color: #D9A441;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}

.tutorial-card-body {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tutorial-card-body.hidden {
  display: none !important;
}

.tutorial-instruction {
  font-size: 12px;
  color: #E2ECF7;
  line-height: 1.4;
  margin: 0;
}

.tutorial-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.tut-dot {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: background 0.3s;
}

.tut-dot.completed {
  background: #4E8A5A;
}

.tut-dot.active {
  background: #D9A441;
  box-shadow: 0 0 6px #D9A441;
}

.tutorial-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.tutorial-hint {
  color: #9FB3C8;
  font-style: italic;
}

.tutorial-skip-btn {
  background: #C0654A;
  color: #FFF;
  border: 1px solid #E27D60;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  cursor: pointer;
}

.tutorial-edge-arrow {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #1F2A44;
  border: 2px solid #D9A441;
  border-radius: 16px;
  padding: 4px 8px;
  color: #F7EEDA;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  z-index: 1100;
  pointer-events: none;
}

.edge-arrow-icon {
  color: #D9A441;
  display: inline-block;
  font-size: 12px;
}

@keyframes tutorial-hud-glow {
  0% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.7); border-color: #D9A441; }
  50% { box-shadow: 0 0 12px 3px rgba(217, 164, 65, 0.9); border-color: #FFF; }
  100% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.7); border-color: #D9A441; }
}

.hud-tutorial-pulse {
  animation: tutorial-hud-glow 1.2s infinite !important;
  border-color: #D9A441 !important;
}
