* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

body {
  background-color: #0b0f19;
  color: #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

#game-container {
  width: 100%;
  max-width: 1100px;
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOP BAR */
#top-bar {
  background-color: #1e293b;
  border-bottom: 2px solid #0284c7;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #38bdf8;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  background-color: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background-color: #475569;
  border-color: #64748b;
}

.btn-primary {
  background-color: #0284c7;
  border-color: #0369a1;
}
.btn-primary:hover {
  background-color: #0369a1;
}

.btn-danger {
  background-color: #991b1b;
  border-color: #7f1d1d;
}
.btn-danger:hover {
  background-color: #7f1d1d;
}

.btn-export {
  background-color: #4338ca;
  border-color: #3730a3;
}
.btn-export:hover {
  background-color: #3730a3;
}

/* MAIN LAYOUT */
#main-layout {
  display: flex;
  min-height: 560px;
}

/* LEFT PANEL (SUBJECT) */
#subject-panel {
  width: 280px;
  min-width: 280px;
  background-color: #0c1322;
  border-right: 2px solid #1e293b;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-transform: uppercase;
}

.portrait-wrapper {
  width: 100%;
  border: 2px solid #38bdf8;
  border-radius: 6px;
  overflow: hidden;
  background-color: #020617;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1/1;
}

.portrait-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.subject-info {
  text-align: center;
}

.subject-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.subject-tagline {
  font-size: 11px;
  font-style: italic;
  color: #94a3b8;
}

.stats-card {
  background-color: #111c30;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
}

.stat-value {
  font-weight: 700;
  color: #38bdf8;
}

.persona-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  text-transform: uppercase;
}
.badge-normal { background: #1e293b; color: #94a3b8; }
.badge-brat { background: #831843; color: #f472b6; border: 1px solid #db2777; }
.badge-bimbo { background: #701a75; color: #f0abfc; border: 1px solid #c026d3; }
.badge-maid { background: #1e3a8a; color: #93c5fd; border: 1px solid #3b82f6; }
.badge-servant { background: #14532d; color: #86efac; border: 1px solid #22c55e; }
.badge-blank { background: #334155; color: #e2e8f0; border: 1px solid #94a3b8; }
.badge-devoted { background: #78350f; color: #fde047; border: 1px solid #eab308; }
.badge-reversal { background: #4c1d95; color: #c4b5fd; border: 1px solid #8b5cf6; }

.depth-meter-container {
  width: 100%;
  height: 6px;
  background-color: #020617;
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0 4px 0;
  border: 1px solid #1e293b;
}

.depth-meter-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #22c55e);
  transition: width 0.3s ease;
}

/* RIGHT STAGE PANEL */
#stage-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #0b1120;
}

/* TOP NARRATIVE STAGE BOX */
.narrative-box {
  flex: 1;
  min-height: 220px;
  max-height: 300px;
  background-color: #0a0f1d;
  border-bottom: 2px solid #1e293b;
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
}

#narrative-text {
  cursor: pointer;
}

/* BOTTOM ACTION PANEL */
.action-panel {
  flex: 1;
  background-color: #0f172a;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.action-heading {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #38bdf8;
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e293b;
}

.filter-btn {
  background-color: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-btn.active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

.filter-badge {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 9px;
}

.category-divider {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 0 2px 0;
}

/* CHOICE LIST */
.choice-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-item {
  background-color: #162032;
  border: 1px solid #1e293b;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
  transition: all 0.15s ease;
}

.choice-item:hover:not(.disabled) {
  background-color: #1e293b;
  border-color: #38bdf8;
  transform: translateX(2px);
}

.choice-item strong {
  color: #38bdf8;
  font-size: 12px;
  min-width: 18px;
}

.choice-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CATEGORY COLOR ACCENTS */
.choice-item.category-trigger { border-left: 3px solid #eab308; }
.choice-item.category-induction { border-left: 3px solid #0284c7; }
.choice-item.category-convincer { border-left: 3px solid #ec4899; }
.choice-item.category-command { border-left: 3px solid #a855f7; }
.choice-item.category-roleplay { border-left: 3px solid #10b981; }
.choice-item.category-state { border-left: 3px solid #64748b; }

/* FORCE MOBILE VIEW */
#main-layout.force-mobile {
  flex-direction: column;
}
#main-layout.force-mobile #subject-panel {
  width: 100%;
  min-width: 100%;
  border-right: none;
  border-bottom: 2px solid #1e293b;
}

/* FIT SCREEN FULLSCREEN */
body.fit-screen-active {
  padding: 0;
}
#game-container.fit-screen {
  max-width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: none;
}
#game-container.fit-screen #main-layout {
  flex: 1;
}