﻿/* ==========================================================================
   《그녀들은 내가 모르는 것을 알고 있다》 - Visual Novel Core Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-panel: rgba(12, 17, 29, 0.85);
  --bg-card: rgba(19, 27, 44, 0.7);
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff2a6d;
  --accent-amber: #ffb703;
  --accent-purple: #9d4edd;
  --accent-green: #05d550;
  --text-primary: #f0f4f8;
  --text-muted: #8b9bb4;
  --text-dim: #4d5b75;
  --border-glow: rgba(0, 240, 255, 0.3);
  --border-danger: rgba(255, 42, 109, 0.4);
  --font-main: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-tech: 'Orbitron', monospace;
  --box-shadow-neon: 0 0 20px rgba(0, 240, 255, 0.25);
  --box-shadow-danger: 0 0 25px rgba(255, 42, 109, 0.35);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
}

/* Background Film Grain & Glitch Effects */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 990;
  opacity: 0.04;
  background-image: radial-gradient(#fff 10%, transparent 11%);
  background-size: 3px 3px;
}

.glitch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 995;
  opacity: 0;
  background: linear-gradient(rgba(255, 42, 109, 0.15) 50%, rgba(0, 240, 255, 0.15) 50%);
  background-size: 100% 4px;
  transition: opacity 0.1s ease;
}

.glitch-active {
  opacity: 1 !important;
  animation: screenGlitch 0.3s steps(2) infinite;
}

@keyframes screenGlitch {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
  50% { transform: translate(2px, -2px); filter: hue-rotate(180deg); }
  75% { transform: translate(-1px, 1px); filter: hue-rotate(270deg); }
  100% { transform: translate(0, 0); filter: hue-rotate(0deg); }
}

/* Main Screen Wrapper */
.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Scene Background Layer */
.scene-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.7) contrast(1.1);
  transition: background-image 0.8s ease, filter 0.8s ease;
  z-index: 1;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(7, 9, 14, 0.85) 90%);
  pointer-events: none;
  z-index: 2;
}

/* Character Stage & Active Bust */
.character-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 220px;
}

.active-char-card {
  position: relative;
  width: 320px;
  height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: charFloatIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes charFloatIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.active-char-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.3);
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.char-badge {
  position: absolute;
  bottom: 25px;
  background: rgba(12, 17, 29, 0.9);
  border: 1px solid var(--accent-cyan);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  text-transform: uppercase;
}

/* CG Modal */
.cg-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.cg-frame {
  max-width: 900px;
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--accent-cyan);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--box-shadow-neon);
  text-align: center;
}

.cg-frame img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
}

.cg-caption {
  font-size: 17px;
  color: #fff;
  margin-bottom: 14px;
  font-weight: 500;
}

.cg-close-btn {
  background: linear-gradient(135deg, var(--accent-cyan), #0077b6);
  color: #000;
  font-weight: 700;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.cg-close-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* Header HUD */
.game-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(to bottom, rgba(7, 9, 14, 0.95), transparent);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-title-tag {
  display: flex;
  flex-direction: column;
}

.title-sub {
  font-family: var(--font-tech);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent-cyan);
}

.title-main {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.chapter-badge {
  font-family: var(--font-tech);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  letter-spacing: 1px;
}

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

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(19, 27, 44, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.hud-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-2px);
}

.hud-btn-phone {
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.25), rgba(0, 240, 255, 0.25));
  border-color: var(--accent-magenta);
}

.pulse-glow {
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 42, 109, 0.4); }
  50% { box-shadow: 0 0 18px rgba(255, 42, 109, 0.85); }
}

.notice-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--accent-magenta);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 8px var(--accent-magenta);
}

.count-badge {
  background: var(--accent-cyan);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Dialogue Wrapper & Box */
.dialogue-wrapper {
  position: relative;
  z-index: 10;
  margin-top: auto;
  padding: 0 30px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speaker-avatar-box {
  position: absolute;
  bottom: calc(100% - 15px);
  left: 60px;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
  background: #000;
  z-index: 12;
}

.speaker-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialogue-box {
  position: relative;
  width: 100%;
  max-width: 1080px;
  min-height: 180px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 16px;
  padding: 22px 28px 16px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.dialogue-box:hover {
  border-color: rgba(0, 240, 255, 0.45);
}

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

.speaker-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: -0.3px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.speaker-role {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.dialogue-controls {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.txt-ctrl-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.txt-ctrl-btn.active, .txt-ctrl-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.dialogue-content {
  flex: 1;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
  word-break: keep-all;
  min-height: 70px;
}

.dialogue-text em {
  color: var(--accent-amber);
  font-style: normal;
  font-weight: 700;
}

.dialogue-text strong {
  color: var(--accent-magenta);
  font-weight: 700;
}

.dialogue-text .app-msg-inline {
  display: inline-block;
  background: rgba(255, 42, 109, 0.15);
  border-left: 3px solid var(--accent-magenta);
  padding: 2px 8px;
  margin: 2px 0;
  font-family: var(--font-tech);
  color: #ff99b3;
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--accent-cyan);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 0.7s infinite;
}

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

.dialogue-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 4px;
}

.click-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  animation: bounceDown 1s infinite alternate ease-in-out;
}

@keyframes bounceDown {
  from { transform: translateY(0); opacity: 0.6; }
  to { transform: translateY(5px); opacity: 1; }
}

.arrow-down {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent-cyan);
}

/* Branch Choice UI */
.choice-container {
  position: absolute;
  bottom: 220px;
  width: 100%;
  max-width: 800px;
  background: rgba(10, 14, 24, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent-magenta);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--box-shadow-danger);
  z-index: 20;
  animation: slideUpChoice 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpChoice {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.choice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.choice-title {
  font-size: 14px;
  font-weight: 700;
  color: #ff9ebb;
  letter-spacing: -0.2px;
}

.prediction-trigger-btn {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.prediction-trigger-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.prediction-box {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--accent-cyan);
  line-height: 1.5;
}

.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  background: rgba(20, 28, 48, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.choice-btn:hover {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), rgba(157, 78, 221, 0.2));
  border-color: var(--accent-cyan);
  transform: translateX(6px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

.choice-badge {
  font-size: 11px;
  font-family: var(--font-tech);
  color: var(--accent-amber);
  background: rgba(255, 183, 3, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Modals General */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

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

.modal-close:hover {
  color: var(--accent-magenta);
}

/* Smartphone Modal */
.phone-device-frame {
  width: 380px;
  height: 720px;
  max-height: 92vh;
  background: #000;
  border-radius: 42px;
  border: 4px solid #333d4e;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35), inset 0 0 10px #000;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.phone-speaker-notch {
  width: 110px;
  height: 18px;
  background: #111;
  border-radius: 0 0 12px 12px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.phone-screen {
  flex: 1;
  background: #090e17;
  border-radius: 30px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 10px;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  padding: 0 4px;
}

.app-sync-status {
  animation: pulseGlow 1.5s infinite;
}

.app-header {
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.app-logo {
  font-family: var(--font-tech);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-cyan);
}

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

.app-prophecy-panel {
  background: rgba(255, 42, 109, 0.08);
  border: 1px solid rgba(255, 42, 109, 0.35);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.prophecy-title {
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-magenta);
  text-align: center;
  margin-bottom: 10px;
}

.prophecy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.prophecy-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.prophecy-num {
  font-family: var(--font-tech);
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-cyan);
}

.prophecy-num span {
  font-size: 14px;
}

.danger-card .prophecy-num { color: var(--accent-amber); }
.killer-card .prophecy-num { color: var(--accent-magenta); }
.waiting-card .prophecy-num { color: #52b788; }

.prophecy-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.app-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-heroines-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.app-heroine-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 25, 41, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.app-heroine-item.unlocked {
  border-color: rgba(0, 240, 255, 0.3);
}

.app-heroine-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.app-heroine-info {
  flex: 1;
}

.app-heroine-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.app-heroine-status {
  font-size: 10px;
  color: var(--text-muted);
}

.app-heroine-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.tag-safe { background: rgba(5, 213, 80, 0.15); color: #05d550; }
.tag-warn { background: rgba(255, 183, 3, 0.15); color: #ffb703; }
.tag-danger { background: rgba(255, 42, 109, 0.15); color: #ff2a6d; }
.tag-lock { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.app-terminal-box {
  background: #03060a;
  border: 1px solid #1f2a3e;
  border-radius: 8px;
  padding: 10px;
  margin-top: auto;
  margin-bottom: 12px;
}

.terminal-tag {
  font-family: var(--font-tech);
  font-size: 9px;
  color: var(--accent-magenta);
}

.terminal-text {
  font-size: 12px;
  color: #a8dadc;
  line-height: 1.4;
  margin-top: 4px;
}

.phone-home-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 20px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.phone-home-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Clue Board Modal */
.clue-board-content {
  padding: 0;
}

.clue-board-desc {
  padding: 14px 24px;
  font-size: 14px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.clue-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  overflow-y: auto;
}

.clue-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
}

.clue-card.unlocked {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.clue-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.clue-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-magenta);
  position: absolute;
  top: 10px;
  left: 10px;
  box-shadow: 0 0 6px var(--accent-magenta);
}

.clue-num {
  font-family: var(--font-tech);
  font-size: 11px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  padding-left: 14px;
}

.clue-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.clue-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.clue-status-tag {
  margin-top: 10px;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Heroine Profiles Modal */
.profile-layout {
  display: flex;
  height: 520px;
}

.profile-tabs {
  width: 220px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.profile-tab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition-smooth);
}

.profile-tab-item:hover, .profile-tab-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-left-color: var(--accent-cyan);
}

.profile-tab-item.active .tab-char-name {
  color: var(--accent-cyan);
}

.tab-char-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.tab-char-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.tab-char-role {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-detail-card {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  gap: 24px;
}

.profile-portrait-col {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-portrait-col img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.profile-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.p-name {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.p-role {
  font-size: 14px;
  color: var(--accent-cyan);
  font-weight: 500;
}

.profile-quote {
  font-style: italic;
  font-size: 15px;
  color: #ff9ebb;
  border-left: 3px solid var(--accent-magenta);
  padding: 8px 14px;
  background: rgba(255, 42, 109, 0.08);
  border-radius: 0 8px 8px 0;
  margin: 12px 0 18px 0;
}

.meters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.meter-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.meter-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.fill-affection {
  background: linear-gradient(90deg, #ff758c, #ff2a6d);
}

.fill-suspicion {
  background: linear-gradient(90deg, #ffd166, #e63946);
}

.profile-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.profile-lore {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.profile-clues-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-clues-list li {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 2px solid var(--accent-cyan);
  color: var(--text-muted);
}

/* History Modal */
.history-content {
  padding: 0;
}

.history-list {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-item {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hist-speaker {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.hist-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Save / Load Modal */
.modal-tab-group {
  display: flex;
  gap: 8px;
}

.modal-tab-group button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-tab-group button.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.slots-container {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  overflow-y: auto;
}

.save-slot {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.save-slot:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

.slot-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 12px;
  color: var(--accent-cyan);
}

.slot-chapter {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.slot-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  height: 34px;
  overflow: hidden;
}

/* Title Screen */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #060911;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.title-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.title-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 60% 40%, rgba(255, 42, 109, 0.15) 0%, rgba(0, 240, 255, 0.08) 50%, transparent 80%);
}

.title-hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.35;
  filter: saturate(1.2) contrast(1.1);
}

.title-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.title-container {
  position: relative;
  z-index: 10;
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-subtitle {
  font-family: var(--font-tech);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.main-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.title-line1 {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
  color: #c9d6df;
}

.title-line2 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
  text-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}

.title-synopsis {
  font-size: 15px;
  color: #b0c4de;
  line-height: 1.8;
  margin-bottom: 32px;
  background: rgba(12, 17, 29, 0.65);
  backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.title-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.title-btn {
  padding: 14px 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0077b6);
  border: none;
  color: #000;
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 240, 255, 0.5);
}

.btn-secondary {
  background: rgba(19, 27, 44, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
}

.btn-text {
  font-size: 17px;
  font-weight: 700;
}

.btn-sub {
  font-family: var(--font-tech);
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.8;
}

.title-footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-tech);
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .game-header {
    padding: 8px 12px;
  }
  .hud-label {
    display: none;
  }
  .hud-btn {
    padding: 6px 10px;
  }
  .title-line1 {
    font-size: 22px;
  }
  .title-line2 {
    font-size: 28px;
  }
  .dialogue-wrapper {
    padding: 0 12px 14px 12px;
  }
  .speaker-avatar-box {
    left: 24px;
    width: 64px;
    height: 64px;
  }
  .dialogue-box {
    padding: 16px 18px 12px 18px;
    min-height: 160px;
  }
  .dialogue-content {
    font-size: 16px;
  }
  .active-char-card {
    width: 220px;
    height: 340px;
  }
  .character-stage {
    padding-bottom: 180px;
  }
  .choice-container {
    bottom: 180px;
    padding: 16px;
  }
  .phone-device-frame {
    width: 95vw;
    height: 85vh;
  }
  .profile-layout {
    flex-direction: column;
    height: auto;
  }
  .profile-tabs {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .profile-detail-card {
    flex-direction: column;
  }
  .profile-portrait-col {
    width: 100%;
    align-items: center;
  }
  .profile-portrait-col img {
    width: 140px;
    height: 180px;
  }
}
