:root {
    --primary: #6a11cb;
    --primary-dark: #2575fc;
    --secondary: #ff4b2b;
    --accent: #ffb75e;
    --background: #0f0c29;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --option-a: #e21b3c;
    --option-b: #1368ce;
    --option-c: #d89e00;
    --option-d: #26890c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #6a11cb);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.btn-icon {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-icon.muted .icon {
    opacity: 0.5;
}

.btn-icon.muted::after {
    content: '/';
    position: absolute;
    font-size: 1.2rem;
    color: var(--secondary);
    font-weight: bold;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
    background: linear-gradient(to right, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-logo {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.view {
    display: none;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.view.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-container {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
}

.primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.6);
}

.secondary {
    background: linear-gradient(45deg, var(--secondary), var(--accent));
    color: white;
}

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

.file-input {
    display: none;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.setup-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem 2rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.setup-card h3 {
    margin-bottom: 1rem;
}

.setup-card p {
    margin-bottom: 2rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.setup-card .btn {
    margin-bottom: 1rem;
}

.status-msg {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.status-msg.ready {
    color: #4CAF50;
    font-weight: bold;
}

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: 100%;
}

.game-sidebar .glass-container {
    height: 600px;
    padding: 1.5rem;
    text-align: left;
    overflow-y: auto;
}

.teams-list {
    margin-top: 1.5rem;
}

.team-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--primary);
}

.team-name {
    font-weight: 800;
    display: block;
}

.player-count {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.separator {
    border: 0;
    border-top: 1px solid var(--glass-border);
    margin: 1.5rem 0;
}

/* Leaderboard */
.leaderboard-list {
    margin-bottom: 1.5rem;
}

.leader-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.leader-item.first {
    background: linear-gradient(45deg, rgba(255, 183, 94, 0.2), rgba(255, 75, 43, 0.2));
    border: 1px solid var(--accent);
}

.leader-name {
    font-weight: 600;
}

.leader-score {
    font-weight: 800;
    color: var(--accent);
}

/* Roulette Styles */
.roulette-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    /* Aumentado de 1.5rem */
}

.selection-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.selection-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 1rem 2rem;
    border-radius: 15px;
    min-width: 200px;
}

.selection-card .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.selection-card .value {
    font-size: 1.4rem;
    font-weight: 700;
}

.roulette-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    margin-bottom: 2rem;
    /* Espacio adicional inferior */
}

.game-actions {
    display: flex;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

.roulette-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--secondary);
    z-index: 10;
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 1300px;
    width: 95vw;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
}

.modal-content.maximized {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}

.modal-content.minimized {
    max-width: 400px;
    height: auto;
    position: fixed;
    bottom: 20px;
    right: 20px;
    transform: none;
}

.modal-content.minimized .modal-body-horizontal,
.modal-content.minimized .modal-footer {
    display: none;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.win-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: all 0.2s;
}

.win-btn span {
    display: block;
    line-height: 1;
}

.win-btn.minimize {
    background: #ffbd44;
}

.win-btn.maximize {
    background: #00ca4e;
}

.win-btn.close {
    background: #ff605c;
}

.win-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.modal-body-horizontal {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0;
    flex: 1;
    overflow-y: visible;
}

.question-text-section {
    flex: 1.2;
    display: flex;
    align-items: center;
}

.options-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-content: center;
}

.question-header {
    margin-bottom: 2rem;
}

.question-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timer-display {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(255, 75, 43, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.timer-display.warning {
    background: #f44336;
    animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 25px rgba(244, 67, 54, 0.7);
    }

    100% {
        transform: scale(1);
    }
}

#question-category {
    background: var(--primary);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

#current-question-text {
    margin-top: 0;
    font-size: 1.8rem;
    line-height: 1.3;
}

/* removed options-grid here as it was moved up */

.option-btn {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    width: 100%;
}

.option-btn:hover {
    transform: scale(1.02);
}

.option-btn.a {
    background-color: var(--option-a);
}

.option-btn.b {
    background-color: var(--option-b);
}

.option-btn.c {
    background-color: var(--option-c);
}

.option-btn.d {
    background-color: var(--option-d);
}

.option-shape {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-message {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 1rem 0;
    min-height: 2rem;
    transition: all 0.3s ease;
}

.feedback-message.correct {
    color: #4CAF50;
    animation: bounce 0.5s ease;
}

.feedback-message.incorrect {
    color: #f44336;
    animation: shake 0.5s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

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

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.modal-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.timer-display.small {
    width: 80px;
    height: 40px;
    border-radius: 20px;
    font-size: 1.2rem;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

/* Winner Section */
.winner-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti-placeholder {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.winner-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 2.5rem;
    border-radius: 24px;
    margin: 2rem 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.winner-name {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.winner-score {
    font-size: 1.5rem;
    opacity: 0.9;
}

.final-results-table {
    margin-top: 3rem;
    text-align: left;
}

.final-results-table h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.final-leaderboard .leader-item {
    padding: 1.2rem;
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .setup-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.striking-message {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 183, 94, 0.5), 0 0 20px rgba(255, 75, 43, 0.3);
    animation: glow-pulse 3s infinite ease-in-out;
    letter-spacing: 1px;
}

@keyframes glow-pulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 183, 94, 0.5), 0 0 20px rgba(255, 75, 43, 0.3);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(255, 183, 94, 0.8), 0 0 40px rgba(255, 75, 43, 0.5);
        color: #ffffff;
    }
}