@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* Base colors */
  --bg: #03050a;
  --fg: #f5f5f7;
  --panel: rgba(18, 19, 26, 0.7);
  --border: rgba(255, 255, 255, 0.08);

  /* Accents */
  --accent: #bf5af2;
  --accent-gold: #ffd700;
  --accent-blue: #5e5ce6;
  --muted: #86868b;

  /* Safe Area variables */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 20px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);

  --glass-bg: rgba(20, 20, 25, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(24px);
  --render-scale: 1;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'EB Garamond', serif;
  line-height: 1.6;
  font-size: 1.15rem;
  overflow-x: hidden;
  min-height: 100vh;
  padding-bottom: var(--safe-area-bottom);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Atmosphere Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 10000;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.03) 0px,
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 2px);
  pointer-events: none;
  z-index: 10001;
}

/* Scene chrome (visible UX improvement) */
.scene-chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  margin-bottom: 10px;
}

header,
.game-header {
  padding: calc(12px + var(--safe-area-top)) 20px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 16, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  box-sizing: border-box;
}

.header-logo {
  height: 100%;
  display: flex;
  align-items: center;
}

.logo-img {
  max-height: 46px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05) rotate(-2deg);
}

.scene-title {
  font-family: "EB Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.scene-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.scene-chrome-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.choice-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#choiceFilter {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
}

#sceneText {
  max-width: 74ch;
  line-height: 1.8;
  font-size: 1.15rem;
  font-family: 'EB Garamond', serif;
  color: #f0f0f5;
}

#sceneText .scene-body {
  overflow-wrap: break-word;
}

#sceneText .scene-body p {
  margin: 0 0 1.5rem;
  opacity: 0.95;
}

#sceneText .scene-narration {
  margin: 0 0 1.5rem;
}

#sceneText .scene-dialogue {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(179, 140, 255, 0.28);
  border-left: 4px solid rgba(179, 140, 255, 0.7);
  background: rgba(18, 18, 28, 0.6);
}

#sceneText .scene-dialogue-speaker {
  display: block;
  margin-bottom: 0.35rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d7c3ff;
}

#sceneText .scene-dialogue-line {
  margin: 0;
  opacity: 0.98;
}

body.ui-no-color .scene-chrome {
  backdrop-filter: none;
  box-shadow: none !important;
}



/* Light theme variables */
[data-theme="light"] {
  --bg: #f8f9fa;
  --fg: #212529;
  --muted: #6c757d;
  --accent: #6f42c1;
  --panel: #ffffff;
  --border: #dee2e6;
}

/* Theme transition animations */
* {
  transition: background-color calc(0.3s * var(--render-scale, 1)) ease,
    color calc(0.3s * var(--render-scale, 1)) ease,
    border-color calc(0.3s * var(--render-scale, 1)) ease;
}

.touch-active {
  transform: scale(0.97);
  opacity: 0.85;
}

body[data-quality="medium"] .panel,
body[data-quality="medium"] #choices button {
  transition-duration: 0.2s;
}

body[data-quality="low"] .panel,
body[data-quality="low"] #choices button,
body[data-quality="low"] header,
body[data-quality="low"] .modal-content {
  transition: none !important;
  box-shadow: none !important;
}

body[data-quality="low"] .loading-spinner::before,
body[data-quality="low"] .loading-spinner::after {
  animation-duration: 1.25s;
}

/* Visual Effects and Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--accent);
  }

  50% {
    box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent);
  }
}

@keyframes achievementUnlock {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes choiceAppear {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes notificationSlide {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes sceneFade {
  from {
    opacity: 0.85;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes screenShake {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(var(--shake-intensity, 3px), 0);
  }

  40% {
    transform: translate(calc(var(--shake-intensity, 3px) * -1), 0);
  }

  60% {
    transform: translate(0, var(--shake-intensity, 3px));
  }

  80% {
    transform: translate(0, calc(var(--shake-intensity, 3px) * -1));
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes hitFlash {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes sparkFade {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }

  18% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

#content.scene-transition {
  animation: sceneFade 240ms ease;
}

#content.fx-shake {
  animation: screenShake var(--shake-duration, 160ms) ease;
}

body.fx-flash::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--flash-color, rgba(255, 255, 255, 0.12));
  opacity: 0;
  pointer-events: none;
  z-index: 99998;
  animation: hitFlash var(--flash-duration, 120ms) ease;
}

body.fx-hitstop * {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}

body.fx-spark::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 40% 45%, var(--spark-color, rgba(255, 255, 255, 0.18)) 0, transparent 35%),
    radial-gradient(circle at 60% 55%, var(--spark-color, rgba(255, 255, 255, 0.18)) 0, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0, transparent 45%);
  opacity: 0;
  pointer-events: none;
  z-index: 99997;
  animation: sparkFade var(--spark-duration, 200ms) ease;
}

.pause-subtitle {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes statIncrease {
  0% {
    transform: scale(1);
    color: var(--fg);
  }

  50% {
    transform: scale(1.1);
    color: var(--accent);
  }

  100% {
    transform: scale(1);
    color: var(--accent);
  }
}

/* Scene transitions */
.scene-transition {
  animation: fadeIn 0.5s ease-out;
}

.scene-text-reveal {
  animation: textReveal 0.8s ease-out;
}

.scene-text-reveal p {
  animation: textReveal 0.6s ease-out;
  animation-fill-mode: both;
}

.scene-text-reveal p:nth-child(1) {
  animation-delay: 0.1s;
}

.scene-text-reveal p:nth-child(2) {
  animation-delay: 0.2s;
}

.scene-text-reveal p:nth-child(3) {
  animation-delay: 0.3s;
}

.scene-text-reveal p:nth-child(4) {
  animation-delay: 0.4s;
}

/* Choice animations */
#choices {
  animation: slideUp 0.5s ease-out 0.1s both;
}

#choices button {
  animation: choiceAppear 0.4s ease-out both;
}

#choices button:focus-visible {
  outline: 2px solid rgba(179, 140, 255, 0.85);
  outline-offset: 3px;
}

#choices button:nth-child(1) {
  animation-delay: 0.2s;
}

#choices button:nth-child(2) {
  animation-delay: 0.3s;
}

#choices button:nth-child(3) {
  animation-delay: 0.4s;
}

#choices button:nth-child(4) {
  animation-delay: 0.5s;
}

#choices button:nth-child(5) {
  animation-delay: 0.6s;
}

#choices button:nth-child(6) {
  animation-delay: 0.7s;
}

.panel {
  animation: fadeIn 0.5s ease-out;
}

.panel:nth-child(1) {
  animation-delay: 0.1s;
}

.panel:nth-child(2) {
  animation-delay: 0.2s;
}

.panel:nth-child(3) {
  animation-delay: 0.3s;
}

.panel:nth-child(4) {
  animation-delay: 0.4s;
}

.panel:nth-child(5) {
  animation-delay: 0.5s;
}

/* Enhanced Choice animations */
#choices {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#choices button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--fg);
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#choices button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

#choices button:hover {
  background: rgba(191, 90, 242, 0.08);
  border-color: rgba(191, 90, 242, 0.4);
  transform: translateX(8px);
  box-shadow: 0 8px 32px rgba(191, 90, 242, 0.1);
}

#choices button:hover::before {
  transform: scaleY(1);
}

#choices button:active {
  transform: translateX(4px) scale(0.99);
  transition-duration: 0.1s;
}

#choices button .choice-index {
  font-size: 0.75rem;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-right: 1rem;
  opacity: 0.6;
}

/* Achievement animations */
.achievement-unlock {
  animation: achievementUnlock 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  background: linear-gradient(135deg, var(--accent), #9d4edd);
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(179, 140, 255, 0.5);
}

.achievement-icon {
  animation: pulse 2s infinite;
  display: inline-block;
}

.achievement-glow {
  animation: glow 2s infinite;
}

/* Choice Badges */
.choice-badges {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
}

.choice-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.choice:hover .choice-badge {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-has-check="true"] .choice-badge {
  color: #a29bfe;
  border-color: rgba(162, 155, 254, 0.3);
  background: rgba(162, 155, 254, 0.05);
}

[data-has-cost="true"] .choice-badge {
  color: #ffe066;
  border-color: rgba(255, 224, 102, 0.3);
  background: rgba(255, 224, 102, 0.05);
}

/* Modal improvements - consolidated with main modal styles below */

/* Notification improvements */
.notification {
  animation: notificationSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Loading animations */
.loading-overlay {
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Stat increase animations */
.stat-increase {
  animation: statIncrease 1s ease-out;
  color: var(--accent) !important;
}

/* Improved panel styling */
.panel {
  background: linear-gradient(135deg, var(--panel) 0%, rgba(23, 24, 33, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Button improvements */
button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  /* MOBILE FIX: Remove 300ms tap delay on iOS Safari and Android */
  touch-action: manipulation;
  /* MOBILE FIX: Prevent text selection on double-tap */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Keyboard navigation */
#choices button.keyboard-selected {
  animation: pulse 0.6s ease-in-out;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Settings Controls */
.difficulty-container,
.animation-speed-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.difficulty-container input[type="range"],
.animation-speed-container input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.difficulty-container input[type="range"]::-webkit-slider-thumb,
.animation-speed-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.difficulty-container input[type="range"]::-webkit-slider-thumb:hover,
.animation-speed-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-labels,
.speed-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.difficulty-value,
.speed-value {
  font-size: 12px;
  color: var(--fg);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
}

/* Volume Controls */
.volume-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-container input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.volume-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.volume-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.volume-container span {
  font-size: 12px;
  color: var(--fg);
  font-weight: 600;
  min-width: 35px;
  text-align: right;
}

/* Audio Visualization */
.audio-visualizer {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.audio-bar {
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  animation: audioPulse 1.5s ease-in-out infinite;
}

.audio-bar:nth-child(2) {
  animation-delay: 0.2s;
}

.audio-bar:nth-child(3) {
  animation-delay: 0.4s;
}

.audio-bar:nth-child(4) {
  animation-delay: 0.6s;
}

@keyframes audioPulse {

  0%,
  100% {
    height: 4px;
    opacity: 0.4;
  }

  50% {
    height: 12px;
    opacity: 1;
  }
}

/* Mute state styling */
.audio-muted .audio-bar {
  background: var(--muted);
  animation: none;
}

/* Cutscene Styles */
.cutscene-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutscene-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1920px;
  max-height: 1080px;
  overflow: hidden;
}

.cutscene-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.5s ease;
}

.cutscene-sprites {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cutscene-sprite {
  position: absolute;
  max-width: 30%;
  max-height: 70%;
  object-fit: contain;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.cutscene-sprite.left {
  left: 10%;
  bottom: 20%;
  transform: translateX(-50%);
}

.cutscene-sprite.center {
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
}

.cutscene-sprite.right {
  right: 10%;
  bottom: 20%;
  transform: translateX(50%);
}

.cutscene-text-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 20%);
  padding: 2rem 2rem 1rem;
  color: white;
}

.cutscene-speaker {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--accent);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cutscene-text {
  font-size: 1.1rem;
  line-height: 1.6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: textReveal 0.8s ease-out;
}

.cutscene-progress {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  color: white;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  min-width: 60px;
  text-align: center;
}

.cutscene-controls {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem;
  border-radius: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cutscene-controls button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutscene-controls button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

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

/* Cutscene Animations */
@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spriteFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes spriteSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spriteSlideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes backgroundFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes backgroundZoom {
  from {
    transform: scale(1.1);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.cutscene-sprite.fadeIn {
  animation: spriteFadeIn 0.8s ease-out;
}

.cutscene-sprite.slideInLeft {
  animation: spriteSlideInLeft 0.8s ease-out;
}

.cutscene-sprite.slideInRight {
  animation: spriteSlideInRight 0.8s ease-out;
}

.cutscene-background.fade {
  animation: backgroundFade 1s ease-out;
}

.cutscene-background.zoom {
  animation: backgroundZoom 1.2s ease-out;
}

/* Character Creation Styles */
.character-creation-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--fg);
  max-height: calc(90vh - 4rem);
  overflow-y: auto;
}

.character-preview-section {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.character-preview {
  flex: 0 0 300px;
  display: flex;
  justify-content: center;
}

.character-portrait {
  position: relative;
  width: 200px;
  height: 300px;
  border: 3px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--panel), rgba(255, 255, 255, 0.1));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.character-base,
.character-hair,
.character-eyes,
.character-clothing,
.character-accessories {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.character-base {
  background: var(--panel);
}

.character-stats-preview {
  flex: 1;
  background: var(--panel);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.character-stats-preview h3 {
  margin-top: 0;
  color: var(--accent);
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-label {
  min-width: 80px;
  font-weight: bold;
}

.stat-fill {
  flex: 1;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.stat-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9d4edd);
  border-radius: 10px;
  width: var(--fill-width, 20%);
  transition: width 0.3s ease-out;
}

.stat-value {
  min-width: 30px;
  text-align: right;
  font-weight: bold;
}

/* Character Preset Cards */
.character-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.character-preset-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.character-preset-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.character-preset-card:active {
  transform: translateY(0);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.preset-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text);
  margin: 0;
}

.preset-background {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

.preset-description {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.preset-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trait-tag {
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

/* Character Creation Tabs */
.character-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.character-tab {
  background: none;
  border: none;
  padding: 1rem 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.character-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.character-tab:hover:not(.active) {
  color: var(--text);
  background: var(--bg-tertiary);
}

/* Personality Traits */
.personality-traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.personality-trait {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.personality-trait:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.personality-trait.selected {
  border-color: var(--accent);
  background: rgba(138, 43, 226, 0.1);
}

.personality-trait-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-primary);
  position: relative;
  flex-shrink: 0;
}

.personality-trait.selected .personality-trait-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.personality-trait.selected .personality-trait-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.personality-trait-info {
  flex: 1;
}

.personality-trait-name {
  font-weight: bold;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.personality-trait-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
}

/* Stat Sliders */
.stat-sliders {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-slider label {
  min-width: 80px;
  font-weight: bold;
}

.stat-slider input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.stat-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.stat-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.stat-value-display {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  color: var(--accent);
}

/* Random Character */
.random-character-section {
  text-align: center;
  padding: 2rem;
}

.generate-random-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.generate-random-btn:hover {
  background: #9d4edd;
  transform: scale(1.05);
}

.random-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: left;
}

/* Character Actions */
.character-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.character-actions button {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
}

.primary-btn:hover {
  background: #9d4edd;
  transform: scale(1.05);
}

.secondary-btn {
  background: var(--bg-secondary);
  color: var(--text);
  border: 2px solid var(--border);
}

.secondary-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

/* Character Errors */
.character-errors {
  background: #ff6b6b;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
  font-weight: bold;
}

/* Mini-Games Styles */
.minigames-container {
  max-width: 1200px;
  margin: 0 auto;
  color: var(--fg);
}

.minigames-description {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.minigames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.minigame-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.minigame-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.2);
}

.minigame-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.minigame-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent);
  margin: 0;
}

.minigame-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  color: white;
}

.minigame-difficulty.easy {
  background: #4CAF50;
}

.minigame-difficulty.medium {
  background: #FF9800;
}

.minigame-difficulty.hard {
  background: #F44336;
}

.minigame-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.minigame-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.minigame-type {
  text-transform: capitalize;
}

.minigame-timer {
  color: var(--accent);
  font-weight: bold;
}

.minigame-play-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.minigame-play-btn:hover {
  background: #9d4edd;
  transform: scale(1.02);
}

.minigames-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Game Interface Styles */
.game-interface {
  max-width: 800px;
  margin: 0 auto;
  color: var(--fg);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.game-header h2 {
  margin: 0;
  color: var(--accent);
}

.game-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.game-difficulty,
.game-timer {
  background: var(--panel);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.game-description {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.game-area {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Pattern Lock Game */
.pattern-lock {
  text-align: center;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 200px;
  margin: 0 auto 1.5rem;
}

.pattern-dot {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pattern-dot:hover {
  background: var(--accent);
  color: white;
}

.pattern-dot.selected {
  background: #4CAF50;
  color: white;
  transform: scale(1.1);
}

.pattern-instructions {
  margin-top: 1rem;
}

/* Security Dance Game */
.security-dance {
  text-align: center;
}

.dance-area {
  position: relative;
  height: 200px;
  background: linear-gradient(45deg, #1a1a2e, #16213e);
  border-radius: 12px;
  margin: 1rem 0;
  overflow: hidden;
}

.character {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  transition: left 0.3s ease;
}

.camera-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.3), transparent);
  animation: cameraSweep 2s infinite;
}

.camera-beam.active {
  animation-play-state: running;
}

.camera-beam:not(.active) {
  animation-play-state: paused;
}

.dance-controls {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0;
}

.control-btn {
  padding: 1rem 2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: #9d4edd;
  transform: scale(1.05);
}

.dance-score {
  margin-top: 1rem;
  font-weight: bold;
  color: var(--accent);
}

@keyframes cameraSweep {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Terminal Hack Game */
.terminal-hack {
  text-align: center;
}

.terminal-screen {
  background: #000;
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  color: #00ff00;
  min-height: 150px;
}

.command-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.prompt {
  color: #00ff00;
}

.current-command {
  flex: 1;
  border: none;
  background: transparent;
  color: #00ff00;
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

.cursor {
  animation: blink 1s infinite;
}

.hack-commands {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.hack-btn {
  padding: 0.75rem;
  background: #333;
  color: #00ff00;
  border: 2px solid #00ff00;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
}

.hack-btn:hover {
  background: #00ff00;
  color: #000;
}

.hack-progress {
  margin-top: 1rem;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: #00ff00;
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Mall Shooting Game */
.mall-shooting {
  text-align: center;
}

.shooting-range {
  position: relative;
  height: 300px;
  background: linear-gradient(45deg, #2c3e50, #34495e);
  border-radius: 12px;
  margin: 1rem 0;
  overflow: hidden;
}

.target {
  position: absolute;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.target:hover {
  transform: scale(1.2);
}

.shooting-controls {
  margin: 1rem 0;
}

.shooting-score {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  font-weight: bold;
}

.shooting-score span {
  color: var(--accent);
}

/* Memory Cards Game */
.memory-cards {
  text-align: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.memory-card {
  aspect-ratio: 1;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.memory-card:hover {
  background: var(--accent);
  color: white;
}

.memory-card.flipped {
  background: var(--panel);
  color: var(--fg);
}

.memory-card .card-front {
  font-size: 1.2rem;
  font-weight: bold;
}

.memory-card .card-back {
  font-size: 1.5rem;
  display: none;
}

.memory-card.flipped .card-front {
  display: none;
}

.memory-card.flipped .card-back {
  display: block;
}

.memory-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  font-weight: bold;
}

.memory-info span {
  color: var(--accent);
}

/* Result Modal */
.result-content,
.error-content {
  text-align: center;
  padding: 2rem;
}

.result-content h2 {
  color: var(--success, #4CAF50);
  margin-bottom: 1rem;
}

.error-content h2 {
  color: #F44336;
  margin-bottom: 1rem;
}

.result-details {
  margin: 1.5rem 0;
  font-size: 1.1rem;
}

.result-details p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.result-actions {
  margin-top: 2rem;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Relationship System Styles */
.relationships-container {
  max-width: 1200px;
  margin: 0 auto;
  color: var(--fg);
}

.relationships-description {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.relationships-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.relationship-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.relationship-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.2);
}

.relationship-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.relationship-avatar {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 50%;
  border: 2px solid var(--border);
}

.relationship-info {
  flex: 1;
}

.relationship-name {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent);
}

.relationship-affinity {
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.relationship-affinity-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin: 1rem 0;
  overflow: hidden;
}

.affinity-fill {
  height: 100%;
  background: linear-gradient(90deg, #F44336 0%, #FF9800 25%, #9E9E9E 50%, #4CAF50 75%, #2196F3 90%, #9C27B0 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.relationship-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.relationship-talk-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.relationship-talk-btn:hover {
  background: #9d4edd;
  transform: scale(1.02);
}

.relationships-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Conversation Styles */
.conversation-container {
  max-width: 600px;
  margin: 0 auto;
  color: var(--fg);
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.conversation-header h2 {
  margin: 0;
  color: var(--accent);
}

.conversation-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.message {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.message-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.message-text {
  background: var(--panel);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.message.player-message {
  flex-direction: row-reverse;
}

.message.player-message .message-content {
  align-items: flex-end;
}

.message.player-message .message-text {
  background: var(--accent);
  color: white;
}

.conversation-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: auto;
}

.conversation-option {
  padding: 0.75rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.conversation-option:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Crafting Modal Styles */
.crafting-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.crafting-actions button {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.crafting-actions .secondary-btn {
  background: var(--bg-secondary);
  color: var(--text);
  border: 2px solid var(--border);
}

.crafting-actions .secondary-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

/* Favorite Button States */
.recipe-actions .secondary-btn.favorited {
  background: #ffd700;
  color: #000;
  border-color: #ffd700;
}

.recipe-actions .secondary-btn.favorited:hover {
  background: #ffed4e;
  border-color: #ffed4e;
}

.character-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.character-tab:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
}

.character-tab-content {
  display: none;
}

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

/* Presets Tab */
.character-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.character-preset-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.character-preset-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(179, 140, 255, 0.2);
}

.character-preset-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--panel), rgba(179, 140, 255, 0.1));
}

.character-preset-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}

.character-preset-card p {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.character-preset-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
}

.character-preset-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Custom Tab */
.character-customization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.customization-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.customization-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--fg);
}

.customization-section input[type="text"],
.customization-section select {
  width: 100%;
  padding: 0.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-size: 1rem;
}

.customization-section input[type="text"]:focus,
.customization-section select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 140, 255, 0.2);
}

.background-description {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.appearance-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.appearance-option select {
  padding: 0.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
}

.appearance-option select:focus {
  border-color: var(--accent);
}

/* Personality Traits */
.personality-traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.personality-trait {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.personality-trait:hover {
  border-color: var(--accent);
  background: rgba(179, 140, 255, 0.1);
}

.personality-trait.selected {
  border-color: var(--accent);
  background: rgba(179, 140, 255, 0.2);
}

.personality-trait input[type="checkbox"] {
  display: none;
}

.personality-trait-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.personality-trait.selected .personality-trait-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.personality-trait.selected .personality-trait-checkbox::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.personality-trait-info {
  flex: 1;
}

.personality-trait-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.personality-trait-description {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Stat Sliders */
.stat-sliders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-slider label {
  min-width: 80px;
  margin-bottom: 0;
}

.stat-slider input[type="range"] {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.stat-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.stat-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-slider span {
  min-width: 30px;
  text-align: right;
  font-weight: bold;
}

/* Random Tab */
.random-character-section {
  text-align: center;
  padding: 2rem;
}

.generate-random-btn {
  background: linear-gradient(135deg, var(--accent), #9d4edd);
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(179, 140, 255, 0.3);
}

.generate-random-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(179, 140, 255, 0.4);
}

.random-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--panel);
  border-radius: 8px;
  border: 2px solid var(--border);
}

/* Character Actions */
.character-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.secondary-btn {
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  border-color: var(--accent);
  background: rgba(179, 140, 255, 0.1);
}

.primary-btn {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--accent), #9d4edd);
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(179, 140, 255, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(179, 140, 255, 0.4);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(179, 140, 255, 0.2);
}

/* Character Errors */
.character-errors {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid #dc3545;
  border-radius: 6px;
  color: #dc3545;
  font-weight: 600;
}

.character-errors ul {
  margin: 0;
  padding-left: 1.5rem;
}

.character-errors li {
  margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cutscene-text-container {
    padding: 1rem;
  }

  .cutscene-speaker {
    font-size: 1rem;
  }

  .cutscene-text {
    font-size: 1rem;
  }

  .cutscene-controls {
    bottom: 80px;
    padding: 0.5rem;
  }

  .cutscene-controls button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .cutscene-sprite {
    max-width: 40%;
    max-height: 60%;
  }

  /* Character Creation Mobile Styles */
  .character-creation-container {
    padding: 1rem;
  }

  .character-preview-section {
    flex-direction: column;
    gap: 1rem;
  }

  .character-preview {
    flex: none;
  }

  .character-portrait {
    width: 150px;
    height: 225px;
  }

  .character-customization-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .appearance-grid {
    grid-template-columns: 1fr;
  }

  .character-tabs {
    flex-wrap: wrap;
  }

  .character-tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .character-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .secondary-btn,
  .primary-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .character-creation-container {
    padding: 0.75rem;
  }

  .character-portrait {
    width: 120px;
    height: 180px;
  }

  .stat-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-fill {
    width: 100%;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .cutscene-text-container {
    padding: 0.75rem;
  }

  .cutscene-speaker {
    font-size: 0.9rem;
  }

  .cutscene-text {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .cutscene-controls {
    bottom: 60px;
    gap: 0.5rem;
  }

  .cutscene-controls button {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

/* Color Schemes */
[data-color-scheme="blue"] {
  --accent: #4dabf7;
  --panel: #1a2332;
  --border: #2d3748;
}

[data-color-scheme="green"] {
  --accent: #51cf66;
  --panel: #1a2e1f;
  --border: #2d5026;
}

[data-color-scheme="red"] {
  --accent: #ff6b6b;
  --panel: #2d1818;
  --border: #5c2a2a;
}

[data-color-scheme="orange"] {
  --accent: #ffd43b;
  --panel: #2d2d1a;
  --border: #5c5c2a;
}

/* Font Families */
[data-font-family="serif"] {
  font-family: 'EB Garamond', Georgia, serif;
}

[data-font-family="mono"] {
  font-family: 'Courier New', monospace;
}

[data-font-family="dyslexic"] {
  font-family: 'Open Dyslexic', 'Comic Sans MS', sans-serif;
}

/* Animation Speed */
[data-animation-speed] * {
  transition-duration: calc(var(--animation-speed) * 1s);
}

[data-animation-speed="0.5"] {
  --animation-speed: 0.5;
}

[data-animation-speed="1"] {
  --animation-speed: 1;
}

[data-animation-speed="1.5"] {
  --animation-speed: 1.5;
}

[data-animation-speed="2"] {
  --animation-speed: 2;
}

/* Modal animations - consolidated with main modal styles */

/* Modal animation removed to avoid conflicts */

/* Loading animations */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes enhancedSpin {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(90deg) scale(1.1);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(270deg) scale(1.1);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Progress bars for stats */
.stat-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.stat-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.8s ease-out;
  position: relative;
}

.stat-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Achievement unlock animation */
@keyframes achievementUnlock {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.achievement-unlock {
  animation: achievementUnlock 0.6s ease-out;
}

/* Success message animation */
@keyframes successBounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

#error.success {
  animation: successBounce 0.8s ease-out;
}

/* Button press feedback */
button:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Focus animations */
button:focus,
input:focus,
select:focus {
  animation: pulse 0.3s ease-in-out;
}

/* Scene text reveal animation */
.scene-text-reveal {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(40, end);
  border-right: 2px solid var(--accent);
}

/* Notification slide-in */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.4s ease-out;
  z-index: 1000;
  max-width: 300px;
}

.notification.success {
  border-color: #4ecdc4;
  background: linear-gradient(135deg, var(--panel), rgba(78, 205, 196, 0.1));
}

.notification.error {
  border-color: #ff6b6b;
  background: linear-gradient(135deg, var(--panel), rgba(255, 107, 107, 0.1));
}

/* Achievement Notifications */
.achievement-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: linear-gradient(135deg, var(--panel), rgba(78, 205, 196, 0.1));
  border: 2px solid #4ecdc4;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 300px;
  max-width: 400px;
  z-index: 1000;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.achievement-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.achievement-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.achievement-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #6f42c1);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.achievement-content {
  flex: 1;
}

.achievement-title {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.achievement-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
  display: block;
}

.achievement-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.achievement-progress {
  margin-top: 12px;
}

.achievement-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.achievement-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4ecdc4);
  border-radius: 3px;
  width: 100%;
  animation: achievementProgress 0.8s ease-out;
}

@keyframes achievementProgress {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

/* Achievement rarity colors */
.achievement-notification.common {
  border-color: #6c757d;
}

.achievement-notification.uncommon {
  border-color: #28a745;
}

.achievement-notification.rare {
  border-color: #007bff;
}

.achievement-notification.epic {
  border-color: #6f42c1;
}

.achievement-notification.legendary {
  border-color: #fd7e14;
}

/* Enhanced achievement list styles */
#achievements li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

#achievements li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
}

#achievements li.achievement-unlocked .achievement-icon {
  background: linear-gradient(135deg, var(--accent), #6f42c1);
  color: white;
}

.achievement-content {
  flex: 1;
}

.achievement-name {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
}

.achievement-name.unlocked {
  color: var(--fg);
}

.achievement-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.achievement-rarity {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
}

.achievement-rarity.common {
  background: #6c757d;
  color: white;
}

.achievement-rarity.uncommon {
  background: #28a745;
  color: white;
}

.achievement-rarity.rare {
  background: #007bff;
  color: white;
}

.achievement-rarity.epic {
  background: #6f42c1;
  color: white;
}

.achievement-rarity.legendary {
  background: #fd7e14;
  color: white;
}

/* Statistics Modal */
.statistics-container {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.statistics-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.stat-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
}

.stat-tab:hover {
  background: var(--border);
}

.stat-tab.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

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

.stat-panel {
  display: none;
}

.stat-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.stat-label {
  font-weight: 600;
  color: var(--muted);
}

.stat-value {
  font-weight: 700;
  color: var(--fg);
}

.best-scores {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.best-scores h4 {
  margin: 0 0 16px 0;
  color: var(--accent);
}

.achievement-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.achievement-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.achievement-progress-item.unlocked {
  border-color: #4ecdc4;
  background: linear-gradient(135deg, var(--panel), rgba(78, 205, 196, 0.1));
}

.achievement-progress-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
}

.achievement-progress-item.unlocked .achievement-progress-icon {
  background: linear-gradient(135deg, var(--accent), #6f42c1);
  color: white;
}

.achievement-progress-content {
  flex: 1;
}

.achievement-progress-name {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

.achievement-progress-item.unlocked .achievement-progress-name {
  color: var(--fg);
}

.achievement-progress-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  margin-bottom: 8px;
}

.achievement-progress-rarity {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-block;
}

.achievement-progress-rarity.common {
  background: #6c757d;
  color: white;
}

.achievement-progress-rarity.uncommon {
  background: #28a745;
  color: white;
}

.achievement-progress-rarity.rare {
  background: #007bff;
  color: white;
}

.achievement-progress-rarity.epic {
  background: #6f42c1;
  color: white;
}

.achievement-progress-rarity.legendary {
  background: #fd7e14;
  color: white;
}

.statistics-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.statistics-actions button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.statistics-actions button:hover {
  border-color: var(--accent);
}

/* Mobile responsiveness for statistics */
@media (max-width: 768px) {
  .statistics-container {
    max-width: 95vw;
    max-height: 90vh;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .statistics-tabs {
    flex-wrap: wrap;
  }

  .stat-tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .statistics-actions {
    flex-direction: column;
  }

  .statistics-actions button {
    width: 100%;
  }

  .achievement-progress-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  overflow-x: hidden;
}

.game-header {
  padding: 3rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  text-align: center;
}

.header-logo {
  margin-bottom: 1rem;
}

.logo-img {
  max-width: 320px;
  width: 90vw;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(191, 90, 242, 0.4));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logo-img:hover {
  transform: scale(1.04) translateY(-5px);
}

#titleScreen {
  position: fixed;
  inset: 0;
  padding-top: 70px;
  /* Respect sticky header */
  background: radial-gradient(circle at center, rgba(15, 16, 20, 0.8), #03050a);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.title-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  width: 90%;
  margin: 20px auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: titleFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px
}

aside .panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

aside .panel:hover {
  border-color: rgba(191, 90, 242, 0.3);
  transform: translateX(4px);
}

.panel h3,
.panel h4 {
  margin: 0 0 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

.panel.small {
  text-align: center
}

#content {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.5rem;
  min-height: 60vh;
  min-width: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow-wrap: break-word;
  word-wrap: break-word;
  animation: fadeIn 0.8s ease-out;
  flex: 1
}

#sceneText {
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  display: block;
  opacity: 1;
  visibility: visible;
  color: var(--fg, #eaeaea)
}

#choices {
  display: block;
  opacity: 1;
  visibility: visible
}

#choices button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #1a1b25;
  color: var(--fg);
  cursor: pointer;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word
}

/* Reaction Mini-Game Styles */
.reaction-game {
  font-family: var(--sans);
  color: var(--fg)
}

.reaction-game h3 {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center
}

.reaction-game p {
  margin: 0 0 16px;
  text-align: center;
  color: var(--muted)
}

.game-stats {
  display: flex;
  justify-content: space-around;
  margin: 16px 0;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 14px
}

.game-area {
  position: relative;
  width: 100%;
  height: 300px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden
}

.reaction-target {
  position: absolute;
  font-size: 48px;
  cursor: pointer;
  transition: opacity 0.2s;
  user-select: none
}

.reaction-target.hidden {
  display: none
}

.reaction-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: var(--muted)
}

.game-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px
}

.game-results {
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center
}

.game-results h4 {
  margin: 0 0 12px
}

.game-results p {
  margin: 6px 0
}

.game-results strong {
  color: var(--accent)
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600
}

.primary-btn:hover {
  opacity: 0.9
}

.secondary-btn {
  background: var(--border);
  color: var(--fg);
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px
}

.secondary-btn:hover {
  opacity: 0.8
}

/* Relationship Bar Styles */
.rel-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0
}

.rel-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease
}

.rel-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 1
}

[data-theme="light"] #choices button {
  background: #ffffff
}

#choices button:hover {
  border-color: var(--accent)
}

#choices button.keyboard-selected {
  border-color: var(--accent);
  background: #2a2b35;
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

[data-theme="light"] #choices button.keyboard-selected {
  background: #e3f2fd
}

#choices .index {
  display: inline-block;
  width: 24px;
  color: var(--muted)
}

ul {
  list-style: none;
  padding: 0;
  margin: 0
}

footer {
  padding: 12px 20px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  text-align: center
}

button#newGame {
  background: var(--accent);
  border: none;
  color: #111;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer
}

[data-theme="light"] button#newGame {
  color: #ffffff
}

#error {
  margin-top: 12px;
  color: #ffb4b4;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ff6b6b;
  background: #2d1b1b
}

#error.success {
  color: #b4ffb4;
  border-color: #4ecdc4;
  background: #1b2d1b
}

.hidden {
  display: none
}

.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center
}

/* Loading states */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 16, 20, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 8px
}

[data-theme="light"] .loading-overlay {
  background: rgba(248, 249, 250, 0.9)
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px
}

.loading-message {
  color: var(--fg);
  font-size: 14px;
  text-align: center
}

@keyframes spin {
  0% {
    transform: rotate(0deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

/* Button states */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed
}

button.loading {
  position: relative;
  color: transparent
}

button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%)
}

/* Modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 50;
  padding: 2rem 1rem;
  overflow: auto
}

#modal.hidden {
  display: none
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
  padding: 16px;
  margin-top: 2rem;
  overflow: auto;
  animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5)
}

#shopItems .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 8px 0
}

#shopItems .prices {
  color: var(--muted)
}

.shopActions,
.combatActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px
}

.log {
  background: #14151d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  min-height: 80px;
  max-height: 180px;
  overflow: auto;
  margin-top: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px
}

[data-theme="light"] .log {
  background: #f8f9fa
}

.combatItems {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px
}

.combatItems select {
  background: #1a1b25;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  padding: 6px
}

[data-theme="light"] .combatItems select {
  background: #ffffff
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px
}

.settings-grid label {
  display: flex;
  align-items: center;
  gap: 6px
}

.settingsActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px
}

/* Theme toggle */
.theme-toggle-container {
  display: flex;
  align-items: center
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
  min-width: 80px;
  justify-content: center
}

.theme-toggle-btn:hover {
  border-color: var(--accent)
}

.theme-toggle-btn .theme-icon {
  font-size: 16px
}

/* End modal reuse settingsActions */

/* Accessibility helpers */
body.text-large {
  font-size: 18px
}

body.no-anim * {
  transition: none !important;
  animation: none !important
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

/* Focus management */
button:focus,
select:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.keyboard-selected:focus {
  outline: 3px solid var(--accent)
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bg: #000;
    --fg: #fff;
    --panel: #111;
    --border: #fff
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    font-size: 16px
  }

  header {
    padding: 12px 16px
  }

  /* Mobile styles are now handled in mobile.css */
  .btnrow {
    flex-direction: column;
    gap: 8px
  }

  .btnrow button {
    width: 100%;
    padding: 12px;
    margin: 0
  }

  #seedInput {
    margin-bottom: 12px
  }

  footer {
    font-size: 14px;
    padding: 16px 20px
  }
}

@media (max-width: 640px) {

  .shopActions,
  .combatActions {
    position: sticky;
    bottom: -16px;
    background: linear-gradient(180deg, transparent, rgba(15, 16, 20, 0.9));
    padding-bottom: 8px
  }

  .modal-content {
    max-width: 95vw;
    padding: 12px
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px
  }

  .combatActions {
    flex-wrap: wrap
  }

  .combatActions button {
    flex: 1;
    min-width: 80px
  }

  .combatItems {
    flex-direction: column;
    gap: 8px
  }

  .combatItems select {
    width: 100%
  }
}

/* Touch interactions */
@media (hover: none) and (pointer: coarse) {
  #choices button:active {
    background: #2a2b35
  }

  button:active {
    background: #2a2b35
  }

  .keyboard-selected {
    background: #2a2b35
  }
}

/* High resolution displays */
@media (min-width: 1200px) {
  main {
    max-width: 1200px
  }

  #content {
    min-height: 70vh
  }

  #sidebar {
    width: 320px
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  header {
    padding: 8px 16px
  }

  main {
    padding: 8px
  }

  #content {
    min-height: 40vh;
    padding: 12px
  }

  .panel {
    padding: 12px;
    margin-bottom: 8px
  }

  #choices button {
    padding: 12px 16px;
    margin: 4px 0;
    font-size: 16px
  }
}

/* Crafting System Styles */
.crafting-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--fg);
  max-height: calc(90vh - 4rem);
  overflow-y: auto;
}

.crafting-station-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--panel);
  border-radius: 8px;
  border: 2px solid var(--border);
}

.crafting-station-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--accent);
}

.crafting-station-section select {
  width: 100%;
  padding: 0.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.station-description {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.crafting-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--panel);
  border-radius: 8px;
  border: 2px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--fg);
}

.filter-group select,
.filter-group input[type="text"] {
  padding: 0.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-size: 1rem;
}

.filter-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.crafting-recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  max-height: 400px;
  overflow-y: auto;
}

.crafting-recipe-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.crafting-recipe-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(179, 140, 255, 0.2);
}

.crafting-recipe-card.selected {
  border-color: var(--accent);
  background: rgba(179, 140, 255, 0.1);
}

.crafting-recipe-card.favorite::after {
  content: '*';
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ffd700;
  font-size: 1.2rem;
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.recipe-card-name {
  font-weight: bold;
  color: var(--accent);
  margin: 0;
}

.recipe-card-category {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.recipe-card-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0;
}

.recipe-card-result {
  font-size: 0.8rem;
  color: var(--fg);
  font-weight: 600;
}

.recipe-card-status {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.recipe-card-status.can-craft {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.recipe-card-status.cannot-craft {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

.crafting-recipe-details {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.recipe-header h3 {
  margin: 0;
  color: var(--accent);
}

.rarity-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

.rarity-common {
  background: #6c757d;
  color: white;
}

.rarity-uncommon {
  background: #28a745;
  color: white;
}

.rarity-rare {
  background: #007bff;
  color: white;
}

.rarity-epic {
  background: #6f42c1;
  color: white;
}

.rarity-legendary {
  background: #ffd700;
  color: black;
}

.recipe-description {
  margin-bottom: 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.recipe-requirements,
.recipe-ingredients,
.recipe-result {
  margin-bottom: 1.5rem;
}

.recipe-requirements h4,
.recipe-ingredients h4,
.recipe-result h4 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
  font-size: 1rem;
}

.requirement-list,
.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.requirement-item,
.ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.requirement-item.available,
.ingredient-item.available {
  color: #28a745;
}

.requirement-item.missing,
.ingredient-item.missing {
  color: #dc3545;
}

.recipe-result {
  background: rgba(179, 140, 255, 0.1);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

.recipe-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.recipe-actions .primary-btn {
  flex: 1;
}

.crafting-queue {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.crafting-queue h3 {
  margin-top: 0;
  color: var(--accent);
}

#queueItems {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.queue-item-name {
  font-weight: 600;
}

.queue-item-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.queue-item-status.queued {
  background: #ffc107;
  color: black;
}

.queue-item-status.crafting {
  background: #007bff;
  color: white;
}

.queue-item-status.completed {
  background: #28a745;
  color: white;
}

.queue-item-status.failed {
  background: #dc3545;
  color: white;
}

.queue-item-cancel {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.queue-item-cancel:hover {
  background: rgba(220, 53, 69, 0.2);
}

.crafting-stats {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.crafting-stats h3 {
  margin-top: 0;
  color: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
}

.crafting-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

/* ============================================================================
   INVENTORY UI STYLES (Phase 1)
   ============================================================================ */

.inventory-controls {
  margin-bottom: 1.5rem;
}

.inventory-search {
  position: relative;
  margin-bottom: 1rem;
}

.inventory-search input {
  width: 100%;
  padding: 0.75rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 1rem;
}

.inventory-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--fg);
}

.inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.inventory-item {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inventory-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.inventory-item.selected {
  border-color: var(--accent);
  background: rgba(179, 140, 255, 0.1);
  box-shadow: 0 0 0 2px var(--accent);
}

.item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.item-favorite-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.item-favorite-btn:hover {
  opacity: 1;
}

.item-favorite-btn.favorited {
  opacity: 1;
}

.item-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-quantity {
  color: var(--muted);
  font-size: 0.9rem;
}

.item-hotkey {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: auto;
}

.item-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.item-tags .tag {
  background: var(--border);
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.inventory-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
}

.inventory-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.inventory-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================================
   STATISTICS DASHBOARD STYLES (Phase 1)
   ============================================================================ */

.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.chart-container h4 {
  margin: 0 0 1rem 0;
  color: var(--accent);
  font-size: 1rem;
}

.progress-chart {
  margin-top: 0.5rem;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9d7aff);
  border-radius: 12px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.progress-value {
  font-weight: 600;
  color: var(--fg);
  min-width: 50px;
  text-align: right;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bar-chart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  min-width: 80px;
  font-size: 0.9rem;
  color: var(--muted);
}

.bar-container {
  flex: 1;
  height: 28px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.bar-value {
  position: absolute;
  right: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  z-index: 1;
}

/* Achievement Summary Styles */
.achievement-summary {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
}

.achievement-summary-item {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.summary-chart {
  flex-shrink: 0;
}

.summary-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.circle-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.circle-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.circle-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent);
}

.circle-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.summary-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-stat:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-value {
  font-weight: 600;
  color: var(--fg);
  font-size: 1.1rem;
}

.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.category-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.category-name {
  color: var(--muted);
  text-transform: capitalize;
}

.category-progress {
  color: var(--fg);
  font-weight: 600;
}

.achievement-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.achievement-progress-item {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.achievement-progress-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.achievement-progress-item.unlocked {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.achievement-progress-item.hidden-achievement {
  opacity: 0.6;
  filter: blur(2px);
}

.achievement-progress-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.achievement-progress-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.achievement-progress-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 1rem;
}

.achievement-progress-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.achievement-category {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--border);
  color: var(--muted);
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: capitalize;
  margin-top: 0.25rem;
  width: fit-content;
}

/* Progression Modal Styles */
.progression-container {
  max-width: 800px;
  margin: 0 auto;
}

.progression-header {
  background: linear-gradient(135deg, var(--accent, #4a90e2), var(--secondary-accent, #5ba0f2));
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.level-display {
  display: flex;
  align-items: center;
  gap: 15px;
}

.level-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1.1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.xp-info {
  min-width: 200px;
}

.xp-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.xp-bar-fill {
  height: 100%;
  background: white;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.xp-text {
  font-size: 0.9em;
  opacity: 0.9;
}

.stat-points-display {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-points-label {
  display: block;
  font-size: 0.8em;
  margin-bottom: 2px;
  opacity: 0.9;
}

.stat-points-value {
  display: block;
  font-size: 1.5em;
  font-weight: bold;
  color: #ffd700;
}

.stats-section,
.skill-trees-section,
.xp-history-section {
  margin-bottom: 25px;
  background: var(--bg, #f8f9fa);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border, #e9ecef);
}

.stats-section h3,
.skill-trees-section h3,
.xp-history-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--fg, #333);
  border-bottom: 2px solid var(--accent, #4a90e2);
  padding-bottom: 5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  border: 2px solid var(--border, #e9ecef);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--accent, #4a90e2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.stat-name {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--fg, #333);
}

.stat-value {
  background: var(--accent, #4a90e2);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9em;
}

.stat-description {
  font-size: 0.9em;
  color: var(--muted, #666);
  margin-bottom: 10px;
}

.stat-actions {
  display: flex;
  gap: 8px;
}

.stat-upgrade-btn {
  background: var(--success, #28a745);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.stat-upgrade-btn:hover:not(:disabled) {
  background: var(--success-hover, #218838);
}

.stat-upgrade-btn:disabled {
  background: var(--disabled, #6c757d);
  cursor: not-allowed;
}

.skill-tree-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border, #e9ecef);
}

.skill-tab {
  background: var(--bg, #f8f9fa);
  border: 1px solid var(--border, #e9ecef);
  padding: 8px 16px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
}

.skill-tab.active {
  background: white;
  border-bottom-color: white;
  font-weight: bold;
  color: var(--accent, #4a90e2);
}

.skill-tab:hover {
  background: var(--hover, #e9ecef);
}

.skill-tree-content {
  background: white;
  border-radius: 6px;
  padding: 20px;
  border: 1px solid var(--border, #e9ecef);
}

.skill-paths-grid {
  display: grid;
  gap: 15px;
}

.skill-path-card {
  border: 2px solid var(--border, #e9ecef);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.2s ease;
}

.skill-path-card:hover {
  border-color: var(--accent, #4a90e2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skill-path-card.locked {
  opacity: 0.6;
  filter: grayscale(50%);
}

.skill-path-card.chosen {
  border-color: var(--success, #28a745);
  background: rgba(40, 167, 69, 0.05);
}

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

.skill-path-name {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--fg, #333);
}

.skill-path-status {
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
}

.skill-path-status.available {
  background: var(--success, #28a745);
  color: white;
}

.skill-path-status.locked {
  background: var(--disabled, #6c757d);
  color: white;
}

.skill-path-status.chosen {
  background: var(--warning, #ffc107);
  color: black;
}

.skill-path-description {
  font-size: 0.9em;
  color: var(--muted, #666);
  margin-bottom: 10px;
}

.skill-path-requirements {
  font-size: 0.8em;
  color: var(--muted, #666);
  margin-bottom: 10px;
}

.skill-path-bonuses {
  font-size: 0.8em;
  color: var(--success, #28a745);
  margin-bottom: 10px;
}

.skill-path-abilities {
  font-size: 0.8em;
  color: var(--info, #17a2b8);
}

.skill-path-actions {
  margin-top: 10px;
}

.skill-choose-btn {
  background: var(--accent, #4a90e2);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.skill-choose-btn:hover:not(:disabled) {
  background: var(--accent-hover, #3a7bd5);
}

.skill-choose-btn:disabled {
  background: var(--disabled, #6c757d);
  cursor: not-allowed;
}

.xp-history-list {
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border, #e9ecef);
  max-height: 200px;
  overflow-y: auto;
}

.xp-history-item {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-light, #f8f9fa);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.xp-history-item:last-child {
  border-bottom: none;
}

.xp-history-source {
  font-weight: bold;
  color: var(--fg, #333);
}

.xp-history-amount {
  color: var(--success, #28a745);
  font-weight: bold;
}

.xp-history-description {
  font-size: 0.9em;
  color: var(--muted, #666);
  margin-top: 2px;
}

/* World Events Modal Styles */
.world-events-container {
  width: 100%;
}

.active-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-event-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.world-event-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mall mood / tension panel (shared) */
.tension-meter {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 12px;
}

.pace-meter {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 12px;
}

.tension-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.pace-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.tension-bar>.fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #35e3ff, #b38cff, #ff4d8d);
  transition: width 240ms ease;
}

.pace-bar>.fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #38bdf8, #facc15);
  transition: width 240ms ease;
}

.tension-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.pace-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.tension-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tension-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 12px;
  color: var(--fg);
}

.world-event-icon {
  font-size: 24px;
  min-width: 24px;
  text-align: center;
}

.progress-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.progress-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-summary-points {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.progress-summary-points strong {
  color: var(--fg);
}

.progress-summary-points.muted {
  color: var(--muted);
}

.progress-summary .level-tag {
  color: var(--fg);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.progress-summary-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.progress-summary-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #35e3ff, #b38cff);
}

.world-event-content {
  flex: 1;
}

.world-event-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.world-event-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.world-event-category {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.world-event-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.no-events-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.no-events-message p {
  margin: 8px 0;
}

.no-events-message p:first-child {
  font-size: 16px;
  font-weight: 500;
}

/* Sidebar polish (fallback for non-v2 themes) */
.stats-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

#sidebar .stat-row {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

#sidebar .stat-row:last-child {
  margin-bottom: 0;
}

#sidebar .stat-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#sidebar .stat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#sidebar .stat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sidebar .stat-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary, var(--bg));
}

#sidebar .stat-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #9d4edd);
}

#sidebar .stat-fill::after {
  content: none;
}

#sidebar .stat-end {
  min-width: 46px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

.stats-summary-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
}

.stat-title {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-badge {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
}

#sidebar .stat-row.focus {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}

#sidebar .stat-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-delta {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-delta.positive {
  color: #4fffc9;
  border-color: rgba(79, 255, 201, 0.6);
  background: rgba(79, 255, 201, 0.18);
}

.stat-delta.negative {
  color: #ff7070;
  border-color: rgba(255, 112, 112, 0.6);
  background: rgba(255, 112, 112, 0.18);
}

.stat-desc {
  font-size: 11px;
  color: var(--muted);
}

.vitals-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-bottom: 6px;
}

.vitals-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7070, #ff915c);
}

#sidebar .vitals-bar.warning .vitals-bar-fill {
  background: linear-gradient(90deg, #ffc857, #ff915c);
}

#sidebar .vitals-bar.danger .vitals-bar-fill {
  background: linear-gradient(90deg, #ff4d8d, #ff7070);
}

.vitals-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.vitals-statuses,
.now-progress,
.progress-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.status-chip,
.now-progress-chip,
.progress-signal-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-chip.muted,
.now-progress-chip.muted,
.progress-signal-chip.muted {
  color: var(--muted);
}

.now-progress-chip,
.progress-signal-chip {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
}

.quest-summary {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.quest-card {
  list-style: none;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

#sidebar .quest-card.urgent {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 0 12px rgba(79, 255, 201, 0.12);
}

.quest-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 6px;
}

.quest-title {
  color: var(--fg);
  font-weight: 600;
}

.quest-count {
  color: var(--muted);
  font-size: 11px;
}

.quest-next {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.4;
}

.quest-chip {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--panel);
}

.quest-optional {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.quest-alert {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quest-journal .quest-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
