@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=swap');

/* --- CONFIGURACIÓN GLOBAL --- */
:root {
    --rojo-sangre: #8b0000;
    --rojo-hover: #a30000;
    --negro-fondo: #121212;
    --gris-oscuro: #1a1a1a;
    --gris-borde: #2a2a2a;
    --texto-principal: #e8e8e8;
    --texto-secundario: #888;
}

*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    background: var(--negro-fondo);
    color: var(--texto-principal);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.container { 
    max-width: 480px; 
    margin: 0 auto; 
    padding: 1rem 1.5rem 3rem;
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}

/* --- ANIMACIONES --- */
.screen { display: none; opacity: 0; }
.screen.active { display: block; animation: fadeIn 0.4s ease forwards; }

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

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.3; }
}

/* --- BRANDING --- */
.titulo { 
    font-family: 'Bebas Neue', sans-serif; 
    font-size: 56px; 
    letter-spacing: 5px; 
    color: var(--rojo-sangre); 
    line-height: 0.9; 
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.subtitulo { 
    font-size: 11px; 
    letter-spacing: 4px; 
    text-transform: uppercase; 
    color: #444; 
    margin-bottom: 1.5rem;
    animation: flicker 4s linear infinite;
}

.bloodline { 
    width: 45px; 
    height: 2px; 
    background: var(--rojo-sangre); 
    margin: 1rem 0 2rem; 
}

.label { 
    font-size: 10px; 
    letter-spacing: 4px; 
    text-transform: uppercase; 
    color: #555; 
    margin-bottom: 12px; 
}

.instruccion {
    font-size: 15px;
    color: var(--texto-secundario);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* --- LISTA DE JUGADORES --- */
.player-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.player-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--gris-borde);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-num { 
    font-family: 'Bebas Neue', sans-serif; 
    color: var(--rojo-sangre); 
    font-size: 14px; 
    letter-spacing: 1px;
}

.player-fields { display: flex; flex-direction: column; gap: 10px; }
.player-sub { display: flex; gap: 10px; align-items: center; }

.vm-input, .vm-select { 
    background: #080808; 
    border: 1px solid var(--gris-borde); 
    color: #fff; 
    padding: 14px; 
    font-size: 16px; 
    border-radius: 4px; 
    outline: none; 
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}

.vm-input:focus { border-color: var(--rojo-sangre); box-shadow: 0 0 5px rgba(139, 0, 0, 0.2); }
.vm-input::placeholder { color: #333; }
.vm-select option { background: #080808; }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

.btn-remove { 
    background: none; 
    border: none; 
    color: #555; 
    font-size: 20px; 
    cursor: pointer;
}

/* --- TOGGLE ROLES FALSOS --- */
.toggle-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 20px 0; 
    border-top: 1px solid var(--gris-borde); 
    margin-top: 15px;
    margin-bottom: 1.5rem;
}

.toggle-label { 
    font-family: 'Bebas Neue', sans-serif; 
    font-size: 18px; 
    letter-spacing: 1.5px; 
    color: var(--texto-principal);
}

.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute; cursor: pointer; inset: 0; 
    background: #2a2a2a; transition: .3s; border-radius: 30px;
}

.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px;
    left: 4px; bottom: 4px; background: white; transition: .3s; border-radius: 50%;
}

input:checked + .slider { background: var(--rojo-sangre); }
input:checked + .slider:before { transform: translateX(22px); }

/* --- BOTONES PRINCIPALES --- */
.btn-primary, .btn-instrucciones {
    width: 100%; 
    background: var(--rojo-sangre); 
    color: #fff; 
    border: none;
    padding: 20px; 
    font-family: 'Bebas Neue', sans-serif; 
    font-size: 24px;
    letter-spacing: 4px; 
    border-radius: 4px; 
    cursor: pointer; 
    text-decoration: none;
    display: block; 
    text-align: center; 
    margin-bottom: 15px;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:active { background: var(--rojo-hover); transform: scale(0.98); }
.btn-primary:disabled { background: #222; color: #444; cursor: not-allowed; opacity: 0.4; transform: none; }

.btn-agregar {
    width: 100%; 
    background: transparent; 
    border: 1px dashed #444;
    color: var(--texto-secundario); 
    padding: 14px; 
    font-family: 'Bebas Neue', sans-serif;
    font-size: 15px; 
    letter-spacing: 2px; 
    margin-bottom: 2rem; 
    border-radius: 4px;
    cursor: pointer;
}

/* --- COUNTER --- */
.counter { 
    color: var(--rojo-sangre); 
    font-family: 'Bebas Neue', sans-serif; 
    font-size: 18px; 
    text-align: center; 
    margin-bottom: 20px; 
    letter-spacing: 2px;
}

.warning {
    font-size: 11px;
    color: var(--rojo-sangre);
    text-align: center;
    margin-top: 10px;
    min-height: 16px;
    letter-spacing: 1px;
}

/* --- PANTALLAS DE JUEGO --- */
.nombre-jugador {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    letter-spacing: 4px;
    color: var(--texto-principal);
    margin-bottom: 0.5rem;
}

.rol-nombre {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    color: var(--rojo-sangre);
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.rol-desc {
    font-size: 15px;
    color: var(--texto-secundario);
    line-height: 1.8;
    white-space: pre-line;
}

.villain-extra {
    border-left: 2px solid var(--rojo-sangre);
    padding-left: 1rem;
    margin-top: 1.5rem;
}

.complice-nombre {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 3px;
    color: var(--texto-principal);
    margin-top: 4px;
}

/* --- ROL FALSO HINT --- */
.rol-falso-hint {
    margin-top: 1rem;
    padding: 12px 16px;
    border-left: 2px solid var(--rojo-sangre);
    font-size: 13px;
    color: var(--texto-secundario);
    letter-spacing: 0.5px;
    line-height: 1.6;
}

/* --- PICKER (botones de selección de jugador) --- */
.picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 1.5rem 0;
}

.picker-btn {
    width: 100%;
    background: var(--gris-oscuro);
    border: 1px solid var(--gris-borde);
    color: var(--texto-principal);
    padding: 18px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.picker-btn:active, .picker-btn.selected { 
    border-color: var(--rojo-sangre); 
    background: #1f0000; 
    color: #fff; 
}

/* --- TIMER --- */
.timer-wrap {
    margin: 2rem 0 1.5rem;
}

.timer-bar-bg {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-bar {
    height: 100%;
    background: var(--rojo-sangre);
    width: 100%;
    transition: width 1s linear;
    border-radius: 2px;
}

.timer-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 32px;
    color: var(--rojo-sangre);
    letter-spacing: 4px;
}

/* --- ALIVE LIST (debate) --- */
.alive-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1rem 0 2rem;
}

.alive-chip {
    background: var(--gris-oscuro);
    border: 1px solid var(--gris-borde);
    color: var(--texto-secundario);
    padding: 6px 14px;
    font-size: 13px;
    letter-spacing: 1px;
    border-radius: 20px;
}

/* --- GAMEOVER --- */
.gameover-roles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1.5rem;
}

.gameover-role-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #1e1e1e;
    color: var(--texto-secundario);
}

.gameover-role-row span:first-child { color: var(--texto-principal); }
.gameover-role-row span:last-child { color: var(--texto-secundario); }
.villain-tag { color: var(--rojo-sangre) !important; }

/* --- MODOS DE JUEGO --- */
.mode-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.mode-btn {
    background: var(--gris-oscuro);
    border: 1px solid var(--gris-borde);
    padding: 20px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mode-btn:active { border-color: var(--rojo-sangre); background: #1f0000; }

.mode-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 4px;
    display: block;
}

.mode-players {
    font-size: 11px;
    color: var(--texto-secundario);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

/* --- INSTRUCCIONES --- */
.instr-text {
    font-size: 14px;
    color: var(--texto-secundario);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.instr-rol {
    font-size: 15px;
    color: var(--texto-principal);
    font-weight: 500;
    margin-bottom: 4px;
    margin-top: 1rem;
}

.instr-paso {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    letter-spacing: 3px;
    color: var(--rojo-sangre);
    margin-bottom: 4px;
    margin-top: 1rem;
}

/* --- FOOTER --- */
.footer-brand { 
    margin-top: auto; 
    padding-top: 3rem; 
    font-size: 11px; 
    letter-spacing: 5px; 
    color: #2a2a2a; 
    text-align: center; 
    text-transform: uppercase;
}

#screen-transition {
  align-items: center;
  justify-content: center;
  height: 100vh;
}

#screen-transition.active {
  display: flex;
}

#screen-transition {
  background: #000;
}

#transitionText {
  font-size: 48px;
  letter-spacing: 4px;
  animation: fadeZoom 1s ease, flicker 2s infinite;
}

@keyframes fadeZoom {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
