/* Styles extracted from game.html */
body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  overflow: auto;
  transition: background 1s ease;
}

body.daytime {
  background: linear-gradient(135deg, #87ceeb 0%, #e0f6ff 100%);
  color: #2c3e50;
}

html, body {
  height: 100%;
}

.game-container {
  width: 100%;
  height: 100vh;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.header {
  padding: 8px 15px;
  background: rgba(139, 0, 139, 0.3);
  border: 2px solid #8b008b;
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.daytime .header {
  background: rgba(255, 215, 0, 0.3);
  border-color: #ffa500;
}

#ghost-subtitle {
  font-size: 11px;
  margin-bottom: 2px;
}

.header h1 {
  margin: 0;
  font-size: 20px;
  color: #ff6b9d;
  text-shadow: 0 0 10px #ff6b9d, 0 0 20px #c44569;
  transition: all 0.5s ease;
  white-space: nowrap;
}

.daytime .header h1 {
  color: #ff8c00;
  text-shadow: 0 0 10px #ffa500;
}

.phase-indicator {
  font-size: 13px;
  font-weight: bold;
  animation: pulse 2s infinite;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.phase-button {
  background: linear-gradient(135deg, #8b008b 0%, #4a004a 100%);
  border: 2px solid #ff6b9d;
  color: white;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  margin-top: 3px;
  transition: all 0.3s ease;
}

.phase-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(255, 107, 157, 0.6);
}

.phase-button:disabled,
.phase-button.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background: linear-gradient(135deg, #444 0%, #333 100%);
  border-color: #666;
}

.phase-button:disabled:hover,
.phase-button.locked:hover {
  transform: none;
  box-shadow: none;
}

.daytime .phase-button {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: #2c3e50;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 107, 157, 0.3);
}

.stat-item {
  background: rgba(255, 107, 157, 0.2);
  padding: 3px 8px;

  border: 1px solid #ff6b9d;
  transition: all 0.5s ease;
}

.daytime .stat-item {
  background: rgba(255, 140, 0, 0.2);
  border-color: #ffa500;
  color: #2c3e50;
}

.main-content {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

.apartments {
  flex: 2 1 66%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.apartment {
  background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
  border: 2px solid #4a5683;

  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 135px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.apartment.moved-out {
  opacity: 0.4;
  cursor: not-allowed;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

.apartment.breaking-down {
  opacity: 0.7;
  cursor: not-allowed;
  background: linear-gradient(135deg, #3d1a1a 0%, #1a0a0a 100%);
  border-color: #8b0000;
  animation: breakdown-pulse 1.5s infinite;
}

@keyframes breakdown-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(139, 0, 0, 0.5); }
  50% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.8); }
}

.daytime .apartment.breaking-down {
  background: linear-gradient(135deg, #ffe0e0 0%, #ffcccc 100%);
  border-color: #cc6666;
}

.daytime .apartment {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe4b5 100%);
  border-color: #daa520;
}

.apartment:hover {
  transform: translateY(-5px);
  border-color: #ff6b9d;
  box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.daytime .apartment:hover {
  border-color: #ffa500;
  box-shadow: 0 5px 20px rgba(255, 165, 0, 0.4);
}

.apartment.scared {
  animation: shake 0.5s;
  background: linear-gradient(135deg, #8b008b 0%, #4a004a 100%);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px) rotate(-5deg); }
  75% { transform: translateX(10px) rotate(5deg); }
}

.apartment-number {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: #888;
}

.daytime .apartment-number {
  color: #666;
}

.resident-emoji {
  font-size: 64px;
  line-height: 1;
  flex-shrink: 0;
}

.resident-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.resident-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resident-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffd700;
  margin: 0;
}

.daytime .resident-name {
  color: #d2691e;
}

.resident-traits {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.trait-tag {
  font-size: 11px;
  color: #ddd;
  background: rgba(74, 74, 106, 0.6);
  padding: 4px 10px;
  white-space: nowrap;
}

.daytime .trait-tag {
  color: #444;
  background: rgba(200, 200, 200, 0.5);
}

.room-decor {
  font-size: 11px;
  color: #bbb;
  text-align: center;
  margin-bottom: 6px;
  min-height: 16px;
  line-height: 1.3;
  font-style: italic;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.daytime .room-decor {
  color: #555;
  background: rgba(0, 0, 0, 0.03);
}

.resident-activity {
  font-size: 12px;
  color: #ff6b9d;
  text-align: center;
  padding: 6px 10px;
  margin: 6px 0;
  min-height: 18px;
  font-weight: 600;
  background: rgba(255, 107, 157, 0.1);
}

.daytime .resident-activity {
  color: #ff8c00;
  background: rgba(255, 140, 0, 0.1);
}

.meter-container {
  margin-bottom: 3px;
  font-size: 12px;
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.meter-label {
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.daytime .meter-label {
  color: #666;
}

.scare-meter, .fear-meter, .suspicion-meter, .stability-meter, .attachment-meter {
  background: rgba(26, 26, 46, 0.6);

  height: 14px;
  overflow: hidden;
  border: 1px solid #4a5683;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.daytime .scare-meter, .daytime .fear-meter, .daytime .suspicion-meter, .daytime .stability-meter, .daytime .attachment-meter {
  background: #e0e0e0;
  border-color: #999;
}

.scare-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b9d 0%, #c44569 100%);

  transition: width 0.3s ease;
}

.fear-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffa500 0%, #ff8c00 100%);

  transition: width 0.3s ease;
}

.suspicion-fill {
  height: 100%;
  background: linear-gradient(90deg, #9370db 0%, #8a2be2 100%);

  transition: width 0.3s ease;
}

.stability-fill {
  height: 100%;
  background: linear-gradient(90deg, #32cd32 0%, #228b22 100%);

  transition: width 0.3s ease;
}

.attachment-fill {
  height: 100%;
  background: linear-gradient(90deg, #4682b4 0%, #1e90ff 100%);
  transition: width 0.3s ease;
}

.status {
  text-align: center;
  font-size: 11px;
  color: #ff6b9d;
  font-style: italic;
  min-height: 14px;
}

.daytime .status {
  color: #ff8c00;
}

.sidebar {
  flex: 1 1 34%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
}

.bottom-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  height: 150px;
}

.bottom-row .selected-resident {
  flex: 1;
  background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
  border: 2px solid #4a5683;
  padding: 8px;
  overflow-y: auto;
  height:150px;
}

.daytime .bottom-row .selected-resident {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe4b5 100%);
  border-color: #daa520;
}

.bottom-row .log {
  flex: 1;
  max-height: none;
}

.control-panel {
  background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
  border: 2px solid #4a5683;

  padding: 8px;
  transition: all 0.3s ease;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.daytime .control-panel {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe4b5 100%);
  border-color: #daa520;
}

.control-panel h3 {
  margin: 0 0 8px 0;
  color: #ffd700;
  font-size: 16px;
  text-align: center;
}

.daytime .control-panel h3 {
  color: #d2691e;
}

.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  border-bottom: 2px solid #4a5683;
}

.daytime .tabs {
  border-bottom-color: #daa520;
}

.tab {
  background: rgba(139, 0, 139, 0.2);
  border: 2px solid #4a5683;
  border-bottom: none;
  color: #e0e0e0;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;

  transition: all 0.3s ease;
}

.daytime .tab {
  background: rgba(255, 165, 0, 0.2);
  border-color: #daa520;
  color: #2c3e50;
}

.tab.active {
  background: rgba(139, 0, 139, 0.5);
  border-color: #ff6b9d;
  color: #ffd700;
  font-weight: bold;
}

.daytime .tab.active {
  background: rgba(255, 165, 0, 0.5);
  border-color: #ffa500;
  color: #d2691e;
}

.tab:hover:not(.active) {
  background: rgba(139, 0, 139, 0.35);
}

.daytime .tab:hover:not(.active) {
  background: rgba(255, 165, 0, 0.35);
}

.tab-content {
  display: none;
}

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

.observation-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.observe-btn {
  background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
  border: 2px solid #ffd700;
  color: white;
  padding: 8px;

  cursor: pointer;
  font-size: 11px;
  transition: all 0.3s ease;
  text-align: center;
}

.observe-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffb520 0%, #ffa020 100%);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 165, 0, 0.5);
}

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

.scare-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.scare-btn {
  background: linear-gradient(135deg, #8b008b 0%, #4a004a 100%);
  border: 2px solid #ff6b9d;
  color: white;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  text-align: center;
}

.scare-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #a020a0 0%, #600060 100%);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.5);
}

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

.selected-resident {
  background: rgba(255, 107, 157, 0.2);
  border: 2px solid #ff6b9d;

  padding: 8px;
  margin-bottom: 8px;
  transition: all 0.5s ease;
}

.daytime .selected-resident {
  background: rgba(255, 165, 0, 0.2);
  border-color: #ffa500;
}

.selected-resident h4 {
  margin: 0 0 6px 0;
  color: #ffd700;
  font-size: 14px;
}

.daytime .selected-resident h4 {
  color: #d2691e;
}

.selected-info {
  font-size: 11px;
  line-height: 1.4;
}

.selected-info-compact {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: center;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
}

.traits-inline {
  color: #aaa;
  font-size: 12px;
}

.daytime .traits-inline {
  color: #666;
}

.stats-row {
  font-size: 13px;
  color: #ccc;
  display: flex;
  gap: 10px;
}

.daytime .stats-row {
  color: #555;
}

.status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(100,100,100,0.3);
}

.status-tag.profiled { background: rgba(0,255,0,0.2); color: #0f0; }
.status-tag.clues { background: rgba(255,215,0,0.2); color: #ffd700; }
.status-tag.hiding { background: rgba(255,107,157,0.2); color: #ff6b9d; }
.status-tag.warning { background: rgba(255,107,157,0.3); color: #ff6b9d; }
.status-tag.danger { background: rgba(255,165,0,0.3); color: #ffa500; }
.status-tag.immune { background: rgba(100,100,100,0.3); color: #888; }

.daytime .status-tag.profiled { background: rgba(0,128,0,0.2); color: #008000; }
.daytime .status-tag.clues { background: rgba(218,165,32,0.2); color: #b8860b; }
.daytime .status-tag.hiding { background: rgba(255,140,0,0.2); color: #ff8c00; }
.daytime .status-tag.warning { background: rgba(255,140,0,0.3); color: #ff8c00; }
.daytime .status-tag.danger { background: rgba(255,0,0,0.2); color: #dc143c; }

.legendary-mini {
  font-size: 12px;
}

.legendary-ability {
  font-size: 9px;
  background: linear-gradient(135deg, rgba(255,215,0,0.3), rgba(255,165,0,0.3));
  padding: 3px 6px;
  border-radius: 3px;
  color: #ffd700;
}

.daytime .legendary-ability {
  color: #b8860b;
}

.discovered-clues-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 40px;
  overflow-y: auto;
}

.clue-tag {
  font-size: 9px;
  padding: 2px 4px;
  background: rgba(139, 0, 139, 0.3);
  border-radius: 3px;
  white-space: nowrap;
}

.daytime .clue-tag {
  background: rgba(255, 165, 0, 0.2);
}

.discovered-clues {
  background: rgba(139, 0, 139, 0.2);
  padding: 10px;

  margin-top: 10px;
}

.daytime .discovered-clues {
  background: rgba(255, 165, 0, 0.2);
}

.clue-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.4;
}

.log {
  background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
  border: 2px solid #4a5683;

  padding: 8px;
  height: 150px;
  overflow-y: auto;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.daytime .log {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe4b5 100%);
  border-color: #daa520;
}

.log h3 {
  margin: 0 0 6px 0;
  color: #ffd700;
  font-size: 16px;
  text-align: center;
}

.daytime .log h3 {
  color: #d2691e;
}

.log-entry {
  padding: 4px 6px;
  margin: 3px 0;
  background: rgba(255, 107, 157, 0.1);
  border-left: 2px solid #ff6b9d;

  font-size: 11px;
  animation: fadeIn 0.5s;
}

.daytime .log-entry {
  background: rgba(255, 165, 0, 0.1);
  border-left-color: #ffa500;
  color: #2c3e50;
}

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

.combo {
  color: #ffd700;
  font-weight: bold;
}

.instructions {
  background: rgba(139, 0, 139, 0.2);
  padding: 8px;

  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 8px;
  transition: all 0.5s ease;
}

.daytime .instructions {
  background: rgba(255, 165, 0, 0.2);
  color: #2c3e50;
}

.upgrade-item {
  background: rgba(139, 0, 139, 0.1);
  padding: 10px;
  margin: 8px 0;
  border: 2px solid #4a5683;
}

.upgrade-item.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 4px 0;
}

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

.daytime .upgrade-item {
  background: rgba(255, 165, 0, 0.1);
  border-color: #daa520;
}

.upgrade-section {
  margin-bottom: 15px;
}

.upgrade-section h4 {
  margin: 0 0 8px 0;
  color: #ff6b9d;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 107, 157, 0.3);
  padding-bottom: 5px;
}

.daytime .upgrade-section h4 {
  color: #ff8c00;
  border-color: rgba(255, 140, 0, 0.3);
}

.upgrade-name {
  font-weight: bold;
  color: #ffd700;
  font-size: 13px;
}

.daytime .upgrade-name {
  color: #d2691e;
}

.upgrade-desc {
  font-size: 11px;
  color: #aaa;
}

.daytime .upgrade-desc {
  color: #666;
}

.upgrade-btn {
  background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
  border: 2px solid #00ff00;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  transition: all 0.3s ease;
}

.upgrade-btn.small {
  width: auto;
  padding: 4px 12px;
  font-size: 12px;
}

.upgrade-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #3ef03e 0%, #2aa02a 100%);
  transform: scale(1.02);
}

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

/* Scare Shop Styles */
.scare-tier {
  margin-bottom: 12px;
}

.tier-header {
  font-size: 12px;
  font-weight: bold;
  color: #ff6b9d;
  margin-bottom: 6px;
  padding: 4px 8px;
  background: rgba(255, 107, 157, 0.1);
}

.daytime .tier-header {
  color: #ff8c00;
  background: rgba(255, 140, 0, 0.1);
}

.tier-scares {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scare-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid #4a5683;
}

.scare-item.owned {
  border-color: #32cd32;
  background: rgba(50, 205, 50, 0.1);
}

.daytime .scare-item {
  background: rgba(255, 255, 255, 0.5);
  border-color: #daa520;
}

.daytime .scare-item.owned {
  border-color: #228b22;
  background: rgba(34, 139, 34, 0.1);
}

.scare-emoji {
  font-size: 18px;
}

.scare-name {
  flex: 1;
  font-size: 12px;
  color: #e0e0e0;
}

.daytime .scare-name {
  color: #2c3e50;
}

.buy-scare-btn {
  background: linear-gradient(135deg, #8b008b 0%, #4a004a 100%);
  border: 1px solid #ff6b9d;
  color: white;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.buy-scare-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #a000a0 0%, #600060 100%);
}

.buy-scare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scare-item.owned .buy-scare-btn {
  background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
  border-color: #00ff00;
}

.legendary-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #000;
  padding: 2px 8px;

  font-size: 10px;
  font-weight: bold;
  margin-left: 5px;
}

.custom-resident-form {
  background: rgba(139, 0, 139, 0.1);
  padding: 15px;

  margin-bottom: 15px;
}

.daytime .custom-resident-form {
  background: rgba(255, 165, 0, 0.1);
}

.form-row {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: #ffd700;
  margin-bottom: 5px;
  font-weight: bold;
}

.daytime .form-label {
  color: #d2691e;
}

.form-input, .form-select {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #4a5683;

  color: #e0e0e0;
  font-size: 14px;
  box-sizing: border-box;
}

.daytime .form-input, .daytime .form-select {
  background: rgba(255, 255, 255, 0.5);
  border-color: #daa520;
  color: #2c3e50;
}

.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 5px;
}

.emoji-option {
  font-size: 24px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  background: rgba(139, 0, 139, 0.2);
  border: 2px solid transparent;

  transition: all 0.2s ease;
}

.daytime .emoji-option {
  background: rgba(255, 165, 0, 0.2);
}

.emoji-option:hover {
  border-color: #ff6b9d;
  transform: scale(1.1);
}

.daytime .emoji-option:hover {
  border-color: #ffa500;
}

.emoji-option.selected {
  border-color: #ffd700;
  background: rgba(255, 107, 157, 0.4);
}

.daytime .emoji-option.selected {
  background: rgba(255, 165, 0, 0.4);
}

.trait-dropdowns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 5px;
}

.trait-select {
  background: rgba(30, 30, 50, 0.9);
  border: 2px solid #4a5683;
  color: #e0e0e0;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trait-select:hover,
.trait-select:focus {
  border-color: #ff6b9d;
  outline: none;
}

.daytime .trait-select {
  background: rgba(255, 255, 255, 0.9);
  border-color: #daa520;
  color: #2c3e50;
}

.daytime .trait-select:hover,
.daytime .trait-select:focus {
  border-color: #ff8c00;
}

.trait-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.trait-tag {
  background: rgba(139, 0, 139, 0.3);
  border: 2px solid #4a5683;
  color: #e0e0e0;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.daytime .trait-tag {
  background: rgba(255, 165, 0, 0.3);
  border-color: #daa520;
  color: #2c3e50;
}

.trait-tag:hover {
  border-color: #ff6b9d;
}

.daytime .trait-tag:hover {
  border-color: #ffa500;
}

.trait-tag.selected {
  background: rgba(255, 107, 157, 0.5);
  border-color: #ffd700;
  font-weight: bold;
}

.daytime .trait-tag.selected {
  background: rgba(255, 165, 0, 0.5);
  border-color: #ff8c00;
}

.create-btn {
  background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
  border: 2px solid #00ff00;
  color: white;
  padding: 10px 20px;

  cursor: pointer;
  font-size: 14px;
  width: 100%;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.create-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #3ef03e 0%, #2aa02a 100%);
  transform: scale(1.02);
}

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

.save-load-section {
  padding: 10px;
}

.save-btn {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  border: 2px solid #5da3f5;
  color: white;
  padding: 10px 16px;

  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
}

.save-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5da3f5 0%, #4a90e2 100%);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(77, 144, 226, 0.5);
}

.save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #555 0%, #444 100%);
}

.delete-btn {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border: 2px solid #e74c3c;
  color: white;
  padding: 10px 16px;

  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  width: 100%;
  transition: all 0.3s ease;
}

.delete-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: scale(1.02);
}

.delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #555 0%, #444 100%);
}

input[type="radio"], input[type="checkbox"] {
  accent-color: #ff6b9d;
}

.daytime input[type="radio"], .daytime input[type="checkbox"] {
  accent-color: #ffa500;
}

@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
  }
  
  .apartments {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .apartments {
    grid-template-columns: 1fr;
  }
  
  .stats {
    flex-direction: column;
    gap: 10px;
  }

  .header h1 {
    font-size: 32px;
  }
}

/* view-transition fallback */
@view-transition { navigation: auto; }

/* Night Modal Styles */
.night-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

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

.night-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
  border: 3px solid #ff6b9d;
  padding: 30px 40px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(255, 107, 157, 0.5);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.night-modal-content h2 {
  color: #ff6b9d;
  font-size: 28px;
  margin: 0 0 20px 0;
  text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.game-end .night-modal-content h2 {
  font-size: 36px;
}

.night-stats {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 20px;
  margin: 15px 0;
}

.night-stats p {
  margin: 8px 0;
  font-size: 16px;
  color: #e0e0e0;
}

.night-hint {
  font-size: 13px;
  color: #aaa;
  font-style: italic;
  margin: 15px 0;
}

.next-day-btn {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  border: none;
  color: white;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.next-day-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(255, 107, 157, 0.5);
}

.progress-label {
  color: #ff6b9d;
  font-weight: bold;
}

.daytime .progress-label {
  color: #ff8c00;
}

/* Tutorial Button */
.tutorial-btn {
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid #ffd700;
  color: #ffd700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-btn:hover {
  background: rgba(255, 215, 0, 0.4);
  transform: scale(1.1);
}

.daytime .tutorial-btn {
  border-color: #d2691e;
  color: #d2691e;
  background: rgba(210, 105, 30, 0.2);
}

/* Tutorial Modal */
.tutorial-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.tutorial-content {
  background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 20px 25px;
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.tutorial-content h2 {
  color: #ffd700;
  margin: 0 0 15px 0;
  font-size: 22px;
}

.tutorial-section {
  text-align: left;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.tutorial-section p {
  margin: 8px 0;
  font-size: 12px;
  color: #e0e0e0;
  line-height: 1.4;
}

.tutorial-close {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  border: none;
  color: white;
  padding: 10px 25px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tutorial-close:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 15px rgba(255, 107, 157, 0.5);
}
