/* TSTP World — Sims & Tycoon 3D Urban Simulation Styles */

:root {
  --w-bg: #0b0f19;
  --w-surface: rgba(17, 24, 39, 0.92);
  --w-border: rgba(255, 255, 255, 0.12);
  --w-accent: #22d3ee;
  --w-accent-glow: rgba(34, 211, 238, 0.35);
  --w-text: #f3f4f6;
  --w-muted: #9ca3af;
  --w-success: #10b981;
  --w-warn: #f59e0b;
  --w-danger: #ef4444;
}

* { box-sizing: border-box; }

body.world-client-body {
  margin: 0;
  padding: 0;
  background: var(--w-bg);
  color: var(--w-text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
  height: 100vh;
  width: 100vw;
}

.world-client {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.world-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(11, 15, 25, 0.96);
  border-bottom: 1px solid var(--w-border);
  z-index: 20;
  flex-shrink: 0;
}

.world-brand {
  display: flex;
  flex-direction: column;
}
.world-brand strong {
  font-size: 1.1rem;
  color: var(--w-accent);
  letter-spacing: 0.05em;
}
.world-brand-sub {
  font-size: 0.72rem;
  color: var(--w-muted);
}

.world-status {
  margin: 0;
  font-size: 0.85rem;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.world-top-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.world-wanted-stars {
  font-size: 1.1rem;
  letter-spacing: 2px;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
  animation: pulse-wanted 1s infinite alternate;
}
@keyframes pulse-wanted {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

#worldBalance {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
}

.world-exit {
  color: var(--w-muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--w-border);
  border-radius: 6px;
  transition: all 0.2s;
}
.world-exit:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--w-text);
}

.world-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}

#worldClientCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.world-crt-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 3px 100%;
  z-index: 5;
}

.world-minimap-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(11, 15, 25, 0.88);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 8px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}
.world-minimap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.world-minimap-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--w-accent);
  letter-spacing: 1px;
}
.world-coords-badge {
  font-size: 0.65rem;
  color: var(--w-muted);
}
#worldMinimap {
  border-radius: 4px;
  display: block;
  cursor: crosshair;
}
.world-minimap-hint {
  margin: 4px 0 0;
  font-size: 0.65rem;
  color: var(--w-muted);
  text-align: center;
}

.world-focus-hint {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 211, 238, 0.92);
  color: #0b0f19;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  z-index: 15;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.6);
  pointer-events: none;
}

.world-comms {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 260px;
  max-height: 180px;
  background: rgba(11, 15, 25, 0.82);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}
.world-comms h2 {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--w-muted);
  text-transform: uppercase;
}
.world-chat-log {
  flex: 1;
  overflow-y: auto;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.world-chat-msg strong {
  color: var(--w-accent);
}

.world-navigator, .world-economy, .world-npc {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 320px;
  max-height: 80vh;
  background: var(--w-surface);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 12px;
  z-index: 15;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}
.world-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.world-nav-room {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--w-border);
  color: var(--w-text);
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s;
}
.world-nav-room:hover, .world-nav-room.is-active {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--w-accent);
}
.world-nav-room span {
  font-size: 0.72rem;
  color: var(--w-muted);
}

.world-economy-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.world-economy-head h2 { margin: 0; font-size: 1.1rem; }
.world-eco-close {
  background: transparent;
  border: none;
  color: var(--w-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.world-eco-close:hover { color: #fff; }

.world-tutorial {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--w-surface);
  border: 2px solid var(--w-accent);
  border-radius: 12px;
  padding: 20px;
  max-width: 480px;
  width: 90%;
  z-index: 25;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--w-accent-glow);
  backdrop-filter: blur(16px);
}
.world-tutorial h2 { margin-top: 0; color: var(--w-accent); }
.world-tutorial ol { padding-left: 20px; line-height: 1.5; font-size: 0.9rem; }
.world-tutorial li { margin-bottom: 8px; }

.world-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid var(--w-accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.world-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.world-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(11, 15, 25, 0.96);
  border-top: 1px solid var(--w-border);
  z-index: 20;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.world-tool {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--w-border);
  color: var(--w-text);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.world-tool:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.world-chat-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 1;
  max-width: 380px;
}
.world-chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--w-border);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
}
.world-chat-input:focus {
  border-color: var(--w-accent);
}
.world-chat-send {
  background: var(--w-accent);
  color: #0b0f19;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Modals & Dialogs */
.world-dialog {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 720px;
  width: 95%;
  color: var(--w-text);
}
.world-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.world-dialog-inner {
  background: var(--w-surface);
  border: 1px solid var(--w-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  max-height: 85vh;
  overflow-y: auto;
}
.world-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--w-border);
}
.world-dialog-close {
  background: transparent;
  border: none;
  color: var(--w-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.world-dialog-close:hover { color: #fff; }

/* 3D Avatar Customizer Styles */
.customizer-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}
@media (max-width: 680px) {
  .customizer-shell { grid-template-columns: 1fr; }
}
.customizer-preview-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.customizer-avatar-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 16px 8px;
  margin-bottom: 12px;
}
.customizer-mannequin {
  font-size: 3.5rem;
  margin-bottom: 4px;
}
.customizer-name-badge {
  font-weight: 800;
  color: var(--w-accent);
}
.customizer-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.customizer-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--w-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.customizer-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.customizer-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.customizer-swatch:hover { transform: scale(1.15); }
.customizer-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 8px #fff;
}
.customizer-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--w-border);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}
.customizer-toggles {
  display: flex;
  gap: 16px;
}
.customizer-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Jobs Dashboard Styles */
.jobs-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.jobs-header-stats {
  display: flex;
  gap: 16px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--w-border);
  font-size: 0.85rem;
}
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.job-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.job-icon-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-icon { font-size: 1.5rem; }
.job-rank-badge {
  background: rgba(34, 211, 238, 0.15);
  color: var(--w-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}
.job-desc {
  font-size: 0.78rem;
  color: var(--w-muted);
  margin: 0;
}
.job-wage-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #fbbf24;
  font-weight: 700;
}
.job-clockin-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.job-clockin-btn:hover { filter: brightness(1.15); }

/* Shift Minigame Shell */
.shift-minigame-shell {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--w-accent);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.shift-minigame-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 20px;
  margin: 12px 0;
}
.shift-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.shift-progress-bar-fill {
  height: 100%;
  background: var(--w-accent);
  transition: width 0.3s;
}

/* Tycoon Dashboard Styles */
.tycoon-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tycoon-overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tycoon-metric-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.tycoon-metric-card span { font-size: 0.72rem; color: var(--w-muted); text-transform: uppercase; }
.tycoon-metric-card strong { display: block; font-size: 1.2rem; color: var(--w-accent); }
.tycoon-biz-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.tycoon-biz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tycoon-biz-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.tycoon-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tycoon-action-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--w-border);
  border-radius: 6px;
  padding: 8px;
}
.tycoon-action-box h5 { margin: 0 0 6px; font-size: 0.78rem; color: var(--w-muted); }
.tycoon-sm-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--w-border);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.tycoon-sm-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* Crime & Lockpicking Styles */
.lockbox-shell {
  background: #111;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.lockbox-dial-graphic {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid #555;
  margin: 16px auto;
  background: radial-gradient(circle, #222 0%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lockbox-pin-indicator {
  position: absolute;
  top: 10px;
  width: 4px;
  height: 20px;
  background: #f59e0b;
  border-radius: 2px;
  transform-origin: 50% 60px;
}

/* Room Decorator Toolbar Styles */
.room-editor-toolbar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 15, 25, 0.94);
  border: 1px solid var(--w-accent);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 18;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px var(--w-accent-glow);
  backdrop-filter: blur(10px);
}
.room-editor-catalog-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--w-border);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.room-editor-catalog-btn:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--w-accent);
}

/* Inventory Backpack Styles */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.inventory-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--w-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.inventory-item-icon { font-size: 2rem; }
.inventory-qty { font-size: 0.72rem; color: var(--w-muted); }
.inventory-desc { font-size: 0.7rem; color: var(--w-muted); margin: 4px 0; }
.inventory-action-row { display: flex; gap: 4px; margin-top: 4px; }

/* NPC Dialogue & Quest Cards */
.npc-dialogue-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.npc-dialogue-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.npc-avatar-icon { font-size: 2rem; }
.npc-sub { font-size: 0.75rem; color: var(--w-muted); }
.npc-dialogue-speech {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--w-accent);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 0.9rem;
}
.npc-quest-section h4 { margin: 10px 0 6px; font-size: 0.85rem; color: var(--w-accent); }
.npc-quest-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--w-border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.npc-quest-rewards {
  font-size: 0.75rem;
  color: #fbbf24;
  margin: 4px 0 8px;
  font-weight: 700;
}
