:root {
  --bg-primary: #0a0c10;
  --bg-card: rgba(18, 22, 30, 0.92);
  --bg-dossier: rgba(22, 28, 38, 0.95);
  --yellow-crime: #facc15;
  --yellow-crime-glow: rgba(250, 204, 21, 0.5);
  --red-blood: #f43f5e;
  --blue-police: #38bdf8;
  --border-crime: rgba(250, 204, 21, 0.35);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --font-typewriter: 'Special Elite', monospace;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --shadow-elevated: 0 16px 40px -10px rgba(0, 0, 0, 0.85);
}

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

body.theme-crime {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Rain Canvas */
#rain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}

.ambient-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(20, 26, 40, 0.5) 0%, rgba(8, 10, 14, 0.98) 100%);
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* POLICE TAPE BANNER */
.police-tape-bar {
  background: repeating-linear-gradient(
    -45deg,
    #facc15,
    #facc15 18px,
    #000 18px,
    #000 36px
  );
  color: #000;
  font-family: var(--font-typewriter);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.25rem 0;
  text-align: center;
  letter-spacing: 0.15em;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.police-tape-bar span {
  background: #facc15;
  padding: 0 1rem;
}

/* TOP HEADER */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2.5rem;
  background: rgba(12, 16, 24, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border-crime);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.5));
}

.brand-text .game-subtitle {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--yellow-crime);
  font-family: var(--font-typewriter);
}

.brand-text .game-main-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.03em;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.act-badge {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--yellow-crime);
  color: #fef08a;
  padding: 0.4rem 1.1rem;
  border-radius: 4px;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.omen-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--blue-police);
  color: #e0f2fe;
  padding: 0.4rem 1.1rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.captain-badge {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid var(--red-blood);
  color: #fecdd3;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.captain-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: var(--font-typewriter);
}

.captain-name {
  font-weight: 800;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--yellow-crime);
  box-shadow: 0 0 12px var(--yellow-crime-glow);
}

.hud-btn.highlight {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(202, 138, 4, 0.4));
  border-color: var(--yellow-crime);
  color: #fff;
}

/* LOBBY WAITING ROOM ON MASTER STAGE */
.lobby-stage-card {
  background: var(--bg-dossier);
  border: 2px solid var(--yellow-crime);
  border-radius: 12px;
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow-elevated), 0 0 35px var(--yellow-crime-glow);
}

.lobby-stage-card.hidden {
  display: none;
}

.dossier-frame.hidden {
  display: none;
}

.lobby-badge-top {
  display: inline-block;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--yellow-crime);
  color: #fef08a;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 0.4rem 1.2rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Selettore Fascicolo d'Indagine nella Lobby */
.lobby-case-selector-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--border-crime);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  margin: 0 auto 1.6rem auto;
  max-width: 780px;
  width: 95%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.case-selector-badge {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--yellow-crime);
  white-space: nowrap;
  letter-spacing: 0.06em;
}

.lobby-case-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  text-overflow: ellipsis;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.lobby-case-select:hover,
.lobby-case-select:focus {
  border-color: var(--yellow-crime);
  box-shadow: 0 0 14px var(--yellow-crime-glow);
}

.lobby-case-select option {
  background: #0f172a;
  color: #fff;
  padding: 0.6rem;
}

.lobby-case-title {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.6rem;
}

.lobby-case-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto 2rem auto;
  line-height: 1.5;
}

.lobby-connect-box {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
}

.lobby-qr-slot img {
  width: 220px;
  height: 220px;
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
  display: block;
  margin: 0 auto 0.6rem auto;
}

.lobby-qr-url {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--yellow-crime);
  word-break: break-all;
}

.lobby-joined-roster {
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.roster-title {
  font-family: var(--font-typewriter);
  font-size: 0.95rem;
  color: var(--yellow-crime);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.lobby-players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1;
  align-content: flex-start;
}

.lobby-waiting-text {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.lobby-agent-pill {
  background: rgba(20, 26, 40, 0.9);
  border: 1.5px solid var(--border-crime);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-start-investigation {
  background: linear-gradient(135deg, #facc15, #ca8a04);
  color: #000;
  border: none;
  font-family: var(--font-typewriter);
  font-size: 1.3rem;
  font-weight: 900;
  padding: 1.2rem 3rem;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.5);
  transition: all 0.2s ease;
}

.btn-start-investigation:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 0 35px rgba(250, 204, 21, 0.7);
}

.btn-start-investigation:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* MAIN CRIME DOSSIER STAGE */
.scene-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.story-scroll-container {
  width: 100%;
}

.dossier-frame {
  background: var(--bg-dossier);
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 12px;
  padding: 2.75rem 3.5rem;
  box-shadow: var(--shadow-elevated), 0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

/* Red Stamp */
.stamp-confidential {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  border: 2.5px solid var(--red-blood);
  color: var(--red-blood);
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.35rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transform: rotate(5deg);
  opacity: 0.85;
  pointer-events: none;
}

/* SCENE TITLE */
.scene-header {
  text-align: center;
  margin-bottom: 2rem;
}

.scene-node-id {
  font-family: var(--font-typewriter);
  font-size: 0.9rem;
  color: var(--yellow-crime);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.scene-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  margin-bottom: 0.85rem;
}

.ornamental-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  max-width: 400px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-crime), transparent);
}

.divider-diamond {
  font-size: 1.1rem;
}

/* VISUAL EVIDENCE BOX */
.scene-visual-box {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.evidence-picture-frame {
  background: #000;
  border: 4px double var(--yellow-crime);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(250, 204, 21, 0.2);
  max-width: 820px;
  width: 100%;
  text-align: center;
}

.evidence-picture-frame img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.evidence-caption {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--yellow-crime);
  letter-spacing: 0.15em;
  padding: 0.6rem 0.5rem 0.2rem;
  text-transform: uppercase;
}

/* AUDIO CLUE PLAYER */
.scene-audio-box {
  margin-bottom: 2rem;
}

.audio-clue-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1.5px solid var(--blue-police);
  border-radius: 10px;
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(56, 189, 248, 0.15);
}

.audio-clue-icon {
  font-size: 2.2rem;
  animation: pulseAudio 1.5s infinite alternate;
}

@keyframes pulseAudio {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.15); opacity: 1; }
}

.audio-clue-info {
  flex: 1;
}

.audio-clue-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.25rem;
}

.audio-clue-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
}

.btn-play-audio-clue {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid #38bdf8;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  font-family: var(--font-typewriter);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
  white-space: nowrap;
}

.btn-play-audio-clue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
  background: #38bdf8;
  color: #000;
}

.btn-play-audio-clue.playing {
  background: #10b981;
  border-color: #34d399;
  color: #000;
  animation: pulseButton 0.8s infinite alternate;
}

@keyframes pulseButton {
  from { box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
  to { box-shadow: 0 0 25px rgba(16, 185, 129, 0.9); }
}

/* NARRATIVE BODY */
.narrative-body {
  margin-bottom: 2.75rem;
  min-height: 130px;
}

.narrative-content {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  line-height: 1.85;
  color: #e2e8f0;
  font-weight: 300;
  white-space: pre-line;
  letter-spacing: 0.015em;
}

/* INTERACTION ARENA */
.interaction-arena {
  background: rgba(11, 15, 23, 0.85);
  border: 1.5px solid rgba(250, 204, 21, 0.25);
  border-radius: 8px;
  padding: 1.85rem 2.25rem;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.interaction-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.arena-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.interaction-prompt {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.turn-status-badge {
  display: inline-block;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  color: var(--yellow-crime);
  letter-spacing: 0.05em;
}

/* CHOICES GRID */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.choice-card {
  background: rgba(22, 28, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s ease;
}

.choice-card.highlight-winning {
  border-color: var(--yellow-crime);
  background: rgba(250, 204, 21, 0.15);
  box-shadow: 0 0 20px var(--yellow-crime-glow);
  transform: scale(1.02);
}

.choice-top {
  margin-bottom: 1rem;
}

.choice-number {
  font-family: var(--font-typewriter);
  font-size: 0.75rem;
  color: var(--yellow-crime);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.choice-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.choice-flavor {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* VOTING AREA */
.choice-voting-area {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.vote-bar-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ca8a04, #facc15);
  width: 0%;
  transition: width 0.4s ease;
}

.voters-tokens {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 28px;
  flex-wrap: wrap;
}

.voter-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-crime);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* FORENSIC TEST D20 ARENA */
.dice-arena-box {
  text-align: center;
  padding: 1.5rem;
}

.dice-target-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid var(--yellow-crime);
  padding: 0.6rem 1.6rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  font-family: var(--font-typewriter);
  font-size: 1.1rem;
  color: #fef08a;
}

.target-num {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--yellow-crime);
}

.dice-results-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.dice-result-card {
  background: rgba(26, 32, 48, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 1.25rem 1.8rem;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dice-result-card.success {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.dice-result-card.fail {
  border-color: var(--red-blood);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.35);
}

.dice-die-visual {
  font-size: 3rem;
  margin-bottom: 0.4rem;
  display: block;
}

.dice-player-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.dice-roll-score {
  font-family: var(--font-typewriter);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--yellow-crime);
  margin-top: 0.25rem;
}

/* PUZZLE / ENIGMA INVESTIGATIVO */
.puzzle-clue-alert {
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #e0f2fe;
}

.puzzle-clue-alert .clue-icon {
  font-size: 2.2rem;
}

/* BOTTOM FOOTER */
.party-footer {
  background: rgba(10, 14, 22, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--border-crime);
  padding: 1rem 2.5rem;
}

.party-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.party-header-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  color: var(--yellow-crime);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.master-quick-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.master-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  outline: none;
}

.master-small-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.master-small-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--yellow-crime);
}

.master-small-btn.danger:hover {
  border-color: var(--red-blood);
  color: #fecdd3;
}

.party-roster {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.no-players-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.player-token-card {
  background: rgba(20, 26, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 220px;
}

.player-token-card.has-voted {
  border-color: var(--yellow-crime);
  box-shadow: 0 0 15px var(--yellow-crime-glow);
}

.player-token-avatar {
  font-size: 1.8rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem;
  border-radius: 6px;
}

.player-token-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
}

.player-token-class {
  font-size: 0.75rem;
  color: var(--yellow-crime);
  margin-bottom: 0.35rem;
  font-family: var(--font-typewriter);
}

.token-hp-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 9999px;
  overflow: hidden;
}

.token-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  width: 100%;
}

.player-token-status {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* MODAL QR CODE */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.modal-card {
  background: #0f141d;
  border: 1.5px solid var(--yellow-crime);
  border-radius: 10px;
  padding: 2.5rem;
  width: 90%;
  max-width: 460px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-elevated), 0 0 30px var(--yellow-crime-glow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-header .modal-icon {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.network-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.net-tab-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.net-tab-btn.active {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(202, 138, 4, 0.4));
  border-color: var(--yellow-crime);
  color: #fff;
}

.qr-container {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.qr-container img {
  display: block;
  width: 220px;
  height: 220px;
}

.url-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.url-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fef08a;
  font-family: monospace;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  text-align: center;
  outline: none;
}

.btn-copy {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

/* DRAMATIC NOTIFICATION BANNER */
.dramatic-banner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 900;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dramatic-banner.hidden {
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.9);
}

.banner-inner {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.95), rgba(202, 138, 4, 0.95));
  color: #000;
  padding: 1.75rem 3.5rem;
  border-radius: 10px;
  box-shadow: 0 0 50px rgba(250, 204, 21, 0.7), 0 20px 40px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.banner-icon-top {
  font-size: 2.4rem;
  margin-bottom: 0.3rem;
}

.banner-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.banner-desc {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ===================================================
   RULES BRIEFING BANNER & RULES MODAL
   =================================================== */
.rules-briefing-banner {
  background: rgba(15, 20, 30, 0.85);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.rules-banner-header {
  text-align: center;
  margin-bottom: 1rem;
}

.rules-badge {
  display: inline-block;
  background: rgba(250, 204, 21, 0.2);
  color: var(--yellow-crime);
  border: 1px solid var(--yellow-crime);
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.35rem 1rem;
  border-radius: 20px;
}

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

.rule-box {
  background: rgba(26, 34, 50, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rule-box:hover {
  border-color: var(--yellow-crime);
  transform: translateY(-2px);
}

.rule-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.rule-body h4 {
  font-size: 0.95rem;
  color: var(--yellow-crime);
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.rule-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-rules-wide {
  max-width: 680px;
}

.rules-modal-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.rules-modal-section {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--yellow-crime);
  padding: 0.8rem 1rem;
  border-radius: 0 6px 6px 0;
}

.rules-modal-section h4 {
  color: var(--yellow-crime);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.rules-modal-section p {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* MASTER CONFIRMATION ADVANCE BAR */
.master-confirm-bar {
  margin-top: 1.75rem;
  border-radius: 12px;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* STATO 1: IN ATTESA CHE TUTTI SCELGANO (NON CLICCABILE) */
.master-confirm-bar.state-waiting {
  background: rgba(20, 25, 38, 0.85);
  border: 1.5px dashed rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: none;
}

.master-confirm-bar.state-waiting .confirm-texts h4 {
  color: var(--yellow-crime);
}

.master-confirm-bar.state-waiting .confirm-pulse-icon {
  animation: pulseWaitingIcon 1.5s infinite alternate;
}

@keyframes pulseWaitingIcon {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.12); opacity: 1; filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5)); }
}

.master-confirm-bar.state-waiting .btn-master-advance {
  background: #252e3d;
  color: #94a3b8;
  border: 1.5px solid #475569;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.75;
  transform: none;
  filter: grayscale(40%);
}

.master-confirm-bar.state-waiting .btn-master-advance:hover {
  background: #252e3d;
  transform: none;
  box-shadow: none;
}

/* STATO 2: TUTTI HANNO SCELTO! (PRONTO AL CLIC, VERDE SMERALDO PULSANTE) */
.master-confirm-bar.state-ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.4));
  border: 2.5px solid #10b981;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.5);
  animation: slideInConfirm 0.4s ease, pulseConfirmBorder 1.8s infinite alternate;
}

.master-confirm-bar.state-ready .confirm-texts h4 {
  color: #34d399;
}

.master-confirm-bar.state-ready .confirm-pulse-icon {
  animation: ringBell 1s infinite ease-in-out;
}

.master-confirm-bar.state-ready .btn-master-advance {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #000;
  border: 2px solid #6ee7b7;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.7);
  animation: pulseButtonReady 1.2s infinite alternate;
}

@keyframes pulseButtonReady {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(52, 211, 153, 0.5); }
  100% { transform: scale(1.05); box-shadow: 0 0 30px rgba(52, 211, 153, 0.95); }
}

.master-confirm-bar.state-ready .btn-master-advance:hover {
  background: #34d399;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 40px rgba(52, 211, 153, 0.95);
}

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

@keyframes pulseConfirmBorder {
  from { box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); border-color: #10b981; }
  to { box-shadow: 0 0 35px rgba(16, 185, 129, 0.7); border-color: #34d399; }
}

.confirm-prompt-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.confirm-pulse-icon {
  font-size: 2.5rem;
  display: inline-block;
}

@keyframes ringBell {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(15deg) scale(1.1); }
  40% { transform: rotate(-15deg) scale(1.1); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
}

.confirm-texts h4 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.confirm-texts p {
  font-size: 0.95rem;
  color: #e2e8f0;
}

.btn-master-advance {
  padding: 1rem 2.2rem;
  border-radius: 10px;
  font-family: var(--font-typewriter);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  white-space: nowrap;
}

/* ==========================================
   DEPISTAGGIO & SABOTAGGIO EFFETTI VISIVI
   ========================================== */
@keyframes sabotageShake {
  0% { transform: translate(0, 0) rotate(0deg); filter: brightness(1); }
  10% { transform: translate(-8px, 4px) rotate(-1deg); filter: brightness(1.4) hue-rotate(30deg); }
  25% { transform: translate(8px, -4px) rotate(1.5deg); filter: brightness(0.6); }
  40% { transform: translate(-6px, -6px) rotate(-1deg); filter: brightness(1.5); }
  55% { transform: translate(6px, 6px) rotate(1deg); filter: brightness(0.8); }
  70% { transform: translate(-4px, 2px) rotate(-0.5deg); }
  85% { transform: translate(3px, -2px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); filter: brightness(1); }
}

.sabotage-screen-shake {
  animation: sabotageShake 0.9s cubic-bezier(.36,.07,.19,.97) both;
}

.sabotage-alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 12, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 2rem;
  animation: fadeInSabotage 0.35s ease;
}

@keyframes fadeInSabotage {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.sabotage-alert-card {
  background: linear-gradient(145deg, #1c1017, #0f0b12);
  border: 2px solid #ef4444;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  padding: 2.5rem 2.8rem;
  box-shadow: 0 25px 60px rgba(239, 68, 68, 0.4), inset 0 0 35px rgba(239, 68, 68, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.sabotage-alert-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
  background-size: 200% 100%;
  animation: barPulse 2s linear infinite;
}

@keyframes barPulse {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.sabotage-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.sabotage-alert-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: #fecaca;
  margin-bottom: 1rem;
  line-height: 1.25;
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.sabotage-alert-text {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
}

.sabotage-alert-footer {
  font-size: 0.88rem;
  color: #94a3b8;
  font-style: italic;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

/* ==========================================
   STATO LETTURA FASCICOLO BLOCCATA
   ========================================== */
.locked-reading {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(40%);
  transition: all 0.4s ease;
  position: relative;
}

.reading-countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  font-family: var(--font-typewriter);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  animation: blinkReading 1.5s infinite alternate;
}

@keyframes blinkReading {
  from { border-color: rgba(245, 158, 11, 0.4); }
  to { border-color: rgba(245, 158, 11, 1); box-shadow: 0 0 12px rgba(245, 158, 11, 0.35); }
}

/* DRAMATIC BANNER */
.dramatic-banner {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e1b2e;
  border: 1.5px solid var(--yellow-crime);
  border-radius: 10px;
  padding: 1.2rem 1.8rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.7);
  z-index: 9999;
  transition: all 0.3s ease;
}
.dramatic-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.banner-inner {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.banner-icon-top {
  font-size: 1.8rem;
}
.banner-title {
  font-family: var(--font-serif);
  font-weight: 800;
  color: var(--yellow-crime);
  font-size: 1.1rem;
}
.banner-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* ===================================================
   ARENA READING PLACEHOLDER (QUANDO LA NARRAZIONE È IN CORSO)
   =================================================== */
.arena-reading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(18, 24, 38, 0.6);
  border: 1.5px dashed rgba(250, 204, 21, 0.4);
  border-radius: 12px;
  animation: pulseBorderReading 2s infinite alternate;
}

@keyframes pulseBorderReading {
  from { border-color: rgba(250, 204, 21, 0.3); box-shadow: 0 0 10px rgba(0,0,0,0.5); }
  to { border-color: rgba(250, 204, 21, 0.7); box-shadow: 0 0 20px rgba(250, 204, 21, 0.2); }
}

.quill-anim {
  font-size: 3.2rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: quillWrite 1.4s infinite ease-in-out alternate;
}

@keyframes quillWrite {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-12deg); }
  100% { transform: translateY(0) rotate(5deg); }
}

.arena-reading-title {
  font-family: var(--font-typewriter);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--yellow-crime);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.arena-reading-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 480px;
  line-height: 1.5;
}

.narrating-pulse {
  animation: textGlowPulse 1.5s infinite alternate;
}

@keyframes textGlowPulse {
  from { color: #cbd5e1; }
  to { color: var(--yellow-crime); text-shadow: 0 0 12px rgba(250, 204, 21, 0.4); }
}

/* ==========================================================================
   CASE CREATOR & AI IMPORTER MODAL STYLES
   ========================================================================== */

.case-selector-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-creator-trigger {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(56, 189, 248, 0.2));
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.5);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-creator-trigger:hover {
  background: linear-gradient(135deg, #eab308, #38bdf8);
  color: #000;
  border-color: #fef08a;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.5);
}

.modal-creator-wide {
  max-width: 860px !important;
  width: 95% !important;
  max-height: 88vh;
  overflow-y: auto;
  background: #090d16 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.15) !important;
}

.creator-tabs-nav {
  display: flex;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.4rem;
  gap: 0.5rem;
}

.creator-tab-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.2rem;
  font-family: var(--font-typewriter);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.creator-tab-btn:hover {
  color: #f8fafc;
}

.creator-tab-btn.active {
  color: #facc15;
  border-bottom-color: #facc15;
}

.creator-tab-pane {
  display: none;
}

.creator-tab-pane.active {
  display: block;
}

.creator-hint-box {
  background: rgba(30, 41, 59, 0.65);
  border-left: 4px solid #38bdf8;
  padding: 0.9rem 1.2rem;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 1.2rem;
}

.creator-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .creator-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.creator-input,
.creator-textarea,
.creator-select {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.creator-textarea {
  resize: vertical;
  line-height: 1.5;
}

.creator-input:focus,
.creator-textarea:focus,
.creator-select:focus {
  border-color: #facc15;
  outline: none;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.25);
}

.creator-action-bar {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

.creator-action-btn {
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-family: var(--font-typewriter);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.creator-action-btn.primary {
  background: linear-gradient(135deg, #ca8a04, #eab308);
  color: #000;
  border-color: #fef08a;
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.4);
}

.creator-action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(250, 204, 21, 0.6);
  background: #facc15;
}

.creator-action-btn.secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}

.creator-action-btn.secondary:hover {
  background: #334155;
  color: #fff;
}

.creator-progress-box {
  text-align: center;
  padding: 2.2rem 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 8px;
  margin-top: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.creator-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(250, 204, 21, 0.2);
  border-top-color: #facc15;
  border-radius: 50%;
  animation: spinCreator 1s linear infinite;
  margin: 0 auto 1.2rem;
}

@keyframes spinCreator {
  to { transform: rotate(360deg); }
}

.creator-progress-title {
  font-family: var(--font-typewriter);
  font-size: 1.2rem;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.creator-progress-step {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.5;
}

.creator-feedback-box {
  padding: 1rem 1.2rem;
  border-radius: 6px;
  margin-top: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.creator-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.creator-feedback-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.creator-progress-box.hidden,
.creator-feedback-box.hidden,
.md-guide-collapsible.hidden {
  display: none !important;
}

.status-indicator-text {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  color: #94a3b8;
}

/* Template Helper Styles in Import Markdown Tab */
.template-actions-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-template-action {
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: var(--font-typewriter);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-template-action:hover {
  background: #38bdf8;
  color: #000;
  border-color: #7dd3fc;
  transform: translateY(-1px);
}

.btn-template-action.secondary {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.4);
}

.btn-template-action.secondary:hover {
  background: #facc15;
  color: #000;
  border-color: #fef08a;
}

.md-guide-collapsible {
  background: #050811;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.2rem;
  max-height: 260px;
  overflow-y: auto;
}

.md-guide-header {
  font-family: var(--font-typewriter);
  font-size: 0.82rem;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.md-guide-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: pre-wrap;
  line-height: 1.45;
}

/* ==========================================================================
   INTELLIGENCE & SUGGESTIONS DOSSIER (ADMIN / MASTER)
   ========================================================================== */
.modal-intelligence-dossier {
  max-width: 920px;
  width: 95%;
  max-height: 90vh;
  background: radial-gradient(circle at top, rgba(30, 41, 59, 0.96) 0%, rgba(10, 15, 26, 0.98) 100%);
  border: 1px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(250, 204, 21, 0.12);
  border-radius: 14px;
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow: hidden;
  position: relative;
}

/* Header */
.dossier-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.1rem;
}

.dossier-badge-glow {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(250, 204, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.2);
  flex-shrink: 0;
}

.dossier-crest {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.dossier-header-text {
  text-align: left;
}

.dossier-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #facc15;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.dossier-title {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: 1.55rem;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.dossier-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
}

/* Stats Counter Grid */
.dossier-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.dossier-stat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dossier-stat-card:hover {
  transform: translateY(-2px);
}

.dossier-stat-card.stat-gold {
  border-color: rgba(250, 204, 21, 0.3);
}
.dossier-stat-card.stat-cyan {
  border-color: rgba(56, 189, 248, 0.3);
}
.dossier-stat-card.stat-purple {
  border-color: rgba(168, 85, 247, 0.3);
}

.dossier-stat-card .stat-icon {
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dossier-stat-card .stat-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dossier-stat-card .stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-family: 'Cinzel', serif;
}

.dossier-stat-card .stat-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* Action Tools Bar */
.dossier-tools-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dossier-actions-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dossier-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-ai-prompt {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.2));
  color: #f5d0fe;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.btn-ai-prompt:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(236, 72, 153, 0.35));
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
}

.btn-secondary-dossier {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary-dossier:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-1px);
}

.dossier-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
  max-width: 380px;
}

.dossier-search-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  color: #64748b;
  font-size: 0.85rem;
  pointer-events: none;
}

.dossier-search-wrap input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 2.2rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.dossier-search-wrap input:focus {
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.2);
}

.btn-clear-search {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* Category Filter Tabs */
.dossier-filter-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}

.dossier-filter-tabs::-webkit-scrollbar {
  display: none;
}

.fb-filter-tab {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.38rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
}

.fb-filter-tab:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
}

.fb-filter-tab.active {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(217, 119, 6, 0.2));
  color: #fef08a;
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.18);
}

.fb-filter-tab .tab-count {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Feedback List Container */
.master-feedback-list {
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-right: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.4) rgba(15, 23, 42, 0.6);
}

.master-feedback-list::-webkit-scrollbar {
  width: 6px;
}

.master-feedback-list::-webkit-scrollbar-thumb {
  background: rgba(250, 204, 21, 0.35);
  border-radius: 3px;
}

/* Individual Feedback Card */
.feedback-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9) 0%, rgba(10, 15, 26, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #facc15;
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.feedback-card:hover {
  transform: translateY(-2px);
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(250, 204, 21, 0.1);
}

.feedback-card.cat-trama { border-left-color: #38bdf8; }
.feedback-card.cat-regole { border-left-color: #facc15; }
.feedback-card.cat-grafica { border-left-color: #c084fc; }
.feedback-card.cat-generale { border-left-color: #34d399; }

.feedback-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feedback-sender-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.feedback-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(250, 204, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.feedback-sender {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.feedback-sender-class {
  font-size: 0.74rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 500;
}

.feedback-cat-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid transparent;
}

.feedback-cat-trama {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.feedback-cat-regole {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
}

.feedback-cat-grafica {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
}

.feedback-cat-altro,
.feedback-cat-generale {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.feedback-context-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  width: fit-content;
}

.feedback-body-text {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.55;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.85rem 1.05rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: inherit;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.feedback-body-text::before {
  content: '“';
  position: absolute;
  top: -0.1rem;
  left: 0.4rem;
  font-size: 2.2rem;
  color: rgba(250, 204, 21, 0.15);
  font-family: serif;
  line-height: 1;
  pointer-events: none;
}

.feedback-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.feedback-time-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #64748b;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.fb-card-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
}

.fb-card-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(250, 204, 21, 0.4);
}

.fb-card-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* Empty State Card */
.feedback-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.feedback-empty-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 0.7rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.feedback-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.35rem;
}

.feedback-empty-desc {
  font-size: 0.86rem;
  color: #64748b;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Admin Toast */
.admin-feedback-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #0f172a;
  border: 1px solid #facc15;
  color: #f8fafc;
  padding: 0.75rem 1.3rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 15px rgba(250, 204, 21, 0.25);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-feedback-toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}



