:root {
  --bg-dark: #0f141c;
  --panel-bg: #1a2232;
  --panel-border: #2c3a52;
  --text-main: #f0f4fc;
  --text-muted: #8b9bb4;
  --accent-gold: #ffcc00;
  --accent-green: #2ecc71;
  --accent-blue: #3498db;
  --accent-red: #e74c3c;
  --accent-purple: #9b59b6;
  --font-pixel: 'Press Start 2P', monospace;
  --font-ui: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-ui);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  padding: 6px;
  overflow: hidden;
}

#game-container {
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 9;
  width: min(calc(100vw - 12px), calc((100vh - 12px) * 16 / 9));
  height: min(calc(100vh - 12px), calc((100vw - 12px) * 9 / 16));
  max-width: 1920px;
  max-height: 1080px;
  background-color: #141b27;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  border: 1px solid var(--panel-border);
  position: relative;
}

/* Header HUD */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  background: linear-gradient(180deg, #1d273a 0%, #161f2e 100%);
  border-bottom: 2px solid var(--panel-border);
  height: 52px;
  flex: 0 0 auto;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.location-badge {
  color: #64b5f6;
  border-color: rgba(100, 181, 246, 0.3);
}

.time-stat {
  color: #f1c40f;
  border-color: rgba(241, 196, 15, 0.35);
  background: rgba(241, 196, 15, 0.08);
  letter-spacing: 0.5px;
}

.time-stat .day-label {
  color: #f39c12;
  font-weight: 800;
  white-space: nowrap;
}

.time-stat .time-sep {
  color: #8b9bb4;
  opacity: 0.6;
}

.time-stat .clock-label {
  color: #ffffff;
  font-family: var(--font-pixel), var(--font-ui);
  font-size: 13px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.warning-stat {
  color: #2ecc71;
  transition: all 0.3s;
}

.warning-stat.danger {
  color: #ff4757;
  border-color: #ff4757;
  animation: pulseWarning 1s infinite alternate;
}

@keyframes pulseWarning {
  from { box-shadow: 0 0 4px #ff4757; }
  to { box-shadow: 0 0 16px rgba(255, 71, 87, 0.6); }
}

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

.game-logo {
  font-size: 13px;
  letter-spacing: 1px;
  color: #ffffff;
  font-family: var(--font-pixel);
  margin: 0;
  white-space: nowrap;
}

.game-logo span {
  color: var(--accent-gold);
}

/* Terminal Wings Navigation Switcher */
.wings-nav {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-wing {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-wing:hover {
  background: #27354a;
  color: #f8fafc;
  border-color: #475569;
}

.btn-wing.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.money-stat {
  font-size: 16px;
  color: var(--accent-gold);
}

.xp-stat {
  font-size: 16px;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.level-stat {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}

.btn-icon {
  background: #253346;
  border: 1px solid #3d4f6c;
  color: white;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-icon:hover {
  background: #344763;
}

.btn-shop {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: white;
  border: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(243, 156, 18, 0.6);
}

/* Canvas Area */
#canvas-wrapper {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #0b0e14;
  overflow: hidden;
}

#gameCanvas {
  display: none !important;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Floating Interaction Prompt */
#interaction-prompt {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 23, 34, 0.92);
  backdrop-filter: blur(8px);
  border: 2px solid var(--accent-gold);
  border-radius: 30px;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 50;
  animation: bouncePrompt 1.2s infinite ease-in-out;
}

@keyframes bouncePrompt {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

.key-badge {
  background: var(--accent-gold);
  color: #1a1a1a;
  font-family: var(--font-pixel);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

#prompt-text {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

/* Modals */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 18, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 0.2s ease;
}

.hidden {
  display: none !important;
}

.modal-box {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  color: white;
  max-height: 94%;
  max-width: 96%;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: white;
}

/* Elevator Modal */
.elevator-box {
  width: 440px;
  text-align: center;
}

.elevator-box h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--accent-gold);
}

.elevator-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.btn-elevator {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #253346;
  border: 2px solid #394b66;
  border-radius: 10px;
  padding: 12px 18px;
  color: white;
  cursor: pointer;
  transition: 0.2s;
  text-align: left;
}

.btn-elevator:hover:not(:disabled) {
  background: #2f425c;
  border-color: var(--accent-blue);
  transform: translateX(4px);
}

.btn-elevator:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  border-color: #2c3a52;
  background: #1a2232;
}

.floor-num {
  font-family: var(--font-pixel);
  background: #121924;
  color: var(--accent-gold);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 16px;
  min-width: 44px;
  text-align: center;
}

.floor-name {
  font-size: 16px;
  font-weight: 700;
  display: block;
}

.btn-elevator small {
  color: var(--text-muted);
  display: block;
}

.btn-secondary {
  background: #253346;
  border: 1px solid #3d4f6c;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary:hover {
  color: white;
}

/* Sorting Modal */
.sorting-box {
  width: 860px;
}

.sorting-header h2 {
  font-size: 22px;
  color: var(--accent-blue);
}

.sorting-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.sorting-arena {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  min-height: 320px;
}

.tub-container {
  flex: 1.2;
  background: #141b26;
  border: 3px dashed #34495e;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.tub-label {
  font-size: 14px;
  font-weight: 700;
  color: #bdc3c7;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.tub-contents {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow-y: auto;
  max-height: 280px;
}

.sort-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 76px;
  background: #222f42;
  border: 2px solid #3d4f6c;
  border-radius: 10px;
  cursor: grab;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.sort-item:hover {
  transform: scale(1.1);
  border-color: var(--accent-gold);
  z-index: 10;
}

.sort-item:active {
  cursor: grabbing;
}

.sort-item .item-icon {
  font-size: 26px;
}

.sort-item .item-title {
  font-size: 9px;
  text-align: center;
  color: #ecf0f1;
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.1;
  padding: 0 2px;
}

.bags-container {
  flex: 1.4;
  display: flex;
  gap: 12px;
}

.bag-drop-zone {
  flex: 1;
  background: #17212e;
  border: 2px solid #2d3e56;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.bag-drop-zone.drag-over {
  transform: scale(1.04);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
}

.bag-pfand {
  border-color: rgba(46, 204, 113, 0.4);
}
.bag-pfand.drag-over {
  border-color: var(--accent-green);
  background: rgba(46, 204, 113, 0.15);
}

.bag-recycle {
  border-color: rgba(52, 152, 219, 0.4);
}
.bag-recycle.drag-over {
  border-color: var(--accent-blue);
  background: rgba(52, 152, 219, 0.15);
}

.bag-trash {
  border-color: rgba(149, 165, 166, 0.4);
}
.bag-trash.drag-over {
  border-color: #95a5a6;
  background: rgba(149, 165, 166, 0.15);
}

.bag-icon {
  font-size: 34px;
  margin-bottom: 6px;
}

.bag-drop-zone h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.bag-rate {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.bag-meter {
  width: 100%;
  height: 12px;
  background: #0f1520;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.meter-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.2s ease;
}

.bag-pfand .meter-bar { background: var(--accent-green); }
.bag-recycle .meter-bar { background: var(--accent-blue); }
.bag-trash .meter-bar { background: #95a5a6; }

.bag-count {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-pixel);
  margin-bottom: 4px;
}

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

.bag-status.full {
  color: var(--accent-gold);
  font-weight: 700;
}

.sorting-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
}

.tip-text {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-primary {
  background: #27ae60;
  color: white;
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  background: #2ecc71;
}

/* Shop / Manager Laptop Modal */
.shop-box {
  width: 780px;
  max-width: 96%;
  max-height: 92%;
  display: flex;
  flex-direction: column;
}

.laptop-box {
  width: 840px;
  max-width: 96%;
  border-color: #38bdf8;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.22), 0 20px 60px rgba(0, 0, 0, 0.85);
}

.laptop-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.laptop-os-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  width: fit-content;
}

.laptop-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid #233045;
  padding-bottom: 12px;
}

.laptop-tab {
  background: #17212e;
  border: 1px solid #2d3e56;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.laptop-tab:hover {
  background: #202d3f;
  color: #ffffff;
}

.laptop-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.workers-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
}

.workers-summary-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.workers-summary-stats strong {
  color: #f1c40f;
}

.btn-hire-worker {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-hire-worker:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

.workers-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  max-height: min(460px, 48vh);
  overflow-y: auto;
  padding-right: 6px;
}

.worker-card {
  background: #17212e;
  border: 1px solid #2d3e56;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s;
}

.worker-card:hover {
  border-color: #3b82f6;
}

.worker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 6px;
}

.worker-title {
  font-size: 14px;
  font-weight: 800;
  color: #f1c40f;
  display: flex;
  align-items: center;
  gap: 6px;
}

.worker-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.worker-status-pill.status-busy {
  background: #3b2314;
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.4);
}

.worker-mode-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #0f172a;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.worker-mode-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.worker-mode-select {
  background: #1e293b;
  border: 1px solid #3b82f6;
  color: #f8fafc;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  width: 100%;
}

.worker-mode-desc {
  font-size: 10px;
  color: #38bdf8;
  line-height: 1.3;
  margin-top: 2px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.skills-button-row,
.upgrades-button-row {
  display: flex;
  gap: 6px;
}

.skill-btn {
  flex: 1;
  padding: 6px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #3b82f6;
  background: #1e3a8a;
  color: #dbeafe;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.skill-btn:hover {
  background: #2563eb;
  color: #ffffff;
}

.skill-btn.unlocked {
  background: #064e3b;
  border-color: #059669;
  color: #34d399;
  cursor: default;
}

.upgrade-btn {
  flex: 1;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #d97706;
  background: #451a03;
  color: #fef3c7;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.upgrade-btn:hover {
  background: #78350f;
  border-color: #f59e0b;
}

.upgrade-btn.maxed {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
  cursor: default;
}

.upgrade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #334155;
  background: #111827;
  color: #64748b;
}

.worker-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 6px;
  margin-top: 2px;
}

.worker-invested {
  font-size: 10px;
  color: #64748b;
}

.btn-fire-worker {
  background: #450a0a;
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-fire-worker:hover {
  background: #7f1d1d;
  color: #ffffff;
}

.no-workers-box {
  grid-column: 1 / -1;
  background: #17212e;
  border: 2px dashed #2d3e56;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  color: #94a3b8;
}

.no-workers-box .empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.no-workers-box h3 {
  font-size: 16px;
  color: #f1c40f;
  margin-bottom: 6px;
}

.no-workers-box p {
  font-size: 12px;
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: min(480px, 50vh);
  overflow-y: auto;
  padding-right: 6px;
}

.shop-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #17212e;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px;
}

.card-icon {
  font-size: 32px;
  background: #253346;
  padding: 12px;
  border-radius: 10px;
}

.card-content {
  flex: 1;
}

.card-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
}

.card-status {
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 600;
}

.btn-buy {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 100px;
  transition: 0.15s;
}

.btn-buy:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.btn-buy:disabled {
  background: #34495e;
  color: #7f8c8d;
  cursor: not-allowed;
  transform: none;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 115px;
}

.btn-sell {
  background: #c0392b;
  color: white;
  border: none;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
}

.btn-sell:hover:not(:disabled) {
  background: #e74c3c;
  transform: translateY(-2px);
}

.btn-sell:disabled {
  background: #2c3e50;
  color: #5d6d7e;
  cursor: not-allowed;
  transform: none;
}

/* Bottom Controls Bar */
#controls-help {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 6px 14px;
  background: #111722;
  border-top: 1px solid var(--panel-border);
  font-size: 11.5px;
  color: var(--text-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key {
  background: #253346;
  border: 1px solid #3d4f6c;
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-pixel);
}

/* Day Summary Modal (22:30 Financial Statement) */
.summary-box {
  width: 580px;
  max-width: 95%;
  border-color: #f59e0b;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.25), 0 20px 60px rgba(0, 0, 0, 0.9);
  text-align: center;
  padding: 24px 28px;
}

.summary-header {
  margin-bottom: 20px;
}

.summary-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.summary-header h2 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 6px;
}

.summary-header p {
  color: var(--text-muted);
  font-size: 13px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  text-align: left;
}

.summary-stat-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-stat-card.highlight-card {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.stat-icon {
  font-size: 24px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.stat-value.text-green {
  color: #10b981;
}

.stat-value.text-red {
  color: #ef4444;
}

.summary-stock-preserved {
  width: 100%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.stock-title {
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-chips {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stock-chip {
  background: #1f2937;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.summary-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  border-top: 1px solid #1f2937;
  padding-top: 16px;
}

.summary-bank-balance {
  font-size: 13px;
  color: #9ca3af;
}

.summary-bank-balance strong {
  color: #fbbf24;
  font-size: 15px;
}

.btn-next-day {
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 8px;
  color: #111827;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.btn-next-day:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* ==========================================
   3D NÉZET (three.js) – game3d.js
   ========================================== */
#gameCanvas3d {
  display: block;
  flex: 0 0 auto;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  background: #0c1220;
}

#gameCanvas3d.tps-pointer-active {
  cursor: none;
}

#overlay3d {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  overflow: hidden;
  display: block;
}

#overlay3d .l3d {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  will-change: transform;
}

#overlay3d .bl3d {
  display: flex;
  align-items: center;
  gap: 5px;
}

#overlay3d .bl3d .bar {
  display: inline-block;
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

#overlay3d .bl3d .bar i {
  display: block;
  height: 100%;
}

#overlay3d .wl3d { border-color: rgba(243, 156, 18, 0.6); }
#overlay3d .dl3d { border-color: rgba(56, 189, 248, 0.6); color: #7dd3fc; }
#overlay3d .tl3d { border-color: rgba(46, 204, 113, 0.6); }
#overlay3d .hl3d { border-color: var(--accent-gold); color: var(--accent-gold); font-size: 12px; }

#overlay3d .ft3d {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, 0.85);
  will-change: transform, opacity;
}

#overlay3d .toast3d {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 25, 0.85);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-ui);
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Lábléc: mindig egy sor. Ha nem fér ki, folyamatosan görgeti a tartalmat (ticker); egérrel ráállva megáll.
   A görgetést a game3d.js kapcsolja (is-ticker osztály), a szélesség változását figyelve. */
#controls-help {
  overflow: hidden;
  position: relative;
}

#controls-help .help-track {
  display: flex;
  flex: none;
  align-items: center;
}

#controls-help .help-group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 20px;
}

#controls-help.is-ticker {
  justify-content: flex-start;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

#controls-help.is-ticker .help-group {
  padding-right: 56px;
}

#controls-help.is-ticker .help-track {
  animation: help-ticker var(--ticker-duration, 30s) linear infinite;
}

#controls-help.is-ticker:hover .help-track {
  animation-play-state: paused;
}

@keyframes help-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Csökkentett mozgás: nincs animáció, kézzel görgethető */
@media (prefers-reduced-motion: reduce) {
  #controls-help.is-ticker {
    overflow-x: auto;
    scrollbar-width: thin;
  }
  #controls-help.is-ticker .help-track {
    animation: none;
  }
}

#controls-help .hint3d {
  color: var(--accent-gold);
}

/* ==========================================================================
   QUEST CHECKLIST PANEL & LEVEL-UP MODAL
   ========================================================================== */

.quest-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  z-index: 45;
  transition: all 0.25s ease;
  user-select: none;
}

.quest-panel.collapsed {
  width: 230px;
  padding: 8px 12px;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.quest-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-icon {
  font-size: 16px;
}

.quest-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12.5px;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.quest-collapse-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.quest-collapse-btn:hover {
  color: #ffffff;
}

.quest-list {
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.quest-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 1.35;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.5);
  padding: 5px 8px;
  border-radius: 6px;
  border-left: 3px solid #64748b;
  transition: all 0.2s;
}

.quest-item.completed {
  color: #94a3b8;
  text-decoration: line-through;
  background: rgba(34, 197, 94, 0.08);
  border-left-color: #22c55e;
}

.quest-check {
  font-weight: 700;
  font-size: 12px;
  color: #64748b;
  min-width: 14px;
  text-align: center;
}

.quest-item.completed .quest-check {
  color: #22c55e;
  text-decoration: none;
}

.quest-text {
  flex: 1;
}

/* Level Up Modal */
.level-up-box {
  text-align: center;
  max-width: 440px;
  padding: 30px 24px;
  border: 2px solid #f59e0b;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.35);
  animation: levelUpPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes levelUpPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.level-up-stars {
  font-size: 32px;
  margin-bottom: 8px;
  animation: bouncePrompt 1.5s infinite;
}

#level-up-title {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: #f59e0b;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.6);
}

.level-up-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 20px;
  padding: 6px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.5);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

#level-up-desc {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.level-up-subdesc {
  font-size: 12.5px;
  color: #94a3b8;
  margin-bottom: 22px;
}

.btn-levelup-continue {
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
