@font-face {
  font-family: 'Futura';
  src: url('/assets/fonts/futuramediumcondensedbt.ttf') format('truetype'),
    url('/assets/fonts/FuturaCondMedium.woff2') format('woff2'),
    url('/assets/fonts/FuturaCondMedium.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@font-face {
  font-family: 'Futura';
  src: url('/assets/fonts/futuramediumcondensedbt.ttf') format('truetype'),
    url('/assets/fonts/FuturaCondMedium.woff2') format('woff2'),
    url('/assets/fonts/FuturaCondMedium.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: fallback;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button {
  touch-action: manipulation;
}

/* Nouvelle palette de couleurs kaki sombre */
:root {
  --background: #1a1812;
  --foreground: #ece4cb;
  --foreground-permanent: #ece4cb;
  --card: #252218;
  --card-foreground: #ece4cb;
  --primary: #626247;
  --primary-dark: #4a4a35;
  --primary-light: #7a7a5a;
  --secondary: #300941;
  --muted: #2a2820;
  --muted-foreground: #9a9680;
  --accent-red: #c63032;
  --accent-green: #81cbd6;
  --dust: #ece4cb;
  --border: #3a3830;
  --yellow: #ffdb2c;
  --purple: #300941;
  --cyan: #81cbd6;
}

/* Mode clair - beige en fond, kaki en écriture */
body.light-mode {
  --background: #ece4cb;
  --foreground: #2a2820;
  --card: #f8f5ed;
  --card-foreground: #2a2820;
  --primary: #626247;
  --primary-dark: #4a4a35;
  --primary-light: #7a7a5a;
  --muted: #e0d9c5;
  --muted-foreground: #6a6555;
  --dust: #2a2820;
  --border: #d0c9b5;
  --accent-red: #c63032;
  --accent-green: #2a8a95;
}

body.light-mode {
  background: var(--background) !important;
}

body.light-mode .header {
  background: var(--background);
}

body.light-mode .screen {
  background: var(--background);
}

body.light-mode .settings-btn {
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
}

body.light-mode .back-btn-circle {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

/* Logo en mode clair - utiliser une teinte sombre */
body.light-mode .logo-img {
  filter: brightness(0) saturate(100%) invert(12%) sepia(8%) saturate(1000%) hue-rotate(20deg) brightness(95%) contrast(90%);
}

/* Tous les logos du dossier assets/logo en mode clair - noir (sauf logo-main qui a sa propre image) */
body.light-mode .logo,
body.light-mode .start-logo,
body.light-mode img[src*="assets/logo"]:not(.logo-main),
body.light-mode img[data-src*="assets/logo"] {
  filter: brightness(0);
}

body.light-mode .logo-o-lottie svg path {
  fill: #2a2820 !important;
  stroke: #2a2820 !important;
}

/* Cacher complètement le Lottie en mode clair */
body.light-mode .logo-o-lottie {
  display: none !important;
}

body.light-mode .menu-title {
  color: var(--foreground);
}

body.light-mode .menu-btn {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .menu-btn .btn-title {
  color: var(--foreground);
}

body.light-mode .menu-btn .btn-subtitle {
  color: var(--muted-foreground);
}

body.light-mode .menu-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
}

body.light-mode .menu-btn.btn-extra {
  background-color: #2a2820;
  border-color: #2a2820;
  box-shadow: 0 4px 12px rgba(42, 40, 32, 0.2);
}

body.light-mode .menu-btn.btn-extra .btn-title {
  color: #ece4cb;
}

body.light-mode .menu-btn.btn-extra .btn-subtitle {
  color: #b5ad98;
}

body.light-mode .menu-btn-big {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .menu-btn-big .btn-title-big {
  color: var(--foreground);
}

body.light-mode .menu-btn-big.btn-primary-big {
  background: #2a2820;
  border-color: #2a2820;
  box-shadow: 0 4px 12px rgba(42, 40, 32, 0.2);
}

body.light-mode .menu-btn-big.btn-primary-big .btn-title-big {
  color: #ece4cb;
}

body.light-mode .menu-difficulty-bar {
  background: linear-gradient(180deg, #7a7a5a 0%, #626247 100%);
  border-color: #8a8a6a;
  color: #ece4cb;
}

body.light-mode .difficulty-number {
  color: #ece4cb;
}

body.light-mode .discover-btn {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .discover-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
}

body.light-mode .settings-panel {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-overlay {
  background: rgba(236, 228, 203, 0.92);
  backdrop-filter: blur(8px);
}

body.light-mode .modal-content {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .setting-label {
  color: var(--foreground);
}

body.light-mode .slider {
  background: var(--muted);
}

body.light-mode .slider::-webkit-slider-thumb {
  background: var(--primary);
}

body.light-mode .toggle-switch {
  background: var(--muted);
}

body.light-mode .toggle-switch.active {
  background: var(--primary);
}

body.light-mode .toggle-knob {
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Format mobile avec container centré */
html,
body {
  height: 100dvh;
  background: #0a0908;
}

html.light-mode,
html.light-mode body {
  background: #ece4cb !important;
}

/* Autres éléments en mode clair */
body.light-mode #gameContainer {
  background: var(--background);
}

body.light-mode .loading-screen {
  background: var(--background);
}

body.light-mode p,
body.light-mode span,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode label {
  color: var(--foreground);
}

body.light-mode .btn,
body.light-mode button:not(.toggle-switch):not(.menu-btn):not(.menu-btn-big):not(.discover-btn):not(.back-btn-circle):not(.settings-btn):not(.difficulty-continue-btn):not(.key-validate):not(.skipDialogButton) {
  background-color: var(--card);
  border-color: var(--border);
}



body.light-mode .btn-primary {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}

body.light-mode .btn-primary:hover {
  background: var(--muted);
  border-color: var(--primary);
}

/* ========== IMAGES EN MODE CLAIR ========== */
/* Ne PAS filtrer les images de contenu, seulement le logo */
body.light-mode img:not(.logo-img):not(.character-detail-img):not(.language-label img) {
  filter: none !important;
}

/* Character cards en mode clair */
body.light-mode .character-card {
  background: var(--card);
  border-color: var(--border);
}

body.light-mode .character-card-name {
  background: var(--muted);
  color: var(--foreground);
}

body.light-mode .character-card:hover {
  border-color: var(--primary);
}

body.light-mode .character-card.empty {
  opacity: 0.5;
}

/* Characters screen */
body.light-mode .characters-content {
  background: var(--background);
}

body.light-mode .characters-title {
  color: var(--foreground);
}

body.light-mode .characters-region {
  color: var(--muted-foreground);
}

body.light-mode .characters-actions .close-btn {
  color: var(--foreground);
}

/* Character detail */
body.light-mode .character-name {
  color: var(--foreground);
}

body.light-mode .character-description {
  color: var(--foreground);
}

body.light-mode .character-description::before {
  background: linear-gradient(90deg, transparent, rgba(42, 40, 32, 0.35), transparent);
}

body.light-mode .character-description .role {
  color: var(--primary);
}

body.light-mode .character-image-frame {
  border-color: rgba(42, 40, 32, 0.15);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

/* Init screens */
body.light-mode .initScreen,
body.light-mode .initScreen2 {
  background: var(--background);
}

body.light-mode .initScreen h2,
body.light-mode .initScreen2 h2 {
  color: var(--foreground);
}

body.light-mode .initScreen p,
body.light-mode .initScreen2 p {
  color: var(--muted-foreground);
}

body.light-mode .characterGrid button {
  border-color: var(--border);
  color: var(--foreground-permanent);
}

body.light-mode .characterGrid button:hover {
  border-color: var(--primary);
}

/* Player list en mode clair */
body.light-mode .playerList button {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(236, 228, 203, 0.92) 90%, rgba(236, 228, 203, 0.97) 100%), var(--bg-image);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .characterGrid button.is-taken {
  opacity: 0.4;
}

body.light-mode .characterGrid button.selected {
  border-color: var(--primary);
  background: var(--muted);
}

/* Detail container */
body.light-mode .detailContainer {
  background: var(--card);
  border-color: var(--border);
}

body.light-mode .detailContainer .characterName {
  color: var(--foreground);
}

body.light-mode .detailContainer .characterDescription {
  color: var(--muted-foreground);
}

/* Dialogs et actions */
body.light-mode .dialogWrapper {
  background-color: rgba(236, 228, 203, 0.9);
}

body.light-mode .dialogWrapper .dialogTextContainer {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .dialog-box {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .dialog-character-name {
  color: var(--primary);
}

/* Action wrapper */
body.light-mode .actionWrapper {
  background: var(--background);
}

body.light-mode .actionQuestion {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .actionChoice {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .actionChoice:hover {
  background: var(--muted);
  border-color: var(--primary);
}

/* End wrapper */
body.light-mode .endWrapper {
  background: var(--background);
}

body.light-mode .endWrapper .text_indication {
  color: var(--foreground);
}

body.light-mode .endWrapper .next_step {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

/* Player select */
body.light-mode .playerSelect {
  background: var(--background);
}

/* Code view */
body.light-mode .codeView {
  background: var(--background);
}

body.light-mode .codeInput {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode .codeInput::placeholder {
  color: var(--muted-foreground);
}

/* QR View */
body.light-mode .qrView {
  background: var(--background);
}

/* Progression view */
body.light-mode .progressionView {
  background: var(--background);
}

body.light-mode .progression-title {
  color: var(--foreground);
}

body.light-mode .progression-step {
  background: var(--card);
  border-color: var(--border);
}

body.light-mode .progression-step-title {
  color: var(--foreground);
}

body.light-mode .progression-step-desc {
  color: var(--muted-foreground);
}

/* Inputs généraux */
body.light-mode input,
body.light-mode textarea,
body.light-mode select {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
  color: var(--muted-foreground);
}

/* SVG icons */
body.light-mode svg {
  color: inherit;
}

body.light-mode .close-btn svg,
body.light-mode .back-btn-circle svg {
  stroke: var(--foreground);
}

/* Discover modal en mode clair */
body.light-mode #discoverModal {
  background: var(--background);
}

body.light-mode .discover-modal-content {
  color: var(--foreground);
}

/* Menu wrapper */
body.light-mode .menuWrapper {
  background: var(--background);
}

/* Init wrapper */
body.light-mode .initWrapper {
  background: var(--background);
}

body.light-mode .initWrapper>p {
  color: var(--muted-foreground);
}

body.light-mode .initWrapper .playerNumber {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

/* Spiral img (loading) */
body.light-mode .spiral-img {
  filter: invert(10%) sepia(10%) saturate(500%) hue-rotate(20deg);
}

/* Video elements - ne pas filtrer */
body.light-mode video {
  filter: none !important;
}

body {
  font-family: "Futura", "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100dvh;
  overflow-x: hidden;
  /* max-width: 420px; */
  margin: 0 auto;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

/* ========== LOADING SCREEN ========== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  /* max-width: 420px; */
  height: 100%;
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.logo-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.logo-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.logo-o-lottie {
  position: absolute;
  top: 50%;
  left: 48.9%;
  width: 25.7%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Agrandissement du logo PROSA sur l'écran de chargement */
.logo-main {
  width: 280px;
  height: auto;
}

body.light-mode .logo-main {
  width: 320px;
}

.spinner-spiral {
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
}

/* Nouveau style pour l'image du serpent spirale */
.spiral-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Suppression du filtre invert - le logo est déjà beige */
}

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

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

/* Fun fact card avec style kaki */
.fun-fact-card {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
}

.fun-fact-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--foreground);
}

.fun-fact-card p {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ========== SCREENS ========== */
.screen {
  background: var(--background);
  display: flex;
  flex-direction: column;
  height: 100%;
  /* max-width: 600px; */
  margin: 0 auto;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.screen.hidden {
  display: none;
}

.menuWrapper {
  padding: 40px 24px 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .menuWrapper {
    padding: 20px 16px;
  }
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 16px 20px;
  position: relative;
  column-gap: 10px;
}

@media (max-width: 480px) {
  .header {
    padding: 15px 16px;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex: 2;
}

.logo-small {
  display: flex;
  align-items: center;
}

.logo-center {
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  /* Suppression du filtre invert pour garder le logo noir */
}

@media (max-width: 480px) {
  .logo-img {
    height: 26px;
  }
}

.btn-primary {
  padding: 16px 24px;
  width: 100%;
  border-radius: 12px;
  background-color: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  transition: 0.3s ease;
  max-width: 600px;
}

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

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 2;
  column-gap: 20px;
  row-gap: 10px;
  flex-wrap: wrap-reverse;
}

.settings-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 24, 18, 0.8);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.settings-btn:hover {
  border-color: var(--dust);
  background: var(--card);
}

.settings-btn:active {
  transform: scale(0.95);
}

.settings-btn svg {
  width: 20px;
  height: 20px;
}

/* ========== MENU SCREEN - AMELIORE ========== */
.menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Titre du menu amélioré */
.menu-title {
  font-family: 'Futura', "Futura PT", "Century Gothic", sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  margin: 40px 0px;
  letter-spacing: 0.05em;
  color: var(--foreground);
}

@media (max-width: 480px) {
  .menu-title {
    font-size: 1.2rem;
    margin: 30px 0px;
  }
}

/* Boutons du menu améliorés avec effet hover */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto 0;
}

/* Page découvrir avec titre rapproché des boutons */
.discover-wrapper {
  justify-content: flex-start;
}

.discover-buttons {
  margin: 8px 0 auto 0;
}

.minigames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.minigame-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 45%),
    var(--card);
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.minigame-thumbnail {
  width: 100%;
  max-height: 140px;
  min-height: 140px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.minigame-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(129, 203, 214, 0.18), transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.minigame-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-light);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.minigame-card:hover::after {
  opacity: 1;
}

.minigame-title {
  font-family: 'Futura', "Futura PT", "Century Gothic", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 14px 16px 0;
}

.minigame-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent-green);
  margin-top: auto;
  padding: 8px 16px 14px;
}

.minigame-cta::after {
  content: "→";
  font-size: 1rem;
}

@media (max-width: 520px) {
  .minigames-grid {
    grid-template-columns: 1fr;
  }
}

.menu-btn {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

@media (max-width: 480px) {
  .menu-btn {
    padding: 18px;
  }
}

.menu-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.menu-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
  transform: translateX(4px);
}

.menu-btn.btn-extra {
  background-color: var(--foreground);
}

.menu-btn.btn-extra .btn-title {
  color: var(--background);
}

.menu-btn:hover::before {
  transform: scaleY(1);
}

.menu-btn:active {
  transform: translateX(4px) scale(0.99);
}

.btn-title {
  display: block;
  font-family: 'Futura', "Futura PT", "Century Gothic", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
}

.btn-subtitle {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* Icône décorative pour les boutons */
.menu-btn-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--primary);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.menu-btn:hover .menu-btn-icon {
  opacity: 1;
}

/* ========== CODE SCREEN ========== */
.code-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding: 20px 40px;
  column-gap: 10px;
}

@media (max-width: 480px) {
  .code-header {
    padding: 16px 20px;
    margin-bottom: 30px;
  }
}

.code-title-section {
  flex: 1;
}

.code-title {
  font-family: 'Futura', "Futura PT", "Century Gothic", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--foreground);
}

.code-subtitle {
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.close-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn svg {
  width: 28px;
  height: 28px;
}

.code-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  margin-top: auto;
}

.code-digit {
  width: 50px;
  height: 60px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--foreground);
}

.code-digit.filled {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--foreground);
}

.code-digit.error {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
  animation: shake 0.4s ease;
}

@keyframes shake {

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

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

/* ========== KEYPAD ========== */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 300px;
  margin: 0 auto;
  padding-bottom: 40px;
  margin-bottom: auto;
  touch-action: manipulation;
}

@media (max-width: 480px) {
  .keypad {
    gap: 12px;
    max-width: 280px;
    padding-bottom: 30px;
  }
}

.key {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  justify-self: center;
}

@media (max-width: 480px) {
  .key {
    width: 70px;
    height: 70px;
    font-size: 1.6rem;
  }
}

.key:hover {
  background: var(--muted);
  border-color: var(--primary);
}

.key:active {
  transform: scale(0.95);
  background: var(--primary);
}

.key-delete {
  background: var(--card);
}

.key-delete svg {
  width: 28px;
  height: 28px;
  color: var(--foreground);
}

.key-validate {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: var(--background);
}

.key-validate svg {
  width: 32px;
  height: 32px;
  color: var(--background);
}

.key-validate:hover {
  background: #6bb5c0;
  border-color: #6bb5c0;
}

/* ========== CHARACTERS SCREEN ========== */
.characters-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px;
}

.characters-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.characters-title {
  font-family: 'Futura', "Futura PT", "Century Gothic", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--foreground);
}

.characters-region {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.characters-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.characters-actions .close-btn {
  color: var(--accent-red);
}

.characters-actions .close-btn svg {
  width: 24px;
  height: 24px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  cursor: pointer;
}

.filter-btn svg {
  width: 16px;
  height: 16px;
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.character-card {
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.character-card:hover {
  transform: scale(1.02);
  border-color: var(--primary);
}

.character-card-image {
  flex: 1;
  background-size: cover;
  background-position: center;
  border-radius: 11px 11px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.character-card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.12;
}

.character-card-name {
  padding: 8px;
  font-size: 0.75rem;
  text-align: center;
  font-weight: 600;
  background: var(--muted);
  color: var(--foreground);
  border-radius: 0 0 11px 11px;
}

.character-card.empty {
  cursor: default;
  opacity: 0.5;
}

.character-card.empty:hover {
  transform: none;
  border-color: var(--border);
}

/* ========== CHARACTER DETAIL SCREEN ========== */
.character-detail-content {
  flex: 1;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-items: start;
  justify-items: center;
  padding: 18px 20px 24px;
  position: relative;
  max-height: 85vh;
  overflow: hidden;
}

.character-detail-media-block {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  justify-items: center;
}

.character-detail-text-block {
  display: grid;
  width: 100%;
  max-width: 560px;
  justify-items: center;
}

.character-detail-close {
  position: fixed;
  top: 20px;
  right: 20px;
  color: var(--accent-red);
  z-index: 600;
}

.character-card-large {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  width: 100%;
  max-width: 560px;
  margin-bottom: 8px;
}

.character-image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(236, 228, 203, 0.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  margin-bottom: 8px;
}

.character-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-image-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.12;
}

/* Custom Video Controls */
.character-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(236, 228, 203, 0.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  margin-bottom: 8px;
}

.character-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.12;
  display: block;
}

.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-video-wrapper:hover .custom-video-controls {
  opacity: 1;
}

.video-play-btn {
  background: rgba(98, 98, 71, 0.4);
  border: 1px solid rgba(236, 228, 203, 0.2);
  color: var(--foreground);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.video-play-btn:hover {
  background: rgba(129, 203, 214, 0.3);
  border-color: rgba(129, 203, 214, 0.5);
  color: var(--accent-green);
  transform: scale(1.1);
}

.video-play-btn:active {
  transform: scale(0.95);
}

.video-play-btn svg {
  width: 20px;
  height: 20px;
}

.video-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.video-progress-bar {
  position: absolute;
  height: 3px;
  background: var(--accent-red);
  width: 0%;
  pointer-events: none;
}

.video-progress-slider {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.video-progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-red);
  border-radius: 50%;
  cursor: pointer;
}

.video-progress-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent-red);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.video-time {
  display: flex;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--foreground);
  flex-shrink: 0;
}

.video-time span {
  min-width: 40px;
  text-align: center;
}

.video-fullscreen-btn {
  background: rgba(98, 98, 71, 0.4);
  border: 1px solid rgba(236, 228, 203, 0.2);
  color: var(--foreground);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.video-fullscreen-btn:hover {
  background: rgba(129, 203, 214, 0.3);
  border-color: rgba(129, 203, 214, 0.5);
  color: var(--accent-green);
  transform: scale(1.1);
}

.video-fullscreen-btn:active {
  transform: scale(0.95);
}

.video-fullscreen-btn svg {
  width: 18px;
  height: 18px;
}

.video-volume-btn {
  background: rgba(98, 98, 71, 0.4);
  border: 1px solid rgba(236, 228, 203, 0.2);
  color: var(--foreground);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.video-volume-btn:hover {
  background: rgba(129, 203, 214, 0.3);
  border-color: rgba(129, 203, 214, 0.5);
  color: var(--accent-green);
  transform: scale(1.1);
}

.video-volume-btn:active {
  transform: scale(0.95);
}

.video-volume-btn svg {
  width: 18px;
  height: 18px;
}

.video-volume-slider {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
}

.video-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  cursor: pointer;
}

.video-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.character-name {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 6px 0 0;
  border-top: none;
  color: var(--foreground);
  letter-spacing: 0.05em;
}

.character-description {
  width: 100%;
  max-width: 560px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 2px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--foreground);
  max-height: 34vh;
  min-height: 22vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.character-description::before {
  content: "";
  display: block;
  height: 1px;
  width: 70%;
  margin: 0 auto 10px;
  background: linear-gradient(90deg, transparent, rgba(236, 228, 203, 0.35), transparent);
}

.character-description .role {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--dust);
}

/* ========== SETTINGS MODAL ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: rgba(26, 24, 18, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

@media (max-width: 480px) {
  .modal-content {
    border-radius: 16px;
    padding: 16px;
    max-height: 85vh;
  }
}

.cinematic-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cinematic-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.cinematic-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cinematic-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cinematic-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--foreground);
  margin: 0;
}

.cinematic-season {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cinematic-description {
  font-size: 0.95rem;
  color: var(--foreground);
  line-height: 1.5;
  margin: 0;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-card:hover .play-overlay {
  opacity: 1;
}

.settings-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 320px;
  position: relative;
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent-red);
}

.close-modal-btn svg {
  width: 28px;
  height: 28px;
}

.setting-item {
  margin-bottom: 24px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--foreground);
}

.slider-container {
  width: 100%;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--muted);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-switch {
  width: 56px;
  height: 32px;
  border-radius: 16px;
  background: var(--muted);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active .toggle-knob {
  transform: translateX(24px);
}

/* ========== SUCCESS FEEDBACK ========== */
.success-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: rgba(129, 203, 214, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.success-overlay.show {
  opacity: 1;
  visibility: visible;
}

.success-content {
  text-align: center;
  color: var(--background);
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.success-text {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===================================
============= Init Screens =============
====================================== */
.initWrapper {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
  gap: 10px;
  font-size: 2rem;
  text-align: center;
  overflow-y: auto;
}

.initWrapper>p {
  margin: 0;
  font-weight: 600;
}

.initWrapper .playerNumber {
  color: var(--background);
  background-color: var(--foreground);
  padding: 3px 14px;
  font-weight: 900;
  margin-right: 4px;
}

.initScreen1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 600px;
  gap: 30px;
  position: relative;
  padding: 0;
  flex: 1;
}

.initScreen1 .playerCountContainer {
  display: flex;
  flex-direction: row;
  border-radius: 20px;
  overflow: hidden;
  font-size: 3rem;
  justify-content: space-between;
  align-items: center;
  border: 3px solid var(--border);
  gap: 0;
  align-self: center;
  width: auto;
  font-weight: 900;
  margin: auto 0;
}

.initScreen1 .playerCountContainer button {
  background-color: var(--card);
  font-weight: 900;
  color: var(--foreground);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  font-size: 2.2rem;
  width: 4.5rem;
  height: 4.5rem;
}

.initScreen1 .playerCountContainer span {
  padding: 0 4rem;
  min-width: 8rem;
  text-align: center;
}

.initScreen1 .playerCountContainer button:hover {
  background: var(--muted);
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .initScreen1 {
    gap: 20px;
    padding: 0 25px;
  }

  .initScreen1 .playerCountContainer {
    font-size: 3rem;
    border-radius: 20px;
    border-width: 2px;
    width: 100%;
    max-width: 280px;
    margin: auto 0;
  }

  .initScreen1 .playerCountContainer button {
    padding: 12px;
    font-size: 2.2rem;
    width: 4.5rem;
    height: 4.5rem;
  }

  .initScreen1 .playerCountContainer span {
    padding: 0 1.2rem;
    min-width: 3.5rem;
  }
}

.initScreen2 {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100%;
  justify-content: center;
  height: 100%;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  gap: 15px;
}

.initScreen2 .locationSection {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.initScreen2 .locationSection p {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: left;
}

.initScreen2 .characterGrid {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 8px;
  height: 100%;
}

.initScreen2 .characterGrid button {
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: end;
  align-items: end;
  font-family: Futura;
  font-size: 1rem;
  color: white;
  padding: 8px;
  font-weight: 900;
  background: #000;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.69) 0%, rgba(0, 0, 0, 0) 58%);
  background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.69) 0%, rgba(0, 0, 0, 0) 58%);
  flex: 1;
  background-position: top center;
  flex-basis: 15%;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: pointer;
}

.initScreen2 .characterGrid button.is-taken {
  filter: grayscale(1);
  opacity: 0.8;
  cursor: default;
}

.initScreen3 {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  justify-content: center;
  align-items: center;
  max-width: 600px;
}

/* ===============================
============ Player list =========
================================== */
.playerList {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.playerList button {
  flex: 1;
  background-position-x: left;
  max-height: 6rem;
  background-position-y: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: end;
  align-items: center;
  padding: 10px 20px;
  color: var(--foreground);
  font-family: Futura;
  border-radius: 15px;
  border: 2px solid var(--border);
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(22, 20, 20, 0.92) 90%, rgba(22, 22, 22, 0.97) 100%), var(--bg-image);
}

.playerList button div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: end;
}

.playerList button span {
  font-size: 1.5rem;
}

.playerList button p {
  font-size: 0.8rem;
}

/* ============================================
============ Character Select details =========
=============================================== */
.detailContainer {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 10dvh 5dvh;
  gap: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 10;
  transition: .2s ease-in-out;
  opacity: 0;
  backdrop-filter: blur(25px);
  background-color: rgba(116, 100, 83, 0.7);
  align-items: start;
  justify-items: center;
  align-content: start;
  overflow-y: auto;
}

@media (max-width: 480px) {
  .detailContainer {
    padding: 5dvh 3dvh;
    gap: 16px;
  }
}

.detailContainer .characterPicture {
  height: calc(50vh - 100px);
  width: auto;
  border: 3px solid var(--border);
  margin-bottom: 8px;
}

.detailContainer .characterName {

  margin: 10px 0px;
  font-size: 1.5rem;
  font-weight: 900;
}

.detailContainer .characterDescription {
  display: block;
  max-width: 700px;
  text-align: center;
  line-height: 1.5;
  padding: 10px 20px;
  max-height: 28vh;
  min-height: 22vh;
  overflow-y: auto;
  font-size: 1rem;
}

.detailContainer .character-media-block {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 700px;
  justify-items: center;
}

.detailContainer .character-text-block {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  width: 100%;
  max-width: 700px;
  justify-items: center;
}

.detailContainer .character-text-block .btn-primary {
  width: 100%;
  max-width: 420px;
}

/* Character name row with language switch */
.character-name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.character-language-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: -6px;
  margin-bottom: 12px;
}

.character-language-row--inline {
  width: auto;
  margin: 0;
  justify-content: flex-end;
  gap: 10px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
}

.language-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.language-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
}

.language-label img {
  background: transparent;
  border: none;
  outline: none;
}

.language-slider {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--muted);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.language-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: var(--foreground);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

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

.language-switch input:checked+.language-slider::before {
  transform: translateX(20px);
}

/* ===================================
============ Actions Wrapper =========
====================================== */
#gameContainer {
  position: relative;
}

.dialogWrapper,
.playerSelect,
.endWrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.dialogWrapper {
  justify-content: end;
  gap: 15px;
}

.playerSelect,
.endWrapper {
  justify-content: center;
  gap: 4px;
}

.dialogWrapper {
  align-items: end;
  background-size: cover;
  background-position: center;
  position: relative;
}

.dialogWrapper .dialogTextContainer {
  padding: 30px;
  width: 100%;
  font-size: 1.4rem;
  min-height: 10rem;
  display: flex;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  /* Avoid text select */
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.dialogWrapper div .characterNameBox {
  position: absolute;
  top: -17px;
  left: 14px;
  padding: 5px 15px;
  background: var(--card);
  border-radius: 10px;
  font-size: 1.2rem;
  transition: .2s ease-in-out;
  opacity: 0;
}

.dialogWrapper div .characterNameBox.shown {
  opacity: 1;
}

.dialogWrapper div .characterNameBox span {
  filter: invert(1) grayscale(1) brightness(calc(130 / 100)) contrast(9000);
}

.dialogWrapper .skipDialogButton {
  padding: 10px 20px;
  display: flex;
  background: var(--foreground);
  border-radius: 15px;
  border: 1px solid var(--border);
  color: var(--background);
  font-weight: 500;
  z-index: 100;
}

.dialogWrapper .foregroundImage {
  position: absolute;
  width: 100%;
  height: 80%;
  top: 0;
  left: 0;
  background-size: 120%;
  background-position: center bottom;
  filter: drop-shadow(-5px -5px 11px #00000047);
  opacity: 0;
  transition: .2s cubic-bezier(0, .29, .85, .94);
  background-repeat: no-repeat;
  bottom: 0%;
  left: 50%;
  transform: translate(-50%, 1%);
  margin: auto auto 10% auto;
}

.dialogWrapper .foregroundImage.shown {
  opacity: 1;
  transform: translate(-50%, 0%);
}

.actionWrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  gap: 24px;
  justify-content: center;
}

.actionQuestion {
  padding: 24px;
  width: 100%;
  font-size: 1.3rem;
  min-height: 8rem;
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.actionChoices {
  display: grid;
  gap: 12px;
}

@media (min-width: 600px) {
  .actionChoices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.actionChoiceButton {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  color: var(--foreground);
  font-size: 1rem;
  transition: all 0.2s ease;
  min-height: 56px;
}

.actionChoiceButton:hover {
  background: var(--muted);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.actionChoiceButton:active {
  transform: translateY(0) scale(0.99);
}

.actionChoiceButton:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* EndWrapper */
.endWrapper {
  position: absolute;
  max-width: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: .2s ease-in-out;
  opacity: 0;
  backdrop-filter: blur(25px);
  background-color: rgba(0, 0, 0, 0.25);
}

.endWrapper.show,
.detailContainer.show {
  opacity: 1;
}

.endWrapper .text_indication {
  font-size: 2.4rem;
  max-width: 20rem;
  text-align: center;
}

.endWrapper .next_step {
  padding: 20px 100px;
  font-size: 3rem;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  font-weight: 900;
  text-align: center;
}

#debugBtn {
  z-index: 2000;
}

/* Language Selection View */
.language-buttons-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 20px;
}

.language-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 40px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--foreground);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-btn:hover {
  background: var(--primary);
  border-color: var(--primary-light);
  transform: translateY(-4px);
}

.language-btn:active {
  transform: translateY(-2px);
}

.language-btn svg {
  width: 40px;
  height: 40px;
  stroke: var(--accent-green);
}

.language-btn.french-btn {
  border-color: #002395;
}

.language-btn.corsican-btn {
  border-color: #c63032;
}

.initScreen1-5 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 20px;
}

/* Language Selection in Character Modal */
.language-selection-container {
  width: 100%;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 15px 0;
}

.language-title {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 15px;
}

.language-buttons-wrapper {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.language-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 25px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.language-choice-btn span:first-child {
  font-size: 2rem;
}

.language-choice-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.language-choice-btn.active {
  background: var(--primary);
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(129, 203, 214, 0.3);
}

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

/* ========== SPLASH VIEW ========== */
.splashWrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.splash-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  max-width: 600px;
}

.splash-btn {
  padding: 20px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.splash-btn-primary {
  background-color: var(--primary);
  color: var(--foreground);
  border: 2px solid var(--primary);
}

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

.splash-btn-secondary {
  background-color: var(--card);
  color: var(--foreground);
  border: 2px solid var(--primary);
}

.splash-btn-secondary:hover {
  background-color: var(--muted);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

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

/* ========== DIFFICULTY VIEW ========== */
.difficulty-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 15px;
  width: 100%;
  height: 350px;
  max-width: 500px;
  padding: 0;
  margin: auto 0;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .difficulty-container {
    height: 300px;
    gap: 10px;
  }
}

.difficulty-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  flex: 1;
  max-width: 150px;
  height: 100%;
}

.aleasWrapper {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
}

@media (max-width: 480px) {
  .difficulty-gauge-wrapper {
    gap: 10px;
    max-width: 100px;
  }
}

.difficulty-gauge {
  width: 100%;
  min-height: 120px;
  background: var(--muted);
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  position: relative;
}

@media (max-width: 480px) {
  .difficulty-gauge {
    min-height: 100px;
    padding-bottom: 15px;
    border: 2px solid transparent;
  }
}

.difficulty-gauge:hover {
  background: var(--primary-dark);
  border-color: var(--primary);
  transform: scale(1.05);
}

.difficulty-gauge.selected {
  background: var(--primary);
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(129, 203, 214, 0.5);
}

.gauge-value {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--foreground);
  transition: color 0.3s ease;
}

.difficulty-gauge:hover .gauge-value,
.difficulty-gauge.selected .gauge-value {
  color: var(--foreground-permanent);
}

@media (max-width: 480px) {
  .gauge-value {
    font-size: 2.5rem;
  }
}

.gauge-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

@media (max-width: 480px) {
  .gauge-label {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }
}

.info-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 24, 18, 0.8);
  border: 1.5px solid var(--border);
  color: var(--foreground);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.info-btn:hover {
  border-color: var(--dust);
  background: var(--card);
}

.info-btn:active {
  transform: scale(0.95);
}

.back-btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 24, 18, 0.8);
  border: 1.5px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 500;
  backdrop-filter: blur(10px);
}

.back-btn-circle svg {
  width: 20px;
  height: 20px;
}

.back-btn-circle:hover {
  border-color: var(--dust);
  background: var(--card);
}

.back-btn-circle:active {
  transform: scale(0.95);
}

/* Back button positioning in modals */
.modal-overlay>.back-btn-circle,
.detailContainer>.back-btn-circle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 600;
}

@media (max-width: 480px) {

  .modal-overlay>.back-btn-circle,
  .detailContainer>.back-btn-circle {
    top: 15px;
    left: 15px;
  }
}

.difficulty-battery {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--foreground);
}

.battery-body.hidden {
  display: none;
}

.battery-body {
  position: relative;
  width: 42px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: rgba(26, 24, 18, 0.8);
  display: flex;
  align-items: center;
  padding: 2px;
  backdrop-filter: blur(10px);
}

.battery-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--foreground);
  transition: width 0.25s ease;
}

.battery-cap {
  position: absolute;
  right: -5px;
  top: 6px;
  width: 4px;
  height: 10px;
  border-radius: 2px;
  background: var(--foreground);
}

.battery-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--background);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.difficulty-battery[data-difficulty="10"] .battery-label {
  color: var(--foreground);
}

.difficulty-info-modal {
  max-width: 500px;
  padding: 40px 30px;
}

.difficulty-info-modal .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.difficulty-info-modal .close-btn svg {
  width: 24px;
  height: 24px;
}

.difficulty-info-modal .close-btn:hover {
  color: var(--accent-red);
}

.difficulty-continue-btn {
  width: 100%;
  max-width: 500px;
  padding: 16px 24px;
  font-size: 1.1rem;
  margin-bottom: 0;
  flex-shrink: 0;
  opacity: 0;
}

.player-select-title {
  font-size: 1.4rem;
  font-weight: 400;
  text-align: left;
  margin-top: 0;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  color: var(--foreground);
}

@media (max-width: 480px) {
  .difficulty-continue-btn {
    font-size: 1rem;
    padding: 14px 20px;
  }
}

/* ========== IN-GAME MENU (Figma Design) ========== */
.menuWrapper-ingame {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 24px;
}

.menu-title-left {
  text-align: left;
  margin-bottom: 30px;
}

.menu-content-ingame {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex: 1;
}

.menu-difficulty-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  width: 50px;
  min-width: 50px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: 999px;
  color: var(--foreground);
  position: relative;
  overflow: hidden;
}

.menu-difficulty-bar span {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  position: absolute;
  bottom: 50%;
}

.menu-difficulty-bar .difficulty-indicator {
  width: 100%;
  background-color: var(--primary);
}

.menu-buttons-ingame {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.menu-btn-big {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: start;
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
  color: var(--foreground);
  background: var(--card);
}

.menu-btn-big:hover {
  background: var(--muted);
  border-color: var(--primary);
}

.menu-btn-big.btn-primary-big {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

.menu-btn-big.btn-primary-big:hover {
  background: var(--dust);
  border-color: var(--dust);
}

.menu-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 30px;
  margin-top: auto;
}

.discover-btn {
  flex: 1;
  padding: 14px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.discover-btn:hover {
  background: var(--muted);
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .menuWrapper-ingame {
    padding: 16px;
  }

  .menu-content-ingame {
    gap: 12px;
  }

  .menu-difficulty-bar {
    width: 45px;
    min-width: 45px;
  }

  .difficulty-number {
    font-size: 1.5rem;
  }

  .menu-btn-big {
    padding: 20px 24px;
    border-radius: 20px;
  }

  .menu-footer {
    padding-top: 20px;
    gap: 12px;
  }

  .discover-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* ========== DISCOVER UNIVERSE MODAL ========== */
#discoverModal {
  position: relative;
}

#discoverModal>.back-btn-circle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 600;
}

.discover-modal-content {
  background: transparent;
  padding: 40px 24px;
  width: 100%;
  max-width: 500px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.discover-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 480px) {
  #discoverModal>.back-btn-circle {
    top: 15px;
    left: 15px;
  }

  .discover-modal-content {
    padding: 30px 20px;
    margin: 16px;
  }
}

/* ========================================
============ GAME OVER PAGE ===============
=========================================== */
.game-over-wrapper {
  justify-content: space-around;
  align-items: center;
  padding: 80px 30px;
  min-height: 100vh;
  flex-direction: column;
}

.game-over-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  width: 100%;
  max-width: 600px;
  text-align: center;
}

/* Titre principal */
.game-over-title {
  font-family: 'Futura', sans-serif;
  font-size: 6.5rem;
  font-weight: 900;
  color: var(--foreground);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 6px;
  line-height: 0.95;
  word-spacing: 100vw;
}

/* Question */
.game-over-question {
  font-family: 'Futura', sans-serif;
  font-size: 1.4rem;
  color: var(--muted-foreground);
  margin: 0;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.3;
}

/* Conteneur des boutons */
.game-over-buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 30px;
  width: 100%;
  flex-wrap: wrap;
}

/* Boutons Oui/Non */
.game-over-choice {
  font-family: 'Futura', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 14px 50px;
  border: 2px solid var(--foreground);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 140px;
  position: relative;
  overflow: hidden;
}

.game-over-choice::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--foreground);
  z-index: -1;
  transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.game-over-choice:hover {
  color: var(--background);
}

.game-over-choice:hover::before {
  left: 0;
}

.game-over-choice:active {
  transform: scale(0.95);
}

/* Bouton NON plus discret */
.game-over-no {
  opacity: 0.6;
  border-color: var(--muted-foreground);
  color: var(--muted-foreground);
}

.game-over-no::before {
  background: var(--muted-foreground);
}

.game-over-no:hover {
  opacity: 1;
  color: var(--background);
}

/* Mode clair */
body.light-mode .game-over-title {
  color: var(--foreground);
}

body.light-mode .game-over-question {
  color: var(--muted-foreground);
}

body.light-mode .game-over-choice {
  border-color: var(--foreground);
  color: var(--foreground);
}

body.light-mode .game-over-choice::before {
  background: var(--foreground);
}

body.light-mode .game-over-choice:hover {
  color: var(--background);
}

body.light-mode .game-over-no {
  border-color: var(--muted-foreground);
  color: var(--muted-foreground);
}

body.light-mode .game-over-no::before {
  background: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 768px) {
  .game-over-wrapper {
    padding: 60px 20px;
    min-height: auto;
  }

  .game-over-title {
    font-size: 3.5rem;
    letter-spacing: 4px;
  }

  .game-over-question {
    font-size: 1.1rem;
  }

  .game-over-buttons {
    gap: 16px;
  }

  .game-over-choice {
    padding: 12px 40px;
    min-width: 120px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .game-over-wrapper {
    padding: 50px 15px;
  }

  .game-over-content {
    gap: 50px;
  }

  .game-over-title {
    font-size: 2.5rem;
    letter-spacing: 3px;
  }

  .game-over-question {
    font-size: 1rem;
  }

  .game-over-buttons {
    gap: 12px;
    width: 100%;
  }

  .game-over-choice {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    font-size: 0.9rem;
    letter-spacing: 2px;
  }
}

/* ========================================
======== BALANCE ERROR MODAL ==============
=========================================== */
.balance-error-modal {
  text-align: center;
  padding: 40px 30px !important;
  max-width: 420px !important;
}

.balance-error-modal h2 {
  font-family: 'Futura', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--foreground);
  margin: 0 0 25px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.balance-error-modal p {
  font-size: 1.05rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0 0 35px;
}

.balance-error-modal p strong {
  color: var(--foreground);
  font-weight: 700;
}

.balance-error-modal .btn-primary {
  margin-top: 10px;
  padding: 16px 32px;
  font-size: 1rem;
  letter-spacing: 1px;
}

.balance-error-modal .close-btn {
  color: #c94a4a;
  transition: transform 0.2s ease, color 0.2s ease;
}

.balance-error-modal .close-btn:hover {
  color: #ff6b6b;
  transform: scale(1.1);
}

body.light-mode .balance-error-modal h2 {
  color: var(--foreground);
}

body.light-mode .balance-error-modal p {
  color: var(--muted-foreground);
}

body.light-mode .balance-error-modal p strong {
  color: var(--foreground);
}

/* ========================================
======== SWITCH DE LANGUE PERSONNAGES =====
=========================================== */
.character-language-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  padding: 10px;
}

.character-name-row--switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  padding: 0 20px;
  box-sizing: border-box;
}

.character-name-row--switch .character-name {
  text-align: left;
  padding: 0;
  margin: 0;
  flex: 1;
}

.character-name-row--switch .characterName {
  text-align: left;
  margin: 0;
  flex: 1;
}

.character-language-switch--inline {
  margin: 0;
  padding: 0;
  gap: 10px;
}

.character-language-switch--inline .language-flag {
  width: 28px;
  height: 28px;
}

/* AR Button */
.character-ar-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(98, 98, 71, 0.85);
  border: 1px solid rgba(236, 228, 203, 0.3);
  border-radius: 8px;
  color: var(--foreground);
  font-family: 'Futura', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.character-ar-button svg {
  width: 18px;
  height: 18px;
}

.character-ar-button:hover {
  background: rgba(139, 127, 85, 0.95);
  border-color: rgba(236, 228, 203, 0.5);
  transform: scale(1.05);
}

.character-ar-button:active {
  transform: scale(0.97);
}

.character-language-switch .language-flag {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: opacity 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  border-radius: 4px;
}

.character-language-switch .language-flag:hover {
  transform: scale(1.1);
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #5a6b4a;
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked+.toggle-slider {
  background-color: #5a6b4a;
}

.switch-toggle input:checked+.toggle-slider:before {
  transform: translateX(26px);
}

/* Mode clair pour le switch */
body.light-mode .toggle-slider {
  background-color: #7a8b6a;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .toggle-slider:before {
  background-color: #ffffff;
}

body.light-mode .switch-toggle input:checked+.toggle-slider {
  background-color: #7a8b6a;
}

/* Modal augmentation jauge */
.endWrapper.dangerWrapper {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(220, 53, 69, 0.15) !important;
}

body.light-mode .endWrapper.dangerWrapper {
  background: rgba(220, 53, 69, 0.1) !important;
}

body.dark-mode .endWrapper.dangerWrapper {
  background: rgba(220, 53, 69, 0.2) !important;
}

/* ========================================
======== PAGE VALIDATION JOUEURS ==========
=========================================== */
.initScreen3 {
  gap: 16px !important;
  padding-top: 20px !important;
}

.submit-difficulty-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-difficulty-section:hover {
  border-color: var(--foreground);
  background: rgba(116, 100, 83, 0.05);
}

.submit-difficulty-label {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.submit-difficulty-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 1px;
}

.submit-change-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.submit-players-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin-bottom: 0;
  margin-top: 8px;
  padding: 0 4px;
}

.submit-players-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-foreground);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Modal difficulté */
.difficulty-modal {
  text-align: center;
  padding: 30px !important;
  max-width: 400px !important;
}

.difficulty-modal h2 {
  font-family: 'Futura', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--foreground);
  margin: 0 0 24px;
  letter-spacing: 2px;
}

.difficulty-options {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.difficulty-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.difficulty-option:hover {
  border-color: var(--foreground);
  transform: translateY(-2px);
}

.difficulty-option.selected {
  border-color: var(--primary);
  background: rgba(116, 100, 83, 0.1);
}

.difficulty-option span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 1px;
}

.diff-gauge {
  width: 30px;
  border-radius: 4px;
  background: linear-gradient(to top, var(--primary) 0%, var(--dust) 100%);
}

.diff-gauge.diff-easy {
  height: 60px;
}

.diff-gauge.diff-normal {
  height: 45px;
}

.diff-gauge.diff-hard {
  height: 30px;
}

.btn-secondary {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

/* Mode clair */
body.light-mode .submit-difficulty-section {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.5);
}

body.light-mode .submit-difficulty-section:hover {
  border-color: var(--foreground);
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .submit-change-btn {
  color: var(--foreground);
}

body.light-mode .submit-change-btn:hover {
  background: var(--foreground);
  color: var(--background);
}

body.light-mode .submit-players-label {
  color: var(--foreground);
}

body.light-mode .difficulty-option {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .difficulty-option:hover {
  border-color: var(--foreground);
}

body.light-mode .difficulty-option.selected {
  background: rgba(116, 100, 83, 0.2);
  border-color: var(--primary);
}

/* Ajustement playerList pour cette page */
.initScreen3 .playerList {
  gap: 12px;
  margin-top: 4px;
}

/* Carte joueur éditable */
.editable-player-card {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.editable-player-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.editable-player-card:hover::before {
  opacity: 1;
}

/* Overlay semi-transparent au hover */
.editable-player-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  border-radius: inherit;
}

.player-edit-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.player-edit-icon svg {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
}

.editable-player-card:hover .player-edit-icon {
  opacity: 1;
}

/* Modal sélection personnage */
.character-select-modal {
  text-align: center;
  padding: 24px !important;
  max-width: 500px !important;
  max-height: 80vh;
  overflow-y: auto;
}

.character-select-modal h2 {
  font-family: 'Futura', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--foreground);
  margin: 0 0 4px;
  letter-spacing: 2px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin: 0 0 20px;
}

.region-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.region-tab {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.region-tab:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

.region-tab.active {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

.characters-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.char-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.char-select-btn:hover:not(.taken) {
  border-color: var(--foreground);
  transform: translateY(-2px);
}

.char-select-btn.current {
  border-color: var(--primary);
  background: rgba(116, 100, 83, 0.15);
}

.char-select-btn.taken {
  opacity: 0.35;
  cursor: not-allowed;
}

.char-select-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background-size: cover;
  background-position: center top;
}

.char-select-btn span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--foreground);
  text-align: center;
  line-height: 1.2;
}

/* Mode clair */
body.light-mode .player-edit-icon {
  color: var(--foreground);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

body.light-mode .editable-player-card::before {
  background: rgba(255, 255, 255, 0.6);
}

body.light-mode .editable-player-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

body.light-mode .region-tab {
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .region-tab:hover {
  border-color: var(--foreground);
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .region-tab.active {
  background: var(--foreground);
  color: var(--background);
}

body.light-mode .char-select-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .char-select-btn:hover:not(.taken) {
  border-color: var(--foreground);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode .char-select-btn.current {
  border-color: var(--primary);
  background: rgba(116, 100, 83, 0.15);
}