:root {
  --bg: #0d0d12;
  --panel: rgba(10, 10, 18, 0.92);
  --panel-border: rgba(255, 255, 255, 0.1);
  --accent: #f5c542;
  --accent2: #e67e22;
  --green: #4caf50;
  --red: #f44336;
  --blue: #42a5f5;
  --purple: #9b59b6;
  --text: #f0f0f0;
  --text-dim: rgba(240, 240, 240, 0.55);
  --text-muted: rgba(240, 240, 240, 0.3);
  --radius: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.7);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: 'Inter', sans-serif; color: var(--text); }
.hidden { display: none !important; }

#gameCanvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: block; }

/* Loading */
#loading-screen { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.loading-content { text-align: center; }
.loading-icon { font-size: 64px; animation: spin 1s linear infinite; display: block; }
.loading-title { font-family: 'Press Start 2P', monospace; font-size: 24px; color: var(--accent); margin: 16px 0 4px; }
.loading-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
.loading-bar { width: 280px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 0 auto 12px; overflow: hidden; }
.loading-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; width: 0%; }
.loading-tip { color: var(--text-muted); font-size: 11px; font-style: italic; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Login */
#login-screen {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, #1a1530 0%, #0d0d12 80%);
}
.login-content {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 32px; width: 360px; max-width: 90%;
  display: flex; flex-direction: column; gap: 12px; text-align: center;
  box-shadow: var(--shadow);
}
.login-logo { font-size: 48px; }
.login-title { font-family: 'Press Start 2P', monospace; font-size: 22px; color: var(--accent); margin-bottom: 4px; }
.login-tagline { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.login-tabs { display: flex; gap: 4px; }
.login-tab {
  flex: 1; padding: 8px; background: transparent; border: 1px solid var(--panel-border);
  color: var(--text-dim); border-radius: var(--radius); cursor: pointer; font-size: 13px;
}
.login-tab.active { background: var(--accent); color: #0d0d12; border-color: var(--accent); font-weight: 700; }
#login-form, #register-form { display: flex; flex-direction: column; gap: 10px; }
#login-form input, #register-form input {
  padding: 10px 12px; background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border);
  color: var(--text); border-radius: var(--radius); font-size: 14px; font-family: inherit;
}
#login-form input:focus, #register-form input:focus { outline: none; border-color: var(--accent); }
.btn-auth {
  padding: 12px; background: var(--accent); color: #0d0d12; border: none;
  border-radius: var(--radius); font-weight: 700; cursor: pointer; transition: transform 0.15s;
  font-family: inherit; font-size: 14px;
}
.btn-auth:hover { transform: translateY(-1px); }
.btn-auth-skip {
  padding: 10px; background: transparent; color: var(--text-dim); border: 1px solid var(--panel-border);
  border-radius: var(--radius); cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-auth-skip:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.auth-error { color: var(--red); font-size: 12px; min-height: 16px; }
.login-divider { color: var(--text-muted); font-size: 11px; }

/* Title */
#title-screen { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, #1a1a2e 0%, #0d0d12 70%); }
.title-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.title-logo { font-size: 72px; filter: drop-shadow(0 0 24px rgba(245,197,66,0.5)); }
.game-title { font-family: 'Press Start 2P', monospace; font-size: clamp(24px, 5vw, 48px); color: var(--accent); text-shadow: 0 0 32px rgba(245,197,66,0.4), 3px 3px 0 rgba(0,0,0,0.5); }
.game-subtitle { color: var(--text-dim); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; }
.game-tagline { color: var(--text); font-size: 15px; margin: 8px 0 16px; }
.title-buttons { display: flex; flex-direction: column; gap: 10px; width: 240px; }
.btn-title { padding: 14px 24px; font-size: 14px; font-weight: 700; background: var(--accent); color: #0d0d12; border: none; border-radius: var(--radius); cursor: pointer; font-family: inherit; transition: transform 0.15s; }
.btn-title:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,197,66,0.4); }
.btn-title.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--panel-border); }
.btn-title.btn-secondary:hover { background: rgba(255,255,255,0.05); }
.title-hint { color: var(--text-muted); font-size: 11px; margin-top: 8px; max-width: 380px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

#hud-top-left { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
#hud-money, #hud-rep, #hud-wanted, #profile-badge {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 6px 12px;
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
  backdrop-filter: blur(8px);
}
#hud-wanted { border-color: var(--red); }
#wanted-stars { color: #ff5252; }
.money-val { color: var(--accent); font-family: 'VT323', monospace; font-size: 18px; }
.hud-icon { font-size: 14px; }
#profile-badge { color: var(--blue); font-size: 12px; }
.profile-icon { margin-right: 4px; }

#hud-top-center { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
#hud-time-block { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 6px 18px; display: flex; gap: 14px; align-items: center; backdrop-filter: blur(8px); }
#hud-day { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
#hud-clock { font-family: 'VT323', monospace; font-size: 22px; color: var(--accent); }
#hud-district-name { font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }
#mode-display { font-size: 11px; color: var(--blue); background: var(--panel); border: 1px solid var(--panel-border); padding: 3px 10px; border-radius: 12px; }

#hud-top-right { position: absolute; top: 12px; right: 12px; pointer-events: auto; }
#minimap-wrap { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 6px; backdrop-filter: blur(8px); }
#minimap { display: block; border-radius: 3px; }
#minimap-label { display: flex; justify-content: space-between; align-items: center; font-size: 9px; color: var(--text-muted); margin-top: 3px; letter-spacing: 1px; }
.btn-mini { background: rgba(255,255,255,0.1); border: 1px solid var(--panel-border); color: var(--text); padding: 2px 6px; border-radius: 3px; font-size: 9px; cursor: pointer; }
.btn-mini:hover { background: rgba(255,255,255,0.2); }
#online-indicator { color: var(--green); font-weight: 700; }

#players-panel {
  position: absolute; top: 170px; right: 12px;
  width: 200px; max-height: 300px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 10px;
  backdrop-filter: blur(8px); pointer-events: auto;
  transform: translateX(220px); transition: transform 0.3s;
}
#players-panel.open { transform: translateX(0); }
.players-header { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 8px; letter-spacing: 1px; }
.online-self, .online-other { font-size: 12px; padding: 4px 6px; border-radius: 3px; }
.online-self { background: rgba(127, 255, 175, 0.1); color: #7fffaf; font-weight: 700; }
.online-other { color: var(--text-dim); }

#hud-bottom-left { position: absolute; bottom: 70px; left: 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
#active-weapon-wrap {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 6px 12px;
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  backdrop-filter: blur(8px);
}
#effect-icons { display: flex; gap: 6px; }
#effect-icons span {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 3px 10px; font-size: 11px;
}

#hud-bottom-right { position: absolute; bottom: 70px; right: 12px; display: flex; gap: 6px; pointer-events: auto; }
.btn-hud-mini {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 8px 12px; font-size: 18px; cursor: pointer;
  color: var(--text); backdrop-filter: blur(8px); transition: all 0.15s;
}
.btn-hud-mini:hover { background: rgba(255,255,255,0.1); border-color: var(--accent); transform: translateY(-2px); }
.btn-hud-mini.playing { border-color: var(--green); animation: pulse-glow 1.5s ease-in-out infinite; }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.5); } 50% { box-shadow: 0 0 0 8px rgba(76,175,80,0); } }

#hud-stats-bar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 8px 14px;
  display: flex; gap: 14px; align-items: center; backdrop-filter: blur(8px);
}
.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-icon { font-size: 14px; }
.stat-track { width: 60px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.stat-fill.health { background: var(--red); }
.stat-fill.hunger { background: var(--accent2); }
.stat-fill.energy { background: var(--blue); }
.stat-fill.hygiene { background: #26c6da; }
.stat-fill.happiness { background: #ec407a; }
.stat-fill.fitness { background: var(--green); }

#chat-wrap { position: absolute; bottom: 16px; left: 16px; width: 280px; pointer-events: auto; }
#chat-input {
  width: 100%; padding: 8px 12px; background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--text); border-radius: var(--radius); font-size: 13px; font-family: inherit;
  backdrop-filter: blur(8px);
}
#chat-input:focus { outline: none; border-color: var(--accent); }

#interact-hint {
  position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 8px 16px; font-size: 13px;
  animation: pulse-border 1.5s ease-in-out infinite; pointer-events: none;
}
#interact-hint kbd {
  background: var(--accent); color: #0d0d12; padding: 2px 7px;
  border-radius: 3px; font-weight: 700; font-family: monospace; margin-right: 4px;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,197,66,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(245,197,66,0); }
}

/* Notifications */
#notifications { position: fixed; top: 80px; right: 16px; z-index: 500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notif { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 10px 16px; font-size: 13px; max-width: 280px; backdrop-filter: blur(8px); animation: notif-in 0.3s ease, notif-out 0.3s ease forwards; animation-delay: 0s, 2.7s; }
.notif.success { border-color: var(--green); }
.notif.error { border-color: var(--red); }
.notif.money { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.notif.info { border-color: var(--blue); }
@keyframes notif-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes notif-out { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* Inventory */
#inventory-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.inv-window {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 24px; width: 600px; max-width: 90%;
  max-height: 85vh; overflow-y: auto;
}
.inv-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.inv-header h2 { font-size: 18px; color: var(--accent); }
.inv-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-dim); margin-left: auto; }
.btn-close-x { background: transparent; border: 1px solid var(--panel-border); color: var(--text-dim); width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-close-x:hover { color: var(--red); border-color: var(--red); }
.inv-filters { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.inv-filter { padding: 4px 10px; background: transparent; border: 1px solid var(--panel-border); color: var(--text-dim); border-radius: var(--radius); font-size: 11px; cursor: pointer; }
.inv-filter.active { background: var(--accent); color: #0d0d12; border-color: var(--accent); font-weight: 700; }
.inv-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.inv-slot {
  aspect-ratio: 1; background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; transition: all 0.15s;
}
.inv-slot.filled:hover { border-color: var(--accent); transform: scale(1.05); }
.inv-slot.equipped { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.inv-slot.empty { opacity: 0.5; cursor: default; }
.inv-icon { font-size: 28px; }
.inv-count { position: absolute; bottom: 2px; right: 4px; font-size: 10px; background: rgba(0,0,0,0.7); padding: 1px 4px; border-radius: 3px; font-weight: 700; }
.inv-tooltip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-4px);
  background: rgba(0,0,0,0.95); padding: 6px 10px; border-radius: 4px;
  font-size: 11px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.15s; z-index: 10;
  border: 1px solid var(--panel-border);
}
.inv-tooltip span { color: var(--text-dim); font-weight: normal; }
.inv-slot:hover .inv-tooltip { opacity: 1; }
.inv-hint { font-size: 11px; color: var(--text-muted); text-align: center; }

/* Help */
#help-overlay {
  position: fixed; inset: 0; z-index: 280;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.help-window {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 28px; width: 600px; max-width: 90%;
  max-height: 85vh; overflow-y: auto;
}
.help-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.help-header h2 { font-size: 20px; color: var(--accent); }
.help-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 20px; }
.help-row { display: flex; gap: 10px; padding: 6px 10px; background: rgba(255,255,255,0.04); border-radius: var(--radius); font-size: 12px; align-items: center; }
.help-row kbd {
  background: var(--accent); color: #0d0d12; padding: 2px 8px;
  border-radius: 3px; font-weight: 700; font-family: monospace; font-size: 11px;
  min-width: 60px; text-align: center;
}
.help-row span { color: var(--text); }
.help-tips { background: rgba(255,255,255,0.04); border-radius: var(--radius); padding: 14px; }
.help-tips h3 { font-size: 14px; color: var(--accent); margin-bottom: 8px; }
.help-tips ul { list-style: none; }
.help-tips li { font-size: 12px; padding: 3px 0; color: var(--text-dim); }

/* Music */
#music-panel {
  position: fixed; bottom: 130px; right: 12px; z-index: 280;
  width: 320px;
}
.music-window {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 18px; backdrop-filter: blur(8px);
}
.music-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.music-header h2 { font-size: 16px; color: var(--accent); }
.now-playing { background: rgba(0,0,0,0.4); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; text-align: center; margin-bottom: 12px; }
.bpm-tag { color: var(--text-muted); font-size: 10px; margin-left: 6px; }
.music-genres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.music-genre-btn { padding: 10px 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--panel-border); border-radius: var(--radius); color: var(--text); cursor: pointer; transition: all 0.15s; text-align: center; }
.music-genre-btn:hover { background: rgba(255,255,255,0.1); }
.music-genre-btn.active { background: rgba(245,197,66,0.15); border-color: var(--accent) !important; }
.genre-icon { font-size: 20px; margin-bottom: 2px; }
.genre-name { font-size: 11px; font-weight: 600; }
.music-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.btn-music-stop { padding: 6px 12px; background: rgba(244,67,54,0.2); border: 1px solid var(--red); color: var(--red); border-radius: var(--radius); cursor: pointer; font-size: 12px; }
.vol-label { display: flex; align-items: center; gap: 6px; font-size: 12px; flex: 1; }
.vol-label input { flex: 1; }
.music-hint { font-size: 10px; color: var(--text-muted); text-align: center; }

/* Shop */
#shop-overlay { position: fixed; inset: 0; z-index: 200; background: #0a0a12; display: flex; flex-direction: column; }
.shop-header { background: rgba(0,0,0,0.6); border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.shop-title-bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.shop-name { font-family: 'Press Start 2P', monospace; font-size: 14px; color: var(--accent); }
.shop-header-stats { margin-left: auto; display: flex; gap: 20px; font-family: 'VT323', monospace; font-size: 18px; }
.btn-exit-shop { padding: 6px 14px; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text-dim); cursor: pointer; border-radius: var(--radius); font-size: 12px; }
.btn-exit-shop:hover { border-color: var(--red); color: var(--red); }
#rush-banner { background: linear-gradient(90deg, #c0392b, #e74c3c, #c0392b); color: white; text-align: center; font-weight: 700; font-size: 13px; padding: 6px; letter-spacing: 2px; animation: rush-flash 0.8s ease-in-out infinite; }
@keyframes rush-flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.shop-body { display: flex; flex: 1; min-height: 0; }
.shop-col { flex: 1; padding: 16px; border-right: 1px solid var(--panel-border); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.shop-col:last-child { border-right: none; }
.customer-col { flex: 1.1; } .builder-col { flex: 1.2; } .ingredient-col { flex: 1.1; }
.col-title { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); padding-bottom: 8px; border-bottom: 1px solid var(--panel-border); }
.no-customer-icon { font-size: 40px; text-align: center; }
.no-customer-text { text-align: center; color: var(--text-dim); font-size: 14px; }
.next-customer-hint { text-align: center; color: var(--text-muted); font-size: 12px; }
.customer-header { display: flex; gap: 12px; align-items: center; }
.customer-avatar { font-size: 40px; }
.customer-name { font-size: 16px; font-weight: 700; }
.customer-type { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.speech-bubble { background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); border-radius: 12px; border-top-left-radius: 2px; padding: 12px; font-size: 13px; line-height: 1.5; font-style: italic; }
.patience-wrap { display: flex; align-items: center; gap: 8px; }
.patience-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.patience-track { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.patience-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.5s, background 0.5s; }
.order-checklist { background: rgba(0,0,0,0.3); border-radius: var(--radius); padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 5px; }
.check-item { display: flex; align-items: center; gap: 8px; }
.check-item.done { color: var(--green); }
.check-item.wrong { color: var(--red); }
.queue-info { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: auto; }
.sandwich-visual { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; min-height: 200px; }
.sw-top-bun, .sw-bottom-bun { background: linear-gradient(135deg, #c8a052, #a07030); border-radius: 20px; padding: 8px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #3a2000; }
.sw-top-bun { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.sw-bottom-bun { border-top-left-radius: 4px; border-top-right-radius: 4px; }
.sw-row { padding: 5px 12px; font-size: 12px; color: var(--text-dim); min-height: 26px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-left: 2px solid transparent; }
.sw-row.filled { color: var(--text); }
.sw-meat.filled { border-left-color: #e57373; }
.sw-cheese.filled { border-left-color: #ffd54f; }
.sw-sauce.filled { border-left-color: #80cbc4; }
.sw-veggies.filled { border-left-color: #81c784; }
.sw-tag { background: rgba(255,255,255,0.1); border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.builder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-serve, .btn-reset, .btn-toast { padding: 10px 18px; border: none; border-radius: var(--radius); font-size: 13px; font-weight: 700; cursor: pointer; flex: 1; }
.btn-serve { background: var(--green); color: white; }
.btn-serve:disabled { background: rgba(255,255,255,0.1); color: var(--text-muted); cursor: not-allowed; }
.btn-reset { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.btn-toast { background: rgba(230,126,34,0.2); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.btn-toast.toasted { background: rgba(230,126,34,0.5); color: #f5c542; }
.accuracy-bar-wrap { display: flex; align-items: center; gap: 8px; }
.accuracy-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.accuracy-track { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.accuracy-fill { height: 100%; background: var(--green); transition: width 0.3s; }
.accuracy-pct { font-size: 12px; color: var(--text-dim); width: 32px; text-align: right; }
.ing-tabs { display: flex; gap: 4px; }
.ing-tab { padding: 5px 10px; font-size: 14px; border: 1px solid var(--panel-border); background: transparent; color: var(--text-dim); cursor: pointer; border-radius: var(--radius); flex: 1; }
.ing-tab.active { background: var(--accent); color: #0d0d12; border-color: var(--accent); }
.ing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; overflow-y: auto; }
.ing-btn { padding: 8px 10px; font-size: 12px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04); color: var(--text); cursor: pointer; border-radius: var(--radius); text-align: left; display: flex; align-items: center; gap: 6px; }
.ing-btn:hover { background: rgba(255,255,255,0.1); }
.ing-btn.selected { background: rgba(245,197,66,0.15); border-color: var(--accent); color: var(--accent); }
.ing-btn.order-match { box-shadow: 0 0 0 1px var(--green) inset; }
.ing-hint { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: auto; }

/* Summary */
#day-summary { position: absolute; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 10; }
.summary-box { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 32px 40px; max-width: 420px; }
.summary-title { font-family: 'Press Start 2P', monospace; font-size: 20px; color: var(--accent); margin-bottom: 20px; text-align: center; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--panel-border); font-size: 14px; }
.summary-row:last-of-type { border-bottom: none; }
.summary-total { font-size: 18px; font-weight: 700; color: var(--green); margin-top: 12px; text-align: center; }
.btn-summary-close { margin-top: 20px; padding: 12px 28px; background: var(--accent); color: #0d0d12; border: none; border-radius: var(--radius); font-weight: 700; cursor: pointer; width: 100%; }

/* Modal */
#building-modal { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 28px 32px; max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 20px; color: var(--accent); margin-bottom: 16px; }
.modal-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--panel-border); }
.modal-item:last-of-type { border-bottom: none; }
.modal-item-name { font-size: 14px; }
.modal-item-price { font-size: 14px; color: var(--accent); font-weight: 700; }
.btn-modal-action { padding: 6px 14px; background: var(--green); color: white; border: none; border-radius: var(--radius); font-size: 12px; cursor: pointer; }
.btn-modal-action:disabled { background: rgba(255,255,255,0.1); color: var(--text-muted); cursor: not-allowed; }
.btn-modal-close { margin-top: 16px; padding: 10px 20px; background: transparent; border: 1px solid var(--panel-border); color: var(--text-dim); border-radius: var(--radius); cursor: pointer; width: 100%; }
.btn-modal-close:hover { color: var(--text); }

/* Pause */
#pause-menu { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; }
.pause-box { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 32px 40px; display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.pause-title { font-family: 'Press Start 2P', monospace; font-size: 18px; text-align: center; margin-bottom: 8px; }
.btn-pause-item { padding: 12px 20px; background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); color: var(--text); border-radius: var(--radius); font-size: 14px; cursor: pointer; transition: all 0.15s; }
.btn-pause-item:hover { background: rgba(255,255,255,0.12); }
.btn-pause-item.save-main { background: var(--accent); color: #0d0d12; font-weight: 700; }
.btn-pause-item.save-main:hover { background: #fed862; }

/* Tutorial */
#tutorial-box { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 350; max-width: 400px; width: 90%; }
.tutorial-inner { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 16px 20px; display: flex; align-items: flex-start; gap: 12px; box-shadow: 0 0 0 1px rgba(245,197,66,0.2), var(--shadow); }
.tutorial-step-icon { font-size: 28px; flex-shrink: 0; }
.tutorial-text { font-size: 13px; line-height: 1.6; flex: 1; }
.btn-tut-next { padding: 6px 14px; background: var(--accent); color: #0d0d12; border: none; border-radius: var(--radius); font-size: 12px; font-weight: 700; cursor: pointer; align-self: flex-end; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

@media (max-width: 700px) {
  .shop-body { flex-direction: column; }
  .shop-col { border-right: none; border-bottom: 1px solid var(--panel-border); }
  #hud-stats-bar { display: none; }
  .inv-grid { grid-template-columns: repeat(4, 1fr); }
  .help-controls { grid-template-columns: 1fr; }
}
