/* Estilos custom complementarios a Tailwind */

/* Fuente */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

* {
    font-family: 'Fredoka', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    min-height: 100dvh;
    background: url('../assets/bg_anime.png') center/cover no-repeat fixed, linear-gradient(135deg, #a1c4fd, #c2e9fb);
    overflow-x: hidden;
}

/* ========== Pantallas ========== */
.screen {
    display: none;
    min-height: 100dvh;
    width: 100%;
    padding: 1rem;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Bienvenida ========== */
.welcome-title {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f093fb, #f5576c, #fda085);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    line-height: 1.1;
}

.welcome-subtitle {
    color: #475569;
    font-size: 1.2rem;
    font-weight: 500;
}

/* ========== Botones ========== */
.btn-primary {
    background: #ff6b6b;
    color: white;
    border: 3px solid #ab0000;
    padding: 1rem 2.5rem;
    border-radius: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 6px 0px #ab0000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 4px 0px #ab0000;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 0px 0px #ab0000;
}

.btn-secondary {
    background: #ffffff;
    border: 3px solid #cbd5e1;
    color: #475569;
    padding: 0.75rem 2rem;
    border-radius: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 4px 0px #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 0px #94a3b8;
    transform: translateY(2px);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #94a3b8;
}

/* ========== Cards & Glass ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 1rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

/* ========== Inputs ========== */
.input-field {
    background: #ffffff;
    border: 3px solid #cbd5e1;
    border-radius: 1.25rem;
    padding: 0.75rem 1rem;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.input-field::placeholder {
    color: #94a3b8;
}

.input-field:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

/* ========== Jugador Card (Revelación) ========== */
.player-reveal-btn {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.25rem;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: left;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    box-shadow: 0 4px 0px #e2e8f0;
}

.player-reveal-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #e2e8f0;
}

.player-reveal-btn.viewed {
    border-color: #10b981;
    background: #d1fae5;
    box-shadow: 0 4px 0px #059669;
}

.player-reveal-btn.revealing {
    overflow: visible;
    z-index: 50;
    transform: translateY(4px);
    box-shadow: 0 0px 0px #e2e8f0;
}

.player-reveal-btn .word-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 104%;
    min-height: 105%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1.15rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    padding: 1.5rem 1rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.player-reveal-btn .word-overlay.impostor {
    background: linear-gradient(135deg, #f5576c, #ff6b6b);
}

.player-reveal-btn .word-overlay.civil {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.player-reveal-btn.revealing .word-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.view-counter {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========== Categorías ========== */
.category-btn {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1rem;
    color: #1e293b;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: center;
    box-shadow: 0 4px 0px #e2e8f0;
}

.category-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0px #e2e8f0;
    border-color: #cbd5e1;
}

.category-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #e2e8f0;
}

.category-btn.selected {
    border-color: #3b82f6;
    box-shadow: 0 4px 0px #2563eb;
    background-color: #eff6ff;
}

/* ========== Countdown ========== */
.countdown-timer {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.countdown-timer.warning {
    background: linear-gradient(135deg, #fda085, #f5576c);
    -webkit-background-clip: text;
    background-clip: text;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.progress-bar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    height: 8px;
    width: 100%;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    border-radius: 999px;
    transition: width 1s linear;
}

/* ========== Votación ========== */
.vote-btn {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.1s ease;
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 0px #e2e8f0;
}

.vote-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0px #e2e8f0;
    border-color: #cbd5e1;
}

.vote-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #e2e8f0;
}

.vote-btn.selected {
    border-color: #ef4444;
    background: #fee2e2;
    box-shadow: 0 4px 0px #dc2626;
}

.vote-btn.voted {
    border-color: #10b981;
    background: #d1fae5;
    opacity: 0.7;
    pointer-events: none;
    box-shadow: 0 0px 0px #059669;
    transform: translateY(4px);
}

/* ========== Resultado ========== */
.result-icon {
    font-size: 5rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ========== Player Counter ========== */
.player-counter {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.counter-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #cbd5e1;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 0px #cbd5e1;
}

.counter-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 0px #94a3b8;
    transform: translateY(2px);
}

.counter-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #94a3b8;
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: 0 0px 0px #cbd5e1;
    transform: translateY(4px);
}

.counter-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    min-width: 3rem;
    text-align: center;
}

/* ========== Rules toggle ========== */
.rules-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.rules-content.open {
    max-height: 600px;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

/* ========== Modo Visual (Imágenes) ========== */
.word-img-container {
    width: 140px;
    height: 140px;
    background: #ffffff;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.word-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== Responsive ========== */
@media (max-width: 400px) {
    .welcome-title {
        font-size: 2.5rem;
    }

    .countdown-timer {
        font-size: 4rem;
    }
}

/* ========== Categorías con Imágenes ========== */
.category-img-card {
    aspect-ratio: 1.25 / 1;
    padding: 0 !important;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    position: relative;
    background-color: #ffffff;
    background-size: 85%;
    background-repeat: no-repeat;
    background-position: center top;
}

.category-img-overlay {
    width: 100%;
    background: linear-gradient(to top, 
        rgba(255,255,255,1) 0%, 
        rgba(255,255,255,0.8) 50%, 
        rgba(255,255,255,0) 100%
    );
    padding: 1.2rem 0.25rem 0.35rem 0.25rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    border-top: none;
}