﻿/* Fantasy Mitaine - Game Styles */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Press+Start+2P&family=VT323&display=swap');

/* Variables de couleur du jeu */
:root {
  --game-bg: #1a1a1a;
  --game-bg-dark: #0f0f0f;
  --game-card-bg: #2a2a2a;
  --game-text: #e8e4dc;
  --game-text-muted: #8a8a8a;
  --game-accent: #c9a050;
  --game-accent-light: #e8d5a8;
  --game-danger: #c44;
  --game-success: #4a8;
  --game-gauge-bg: #333;
  --game-gauge-fill: #c9a050;
}

/* ===== FULLSCREEN MODE ===== */
.game-fullscreen {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* ===== MAIN CONTAINER ===== */
.game-main {
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.game {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  width: 100%;
  padding: 0;
  position: relative;
  font-family: 'Crimson Text', Georgia, serif;
  color: var(--game-text);
}

/* Avoid FOUC: hide progressive/toggled layers until JS applies the runtime HUD state. */
.game.preinit [data-tier],
.game.preinit .result-toast,
.game.preinit .threads-overlay,
.game.preinit .tutorial-overlay,
.game.preinit .pause-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===== JAUGES ===== */
.game .gauges {
  display: flex;
  justify-content: space-around;
  padding: 24px 78px 28px 78px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  overflow: visible;
}

.game .gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 60px;
  position: relative;
  transition: transform 0.2s ease;
}

.game .gauge.pulse {
  animation: gauge-pulse 0.4s ease;
}

.game .gauge.critical {
  animation: gauge-shake 0.3s ease infinite;
}

.game .gauge.critical .gauge-icon {
  background: var(--game-danger);
  box-shadow: 0 0 15px var(--game-danger);
}

.game .gauge.preview {
  transform: scale(1.08);
}

.game .gauge.preview .gauge-icon {
  box-shadow: 0 0 8px rgba(201, 160, 80, 0.5);
  border-color: var(--game-accent-light);
}

.game .gauge-preview-dir {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  pointer-events: none;
  animation: preview-pulse 0.6s ease-in-out infinite alternate;
}
.game .gauge-preview-dir.dir-up { color: #4ade80; }
.game .gauge-preview-dir.dir-down { color: #f87171; }
@keyframes preview-pulse {
  from { opacity: 0.6; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.15); }
}

.game .gauge-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--game-gauge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--game-accent);
  border: 2px solid var(--game-accent);
  transition: all 0.3s ease;
}

.game .gauge-bar {
  width: 40px;
  height: 6px;
  background: var(--game-gauge-bg);
  border-radius: 3px;
  overflow: hidden;
}

.game .gauge-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--game-accent), var(--game-accent-light));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.game .gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--game-text-muted);
}

.game .gauge-subtitle {
  font-size: 9px;
  color: var(--game-accent);
  opacity: 0;
  white-space: nowrap;
  line-height: 1;
  min-height: 10px;
  transition: opacity 0.2s;
  pointer-events: none;
}

.game .gauge:hover .gauge-subtitle,
.game .gauge.preview .gauge-subtitle {
  opacity: 1;
}

/* ===== ZONE CENTRALE ===== */
.game .stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  overflow: hidden;
}

/* ===== INDICATEURS DE CHOIX ===== */
.game .choice-indicator {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px 16px;
  background: rgba(0,0,0,0.8);
  border-radius: 8px;
  font-size: 13px;
  max-width: 180px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 5;
}

.game .choice-indicator-label {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.game .choice-indicator-result {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
}

.game .choice-indicator.left {
  left: 10px;
  border-left: 3px solid var(--game-success);
}

.game .choice-indicator.right {
  right: 10px;
  border-right: 3px solid var(--game-accent);
}

.game .choice-indicator.visible {
  opacity: 1;
}

/* ===== MUSIQUE ===== */
.game .music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 20px 12px;
  flex-shrink: 0;
}

.game .music-info {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: rgba(201, 160, 80, 0.5);
  margin-right: 4px;
  width: 240px;
  overflow: hidden;
  position: relative;
}

.game .music-info-wrapper {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-text 10s linear infinite;
}

.game .music-info-text {
  display: inline-block;
  padding-right: 60px;
}

@keyframes scroll-text {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.game .music-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(201, 160, 80, 0.3);
  color: rgba(201, 160, 80, 0.6);
  font-family: 'Cinzel', serif;
  width: 28px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.game .music-btn svg {
  display: block;
}

.game .music-btn .icon-play,
.game .music-btn .icon-pause {
  display: none;
}

.game .music-btn.playing .icon-pause {
  display: block;
}

.game .music-btn:not(.playing) .icon-play {
  display: block;
}

.game .music-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.game .music-btn:not(:disabled):hover {
  background: rgba(201, 160, 80, 0.15);
  border-color: rgba(201, 160, 80, 0.5);
  color: rgba(201, 160, 80, 0.9);
  transform: translateY(-1px);
}

.game .music-volume-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.game .music-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 0;
  background: rgba(201, 160, 80, 0.2);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0;
  position: absolute;
  bottom: 32px;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.game .music-volume-slider.visible {
  height: 60px;
  opacity: 1;
}

.game .music-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: rgba(201, 160, 80, 0.7);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.game .music-volume-slider::-webkit-slider-thumb:hover {
  background: rgba(201, 160, 80, 0.9);
}

.game .music-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: rgba(201, 160, 80, 0.7);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.game .music-volume-slider::-moz-range-thumb:hover {
  background: rgba(201, 160, 80, 0.9);
}

.game .music-volume-slider:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.game .music-player {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  right: 0;
  bottom: 0;
}

.game .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 520px) {
  .game .music-controls {
    right: 10px;
    bottom: 70px;
    gap: 4px;
  }
  .game .music-info {
    font-size: 10px;
    max-width: 100px;
  }
  .game .music-btn {
    width: 24px;
    height: 22px;
  }
  .game .music-btn svg {
    width: 12px;
    height: 12px;
  }
}

/* ===== CARTE ===== */
.game .card {
  animation: none !important; /* Neutraliser l'animation globale "rise" de style.css */
  width: 100%;
  max-width: 332px;
  min-height: 360px;
  background: var(--game-card-bg);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  position: relative;
  opacity: 1;
  transform: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game .card:active {
  cursor: grabbing;
}

.game .card.dragging {
  transition: none;
}

.game .card.snap-left {
  border-color: var(--game-success);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(74,136,102,0.3);
}

.game .card.snap-right {
  border-color: var(--game-accent);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(201,160,80,0.3);
}

.game .card-scene {
  width: calc(100% + 40px);
  flex: 1;
  min-height: 140px;
  margin: 8px -20px -24px -20px;
  border-radius: 0 0 16px 16px;
  background-size: cover;
  background-position: center;
  order: 2;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%);
}

.game .card-scene[data-scene=""] {
  display: none;
}

.game .card-location {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 12px;
  font-style: italic;
  color: var(--game-text-muted);
  margin-bottom: 12px;
  opacity: 0.8;
  display: none;
}

.game .card-location:empty {
  display: none;
}

.game .card-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--game-accent);
  margin-bottom: 6px;
  order: 0;
}

.game .card-title:empty {
  display: none;
}

.game .card-text {
  font-size: 17px;
  line-height: 1.46;
  color: var(--game-text);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  width: 100%;
  overflow-wrap: anywhere;
  order: 1;
}

.game .card.text-long {
  min-height: 350px;
  padding: 22px 19px;
}

.game .card.text-long .card-text {
  font-size: 15.5px;
  line-height: 1.4;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
}

.game .card.text-very-long {
  min-height: 338px;
  padding: 18px 17px;
}

.game .card.text-very-long .card-text {
  font-size: 14.5px;
  line-height: 1.34;
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
}

/* ===== RESULT LINE (feedback integre, sans toast overlay) ===== */
.game .result-toast {
  display: none;
  min-height: 24px;
  margin: 10px 16px 8px;
  padding: 6px 10px;
  width: min(92%, 760px);
  align-self: center;
  text-align: center;
  font-size: 15.5px;
  line-height: 1.36;
  font-style: italic;
  font-weight: 600;
  color: rgba(246, 240, 229, 0.97);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  background: rgba(25, 21, 31, 0.52);
  border: 1px solid rgba(220, 200, 166, 0.25);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.game .result-toast.show {
  opacity: 1;
}

.game .result-toast.line-long {
  font-size: 14.5px;
}

.game .result-toast:empty {
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* ===== SLIDE HINT (mobile instruction) ===== */
.game .slide-hint {
  display: none;
  text-align: center;
  font-size: 12px;
  color: var(--game-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0;
  opacity: 0.7;
  flex-shrink: 0;
  margin-top: 4px;
}

.game .slide-hint.show {
  display: block;
  animation: hint-fade-in 0.4s ease-out;
}

@keyframes hint-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

/* ===== APERCU DES CHOIX (mobile) ===== */
.game .mobile-choices {
  display: none;
  gap: 12px;
  padding: 12px 16px 24px;
  flex-shrink: 0;
  opacity: 0;
}

.game .mobile-choice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  min-height: 46px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.game .mobile-choice:focus-visible {
  outline: 2px solid rgba(201, 160, 80, 0.8);
  outline-offset: 1px;
}

.game .mobile-choice:active {
  transform: translateY(1px);
}

.game .mobile-choice.left {
  border-color: rgba(74,136,102,0.4);
  justify-content: flex-start;
}

.game .mobile-choice.right {
  border-color: rgba(201,160,80,0.4);
  justify-content: flex-end;
  text-align: right;
}

.game .mobile-choice.left:hover,
.game .mobile-choice.left:focus-visible {
  border-color: rgba(74,136,102,0.75);
  background: rgba(13, 40, 24, 0.45);
}

.game .mobile-choice.right:hover,
.game .mobile-choice.right:focus-visible {
  border-color: rgba(201,160,80,0.78);
  background: rgba(43, 34, 14, 0.5);
}

.game .mobile-choice-arrow {
  font-size: 18px;
  color: var(--game-accent);
  opacity: 0.8;
  flex-shrink: 0;
}

.game .mobile-choice.left .mobile-choice-arrow {
  color: var(--game-success);
}

.game .mobile-choice-label {
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--game-text);
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Mobile choices visible and animated */
.game .mobile-choices.visible {
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

/* ===== BOUTONS DE CHOIX (desktop) ===== */
.game .choices {
  display: flex;
  gap: 12px;
  padding: 8px 18px 4px;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.game .choices.visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s ease-out;
}

.game .choice-btn {
  flex: 1;
  min-height: 64px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: var(--game-text);
  font-family: 'Crimson Text', serif;
  font-size: 20px;
  line-height: 1.15;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  text-align: center;
}

.game .choice-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

.game .choice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.game .choice-btn.left:not(:disabled) {
  border-color: rgba(74,136,102,0.5);
}

.game .choice-btn.right:not(:disabled) {
  border-color: rgba(201,160,80,0.5);
}

.game .choice-main-label {
  display: inline-block;
}

.game .choice-outcome {
  margin-top: 6px;
  font-size: 10px;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.game .choice-outcome-stable {
  color: #8df7c4;
}

.game .choice-outcome-variable {
  color: #f9c977;
}

/* ===== ECRANS ===== */
.game .start-screen,
.game .gameover-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,15,15,0.95);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 20px 0;
}

.game .start-screen.hidden,
.game .gameover-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.game .start-content,
.game .gameover-content {
  text-align: center;
  padding: 30px 20px;
  max-height: 100%;
}

.game .start-content h1,
.game .gameover-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--game-accent);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.game .tagline {
  font-size: 18px;
  font-style: italic;
  color: var(--game-text-muted);
  margin-bottom: 8px;
}

.game .start-pitch {
  font-size: 14px;
  color: var(--game-text-muted);
  max-width: 320px;
  margin: 0 auto 24px;
  line-height: 1.5;
  opacity: 0.85;
}

.game .start-narrator {
  font-size: 12px;
  color: rgba(232, 213, 168, 0.9);
  max-width: 340px;
  margin: -12px auto 20px;
  line-height: 1.45;
  font-style: italic;
  min-height: 20px;
}

.game .start-narrator:empty {
  display: none;
}

.game .start-content.start-content-minimal .tagline,
.game .start-content.start-content-minimal .start-narrator,
.game .start-content.start-content-minimal .start-record {
  display: none !important;
}

.game .start-content.start-content-minimal .start-pitch {
  max-width: 360px;
  margin: 0 auto 12px;
  color: var(--game-text);
  opacity: 1;
  font-size: 16px;
}

.game .start-content.start-content-minimal .instruction-text {
  display: none;
}

.game .instructions {
  max-width: 360px;
  margin: 0 auto 32px;
  padding: 20px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.game .instruction-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--game-text);
  margin-bottom: 16px;
}

.game .gauge-explain {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.game .gauge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--game-text);
}

.game .gauge-abbr {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--game-gauge-bg);
  border: 1px solid var(--game-accent);
  color: var(--game-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
}

.game .warning-text {
  font-size: 13px;
  color: var(--game-danger);
  font-style: italic;
  margin-bottom: 0;
}

.game .run-modifier-panel {
  width: 100%;
  margin: 12px 0 0;
  padding: 12px;
  background: rgba(0,0,0,0.34);
  border: 1px solid rgba(201,160,80,0.25);
  border-radius: 12px;
}

.game .run-modifier-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--game-accent);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.game .run-modifier-subtitle {
  font-size: 12px;
  color: var(--game-text-muted);
  margin-bottom: 10px;
}

.game .run-modifier-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.game .run-modifier-option {
  text-align: left;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.38);
  color: var(--game-text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.game .run-modifier-option:hover {
  border-color: rgba(201,160,80,0.55);
  transform: translateY(-1px);
}

.game .run-modifier-option.selected {
  border-color: var(--game-accent);
  background: rgba(201,160,80,0.14);
  box-shadow: 0 0 0 1px rgba(201,160,80,0.28) inset;
}

.game .run-modifier-option-name {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--game-accent-light);
  margin-bottom: 2px;
}

.game .run-modifier-option-tagline {
  display: block;
  font-size: 11px;
  color: var(--game-text-muted);
}

.game .start-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 34px;
  margin: 8px auto 6px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: var(--game-text-muted);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.game .start-settings-btn:hover,
.game .start-settings-btn.active {
  border-color: var(--game-accent);
  color: var(--game-accent-light);
}

.game .start-settings-btn.active {
  background: rgba(201,160,80,0.12);
}

.game .start-settings-panel {
  max-width: 390px;
  margin: 4px auto 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
}

.game .start-settings-panel.hidden {
  display: none;
}

.game .start-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game .start-access-row + .start-access-row {
  margin-top: 8px;
}

.game .start-access-label {
  font-size: 12px;
  color: var(--game-text-muted);
}

.game .start-access-options {
  display: flex;
  gap: 6px;
}

.game .start-access-option,
.game .start-access-toggle {
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.35);
  color: var(--game-text);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.game .start-access-option.selected,
.game .start-access-toggle.selected {
  border-color: var(--game-accent);
  background: rgba(201,160,80,0.16);
}

.game .gameover-content > p:not([class]) {
  font-size: 16px;
  color: var(--game-text-muted);
  margin-bottom: 30px;
}

.game .btn-start {
  background: linear-gradient(135deg, var(--game-accent), #a88030);
  border: none;
  padding: 16px 48px;
  border-radius: 30px;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 30px rgba(201,160,80,0.3);
  margin-top: 12px;
  margin-bottom: 16px;
}

.game .btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(201,160,80,0.4);
}

.game .btn-start:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.game .btn-start:hover:disabled {
  transform: none;
  box-shadow: none;
}

.game .start-record {
  display: none;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--game-accent-light);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.game .btn-back {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  padding: 12px 32px;
  border-radius: 30px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--game-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

.game .btn-back:hover {
  border-color: rgba(255,255,255,0.5);
  color: var(--game-text);
  transform: translateY(-1px);
}

.game .start-save-action {
  margin-top: 6px;
  margin-bottom: 6px;
}

.game .start-save-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.game .start-save-action.is-hidden,
.game .start-save-summary.is-hidden {
  display: none;
}

.game .start-secondary-menu {
  margin-top: 10px;
  width: min(360px, 100%);
  text-align: center;
}

.game .start-secondary-menu > summary {
  list-style: none;
  cursor: pointer;
  color: var(--game-text-muted);
  font-size: 12px;
  user-select: none;
}

.game .start-secondary-menu > summary::-webkit-details-marker {
  display: none;
}

.game .start-secondary-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
/* ===== API STATUS ===== */
.game .api-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--game-text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: none;
}

.game .api-status.show {
  display: block;
  opacity: 0.92;
}

.game .api-status[data-kind="error"] {
  color: #ffd0c0;
  background: rgba(120, 24, 24, 0.45);
  border: 1px solid rgba(255, 120, 120, 0.55);
  padding: 3px 8px;
  border-radius: 8px;
}

/* ===== BOUTON QUITTER ===== */
.game .quit-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--game-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 120;
  backdrop-filter: blur(4px);
}

.game .quit-btn:hover {
  background: rgba(0,0,0,0.8);
  color: var(--game-text);
  border-color: var(--game-accent);
  transform: scale(1.05);
}

.game .quit-btn.ui-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== MODE HUD MINIMAL (initial state — JS applyMinimalHudVisibility drives actual visibility) ===== */
.game .items-bar,
.game .run-name,
.game .game-context,
.game .objectives-btn,
.game .reroll-btn {
  display: none;
}

.game.hud-show-items .items-bar { display: flex; }
.game.hud-show-run-name .run-name { display: block; }
.game.hud-show-advanced .game-context { display: flex; }
.game.hud-show-objectives .objectives-btn { display: flex; }
.game.hud-show-objectives .run-compass { display: block; }
.game.hud-show-objectives .run-compass-help-floating { display: inline-flex; }
.game.hud-show-reroll .reroll-btn { display: inline-flex; }
.game:not(.hud-show-objectives) .run-mission { display: none !important; }
.game:not(.hud-show-run-mission) .run-mission { display: none !important; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: var(--game-card-bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--game-text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--game-accent);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--game-text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes gauge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes gauge-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ===== ITEMS BAR ===== */
.game .items-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 2px 0;
  position: absolute;
  top: 118px;
  left: 12px;
  right: 12px;
  z-index: 81;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
}

.game .items-bar:empty {
  display: none;
}

.game .item-pip {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.15);
  border: 1.5px solid rgba(255, 215, 0, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  color: var(--game-text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
  flex: 0 0 auto;
}

.game .item-pip:hover,
.game .item-pip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 0, 0.75);
  background: rgba(255, 215, 0, 0.22);
}

.game .item-icon {
  font-size: 14px;
  line-height: 1;
}

.game .item-name {
  display: none;
}

.game .item-pip[data-item-tooltip]:not([data-item-tooltip=""])::after {
  content: attr(data-item-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 190px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.86);
  color: var(--game-text-muted);
  font-size: 11px;
  line-height: 1.25;
  text-transform: none;
  white-space: normal;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
}

.game .item-pip[data-item-tooltip]:not([data-item-tooltip=""]):hover::after,
.game .item-pip[data-item-tooltip]:not([data-item-tooltip=""]):focus-visible::after {
  opacity: 1;
}

.game .gauge-number {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--game-text-muted);
  font-family: monospace;
}

.game .gauge {
  position: relative;
}

/* ===== CONTEXTE DU JEU ===== */
/* Compteur de tours: independant, toujours au meme endroit */
.game .turn-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 80;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--game-text-muted);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

.game .run-mission {
  display: none;
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 126px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(68%, 360px);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201,160,80,0.35);
  background: rgba(0,0,0,0.58);
  color: rgba(240, 230, 205, 0.95);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}

.game.has-items-hud .run-mission {
  display: none !important;
}

.game .run-mission.done {
  border-color: rgba(74,136,102,0.62);
  color: #b7f3d4;
}

.game .run-name {
  position: absolute;
  top: 70px;
  right: 16px;
  z-index: 80;
  font-size: 10px;
  font-style: italic;
  color: var(--game-text-muted);
  opacity: 0.7;
  white-space: nowrap;
}

.game .death-run-name {
  font-size: 11px;
  color: var(--game-text-muted);
  font-style: italic;
  margin-bottom: 8px;
  opacity: 0.8;
  text-overflow: ellipsis;
}

/* Contexte (place + thread): en bas a gauche au-dessus des boutons */
.game .game-context {
  position: absolute;
  bottom: 120px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 200px;
  z-index: 80;
}

.game .context-place {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(201, 160, 80, 0.3);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--game-accent-light);
  backdrop-filter: blur(4px);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game .context-place:empty {
  display: none;
}

.game .context-modifier {
  background: rgba(83, 246, 161, 0.12);
  border: 1px solid rgba(83, 246, 161, 0.44);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 10px;
  color: #bcffd6;
  backdrop-filter: blur(4px);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game .context-modifier:empty {
  display: none;
}

.game .context-thread {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 10px;
  color: #c4b5fd;
  backdrop-filter: blur(4px);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.game .context-thread:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  color: #ddd6fe;
}

.game .context-thread:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3);
}

.game .context-thread:empty {
  display: none;
}

.game .run-compass {
  position: absolute;
  top: 152px;
  right: 16px;
  z-index: 82;
  width: min(360px, calc(100vw - 32px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 209, 136, 0.34);
  background: linear-gradient(180deg, rgba(24, 18, 10, 0.9), rgba(20, 16, 11, 0.86));
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  display: none;
}

.game.has-items-hud .run-compass {
  top: 152px;
  display: none;
}

.game .run-compass-title {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1ca90;
  margin-bottom: 0;
}

.game .run-compass-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game .run-compass-help {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(241, 202, 144, 0.45);
  background: rgba(18, 14, 10, 0.72);
  color: #f5d6a8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.game .run-compass-help-floating {
  position: absolute;
  top: 118px;
  left: 16px;
  right: auto;
  z-index: 83;
  display: none;
}

.game .run-compass-help:hover {
  border-color: rgba(241, 202, 144, 0.72);
}

.game .run-compass-line {
  font-size: 11px;
  line-height: 1.35;
  color: var(--game-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game .run-compass-line:empty {
  display: none;
}

.game .run-compass[data-expanded="false"] #run-compass-risk,
.game .run-compass[data-expanded="false"] #run-compass-action {
  display: none;
}

.game .run-compass-action {
  color: #ffd598;
}

/* ===== DELTA JAUGES ===== */
.game .gauge-delta {
  position: absolute;
  top: -14px;
  left: 50%;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 160;
  animation: delta-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  transition: opacity 300ms ease;
}

@keyframes delta-pop {
  0% { transform: translateX(-50%) translateY(8px) scale(0.5); opacity: 0; }
  60% { transform: translateX(-50%) translateY(-4px) scale(1.15); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.game .gauge-delta.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

.game .gauge-delta.positive {
  color: #d5ffe6;
  background: rgba(21, 137, 79, 0.92);
}

.game .gauge-delta.negative {
  color: #ffe2e2;
  background: rgba(166, 38, 38, 0.94);
}

/* ===== GAUGE FLASH (big impact |delta| >= 3) ===== */
.game .gauge-fill.gauge-flash {
  animation: gauge-flash 0.2s ease-out;
}
@keyframes gauge-flash {
  0% { filter: brightness(2.5); }
  100% { filter: brightness(1); }
}

/* ===== ECRAN DE MORT ENRICHI ===== */
.game .gameover-content {
  max-width: 400px;
  animation: gameover-appear 0.6s ease-out;
}

.game .gameover-content h2 {
  font-size: 24px;
  margin-bottom: 12px;
  animation: gameover-title-drop 0.5s ease-out 0.1s both;
}

.game .gameover-content h2.death-title-cinematic {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#gameover-reason.death-content-prep {
  opacity: 0;
  transform: translateY(10px);
}

#gameover-reason.death-content-live {
  animation: death-content-rise 0.42s ease-out both;
}

@keyframes gameover-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gameover-title-drop {
  from { opacity: 0; transform: translateY(-12px) scale(1.1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes death-content-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.game .death-cause {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--game-danger);
  margin-bottom: 6px;
  opacity: 0.9;
}

.game .death-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--game-text);
  margin-bottom: 12px;
}

.game .death-flavor {
  font-size: 12px;
  font-style: italic;
  color: var(--game-text-muted);
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border-left: 3px solid var(--game-accent);
}

.game .death-reaction {
  font-size: 13px;
  color: var(--game-accent-light, #e8c060);
  margin-bottom: 14px;
  font-style: italic;
  opacity: 0.9;
}

.game .death-collection-badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 6px;
  color: var(--game-text);
}
.game .death-collection-badge.new-death {
  background: rgba(201, 160, 80, 0.2);
  border: 1px solid var(--game-accent);
  color: var(--game-accent-light, #e8c060);
  animation: new-death-glow 1.5s ease-in-out;
}
@keyframes new-death-glow {
  0% { box-shadow: 0 0 0 rgba(201, 160, 80, 0); }
  50% { box-shadow: 0 0 12px rgba(201, 160, 80, 0.5); }
  100% { box-shadow: 0 0 0 rgba(201, 160, 80, 0); }
}
.game .death-collection-count {
  font-size: 11px;
  color: var(--game-text-muted);
  margin-bottom: 10px;
}

.game .death-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
}

.game .death-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.game .death-stats .stat-value {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--game-accent);
}

.game .death-stats .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--game-text-muted);
}

.game .death-stats .stat.new-record .stat-value {
  color: #4ade80;
}

.game .death-stats .stat.new-record .stat-label {
  color: #4ade80;
}

.game .near-miss {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0 6px;
}

.game .near-miss-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--game-accent);
  margin-bottom: 6px;
}

.game .near-miss-text {
  font-size: 14px;
  color: var(--game-text);
}

.game .relaunch-hook {
  margin-top: 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
}

.game .relaunch-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--game-text-muted);
  margin-bottom: 6px;
}

.game .relaunch-line {
  font-size: 13px;
  color: var(--game-text);
}

.game .progress-roadmap {
  margin-top: 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
}

.game .roadmap-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--game-text-muted);
  margin-bottom: 8px;
}

.game .roadmap-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 5px;
}

.game .roadmap-line:last-child {
  margin-bottom: 0;
}

.game .roadmap-line.done .roadmap-text {
  color: #7dd3a5;
}

.game .roadmap-line.pending .roadmap-text {
  color: var(--game-text);
}

.game .roadmap-status {
  width: 22px;
  color: var(--game-accent);
  font-size: 11px;
  letter-spacing: 1px;
}

.game .death-lesson {
  font-size: 14px;
  font-style: italic;
  color: var(--game-accent);
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(201, 160, 80, 0.1);
  border-radius: 8px;
}

.game .death-nudge {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--game-accent-light);
  margin-top: 16px;
  letter-spacing: 0.05em;
}

/* ===== PROFIL SUR ECRAN DE MORT ===== */
.game .death-profile {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.game .profile-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.game .profile-stat:last-child {
  border-bottom: none;
}

.game .profile-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--game-text-muted);
}

.game .profile-value {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--game-text);
}

.game .profile-value.new-best {
  color: #4ade80;
  animation: pulse-glow 1s ease infinite;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }
  50% { text-shadow: 0 0 15px rgba(74, 222, 128, 0.8); }
}

/* ===== NOUVEAUX ACHIEVEMENTS ===== */
.game .new-achievements {
  margin: 16px 0;
}

.game .achievement-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--game-accent), #a88030);
  color: #1a1a1a;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px;
  animation: badge-pop 0.5s ease;
}

@keyframes badge-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== PACKS DEBLOQUES ===== */
.game .new-packs {
  margin: 16px 0;
}

.game .pack-badge {
  display: inline-block;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin: 4px;
  animation: badge-pop 0.5s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* ===== BOUTON OBJECTIFS ===== */
.game .objectives-btn {
  position: absolute;
  top: 64px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  z-index: 86;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--game-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.game .objectives-btn:hover {
  background: rgba(0,0,0,0.8);
  border-color: var(--game-accent);
  transform: scale(1.05);
}

.game .objectives-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--game-accent);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: 'Cinzel', serif;
}

.game .objectives-badge.complete {
  background: var(--game-success);
}

/* ===== BOUTON REROLL ===== */
.game .reroll-btn {
  position: absolute;
  top: 112px;
  right: 16px;
  min-width: 96px;
  height: 30px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(0,0,0,0.55);
  color: var(--game-text);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.game .reroll-btn.ui-hidden {
  display: none !important;
}

.game .reroll-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--game-accent);
  background: rgba(0,0,0,0.75);
}

.game .reroll-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.game .reroll-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--game-accent);
  color: #121212;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
}

/* ===== OVERLAY OBJECTIFS ===== */
.game .objectives-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.game .objectives-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== OVERLAY TUTORIEL ===== */
.game .tutorial-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.game .tutorial-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== OVERLAY MENU ===== */
.game .pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.game .pause-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.game .pause-panel {
  width: min(360px, 90%);
  background: var(--game-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.game .pause-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game .pause-header h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--game-accent);
}

.game .pause-close {
  background: none;
  border: none;
  color: var(--game-text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.game .pause-action {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.34);
  color: var(--game-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.game .pause-action:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.game .pause-action.pause-danger {
  border-color: rgba(196, 68, 68, 0.5);
}

.game .pause-options {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game .pause-options.hidden {
  display: none;
}

.game .pause-option-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.34);
  color: var(--game-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.game .pause-option-btn:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.game .tutorial-panel {
  background: var(--game-card-bg);
  border-radius: 18px;
  padding: 22px;
  max-width: 420px;
  width: 90%;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.game .tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.game .tutorial-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--game-accent);
  margin: 0;
}

.game .tutorial-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--game-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.game .tutorial-close:hover {
  color: var(--game-text);
}

.game .tutorial-steps {
  display: grid;
  gap: 12px;
}

.game .tutorial-step {
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--game-accent);
}

.game .tutorial-step-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--game-text);
  margin-bottom: 4px;
}

.game .tutorial-step-text {
  font-size: 13px;
  color: var(--game-text-muted);
}

.game .tutorial-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.game .objectives-panel {
  background: var(--game-card-bg);
  border-radius: 16px;
  padding: 20px;
  max-width: 340px;
  width: 90%;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.game .objectives-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.game .objectives-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--game-accent);
  margin: 0;
}

.game .objectives-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--game-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.game .objectives-close:hover {
  color: var(--game-text);
}

.game .objectives-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game .objective-item {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 14px;
  border-left: 3px solid var(--game-text-muted);
  transition: all 0.3s ease;
}

.game .objective-item.completed {
  border-left-color: var(--game-success);
  background: rgba(74, 222, 128, 0.1);
}

.game .objective-item.in-progress {
  border-left-color: var(--game-accent);
}

.game .objective-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--game-text);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game .objective-check {
  color: var(--game-success);
  font-size: 16px;
}

.game .objective-desc {
  font-size: 12px;
  color: var(--game-text-muted);
  margin-bottom: 8px;
}

.game .objective-meta {
  font-size: 11px;
  color: var(--game-text-muted);
  margin: -4px 0 8px;
}

.game .objective-hint {
  font-size: 11px;
  color: var(--game-text-muted);
  margin: -4px 0 8px;
  border-left: 2px solid rgba(255,255,255,0.2);
  padding-left: 6px;
}

.game .objective-reward {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 8px;
  margin: 6px 0 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game .objective-reward.unlocked {
  border-color: rgba(74, 222, 128, 0.5);
}

.game .objective-reward .reward-label {
  color: var(--game-text-muted);
}

.game .objective-reward .reward-pack {
  color: var(--game-text);
  font-weight: 600;
}

.game .objective-reward .reward-state {
  color: var(--game-success);
}

.game .objective-repeat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--game-text-muted);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 10px;
}

.game .objective-thread-hint {
  font-size: 11px;
  color: var(--game-accent);
  background: rgba(187, 134, 252, 0.1);
  border-left: 2px solid var(--game-accent);
  padding: 6px 8px;
  margin: 8px 0;
  border-radius: 4px;
  line-height: 1.4;
}

.game .objective-thread-hint.inactive {
  color: var(--game-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--game-text-muted);
}

.game .objective-thread-hint strong {
  color: #fff;
  font-weight: 600;
}

.game .objective-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game .objective-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.game .objective-fill {
  height: 100%;
  background: var(--game-accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.game .objective-item.completed .objective-fill {
  background: var(--game-success);
}

.game .objective-count {
  font-size: 11px;
  color: var(--game-text-muted);
  min-width: 40px;
  text-align: right;
}

/* ===== OVERLAY THREADS (ARCS NARRATIFS) ===== */
.game .threads-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.game .threads-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.game .threads-panel {
  background: var(--game-card-bg);
  border-radius: 16px;
  padding: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(139, 92, 246, 0.2);
}

.game .threads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.game .threads-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: #c4b5fd;
  margin: 0;
}

.game .threads-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--game-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.game .threads-close:hover {
  color: var(--game-text);
}

.game .threads-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game .threads-intro {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--game-text-muted);
}

.game .threads-intro strong {
  color: #c4b5fd;
  font-weight: 600;
}

.game .thread-item {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 14px;
  border-left: 3px solid rgba(139, 92, 246, 0.6);
}

.game .thread-item.active {
  border-left-color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.game .thread-item.spotlight {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.game .thread-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--game-text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game .thread-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.game .thread-badge.spotlight {
  background: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.game .thread-stage {
  font-size: 12px;
  color: var(--game-text-muted);
  margin-bottom: 8px;
}

.game .thread-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.game .thread-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.game .thread-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.8), #c4b5fd);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.game .thread-item.spotlight .thread-progress-fill {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.8), #fbbf24);
}

.game .thread-progress-text {
  font-size: 10px;
  color: var(--game-text-muted);
  min-width: 50px;
  text-align: right;
}

/* ===== NOTIFICATION OBJECTIF ===== */
.game .objective-toast {
  position: fixed;
  top: 112px;
  left: 50%;
  transform: translate(-50%, -8px) scale(0.96);
  background: linear-gradient(135deg, var(--game-success), #2d8a5e);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(74, 222, 128, 0.4);
}

.game .objective-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.game .objective-toast-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.game .objective-toast-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
}

/* ===== PROGRESS NOTIFICATION ===== */
.game .objective-progress-toast {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translate(-50%, 20px) scale(0.95);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 210;
}

.game .objective-progress-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.game .objective-progress-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.game .objective-progress-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
}

.game .objective-progress-count {
  font-size: 11px;
  color: var(--game-text-muted);
  margin-top: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-height: 700px) {
  .game .gauges {
    padding: 46px 70px 18px 70px;
  }

  .game .gauge-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .game .card {
    min-height: 280px;
    padding: 20px;
  }

  .game .card-title {
    font-size: 16px;
  }

  .game .card-text {
    font-size: 17px;
  }

  .game .choices {
    padding: 8px 16px 6px;
  }

  .game .mobile-choices {
    padding: 8px 12px 6px;
    gap: 8px;
  }

  .game .mobile-choice {
    padding: 10px 12px;
    min-height: 44px;
  }

  .game .reroll-btn {
    top: 160px;
  }

  .game .mobile-choice-label {
    font-size: 12px;
  }

  .game .result-toast {
    font-size: 14px;
  }

  .game .run-mission {
    top: calc(env(safe-area-inset-top, 0px) + 108px);
    max-width: calc(100% - 128px);
    font-size: 10px;
    padding: 4px 8px;
  }

  /* Game over compact */
  .game .gameover-content h2 {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .game .death-stats {
    gap: 12px;
    padding: 10px;
    margin: 12px 0;
  }

  .game .death-stats .stat-value {
    font-size: 20px;
  }

  .game .btn-start {
    padding: 12px 36px;
    font-size: 14px;
  }
}

@media (max-height: 550px) {
  .game .gauges {
    padding: 40px 64px 14px 64px;
  }

  .game .gauge-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .game .gauge-bar {
    width: 30px;
    height: 4px;
  }

  .game .gauge-label {
    font-size: 8px;
  }

  .game .card {
    min-height: 200px;
    padding: 16px;
  }

  .game .card-title {
    font-size: 14px;
  }

  .game .card-text {
    font-size: 15px;
  }

  .game .choice-btn {
    padding: 12px 8px;
    font-size: 14px;
  }

  .game .mobile-choices {
    padding: 6px 10px 4px;
    gap: 6px;
  }

  .game .mobile-choice {
    padding: 8px 10px;
    min-height: 38px;
  }

  .game .mobile-choice-arrow {
    font-size: 14px;
  }

  .game .mobile-choice-label {
    font-size: 11px;
  }

  .game .result-toast {
    font-size: 13px;
  }

  .game .run-mission {
    top: calc(env(safe-area-inset-top, 0px) + 92px);
  }

  /* Game over tres compact */
  .game .start-content,
  .game .gameover-content {
    padding: 15px 15px;
  }

  .game .gameover-content h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .game .death-text {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .game .death-flavor {
    font-size: 11px;
    padding: 8px;
    margin-bottom: 10px;
  }

  .game .death-stats {
    gap: 10px;
    padding: 8px;
    margin: 10px 0;
  }

  .game .death-stats .stat-value {
    font-size: 18px;
  }

  .game .death-stats .stat-label {
    font-size: 9px;
  }

  .game .death-profile {
    padding: 10px;
    margin: 12px 0;
  }

  .game .profile-stat {
    padding: 5px 0;
  }

  .game .btn-start {
    padding: 10px 30px;
    font-size: 13px;
  }

  .game .btn-back {
    padding: 8px 24px;
    font-size: 12px;
    margin-top: 10px;
  }
}

/* TEMPORAIREMENT DESACTIVE POUR DEBUG ANIMATIONS
@media (prefers-reduced-motion: reduce) {
  .game * {
    animation: none !important;
    transition: none !important;
  }
}
*/

/* ===== Layout mode switch (JS toggles .mobile-layout on .game) ===== */
.game.mobile-layout .choices {
  display: none;
}

.game.mobile-layout .mobile-choices {
  display: flex;
}

/* ===== CARD EDIT BUTTON (ADMIN) ===== */
.card-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(42, 42, 42, 0.9);
  border: 1px solid rgba(201, 160, 80, 0.3);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--game-accent);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.card-edit-btn:hover {
  opacity: 1;
  background: rgba(201, 160, 80, 0.2);
  border-color: var(--game-accent);
  transform: scale(1.05);
}

.card-edit-btn.hidden {
  display: none;
}

/* ===== CARD EDIT MODAL ===== */
.card-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.card-edit-modal.hidden {
  display: none;
}

.card-edit-panel {
  background: var(--game-card-bg);
  border: 1px solid var(--game-accent);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.card-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(201, 160, 80, 0.2);
}

.card-edit-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-edit-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--game-accent);
  margin: 0;
}

.btn-prev-card {
  background: rgba(201, 160, 80, 0.15);
  border: 1px solid rgba(201, 160, 80, 0.3);
  color: var(--game-accent);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-prev-card:hover {
  background: rgba(201, 160, 80, 0.25);
  border-color: var(--game-accent);
}

.btn-prev-card.hidden {
  display: none;
}

.card-edit-header #edit-card-id {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--game-text-muted);
}

.card-edit-close {
  background: none;
  border: none;
  color: var(--game-text);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.card-edit-close:hover {
  color: var(--game-accent);
}

.card-edit-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--game-accent-light);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  background: var(--game-bg-dark);
  border: 1px solid rgba(201, 160, 80, 0.3);
  border-radius: 4px;
  padding: 10px;
  color: var(--game-text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--game-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.gauge-edit-row {
  display: flex;
  gap: 10px;
}

.gauge-edit-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gauge-edit-field span {
  font-weight: bold;
  color: var(--game-accent);
  font-size: 13px;
  min-width: 14px;
}

.gauge-edit-field input[type="number"] {
  width: 52px;
  padding: 4px 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 160, 80, 0.3);
  border-radius: 4px;
  color: var(--game-text);
  font-size: 14px;
}

.gauge-edit-field input[type="number"]:focus {
  border-color: var(--game-accent);
  outline: none;
}

.card-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--game-accent);
  color: var(--game-bg-dark);
}

.btn-primary:hover {
  background: var(--game-accent-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--game-text);
  border: 1px solid rgba(201, 160, 80, 0.3);
}

.btn-secondary:hover {
  border-color: var(--game-accent);
  background: rgba(201, 160, 80, 0.1);
}

/* =================================================================
   RETRO PIXEL THEME (90s/2000 arcade + CRT)
   Keep layout/logic intact, only visual overrides.
   ================================================================= */

:root {
  --game-bg: #091016;
  --game-bg-dark: #05080c;
  --game-card-bg: #141b24;
  --game-text: #d9f7d2;
  --game-text-muted: #86a497;
  --game-accent: #ffe067;
  --game-accent-light: #fff2a5;
  --game-danger: #ff5d5d;
  --game-success: #53f6a1;
  --game-gauge-bg: #0f131a;
  --game-gauge-fill: #53f6a1;
}

.game-main {
  position: relative;
  background:
    radial-gradient(1100px circle at 0% 0%, rgba(83, 246, 161, 0.12), transparent 65%),
    radial-gradient(900px circle at 100% 100%, rgba(255, 224, 103, 0.1), transparent 60%),
    linear-gradient(180deg, #0b1219 0%, #05080c 100%);
}

.game-main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.13) 0px,
      rgba(255, 255, 255, 0.13) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(83, 246, 161, 0.06) 0px,
      rgba(83, 246, 161, 0.06) 1px,
      transparent 1px,
      transparent 4px
    );
}

.game {
  z-index: 1;
  font-family: "VT323", "Courier New", monospace;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.game .gauges {
  background: rgba(5, 9, 13, 0.82);
  border-bottom: 2px solid rgba(83, 246, 161, 0.32);
  box-shadow: inset 0 -1px 0 rgba(255, 224, 103, 0.28);
}

.game .gauge-icon {
  border-radius: 4px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  border-width: 2px;
  background: #0a1118;
  box-shadow:
    inset 0 0 0 1px rgba(83, 246, 161, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.45);
}

.game .gauge-bar {
  width: 42px;
  height: 8px;
  border-radius: 0;
  border: 1px solid rgba(83, 246, 161, 0.45);
  background: #090d12;
}

.game .gauge-fill {
  border-radius: 0;
  background:
    linear-gradient(90deg, #53f6a1 0%, #ffe067 100%),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.22) 0px,
      rgba(0, 0, 0, 0.22) 2px,
      transparent 2px,
      transparent 4px
    );
}

.game .gauge-label {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.game .turn-counter,
.game .context-place,
.game .context-modifier,
.game .context-thread,
.game .quit-btn,
.game .objectives-btn,
.game .reroll-btn {
  border-radius: 0;
  border-width: 2px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.game .turn-counter {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: var(--game-accent-light);
}

.game .context-place {
  border-color: rgba(255, 224, 103, 0.45);
  color: var(--game-accent-light);
}

.game .context-modifier {
  border-color: rgba(83, 246, 161, 0.6);
}

.game .context-thread {
  background: rgba(83, 246, 161, 0.14);
  border-color: rgba(83, 246, 161, 0.5);
  color: #bcffd6;
}

.game .context-thread:hover {
  background: rgba(83, 246, 161, 0.22);
  border-color: rgba(83, 246, 161, 0.75);
  box-shadow: 0 4px 12px rgba(83, 246, 161, 0.24);
  color: #d9ffe7;
}

.game .card {
  border-radius: 0;
  border: 3px solid rgba(83, 246, 161, 0.55);
  background:
    linear-gradient(180deg, rgba(20, 27, 36, 0.97), rgba(10, 14, 20, 0.97));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 224, 103, 0.2);
}

.game .card-scene {
  border-radius: 0;
}
.game .card-location {
  font-size: 18px;
  color: #b7dfc4;
  display: none;
}
.game .card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.25;
}

.game .card-text {
  font-size: 20px;
  line-height: 1.24;
  color: #e9ffe3;
}

.game .card.text-long .card-text {
  font-size: 17.5px;
  line-height: 1.2;
}

.game .card.text-very-long .card-text {
  font-size: 16px;
  line-height: 1.16;
}


.game .choice-indicator {
  border-radius: 0;
  border: 2px solid rgba(83, 246, 161, 0.25);
  background: rgba(3, 6, 10, 0.88);
}

.game .choice-btn,
.game .mobile-choice,
.game .btn-start,
.game .btn-back,
.game .run-modifier-option,
.btn-primary,
.btn-secondary {
  border-radius: 0;
}

.game .choice-btn {
  font-family: "Crimson Text", serif;
  font-size: 20px;
  line-height: 1.15;
  border-width: 2px;
  background: rgba(10, 15, 21, 0.85);
  color: #efffe6;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.75);
}

.game .run-modifier-option {
  font-family: "VT323", monospace;
  border-width: 2px;
}

.game .run-modifier-option-name {
  font-size: 14px;
}

.game .run-modifier-option-tagline {
  font-size: 13px;
}

.game .choice-btn.left:not(:disabled),
.game .mobile-choice.left {
  border-color: rgba(83, 246, 161, 0.7);
}

.game .choice-btn.right:not(:disabled),
.game .mobile-choice.right {
  border-color: rgba(255, 224, 103, 0.72);
}

.game:not(.mobile-layout) .choices {
  margin: 0 14px 10px;
  padding: 10px 12px 12px;
  border-radius: 12px;
}

.game:not(.mobile-layout) .choices.visible {
  background: linear-gradient(180deg, rgba(8, 14, 21, 0.9), rgba(6, 11, 17, 0.94));
  border: 1px solid rgba(255, 224, 103, 0.3);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(83, 246, 161, 0.1);
}

.game:not(.mobile-layout) .choice-btn {
  min-height: 64px;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: #eeffe5;
  border-width: 2px;
  border-style: solid;
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.28);
}

.game:not(.mobile-layout) .choice-btn.left:not(:disabled) {
  border-color: rgba(83, 246, 161, 0.9);
  background: linear-gradient(180deg, rgba(7, 42, 31, 0.93), rgba(5, 27, 20, 0.96));
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(83, 246, 161, 0.22);
}

.game:not(.mobile-layout) .choice-btn.right:not(:disabled) {
  border-color: rgba(255, 224, 103, 0.92);
  background: linear-gradient(180deg, rgba(48, 38, 13, 0.92), rgba(31, 24, 9, 0.96));
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 224, 103, 0.22);
}

.game:not(.mobile-layout) .choice-btn:hover:not(:disabled),
.game:not(.mobile-layout) .choice-btn:focus-visible {
  filter: brightness(1.08) saturate(1.12);
}


.game .mobile-choice-label {
  font-size: 15px;
}

.game .start-screen,
.game .gameover-screen {
  background: rgb(3, 6, 10);
}

.game .objectives-overlay,
.game .threads-overlay,
.game .tutorial-overlay {
  background: rgba(3, 6, 10, 0.9);
}

.game .start-content h1,
.game .gameover-content h2,
.game .objectives-header h3,
.game .threads-header h3,
.game .tutorial-header h3 {
  font-family: "Press Start 2P", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.game .tagline,
.game .instruction-text,
.game .death-text,
.game .death-flavor,
.game .relaunch-line,
.game .objective-desc,
.game .thread-stage {
  font-size: 16px;
  line-height: 1.28;
}

.game .instructions,
.game .run-modifier-panel,
.game .death-profile,
.game .objectives-panel,
.game .threads-panel,
.game .tutorial-panel {
  border-radius: 0;
  border-width: 2px;
}

.game .threads-panel {
  border-color: rgba(83, 246, 161, 0.35);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(83, 246, 161, 0.12);
}

.game .threads-header {
  border-bottom: 1px solid rgba(83, 246, 161, 0.35);
}

.game .threads-intro,
.game .thread-item,
.game .thread-item.active {
  background: rgba(83, 246, 161, 0.08);
  border-color: rgba(83, 246, 161, 0.4);
}

.game .thread-badge {
  background: rgba(83, 246, 161, 0.2);
  color: #b6ffd3;
}

.game .thread-progress-fill {
  background: linear-gradient(90deg, rgba(83, 246, 161, 0.85), #ffe067);
}

.game .objective-thread-hint {
  color: #bcffd6;
  background: rgba(83, 246, 161, 0.08);
  border-left-color: rgba(83, 246, 161, 0.7);
}

.game .pack-badge {
  background: linear-gradient(135deg, #53f6a1, #2aa56b);
  color: #08210f;
  box-shadow: 0 4px 15px rgba(83, 246, 161, 0.28);
}

.game .result-toast {
  font-size: 15.5px;
  line-height: 1.25;
}

.game .result-toast.line-long {
  font-size: 14px;
  line-height: 1.2;
}

@media (max-width: 520px) {
  .game .gauges {
    padding: 14px 40px 16px 40px;
    justify-content: space-between;
    gap: 7px;
  }

  .game .gauge {
    min-width: 0;
    flex: 1 1 0;
    gap: 4px;
  }

  .game .gauge-icon {
    width: 32px;
    height: 32px;
    font-size: 8px;
  }

  .game .gauge-bar {
    width: 30px;
    height: 6px;
  }

  .game .gauge-label {
    display: none;
  }

  .game .gauge-subtitle {
    display: none;
  }

  .game .card-text {
    font-size: 16.5px;
  }

  .game .result-toast {
    font-size: 14px;
  }

  .game .tagline,
  .game .instruction-text,
  .game .death-text,
  .game .death-flavor,
  .game .relaunch-line,
  .game .objective-desc,
  .game .thread-stage {
    font-size: 13px;
  }

  .game .choice-btn {
    font-size: 14px;
    line-height: 1.28;
  }

  .game .run-compass {
    display: none;
  }

  .game .items-bar {
    top: 110px;
    left: 12px;
    right: 12px;
    justify-content: center;
  }

  .game.has-items-hud .run-compass {
    display: none;
  }

  .game .run-compass-line {
    white-space: normal;
  }

  .game.mobile-layout .stage {
    padding: 12px;
  }

  .game.mobile-layout .slide-hint.show {
    margin-top: 0;
    padding: 4px 0 2px;
  }

  .game.mobile-layout .mobile-choices {
    gap: 8px;
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .game.mobile-layout .mobile-choice {
    min-height: 52px;
    border-radius: 10px;
    background: rgba(8, 15, 24, 0.86);
  }

  .game.mobile-layout .mobile-choice-label {
    font-size: 14px;
    line-height: 1.2;
  }
}

@media (max-width: 400px) {
  .game .gauges {
    padding: 12px 28px 14px 28px;
    gap: 6px;
  }

  .game .gauge-label {
    display: none;
  }

  .game.mobile-layout .mobile-choice-label {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ================================================================
   Accessibility toggles (start screen)
   ================================================================ */
body.a11y-font-large .game .card-text {
  font-size: 21.5px;
}

body.a11y-font-large .game .card.text-long .card-text {
  font-size: 18.5px;
}

body.a11y-font-large .game .card.text-very-long .card-text {
  font-size: 17px;
}

body.a11y-font-large .game .result-toast {
  font-size: 16px;
}

body.a11y-font-large .game .choice-btn,
body.a11y-font-large .game .mobile-choice-label {
  font-size: 16px;
}

body.a11y-font-large .game .tagline,
body.a11y-font-large .game .instruction-text,
body.a11y-font-large .game .warning-text {
  font-size: 17px;
  line-height: 1.32;
}

body.a11y-font-xl .game .card-text {
  font-size: 23px;
}

body.a11y-font-xl .game .card.text-long .card-text {
  font-size: 20px;
}

body.a11y-font-xl .game .card.text-very-long .card-text {
  font-size: 18px;
}

body.a11y-font-xl .game .result-toast {
  font-size: 17px;
}

body.a11y-font-xl .game .choice-btn,
body.a11y-font-xl .game .mobile-choice-label {
  font-size: 17px;
}

body.a11y-font-xl .game .tagline,
body.a11y-font-xl .game .instruction-text,
body.a11y-font-xl .game .warning-text {
  font-size: 18px;
  line-height: 1.34;
}

/* ===== GAUGE WARNING TIER ===== */
.game .gauge.warning .gauge-icon {
  border-color: #e8a020;
  box-shadow: 0 0 10px rgba(232, 160, 32, 0.4);
}
.game .gauge.warning .gauge-fill {
  background: linear-gradient(90deg, #e8a020, #f0c040);
}
.game .gauge.warning {
  animation: gauge-pulse-warning 1.5s ease-in-out infinite;
}
@keyframes gauge-pulse-warning {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Critical gauge: red bar + pulse */
.game .gauge.critical .gauge-fill {
  background: linear-gradient(90deg, #c44, #e66);
}
.game .gauge.critical .gauge-icon {
  border-color: #c44;
  box-shadow: 0 0 12px rgba(204, 68, 68, 0.6);
}
.game .gauge.critical {
  animation: gauge-pulse-critical 0.8s ease-in-out infinite;
}
@keyframes gauge-pulse-critical {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===== DANGER VIGNETTE ===== */
.game-main::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.game-main.vignette-warning::after {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(232, 160, 32, 0.2) 100%);
}
.game-main.vignette-critical::after {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(204, 68, 68, 0.35) 100%);
  animation: vignette-pulse 1.2s ease-in-out infinite;
}
@keyframes vignette-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== SCREEN SHAKE ===== */
.game-main.screen-shake {
  animation: screen-shake-anim var(--shake-duration, 250ms) ease-out;
}
@keyframes screen-shake-anim {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(calc(-1 * var(--shake-intensity, 2px)), var(--shake-intensity, 2px)); }
  20% { transform: translate(var(--shake-intensity, 2px), calc(-1 * var(--shake-intensity, 2px))); }
  30% { transform: translate(calc(-1 * var(--shake-intensity, 2px)), 0); }
  40% { transform: translate(var(--shake-intensity, 2px), var(--shake-intensity, 2px)); }
  50% { transform: translate(calc(-1 * var(--shake-intensity, 2px)), calc(-1 * var(--shake-intensity, 2px))); }
  60% { transform: translate(var(--shake-intensity, 2px), 0); }
  70% { transform: translate(calc(-1 * var(--shake-intensity, 2px)), var(--shake-intensity, 2px)); }
  80% { transform: translate(0, calc(-1 * var(--shake-intensity, 2px))); }
  90% { transform: translate(var(--shake-intensity, 2px), 0); }
}

/* ===== GAUGE REVEAL POP ===== */
.game .gauge.reveal-pop {
  animation: gauge-reveal-pop 0.35s ease-out;
}
@keyframes gauge-reveal-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== RESTART BUTTON PULSE ===== */
.gameover-screen .btn-start {
  font-size: 22px;
  padding: 16px 48px;
  margin-top: 12px;
  animation: restart-pulse 1.5s ease-in-out infinite;
}
@keyframes restart-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 160, 80, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 24px 6px rgba(201, 160, 80, 0.35); }
}

/* ===== DEATH GAUGE BARS ===== */
.death-gauges {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}
.death-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.death-gauge-label {
  font-size: 11px;
  color: var(--game-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.death-gauge-bar {
  width: 36px;
  height: 5px;
  background: var(--game-gauge-bg);
  border-radius: 3px;
  overflow: hidden;
}
.death-gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.death-gauge-fill.tier-normal { background: linear-gradient(90deg, var(--game-accent), var(--game-accent-light)); }
.death-gauge-fill.tier-warning { background: linear-gradient(90deg, #e8a020, #f0c040); }
.death-gauge-fill.tier-critical { background: linear-gradient(90deg, #c44, #e66); }
.death-gauge.killer {
  background: rgba(200, 40, 40, 0.15);
  border-radius: 4px;
  outline: 1px solid rgba(200, 40, 40, 0.4);
}
.death-gauge.killer .death-gauge-label {
  color: #f87171;
  font-weight: 800;
}
.death-gauge-value {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--game-text);
}

/* ===== SFX TOGGLE ===== */
.game > .sfx-toggle {
  align-self: center;
  flex-shrink: 0;
  margin: 4px 0;
}
.sfx-toggle {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(201, 160, 80, 0.3);
  color: rgba(201, 160, 80, 0.6);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sfx-toggle:hover {
  background: rgba(201, 160, 80, 0.15);
  border-color: rgba(201, 160, 80, 0.5);
  color: rgba(201, 160, 80, 0.9);
}
.sfx-toggle.active {
  border-color: rgba(201, 160, 80, 0.6);
  color: rgba(201, 160, 80, 0.9);
}

/* ===== DISCOVERY TOAST ===== */
.discovery-toast {
  position: absolute;
  bottom: 80px;
  right: 16px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(201, 160, 80, 0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--game-text-muted);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 50;
}
.discovery-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== FIRST-RUN HINT ===== */
.card.first-run-hint::after {
  content: 'Glisse!';
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--game-accent);
  animation: hint-bounce 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

/* ===== PROGRESSIVE DISCLOSURE (Tier System) ===== */
.tier-locked { display: none !important; }

/* Unlock toast (tier upgrade notification) */
.unlock-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(40, 30, 10, 0.92);
  border: 2px solid var(--game-accent);
  border-radius: 16px;
  padding: 18px 32px;
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--game-accent-light);
  text-align: center;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 0 0 40px rgba(201, 160, 80, 0.3);
}
.unlock-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: unlock-pop 0.42s ease-out, unlock-glow 1.4s ease-in-out infinite;
}
.unlock-toast.kind-achievement {
  border-color: #e3c16a;
  box-shadow: 0 0 42px rgba(227, 193, 106, 0.38);
}
.unlock-toast.kind-pack {
  border-color: #7dd3a5;
  color: #dbffe8;
  box-shadow: 0 0 48px rgba(125, 211, 165, 0.4);
}
.unlock-toast.kind-pack.show {
  animation: unlock-pop 0.42s ease-out, unlock-glow-pack 1.5s ease-in-out infinite;
}
.unlock-toast.kind-tier {
  border-color: var(--game-accent);
}
@keyframes unlock-pop {
  0% { transform: translate(-50%, -50%) scale(0.84); }
  55% { transform: translate(-50%, -50%) scale(1.04); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes unlock-glow {
  0%, 100% { box-shadow: 0 0 26px rgba(201, 160, 80, 0.32); }
  50% { box-shadow: 0 0 52px rgba(201, 160, 80, 0.52); }
}
@keyframes unlock-glow-pack {
  0%, 100% { box-shadow: 0 0 28px rgba(125, 211, 165, 0.34); }
  50% { box-shadow: 0 0 58px rgba(125, 211, 165, 0.56); }
}

/* Pulsing replay button for tier 0 */
.btn-start.pulse-replay {
  animation: pulse-replay 1.5s ease-in-out infinite;
}
@keyframes pulse-replay {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 160, 80, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 4px rgba(201, 160, 80, 0.3); }
}

/* Tier 0: reduce gauge padding when labels hidden */
.gauges:has(.gauge-label.tier-locked) {
  padding-bottom: 12px;
}

body.motion-reduced .game * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ===== CONTEXTUAL TUTORIAL BUBBLES ===== */
.tutorial-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  background: rgba(201, 160, 80, 0.92);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  z-index: 200;
  white-space: normal;
  max-width: min(320px, 90vw);
  pointer-events: none;
  animation: tutorial-fade-in 0.4s ease-out;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.tutorial-focus {
  box-shadow: 0 0 0 2px rgba(201, 160, 80, 0.85), 0 0 20px rgba(201, 160, 80, 0.25);
  border-radius: 10px;
  animation: tutorial-focus-pulse 1.1s ease-in-out infinite;
}

.tutorial-focus-secondary {
  box-shadow: 0 0 0 1px rgba(201, 160, 80, 0.65);
  border-radius: 10px;
}

.tutorial-bubble-below {
  top: calc(100% + 8px);
}

.tutorial-bubble-above {
  bottom: calc(100% + 8px);
}

.tutorial-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}

.tutorial-bubble-below::after {
  bottom: 100%;
  border-bottom-color: rgba(201, 160, 80, 0.92);
}

.tutorial-bubble-above::after {
  top: 100%;
  border-top-color: rgba(201, 160, 80, 0.92);
}

@keyframes tutorial-fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes tutorial-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(201, 160, 80, 0.85), 0 0 16px rgba(201, 160, 80, 0.22); }
  50% { box-shadow: 0 0 0 2px rgba(201, 160, 80, 0.95), 0 0 26px rgba(201, 160, 80, 0.35); }
}

/* ===== HOTFIX LAYOUT/OVERLAY STABILITY ===== */
.game .objective-toast,
.game .objective-progress-toast {
  display: none !important;
}

.game::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 182px;
  pointer-events: none;
  z-index: 88;
  background: linear-gradient(180deg, rgba(3, 6, 10, 0.99) 0%, rgba(3, 6, 10, 0.97) 82%, rgba(3, 6, 10, 0.85) 100%);
}

.game .gauges {
  position: relative;
  z-index: 90;
  background: rgba(3, 6, 10, 0.97) !important;
}

.game .turn-counter,
.game .objectives-btn,
.game .run-mission,
.game .run-compass,
.game .run-compass-help-floating,
.game .reroll-btn {
  z-index: 92 !important;
  backdrop-filter: none !important;
}

.game .turn-counter,
.game .objectives-btn {
  background: rgba(3, 6, 10, 0.96) !important;
}

.game .run-compass {
  background: linear-gradient(180deg, rgba(20, 15, 9, 0.97), rgba(14, 11, 8, 0.97)) !important;
}

.game .run-compass-line {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.game .run-compass-action {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* ===== HUD REBOOT (single source of truth) ===== */
.game .gauges {
  padding: 22px 86px 34px 86px !important;
}

.game .gauge {
  gap: 5px;
}

.game .gauge-subtitle {
  min-height: 11px;
}

.game .run-mission {
  display: none !important;
}

.game.hud-show-objectives .run-compass {
  display: none !important;
}

.game.hud-show-objectives.run-compass-open .run-compass {
  display: block !important;
}

.game .run-compass {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 122px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 94 !important;
  width: min(92%, 430px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 224, 103, 0.44);
  background: linear-gradient(180deg, rgba(9, 12, 16, 0.98), rgba(8, 10, 14, 0.98)) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.46);
}

.game .run-compass-title {
  margin-bottom: 4px;
}

.game .run-compass-line {
  display: block;
  font-size: 12px;
  line-height: 1.28;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.game .run-compass-help-floating {
  top: calc(env(safe-area-inset-top, 0px) + 119px);
  left: 14px;
  right: auto;
  z-index: 95 !important;
}

.game .run-compass-help {
  width: 26px;
  height: 26px;
  border-radius: 999px !important;
  padding: 0;
  display: grid;
  place-items: center;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.game .run-compass-help.is-open {
  border-color: rgba(83, 246, 161, 0.78);
  color: #9dffd1;
}

@media (max-width: 520px) {
  .game .gauges {
    padding: 14px 40px 18px 40px !important;
  }

  .game .run-compass-help-floating {
    top: calc(env(safe-area-inset-top, 0px) + 104px);
    left: 10px;
  }

  .game .run-compass {
    top: calc(env(safe-area-inset-top, 0px) + 138px);
    width: calc(100% - 20px);
  }
}

