/* ── Android Infinity — stylesheet entry point ──────────────────── */
/* Edit the files in src/styles/ rather than this file directly.    */
/* ALPHA 0.0.4                                                       */

/* ── Base: fonts, CSS variables, themes, body, typography ─────── */

/* Fonts are loaded via <link> tags in index.html to avoid
   nested @import issues when opened from file:// protocol */

/* ── CSS Custom Properties (default theme) ─────────────────────── */
:root {
  --primary-color: #00e6ff;
  --secondary-color: #000000;
  --background-color: #111111;
  --text-color: #ffffff;
  --border-color: #00e6ff;
  --accent-color: #00e6ff;
  --shadow-color: rgba(0, 255, 255, 0.3);
  --title-image: url('img/ui/AI title default.png');
  --game-font: 'Orbitron', sans-serif;
  --game-font-size: 16px;
}

/* ── Theme Variants ─────────────────────────────────────────────── */
.theme-black-red {
  --primary-color: #ff0000;
  --secondary-color: #000000;
  --background-color: #111111;
  --text-color: #ffffff;
  --border-color: #ff0000;
  --accent-color: #ff0000;
  --shadow-color: rgba(255, 0, 0, 0.3);
  --title-image: url('img/ui/AI title industrial.png');
}

.theme-white-cyan {
  --primary-color: #00e6ff;
  --secondary-color: #ffffff;
  --background-color: #ffffff;
  --text-color: #000000;
  --border-color: #00e6ff;
  --accent-color: #00e6ff;
  --shadow-color: rgba(0, 230, 255, 0.3);
  --title-image: url('img/ui/AI title light.png');
}

.theme-grey-green {
  --primary-color: #00ff00;
  --secondary-color: #808080;
  --background-color: #404040;
  --text-color: #ffffff;
  --border-color: #00ff00;
  --accent-color: #00ff00;
  --shadow-color: rgba(0, 255, 0, 0.3);
  --title-image: url('img/ui/AI title mellow.png');
}

.theme-pinkie-lemon {
  --primary-color: #ff93c9;
  --secondary-color: #ffff5e;
  --background-color: #ffff5e;
  --text-color: #000000;
  --border-color: #ff93c9;
  --accent-color: #ff93c9;
  --shadow-color: rgba(206, 95, 150, 0.3);
  --title-image: url('img/ui/AI title pinkielemon.png');
}

.theme-grassland {
  --primary-color: #2d5016;
  --secondary-color: #90ee90;
  --background-color: #90ee90;
  --text-color: #000000;
  --border-color: #2d5016;
  --accent-color: #2d5016;
  --shadow-color: rgba(45, 80, 22, 0.3);
  --title-image: url('img/ui/AI title grassland.png');
}

.theme-forest {
  --primary-color: #4a7c59;
  --secondary-color: #3d2817;
  --background-color: #3d2817;
  --text-color: #ffffff;
  --border-color: #4a7c59;
  --accent-color: #4a7c59;
  --shadow-color: rgba(74, 124, 89, 0.3);
  --title-image: url('img/ui/AI title forest.png');
}

.theme-ocean {
  --primary-color: #87ceeb;
  --secondary-color: #1a3a5c;
  --background-color: #1a3a5c;
  --text-color: #ffffff;
  --border-color: #87ceeb;
  --accent-color: #87ceeb;
  --shadow-color: rgba(135, 206, 235, 0.3);
  --title-image: url('img/ui/AI title ocean.png');
}

.theme-wasteland {
  --primary-color: #b19cd9;
  --secondary-color: #2d2d2d;
  --background-color: #2d2d2d;
  --text-color: #ffffff;
  --border-color: #b19cd9;
  --accent-color: #b19cd9;
  --shadow-color: rgba(177, 156, 217, 0.3);
  --title-image: url('img/ui/AI title wasteland.png');
}

.theme-orange-soda {
  --primary-color: #39ff14;
  --secondary-color: #ff6600;
  --background-color: #ff6600;
  --text-color: #000000;
  --border-color: #39ff14;
  --accent-color: #39ff14;
  --shadow-color: rgba(57, 255, 20, 0.3);
  --title-image: url('img/ui/AI title orangesoda.png');
}

.theme-strawberry-cream {
  --primary-color: #ff6b9d;
  --secondary-color: #fff8e7;
  --background-color: #fff8e7;
  --text-color: #000000;
  --border-color: #ff6b9d;
  --accent-color: #ff6b9d;
  --shadow-color: rgba(255, 107, 157, 0.3);
  --title-image: url('img/ui/AI title strawberrycream.png');
}

/* ── Body & Typography ──────────────────────────────────────────── */
html, body {
  height: 100%;
}

body {
  font-family: var(--game-font, 'Orbitron', sans-serif);
  font-size: var(--game-font-size, 16px);
  background: linear-gradient(135deg, var(--background-color), var(--secondary-color));
  color: var(--text-color);
  margin: 0;
  padding: 0;
  text-align: center;
}

/* Game screen locks page scroll; title screen allows it */
body:has(#game.screen.active) {
  overflow: hidden;
}

body:not(:has(#game.screen.active)) {
  overflow-y: auto;
}

h1, h2, h3 {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-color);
}

.screen {
  display: none;
  padding: 20px;
}

.screen.active {
  display: block;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── Moon Phase Overlay ─────────────────────────────────────────── */
/* Full-screen ambient tint for blood/blue moons. Sits above the game scene
   but ignores pointer events. Two stacked layers per phase:
     • a base radial glow using 'screen' — brightens/colorizes dark themes
       (where 'multiply' would vanish into black)
     • an edge vignette using 'overlay' — deepens the color and frames the scene
   Combined, the effect stays vivid on both dark and light themes. */
.moon-overlay {
  position: fixed;
  inset: 0;
  z-index: 999; /* above the game scene, just below modals (1000) so menus stay clean */
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

/* Only glow while the game screen is active — never on title/character creator. */
body:has(#game.screen.active) .moon-overlay-active {
  opacity: 1;
}

/* Base glow layer — 'screen' makes the color pop against dark backgrounds. */
.moon-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse at center,
              var(--moon-glow-core) 0%,
              var(--moon-glow-mid) 55%,
              var(--moon-glow-edge) 100%);
}

/* Vignette layer — 'overlay' deepens/saturates the color, especially at edges. */
.moon-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  mix-blend-mode: overlay;
  background: radial-gradient(ellipse at center,
              transparent 25%,
              var(--moon-vignette) 115%);
}

/* Blood moon — vivid, ominous red. */
.moon-overlay-blood {
  --moon-glow-core: rgba(255, 40, 40, 0.30);
  --moon-glow-mid:  rgba(200, 20, 20, 0.24);
  --moon-glow-edge: rgba(120, 0, 0, 0.18);
  --moon-vignette:  rgba(150, 0, 0, 0.5);
}

/* Blue moon — cool, mystical blue. */
.moon-overlay-blue {
  --moon-glow-core: rgba(80, 150, 255, 0.30);
  --moon-glow-mid:  rgba(40, 90, 230, 0.24);
  --moon-glow-edge: rgba(15, 40, 150, 0.18);
  --moon-vignette:  rgba(20, 60, 200, 0.48);
}

/* Gentle breathing pulse on the glow layer so the moon feels alive and draws
   the eye. Animating the ::before (not the root) keeps the root's opacity free
   for the fade-in/out transition. */
.moon-overlay-active::before {
  animation: moon-pulse 6.5s ease-in-out infinite;
}

@keyframes moon-pulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 0.9; }
}

/* Respect reduced-motion preferences — keep the tint, drop the pulse. */
@media (prefers-reduced-motion: reduce) {
  .moon-overlay-active::before {
    animation: none;
  }
}
       /* variables, themes, fonts, body */
/* ── Layout: game screen, sidebars, main area, story/bottom sections */

/* ── Game Screen Layout ─────────────────────────────────────────── */
.game-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Game screen should not have the generic .screen padding —
   the sidebar and main area handle their own spacing. */
#game.screen {
  padding: 0;
}

/* ── Player Sidebar (left) ──────────────────────────────────────── */
.game-sidebar {
  width: 405px;
  min-width: 405px;
  background: var(--background-color);
  border-right: 2px solid var(--primary-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 8px 20px 30px 8px;
  position: relative;
  transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}

.game-sidebar.collapsed {
  width: 36px;
  min-width: 36px;
  padding: 15px 0;
  overflow: hidden;
}

.game-sidebar.collapsed > *:not(.sidebar-collapse-btn) {
  display: none;
}

/* ── Sidebar Collapse Toggle ────────────────────────────────────── */
.sidebar-collapse-btn {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  font-size: 11px;
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--primary-color);
  color: var(--background-color);
  box-shadow: none;
}

.sidebar-collapse-btn-right {
  right: auto;
  left: 6px;
}

/* ── Player Sidebar Inner ───────────────────────────────────────── */
#sidebar {
  background: var(--background-color);
  padding: 15px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  width: 320px;
  text-align: left;
  box-shadow: 0 0 15px var(--primary-color);
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-footer {
  flex-shrink: 0;
  padding-top: 10px;
  border-top: 1px solid var(--primary-color);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-footer button {
  font-size: 12px;
  padding: 5px 10px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
}

.sidebar-content::-webkit-scrollbar { width: 8px; }
.sidebar-content::-webkit-scrollbar-track {
  background: var(--background-color);
  border-radius: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}
.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.character-name-display {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  background: var(--secondary-color);
}

.character-name-display h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.5em;
  text-shadow: 0 0 10px var(--primary-color);
}

/* ── Main Game Area ─────────────────────────────────────────────── */
.game-main {
  flex: 1;
  min-width: 0;
  background: var(--background-color);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.game-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: visible;
  position: relative;
}

.game-content h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.game-content p {
  color: var(--text-color);
}

.game-top-section {
  position: sticky;
  top: 0;
  background: var(--background-color);
  z-index: 10;
  flex-shrink: 0;
}

.game-top-section:not(:empty) {
  padding: 10px 0;
  border-bottom: 1px solid var(--primary-color);
}

.game-story-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 200px;
  scroll-behavior: smooth;
  justify-content: flex-start;
}

.game-bottom-section {
  flex-shrink: 0;
  background: var(--background-color);
  border-top: 1px solid var(--primary-color);
  padding: 10px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 550px);
}

/* Compact buttons in bottom section */
.game-bottom-section .location-btn,
.game-bottom-section .room-btn,
.game-bottom-section .clinton-btn {
  min-width: 5em;
}

/* ── Action Buttons (sidebar) ───────────────────────────────────── */
.action-buttons {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-buttons button {
  width: 100%;
  padding: 10px;
  font-size: 1em;
}

/* ── Undo/Redo Buttons ──────────────────────────────────────────── */
.undo-redo-container {
  display: flex;
  gap: 6px;
  width: 100%;
}

.undo-redo-btn {
  flex: 1;
  padding: 8px 6px;
  font-size: 0.9em;
  cursor: pointer;
  border: 1px solid var(--primary-color);
  background: var(--background-color);
  color: var(--text-color);
  border-radius: 4px;
  transition: opacity 0.2s, background-color 0.2s;
}

.undo-redo-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--background-color);
}

.undo-redo-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Game Settings (in-game tab) ────────────────────────────────── */
.game-settings-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.game-settings-content label {
  color: var(--text-color);
}

.game-settings-content select {
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  padding: 5px 10px;
  border-radius: 3px;
  margin-left: 10px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
  transform: translateX(26px);
}
     /* game screen, sidebars, sections */
/* ── Components: buttons, inputs, modals, save slots, forms ─────── */

/* ── Buttons ────────────────────────────────────────────────────── */
button {
  background: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  padding: 0.6em 1.5em;
  margin: 8px;
  font-size: var(--game-font-size, 16px);
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: var(--primary-color);
  color: var(--background-color);
  box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  text-shadow: none;
}

/* ── Form Inputs ────────────────────────────────────────────────── */
label {
  display: block;
  margin: 8px 0;
  font-size: 14px;
}

select,
input[type="text"],
input[type="number"],
input[type="range"] {
  background: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  padding: 2px 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  box-shadow: 0 0 6px var(--primary-color);
}

.checkbox-group {
  margin: 15px 0;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--secondary-color);
}

.checkbox-group h4 {
  margin: 0 0 10px 0;
  color: var(--primary-color);
  font-size: 14px;
  text-transform: uppercase;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  margin: 5px 0;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary-color);
}

/* ── Generic Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  position: relative;
  box-shadow: 0 0 20px var(--primary-color);
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: var(--primary-color);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: 0.2s;
}

.close-modal:hover {
  color: var(--text-color);
  text-shadow: 0 0 10px var(--primary-color);
}

.modal-image-container {
  text-align: center;
  margin-bottom: 15px;
}

.modal-image-container img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.modal-sprite-info {
  text-align: center;
}

.modal-sprite-info h3 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 18px;
}

.modal-sprite-info p {
  color: var(--text-color);
  font-size: 12px;
  margin: 0;
  font-family: monospace;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.modal-header h2 {
  margin: 0;
  color: var(--primary-color);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 40px;
  height: 40px;
  line-height: 40px;
  transition: 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-color);
  text-shadow: 0 0 10px var(--primary-color);
  background: transparent;
  box-shadow: none;
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* ── Save Slots Modal ───────────────────────────────────────────── */
.save-slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  padding: 10px;
}

.save-slot {
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  transition: 0.2s;
}

.save-slot:hover {
  box-shadow: 0 0 10px var(--primary-color);
  border-color: var(--accent-color);
}

.save-slot.empty {
  opacity: 0.7;
  border-style: dashed;
}

.save-slot.has-data {
  border-color: var(--accent-color);
}

.save-slot-info {
  margin-bottom: 10px;
}

.save-slot-name {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 16px;
  margin-bottom: 5px;
}

.save-slot-date {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
}

.save-slot-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.save-slot-actions button {
  flex: 1;
  min-width: 60px;
  padding: 8px 12px;
  font-size: 12px;
  margin: 0;
}

.slot-load-btn {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--background-color);
}

.slot-load-btn:hover {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.slot-save-btn {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--background-color);
}

.slot-delete-btn {
  background: #8b0000;
  border-color: #8b0000;
  color: #fff;
}

.slot-delete-btn:hover {
  background: #a00000;
  box-shadow: 0 0 10px #a00000;
}

.save-slots-btn {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.save-slots-btn:hover {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.autosave-slot {
  border: 2px solid var(--accent-color) !important;
  background: color-mix(in srgb, var(--accent-color) 10%, transparent) !important;
}

/* ── Save/Load in-game modal ────────────────────────────────────── */
.save-load-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.save-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* New card layout — one row per slot */
.save-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  background: var(--secondary-color);
}

.save-slot-card.autosave-slot {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, var(--secondary-color));
}

.save-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.save-card-label {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 0.9em;
  white-space: nowrap;
}

.autosave-slot .save-card-label {
  color: var(--accent-color);
}

.save-card-detail {
  color: var(--text-color);
  font-size: 0.8em;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.save-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.save-card-actions button {
  padding: 5px 12px;
  font-size: 0.78em;
  margin: 0;
  min-width: 0;
}

.slot-save-btn {
  border-color: var(--primary-color);
}

.slot-load-btn {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--background-color);
}

.slot-load-btn:hover {
  box-shadow: 0 0 8px var(--accent-color);
}

.slot-export-btn {
  border-color: var(--border-color);
}

.slot-delete-btn {
  background: #6b0000;
  border-color: #6b0000;
  color: #fff;
}

.slot-delete-btn:hover {
  background: #900;
  box-shadow: 0 0 8px #900;
}

.save-import-export-section {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* ── Game Modals ────────────────────────────────────────────────── */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.game-modal.hidden {
  display: none;
}

.game-modal .modal-content {
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── System Modal fixed size ────────────────────────────────────── */
#system-modal .modal-content {
  width: 900px;
  height: 85vh;
}

#system-modal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#system-modal .system-content {
  flex: 1;
  overflow-y: auto;
  display: none;
}

#system-modal .system-content.active {
  display: block;
}

.game-modal .modal-header {
  background: var(--primary-color);
  color: var(--background-color);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-modal .modal-header h3 {
  margin: 0;
  color: var(--background-color);
}

.game-modal .close-modal {
  background: none;
  border: none;
  color: var(--background-color);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-modal .close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.game-modal .modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── Personal Database ──────────────────────────────────────────── */
.personal-database .modal-content {
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid var(--primary-color);
  box-shadow:
    0 0 25px var(--primary-color),
    0 0 50px var(--primary-color),
    0 0 80px color-mix(in srgb, var(--primary-color) 50%, transparent),
    inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.personal-database .modal-header {
  background: color-mix(in srgb, var(--primary-color) 70%, black);
  box-shadow:
    0 4px 20px color-mix(in srgb, var(--primary-color) 60%, transparent),
    inset 0 -2px 8px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--primary-color);
}

.personal-database .modal-body {
  background: rgba(0, 0, 0, 0.88);
  color: var(--accent-color);
  text-shadow: 0 0 6px color-mix(in srgb, var(--accent-color) 50%, transparent);
}

.personal-database .modal-body h4,
.personal-database .modal-body p,
.personal-database .modal-body span,
.personal-database .modal-body label {
  color: var(--accent-color) !important;
  text-shadow: 0 0 5px color-mix(in srgb, var(--accent-color) 40%, transparent);
}

.personal-database .modal-body h4 {
  color: var(--primary-color) !important;
  text-shadow: 0 0 8px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

.personal-database .character-description [style*="color"] {
  color: var(--accent-color) !important;
  text-shadow: 0 0 5px color-mix(in srgb, var(--accent-color) 40%, transparent);
}

.personal-database #npcs-list [style*="color"],
.personal-database #quest-list [style*="color"],
.personal-database #inventory-items [style*="color"] {
  color: var(--accent-color) !important;
  text-shadow: 0 0 5px color-mix(in srgb, var(--accent-color) 40%, transparent);
}

.personal-database .calendar-day,
.personal-database .calendar-day-header,
.personal-database .calendar-day div {
  text-shadow: none;
}

.personal-database #calendar-container h3 {
  color: var(--primary-color) !important;
  text-shadow: 0 0 8px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

.personal-database .system-tab-btn {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid color-mix(in srgb, var(--primary-color) 60%, transparent);
  color: var(--accent-color);
  text-shadow: 0 0 6px color-mix(in srgb, var(--accent-color) 50%, transparent);
  transition: all 0.2s ease;
}

.personal-database .system-tab-btn:hover {
  background: color-mix(in srgb, var(--primary-color) 25%, black);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.personal-database .system-tab-btn.active {
  background: var(--primary-color);
  color: var(--background-color);
  box-shadow:
    0 0 12px var(--primary-color),
    0 0 24px color-mix(in srgb, var(--primary-color) 40%, transparent);
  text-shadow: none;
}

.personal-database .system-content {
  border-top: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
  padding-top: 15px;
}

/* ── Room Modal ─────────────────────────────────────────────────── */
.room-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.room-modal.hidden {
  display: none;
}

.room-modal-box {
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 0 30px var(--shadow-color);
  width: 90vw;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.room-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
  z-index: 10;
  line-height: 1;
}

.room-modal-close:hover {
  color: var(--text-color);
  background: transparent;
  box-shadow: none;
}

.room-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px;
}

.room-modal-body::-webkit-scrollbar { width: 6px; }
.room-modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

/* ── Cheats Modal ───────────────────────────────────────────────── */
#cheats-modal .modal-content {
  overflow: visible;
  position: relative;
}

.teleport-disabled-msg {
  color: #ff6b6b;
  font-size: 0.85em;
  font-style: italic;
  margin-left: 8px;
}

.cheats-content {
  max-width: 800px;
}

.cheat-section {
  margin-bottom: 25px;
  padding: 15px;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.1);
}

.cheat-section h4 {
  margin: 0 0 15px 0;
  color: var(--primary-color);
  font-size: 16px;
}

.cheat-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cheat-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.cheat-controls input[type="number"],
.cheat-controls select {
  background: var(--background-color);
  border: 1px solid var(--primary-color);
  color: var(--text-color);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 14px;
  min-width: 80px;
}

.cheat-controls button {
  padding: 8px 16px;
  font-size: 14px;
  margin: 2px;
}

.stat-row,
.npc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.npc-group {
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.npc-group.npc-not-met {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Cheat Unauthorized / Censored states ──────────────────────── */
.cheat-unauthorized {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 0;
}

.unauthorized-text {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #c084fc;
  text-shadow: 0 0 6px #a855f7, 0 0 12px #7c3aed;
  animation: unauthorized-pulse 2s ease-in-out infinite;
}

@keyframes unauthorized-pulse {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 6px #a855f7, 0 0 12px #7c3aed; }
  50% { opacity: 1; text-shadow: 0 0 10px #c084fc, 0 0 20px #a855f7, 0 0 30px #7c3aed; }
}

.npc-censored {
  position: relative;
  overflow: hidden;
}

.npc-censored .npc-group-label {
  position: relative;
  z-index: 2;
}

.censored-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.15) 0%, rgba(88, 28, 135, 0.25) 100%);
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.glitch-text {
  font-size: 11px;
  font-family: monospace;
  color: #c084fc;
  text-shadow: 0 0 4px #a855f7;
  transform: scaleY(-1);
  line-height: 1.6;
  letter-spacing: 1px;
  animation: glitch-flicker 3s steps(1) infinite;
  user-select: none;
}

.glitch-text:nth-child(2) {
  transform: scaleY(1) skewX(-3deg);
  animation-delay: 0.7s;
}

.glitch-text:nth-child(3) {
  transform: scaleY(-1) scaleX(-1);
  animation-delay: 1.4s;
}

@keyframes glitch-flicker {
  0%, 90%, 100% { opacity: 0.8; }
  91% { opacity: 0.2; }
  92% { opacity: 0.9; }
  93% { opacity: 0.3; }
  95% { opacity: 1; }
}

.censored-error {
  margin-top: 4px;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #f87171;
  text-shadow: 0 0 4px #ef4444, 0 0 8px #dc2626;
  animation: error-blink 1.5s steps(1) infinite;
}

@keyframes error-blink {
  0%, 70%, 100% { opacity: 1; }
  71%, 85% { opacity: 0; }
}

.npc-group-label {
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 6px;
  font-size: 13px;
}

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

.npc-cheats-grid .npc-group {
  margin-bottom: 0;
  padding: 6px 8px;
  min-width: 0;
}

.npc-cheats-grid .npc-group-label {
  font-size: 13px;
  margin-bottom: 4px;
}

.npc-cheats-grid .npc-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.npc-cheats-grid .npc-row label {
  font-size: 12px;
  gap: 4px;
  min-width: 0;
  flex: none;
}

.npc-cheats-grid .npc-row input[type="number"] {
  width: 44px;
  padding: 2px 3px;
  font-size: 11px;
}

.npc-cheats-grid .npc-row button {
  padding: 2px 6px;
  font-size: 10px;
  min-width: unset;
  flex-shrink: 0;
}

.stat-row label,
.npc-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-row button,
.npc-row button {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 60px;
}

.disabled-note {
  color: var(--text-color);
  opacity: 0.6;
  font-style: italic;
  font-size: 12px;
}

@media (min-width: 768px) {
  .cheat-controls:not(.npc-cheats-grid) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .cheat-controls label {
    min-width: 200px;
  }
}

/* ── Feldt Hacks Sprite (Cheats Modal) ─────────────────────────── */
.feldt-hacks-animation {
  position: absolute;
  top: -40px;
  right: -120px;
  width: 160px;
  height: 192px;
  background: no-repeat 0 0;
  background-size: 320px 192px;
  image-rendering: pixelated;
  z-index: 1001;
  pointer-events: none;
  animation: feldt-frame 2.4s steps(1) infinite;
}

@keyframes feldt-frame {
  0%   { background-position: 0 0; }
  50%  { background-position: -160px 0; }
}

/* ── Gallery ────────────────────────────────────────────────────── */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 20px;
}

.gallery-content {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.gallery-category {
  margin-bottom: 30px;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
}

.gallery-category h3 {
  margin: 0 0 15px 0;
  color: var(--primary-color);
  text-transform: uppercase;
  font-size: 16px;
}

.sprite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.sprite-item {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  transition: 0.2s;
}

.sprite-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

.sprite-item img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 5px auto;
}

.sprite-item .sprite-name {
  font-size: 10px;
  color: var(--text-color);
  word-break: break-word;
}

/* ── Checklist Mode ───────────────────────────────────────────────────────── */

/* Gallery tab needs to be a flex column so the sticky header works */
#title-tab-gallery {
  display: none;
  flex-direction: column;
  min-height: 560px;
  /* Counteract the parent .title-panel padding so header spans full width */
  margin: -20px;
}

#title-tab-gallery.active {
  display: flex;
}

/* The checklist header + toolbar sit outside the scroll so they stay put */
.gallery-checklist-header,
.checklist-toolbar {
  flex-shrink: 0;
}

/* Only the gallery content area scrolls */
#title-tab-gallery .gallery-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Header row sitting above the gallery content */
.gallery-checklist-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--background-color);
}

/* Info toolbar shown only in checklist mode */
.checklist-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: color-mix(in srgb, var(--primary-color) 12%, var(--background-color));
  border-bottom: 1px solid var(--primary-color);
  font-size: 0.85em;
  flex-wrap: wrap;
}

.checklist-toolbar.hidden {
  display: none;
}

.checklist-counter {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1em;
  min-width: 80px;
}

/* Toggle button — normal state */
.checklist-toggle-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--secondary-color);
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.checklist-toggle-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Toggle button — active / checklist-on state */
.checklist-toggle-btn--active {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #000 !important;
}

/* Clear-all button in toolbar */
.checklist-clear-btn {
  padding: 4px 10px;
  border: 1px solid #cc3333;
  border-radius: 4px;
  background: transparent;
  color: #cc3333;
  cursor: pointer;
  font-size: 0.8em;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
}

.checklist-clear-btn:hover {
  background: #cc3333;
  color: #fff;
}

/* Sprite items in checklist mode: pointer becomes a finger to hint interactivity */
.checklist-mode .sprite-item[data-sprite-path] {
  cursor: pointer;
  position: relative;
}

/* The tick-mark overlay (hidden by default, shown when done) */
.sprite-item__tick {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #000;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  font-weight: bold;
  pointer-events: none;
  z-index: 2;
}

.sprite-item__tick::after {
  content: '✓';
}

/* Show tick and dim when done */
.checklist-mode .sprite-item--done .sprite-item__tick {
  display: block;
}

.checklist-mode .sprite-item--done {
  opacity: 0.45;
  border-color: var(--primary-color);
}

.checklist-mode .sprite-item--done:hover {
  opacity: 0.65;
}

/* In normal mode, done-state doesn't visually change anything */
:not(.checklist-mode) .sprite-item--done {
  opacity: 1;
}
 /* buttons, modals, inputs, save slots */
/* ── Title Screen: banner, tabs, panels, home tab ───────────────── */

.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding-bottom: 40px;
}

.title-banner-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 30px;
}

.title-banner-img {
  max-width: 1000px;
  width: 90%;
  height: auto;
  object-fit: contain;
}

.title-tab-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 20px;
  width: 90%;
  max-width: 1000px;
  border-bottom: 2px solid var(--primary-color);
}

.title-tab {
  background: var(--background-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 24px;
  margin: 0 2px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
  text-shadow: 0 0 5px var(--primary-color);
  font-family: 'Orbitron', sans-serif;
}

.title-tab:hover,
.title-tab.active {
  background: var(--primary-color);
  color: var(--background-color);
  box-shadow: 0 0 10px var(--primary-color);
  text-shadow: none;
}

.title-tab-new-game {
  margin-left: auto;
  border-radius: 6px 6px 0 0;
  background: var(--accent-color);
  color: var(--background-color);
  border-color: var(--accent-color);
  text-shadow: none;
}

.title-tab-new-game:hover {
  box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
  background: var(--accent-color);
  color: var(--background-color);
}

.title-panel {
  width: 90%;
  max-width: 1000px;
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 0 20px var(--primary-color);
  min-height: 300px;
  padding: 20px;
  text-align: left;
  overflow-y: auto;
  max-height: 65vh;
}

.title-tab-content {
  display: none;
  min-height: 560px;
}

.title-tab-content.active {
  display: block;
  min-height: 560px;
}

/* ── Home Tab ───────────────────────────────────────────────────── */
.home-tab-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 10px 20px;
}

.home-section {
  margin-bottom: 28px;
}

.home-section h2 {
  color: var(--primary-color);
  font-size: 1.6em;
  margin-bottom: 10px;
}

.home-section h3 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.home-section p,
.home-section ul {
  color: var(--text-color);
  line-height: 1.6;
  margin: 0 0 8px 0;
}

.home-section ul {
  padding-left: 20px;
}

.home-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  border: 1px solid var(--primary-color);
  padding: 6px 14px;
  border-radius: 4px;
  margin-top: 4px;
  transition: background 0.2s, color 0.2s;
}

.home-link:hover {
  background: var(--primary-color);
  color: var(--background-color);
}

/* ── Settings Page ──────────────────────────────────────────────── */
.settings-header {
  text-align: center;
  margin-bottom: 30px;
}

.settings-header h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.settings-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 10px;
}

.tab-button {
  background-color: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--primary-color);
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.tab-button:hover,
.tab-button.active {
  background-color: var(--primary-color);
  color: var(--background-color);
}

.settings-tab {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.settings-tab.active {
  display: block;
}

.settings-tab h3 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.settings-section {
  margin-bottom: 30px;
}

.settings-section label {
  display: block;
  margin-bottom: 15px;
  color: var(--text-color);
  font-size: 16px;
}

.settings-section input[type="checkbox"] {
  margin-right: 10px;
  accent-color: var(--primary-color);
}

.settings-section input[type="range"] {
  width: 200px;
  margin-right: 10px;
  accent-color: var(--primary-color);
}

.settings-section select {
  background-color: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  padding: 5px 10px;
  border-radius: 3px;
  margin-left: 10px;
}

.settings-section span {
  color: var(--primary-color);
  font-weight: bold;
}

.nnpc-entry {
  background-color: var(--background-color);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--primary-color);
  margin-bottom: 15px;
}

.nnpc-entry h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.nnpc-entry label {
  display: inline-block;
  margin-right: 20px;
  margin-bottom: 10px;
}

/* ── Home tab subtabs (About / Changelog) ── */
.home-subtab-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.home-subtab-btn {
  background-color: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--primary-color);
  padding: 8px 22px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.95em;
}

.home-subtab-btn:hover,
.home-subtab-btn.active {
  background-color: var(--primary-color);
  color: var(--background-color);
}

.home-subtab-content {
  display: none;
}

.home-subtab-content.active {
  display: block;
}

/* Changelog entries */
.changelog-entry {
  margin-bottom: 20px;
}

.changelog-version {
  color: var(--primary-color);
  margin-bottom: 6px;
}

.changelog-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-color);
  line-height: 1.7;
}

.changelog-list li {
  margin-bottom: 2px;
}
      /* title screen, settings page */
/* ── Character: CC doll, wardrobe, clothing shop, clothing items ─── */

/* ── CC Screen Layout ───────────────────────────────────────────── */
#character-ui {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: flex-start;
  height: 560px;
}

#doll-container {
  background: var(--background-color);
  padding: 10px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  box-shadow: 0 0 15px var(--primary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

#doll-canvas {
  width: 400px;
  height: 500px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

#doll-stats {
  margin-top: 10px;
  font-size: 14px;
}

/* ── Pixel-perfect canvas rendering ────────────────────────────── */
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#npc-canvas {
  width: 300px;
  height: 400px;
}

/* ── Doll Preview Container ─────────────────────────────────────── */
.doll-preview-container {
  text-align: center;
  margin-bottom: 15px;
  padding: 8px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  background: var(--secondary-color);
  width: 400px;
  height: 500px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Wardrobe ───────────────────────────────────────────────────── */
.wardrobe-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 15px;
}

.wardrobe-tab {
  background: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 100px;
}

.wardrobe-tab:hover {
  border-color: var(--accent-color);
  background: var(--secondary-color);
}

.wardrobe-tab.active {
  background: var(--primary-color);
  color: var(--background-color);
  border-color: var(--primary-color);
}

.wardrobe-content {
  margin-bottom: 20px;
}

.wardrobe-content h5 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.2em;
}

.clothing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.clothing-item {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}

.clothing-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.clothing-item.equipped {
  border-color: var(--accent-color);
  background: var(--secondary-color);
  box-shadow: 0 0 15px var(--shadow-color);
}

.clothing-item.purchased {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, var(--background-color), color-mix(in srgb, var(--accent-color) 15%, var(--background-color)));
}

.clothing-item.purchased .clothing-info h6 {
  color: var(--accent-color);
}

.clothing-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  padding: 4px;
}

.clothing-info {
  flex: 1;
}

.clothing-info h6 {
  color: var(--primary-color);
  margin: 0 0 8px 0;
  font-size: 1.1em;
}

.clothing-info p {
  color: var(--text-color);
  margin: 0 0 12px 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.equip-btn,
.unequip-btn {
  background: var(--accent-color);
  color: var(--background-color);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 80px;
}

.equip-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.unequip-btn {
  background: #ff6b6b;
}

.unequip-btn:hover {
  background: #ff4444;
  transform: translateY(-2px);
}

.mechanics-btn {
  background: linear-gradient(45deg, #4a90e2, #5ba0f2);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 5px;
  min-width: 100px;
}

.mechanics-btn:hover {
  background: linear-gradient(45deg, #357abd, #4a90e2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.wardrobe-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid var(--primary-color);
}

.strip-btn {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 120px;
}

.strip-btn:hover {
  background: linear-gradient(45deg, #ff4444, #ff6b6b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* ── Clothing Class Icons ────────────────────────────────────────── */
.clothing-class-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.clothing-class-icon-wrap {
  position: relative;
  display: inline-flex;
  cursor: default;
}

.clothing-class-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.clothing-class-icon-wrap:hover .clothing-class-icon {
  opacity: 1;
}

.clothing-class-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78em;
  color: var(--text-color);
  white-space: normal;
  min-width: 200px;
  width: max-content;
  max-width: 280px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  pointer-events: none;
  line-height: 1.5;
  text-align: left;
}

.clothing-class-tooltip strong {
  color: var(--primary-color);
  display: block;
  margin-bottom: 3px;
}

.clothing-class-icon-wrap:hover .clothing-class-tooltip {
  display: block;
}

/* ── Clothing Shop ──────────────────────────────────────────────── */
.clothing-shop-interface {
  background: var(--background-color);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.clothing-shop-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--accent-color);
}

.clothing-shop-header h3 {
  color: var(--accent-color);
  margin-bottom: 10px;
  font-size: 24px;
}

.clothing-shop-header p {
  color: var(--text-color);
  margin: 5px 0;
  font-size: 16px;
}

.clothing-shop-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.clothing-shop-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.clothing-shop-right {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 12px;
  background: var(--background-color);
  text-align: center;
}

.clothing-shop-right h4 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
}

.clothing-shop-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  margin-bottom: 0;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--primary-color);
}

.shop-tab-btn {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  padding: 7px 12px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 0;
}

.shop-tab-btn:hover {
  background: linear-gradient(135deg, #495057, #343a40);
}

.shop-tab-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: var(--background-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.clothing-shop-content {
  height: 480px;
  overflow-y: auto;
  border: 1px solid var(--primary-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px;
  background: var(--background-color);
}

.clothing-shop-content::-webkit-scrollbar { width: 6px; }
.clothing-shop-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.shop-tab {
  display: none;
}

.shop-tab.active {
  display: block;
}

/* ── Shop 2-Column Grid ──────────────────────────────────────────── */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shop-grid-item {
  background: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.shop-grid-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.shop-grid-item.expanded {
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(var(--primary-color-rgb, 100, 200, 255), 0.3);
}

.shop-grid-item.owned {
  border-color: #28a74580;
}

.shop-grid-item.owned::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 85%, #28a74520 100%);
  pointer-events: none;
}

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

.shop-grid-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-grid-item-name {
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-grid-item-desc {
  color: var(--text-color);
  opacity: 0.6;
  font-size: 0.75em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-grid-item-price {
  color: #20c997;
  font-weight: bold;
  font-size: 0.85em;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-grid-item-price small {
  font-weight: normal;
  opacity: 0.7;
}

.shop-grid-owned-dot {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 11px;
  color: #28a745;
  font-weight: bold;
}

/* Expanded detail panel - spans full width below the clicked grid item */
.shop-expanded-panel {
  grid-column: 1 / -1;
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 16px;
  margin: 4px 0;
  animation: expandIn 0.2s ease;
}

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

.shop-expanded-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.shop-expanded-header h4 {
  color: var(--accent-color);
  margin: 0;
  font-size: 1.1em;
}

.shop-expanded-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* ── Legacy Shop Item (used by android shop) ────────────────────── */
.shop-item {
  background: var(--background-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  transition: all 0.3s ease;
}

.shop-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.shop-item.owned {
  border-color: #28a745;
  background: linear-gradient(135deg, var(--background-color), #d4edda);
}

.shop-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.shop-item-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  padding: 3px;
  image-rendering: pixelated;
}

.shop-item-header h4 {
  color: var(--accent-color);
  margin: 0;
  font-size: 18px;
}

.price {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
}

.description {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.4;
}

.color-options {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.color-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #ccc;
}

.color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.color-btn.owned {
  cursor: not-allowed;
  opacity: 0.6;
}

.color-btn.selected,
.color-btn.custom-color-btn.selected {
  box-shadow: 0 0 10px 3px rgba(255, 255, 0, 0.8) !important;
  border-color: #ffff00 !important;
  transform: scale(1.15);
}

.owned-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
}

/* ── Shop Preview Panel ─────────────────────────────────────────── */
.clothing-shop-preview {
  text-align: center;
  padding: 10px 0 0 0;
}

.preview-doll-container {
  margin: 10px 0;
  display: flex;
  justify-content: center;
}

#preview-doll-canvas {
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  background: var(--background-color);
}

.preview-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.preview-btn {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.preview-btn:hover {
  background: linear-gradient(135deg, #495057, #343a40);
  transform: translateY(-2px);
}

.purchase-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.purchase-btn:hover {
  background: linear-gradient(135deg, #20c997, #17a2b8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.purchase-btn:disabled,
.purchase-btn.disabled {
  background: linear-gradient(135deg, #6c757d, #495057);
  cursor: not-allowed;
  opacity: 0.6;
}

.purchase-btn:disabled:hover,
.purchase-btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ── Custom Color ───────────────────────────────────────────────── */
.custom-color-btn {
  background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff, #ffff00, #ff00ff, #00ffff) !important;
  color: white;
  font-weight: bold;
  border: 2px solid #333 !important;
}

.custom-color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.custom-color-input {
  margin-top: 10px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.custom-color-input input[type="color"] {
  width: 50px;
  height: 30px;
  border: none;
  border-radius: 3px;
  margin-right: 10px;
  cursor: pointer;
}

.custom-color-apply {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.custom-color-apply:hover {
  background-color: #45a049;
}
  /* CC doll, wardrobe, clothing shop */
/* ── Game UI: locations, rooms, NPCs, stats, events, map ── */

/* ── Basic Info Panel ───────────────────────────────────────────── */
.basic-info {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  background: var(--background-color);
}

.time-display,
.date-display,
.credits-display {
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: bold;
}

.credits-icon-wrap {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 0;
}

.credits-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  display: block;
}

/* ── Stats Bars ─────────────────────────────────────────────────── */
.stats-container {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  background: var(--background-color);
}

.stats-container h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  text-align: center;
}

.stat-bar {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-bar label {
  min-width: 80px;
  color: var(--text-color);
  font-size: 14px;
}

.bar-container {
  flex: 1;
  height: 20px;
  background: var(--secondary-color);
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.stat-bar span {
  min-width: 40px;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 12px;
}

/* ── Character Stats (modal variant) ───────────────────────────── */
.character-stats {
  margin: 20px 0;
  padding: 20px;
  background: var(--secondary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
}

.character-stats h5 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.2em;
}

.character-stats .stat-bar label {
  display: block;
  color: var(--text-color);
  margin-bottom: 5px;
  font-weight: bold;
}

.character-stats .bar-container {
  width: 100%;
  height: 20px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
}

.character-stats .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
  transition: width 0.3s ease;
  border-radius: 10px;
}

.character-stats .stat-bar span {
  color: var(--text-color);
  font-weight: bold;
  font-size: 0.9em;
}


/* ── Character Detail Tab ───────────────────────────────────────── */
.character-detail {
  display: flex;
  gap: 15px;
}

.character-description {
  flex: 1;
}

.character-description h4,
.character-description h5 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.character-description p {
  color: var(--text-color);
  margin-bottom: 15px;
}

/* ── System Tab ─────────────────────────────────────────────────── */
.system-tabs {
  display: flex;
  margin-bottom: 15px;
  gap: 5px;
}

.system-tab-btn {
  padding: 6px 10px;
  font-size: 11px;
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  border-radius: 3px;
  cursor: pointer;
}

.system-tab-btn:hover,
.system-tab-btn.active {
  background: var(--primary-color);
  color: var(--background-color);
}

.system-content {
  display: none;
}

.system-content.active {
  display: block;
}

.system-content h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* ── Location ───────────────────────────────────────────────────── */
.location-info {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  width: 100%;
  max-width: none;
}

.location-info h3 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 1.3em;
  text-align: left;
}

.location-info p {
  color: var(--text-color);
  margin: 0 0 15px 0;
  line-height: 1.6;
  text-align: left;
  font-style: normal;
}

.location-destinations h4 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
}

.location-btn {
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  padding: 0.75em 1.25em;
  margin: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--game-font-size, 16px);
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 7.5em;
}

.location-btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.location-btn:active {
  transform: translateY(0);
}

.location-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--border-color);
  color: var(--text-color);
}

.location-btn.disabled:hover {
  background: var(--border-color);
  transform: none;
  box-shadow: none;
}

.location-btn.building-btn {
  background: var(--primary-color);
  border-left: 4px solid var(--accent-color);
}

.location-btn.building-btn:hover {
  background: var(--accent-color);
  border-left-color: var(--primary-color);
}

.location-btn.street-btn {
  background: var(--secondary-color);
  border-left: 4px solid var(--primary-color);
  color: var(--text-color);
}

.location-btn.street-btn:hover {
  background: var(--primary-color);
  color: var(--background-color);
  border-left-color: var(--secondary-color);
}

/* ── Travel Time Label ──────────────────────────────────────────── */
.travel-time {
  font-size: 0.9em;
  font-weight: 500;
  margin-left: 4px;
}

.building-btn .travel-time {
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.street-btn .travel-time {
  color: black;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
}

/* ── Compact Travel UI (DoL-style) ──────────────────────────────── */
.location-travel-compact {
  margin-top: 15px;
  padding: 15px;
  background: var(--secondary-color);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 0.95em;
  line-height: 2;
}

.travel-category {
  margin-bottom: 10px;
}

.travel-category:last-child {
  margin-bottom: 0;
}

.travel-category strong {
  color: var(--primary-color);
  margin-right: 8px;
  font-weight: bold;
}

.travel-category a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: underline;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.travel-category a:hover {
  color: var(--primary-color);
  text-shadow: 0 0 5px var(--primary-color);
  text-decoration: none;
}

.travel-separator {
  color: var(--text-color);
  opacity: 0.5;
  margin: 0 4px;
}

/* ── Vertical List Travel UI (DoL-style) ────────────────────────── */
.travel-section {
  margin: 20px 0;
  text-align: left;
}

.travel-section h4 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 1.1em;
  font-weight: bold;
  text-align: left;
}

.travel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.travel-list li {
  margin: 5px 0;
  padding: 0;
  text-align: left;
}

.travel-list a {
  color: var(--accent-color);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  padding: 2px 0;
}

.travel-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
  transform: translateX(5px);
}

/* Location icons in travel links */
.travel-location-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  image-rendering: pixelated;
  opacity: 0.85;
  flex-shrink: 0;
}

.travel-list a,
.travel-list span {
  display: inline-flex;
  align-items: center;
}

.travel-list a:hover .travel-location-icon {
  opacity: 1;
}

/* ── NPC Overlay (Right Side) ───────────────────────────────────── */
.npc-overlay {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 590px;  /* Default (adultF); overridden per-NPC via JS */
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 0 20px 0;
}

.npc-overlay canvas {
  image-rendering: pixelated;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.npc-overlay.hidden {
  display: none;
}

.npc-overlay.force-hidden {
  display: none !important;
}

/* ── Inline Map ─────────────────────────────────────────────────── */
.inline-map-container {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--primary-color);
  text-align: center;
}

.inline-map-container canvas {
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  max-width: 100%;
  cursor: default;
}

/* ── Map Canvas ─────────────────────────────────────────────────── */
.map-container {
  text-align: center;
  margin-bottom: 20px;
}

#map-canvas {
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#map-canvas:hover {
  border-color: var(--accent-color);
}

#area-info {
  padding: 15px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  background: var(--secondary-color);
  margin-top: 15px;
}

#area-info h4,
#area-info h5 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

#area-info p {
  color: var(--text-color);
  margin-bottom: 15px;
  line-height: 1.4;
}

#area-info ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-color);
}

#area-info li {
  margin-bottom: 5px;
}

/* ── Room Interactions ──────────────────────────────────────────── */
.room-interactions h4 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
}

.room-btn {
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  padding: 0.75em 1.25em;
  margin: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--game-font-size, 16px);
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 8.75em;
}

.room-btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.room-btn:active {
  transform: translateY(0);
}

.room-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border-color);
  color: var(--text-color);
}

/* ── Room Interface ─────────────────────────────────────────────── */
.room-interface {
  background: var(--secondary-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease-in;
}

.room-interface h4 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.3em;
}

.room-interface p {
  color: var(--text-color);
  margin: 0 0 20px 0;
  text-align: center;
}

/* ── Charging Station ───────────────────────────────────────────── */
.charging-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.charging-btn {
  background: var(--accent-color);
  color: var(--background-color);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 80px;
}

.charging-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ── Mirror ─────────────────────────────────────────────────────── */
.mirror-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.hair-section h5 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

.hair-section select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9em;
}

.hair-section select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 5px var(--shadow-color);
}

/* ── Desk ───────────────────────────────────────────────────────── */
.desk-options {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.desk-btn {
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  padding: 15px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  min-width: 120px;
}

.desk-btn:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.desk-btn:active {
  transform: translateY(0);
}

/* ── Close Button ───────────────────────────────────────────────── */
.close-btn {
  background: var(--border-color);
  color: var(--background-color);
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.close-btn:hover {
  background: var(--primary-color);
  color: var(--background-color);
}

/* ── Clinton Actions ────────────────────────────────────────────── */
.clinton-actions h4 {
  color: var(--primary-color);
  margin: 0 0 15px 0;
  text-align: center;
}

.clinton-btn {
  background: var(--accent-color);
  color: var(--background-color);
  border: none;
  padding: 0.75em 1.25em;
  margin: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--game-font-size, 16px);
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 9em;
}

.clinton-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clinton-btn:active {
  transform: translateY(0);
}

/* ── Event animations ───────────────────────────────────────────── */
@keyframes eventFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Event Text ─────────────────────────────────────────────────── */
.event-text {
  line-height: 1.75;
  text-align: left;
  margin: 0.5em 0;
  padding: 0.5em;
  cursor: pointer;
  border-radius: 4px;
  max-width: 54em;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95em;
  animation: eventFadeIn 0.4s ease-out forwards;
}

.event-text:hover {
  background: rgba(255, 255, 255, 0.05);
}

.event-dialogue {
  color: var(--text-color);
}

.event-dialogue strong {
  color: var(--accent-color);
  font-weight: bold;
}

.event-action {
  color: var(--accent-color);
  font-style: italic;
  text-align: center;
  font-size: 0.9em;
}

.event-sequence-end {
  color: var(--primary-color);
  font-weight: bold;
  text-align: center;
  font-size: 1em;
  border-top: 1px solid var(--primary-color);
  padding-top: 1em;
  margin-top: 1em;
}

/* ── Event Paragraph Text (DoL-style) ───────────────────────────── */
.event-text-paragraph {
  line-height: 1.8;
  text-align: left;
  margin: 0 0 1.5em 0;
  padding: 0;
  width: 100%;
  color: var(--text-color);
  font-size: 1em;
  animation: eventFadeIn 0.4s ease-out forwards;
}

.event-text-paragraph p {
  margin: 0 0 0.75em 0;
  padding: 0;
}

.event-text-paragraph p:last-child {
  margin-bottom: 0;
}

/* ── Event Choices (DoL-style) ──────────────────────────────────── */
.event-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  padding: 0;
}

.choice-btn {
  padding: 12px 20px;
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.choice-btn:hover {
  background: var(--primary-color);
  color: var(--background-color);
  transform: translateX(5px);
  box-shadow: 0 0 10px var(--primary-color);
}

.choice-btn:active {
  transform: translateX(3px);
}

/* Stat hint shown on choices when showStatInfo is enabled */
.choice-stat-hint {
  display: block;
  font-size: 0.78em;
  opacity: 0.7;
  margin-top: 4px;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Hidden/mystery stat gains — glowing purple */
.hidden-stat-gain {
  color: #b266ff;
  text-shadow: 0 0 6px #b266ff, 0 0 12px #7a00cc;
  font-style: italic;
  opacity: 1;
}

/* ── Clothing / Status Alerts ───────────────────────────────────── */
.clothing-alert {
  padding: 10px 15px;
  margin: 15px 0;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

.clothing-alert.naked {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
  border: 2px solid #ff4444;
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

.clothing-alert.clothed {
  background: linear-gradient(45deg, #4CAF50, #66bb6a);
  color: white;
  border: 2px solid #388e3c;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.clothing-alert.underwear {
  background: linear-gradient(45deg, #ff9800, #ffb74d);
  color: white;
  border: 2px solid #f57c00;
  box-shadow: 0 0 15px rgba(255, 152, 0, 0.3);
}

/* Compact sidebar variant */
.sidebar-clothing-status {
  display: none;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
}

.sidebar-clothing-status.clothing-alert.naked {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
  border: 1px solid #ff4444;
}

.sidebar-clothing-status.clothing-alert.clothed {
  background: linear-gradient(45deg, #4CAF50, #66bb6a);
  color: white;
  border: 1px solid #388e3c;
}

.sidebar-clothing-status.clothing-alert.underwear {
  background: linear-gradient(45deg, #ff9800, #ffb74d);
  color: white;
  border: 1px solid #f57c00;
}

/* ── Pass-Out Fade Overlay ──────────────────────────────────────── */
#passout-fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease-in-out;
}

#passout-fade-overlay.fading {
  opacity: 1;
  pointer-events: all;
}

/* ── Empathy Core Overheating Warning ───────────────────────────── */
.sidebar-stress-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(45deg, #8b0000, #cc0000);
  border: 1px solid #ff0000;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.6), inset 0 0 4px rgba(255, 0, 0, 0.3);
  animation: stressWarningPulse 1.5s ease-in-out infinite;
}

.sidebar-stress-warning.hidden {
  display: none;
}

@keyframes stressWarningPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6), inset 0 0 4px rgba(255, 0, 0, 0.3);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.9), inset 0 0 8px rgba(255, 0, 0, 0.5);
    opacity: 0.85;
  }
}

/* ── Action Description ─────────────────────────────────────────── */
.action-description {
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: 6px;
  font-style: italic;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
  background: var(--background-color);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  font-size: 0.95em;
}

/* ── Event Status ───────────────────────────────────────────────── */
.event-status {
  padding: 10px 15px;
  margin: 15px 0;
  border-radius: 8px;
  text-align: center;
  animation: fadeIn 0.5s ease-in;
  background: linear-gradient(45deg, #ff9800, #ffb74d);
  color: white;
  border: 2px solid #f57c00;
  box-shadow: 0 0 15px rgba(255, 152, 0, 0.3);
}

.event-status.hidden {
  display: none;
}

.event-status h4 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
}

.event-status p {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.9;
}

/* ── Skip Button ────────────────────────────────────────────────── */
.skip-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: bold;
  transition: background-color 0.3s ease;
  z-index: 100;
}

.skip-button:hover {
  background: var(--primary-color);
}

.skip-button:active {
  transform: scale(0.95);
}

/* ── Job System ─────────────────────────────────────────────────── */
.job-options {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.job-options .room-btn {
  flex: 1;
  min-width: 120px;
}
    /* locations, rooms, NPCs, events, map */
/* ── Minigames ──────────────────────────────────────────────────── */

/* ── Cafe Shift Minigame ────────────────────────────────────────── */
.room-modal-box:has(#cafe-mg-wrap) {
  width: auto;
  min-width: 650px;
  max-width: 665px;
}

#room-modal-body:has(#cafe-mg-wrap) {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#cafe-scene {
  display: block;
}

.cafe-drag-item {
  touch-action: none;
  -webkit-user-drag: none;
}

.cafe-drag-item:active {
  cursor: grabbing;
}
  /* cafe and future minigames */
