
/* --- GLOBAL & VARIABLES --- */
:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --accent-color: #f72585;
    --bg-dark: #121212;
    --text-light: #ffffff;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Montserrat', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
}

/* --- LAYOUT & CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.container-setup {
    margin-top: 60px;
    margin-bottom: 60px;
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    letter-spacing: 1px;
    background: linear-gradient(45deg, var(--primary-color), #00d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.btn-nav-action {
    background: var(--primary-color);
    color: white;
}

.nav-link.btn-nav-action:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 20px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 5px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.btn:focus { outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); }

.btn-success { background-color: #28a745; color: white; }
.btn-success:hover { background-color: #218838; }

.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover { background-color: #c82333; }

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { filter: brightness(0.9); }

/* --- DISPLAY / TELÃO STYLES --- */

.display-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 50px;
    box-sizing: border-box;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

/* Tracks Area */
.tracks-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 60px; /* Aumentado de 20px para 60px para evitar sobreposição do avatar */
    position: relative;
    padding-left: 20px; /* Adicionado um pouco de respiro na esquerda */
}

.team-info {
    width: 180px; /* Aumentado um pouco */
    text-align: right;
    font-weight: bold;
    font-family: var(--font-display);
    font-size: 1.8rem; /* Aumentado */
    text-shadow: 0 0 15px rgba(0,0,0,0.9);
    z-index: 2;
    line-height: 1;
}

.track-line {
    flex-grow: 1;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
}

/* Markers on the track */
.track-step {
    position: absolute;
    width: 2px;
    height: 20px;
    background: rgba(255,255,255,0.05);
    top: -4px;
}

/* Avatar */
.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    box-shadow: 0 0 20px currentColor;
    border: 4px solid white;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy effect */
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.avatar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 30px currentColor;
    opacity: 0.6;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Finish Line */
.finish-line {
    position: absolute;
    right: 0;
    height: 40px;
    width: 10px;
    background-image: repeating-linear-gradient(
        45deg,
        #fff,
        #fff 10px,
        #000 10px,
        #000 20px
    );
    opacity: 0.5;
}

/* Question Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.question-card {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    padding: 60px;
    border-radius: 30px;
    max-width: 80%;
    width: 1000px;
    text-align: center;
    box-shadow: 0 0 100px rgba(0, 123, 255, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active .question-card {
    transform: scale(1);
}

.overlay-team-header {
    font-size: 3rem;
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    display: block;
    text-shadow: 0 0 20px currentColor;
}

.q-category {
    font-size: 2rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 20px;
}

.q-text {
    font-size: 3.5rem;
    font-family: var(--font-display);
    line-height: 1.2;
    margin-bottom: 40px;
}

.q-timer {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Turn Indicator in Background */
.turn-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: background 1s;
    opacity: 0.1;
}

/* --- Refactored Setup Styles --- */
.setup-header { 
    margin-bottom: 40px; 
    text-align: center; 
}

.setup-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setup-desc { 
    color: #aaa; 
    font-size: 1.1rem;
}

.tab-container { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 30px; 
    justify-content: center; 
}

.tab-btn { 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 12px 25px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-btn.active { 
    background: var(--primary-color); 
    color: #000;
    font-weight: bold;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.tab-btn.active .badge-count {
    background: white;
    color: var(--primary-color);
}

.setup-card, .card { 
    background: #1e1e1e;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
}

.setup-card {
    max-width: 800px; 
    margin-left: auto;
    margin-right: auto; 
}

.form-group { 
    margin-bottom: 25px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 10px; 
    color: #ddd; 
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control { 
    width: 100%; 
    padding: 14px 16px; 
    border-radius: 8px; 
    background: rgba(0, 0, 0, 0.2); 
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Ensure padding doesn't overflow width */
    font-family: var(--font-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.color-picker { 
    height: 50px; 
    padding: 5px; 
    cursor: pointer; 
}

.team-row { 
    display: grid; 
    grid-template-columns: 50px 1fr 100px; 
    gap: 20px; 
    align-items: center; 
    margin-bottom: 15px; 
    padding: 15px; 
    background: rgba(255,255,255,0.03); 
    border-radius: 12px; 
    border: 1px solid rgba(255,255,255,0.02);
    transition: background 0.3s;
}

.team-row:hover {
    background: rgba(255,255,255,0.06);
}

.team-id { 
    font-family: var(--font-display); 
    font-size: 1.2rem; 
    color: var(--primary-color); 
    text-align: center; 
    font-weight: bold;
}

.form-label-title { 
    margin-bottom: 20px; 
    font-size: 1.3rem; 
    color: white; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    display: block;
}

.form-actions { 
    margin-top: 40px; 
    display: flex; 
    gap: 20px; 
    justify-content: flex-end; 
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.hidden { display: none !important; }

.track-hint { 
    color: #888; 
    margin-top: 8px;
    display: block;
    font-size: 0.85rem;
}

/* Grid Layout for Questions Tab */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

.questions-list { 
    max-height: 600px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    padding-right: 5px; /* Space for scrollbar */
}

/* Scrollbar styling */
.questions-list::-webkit-scrollbar {
    width: 6px;
}
.questions-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.questions-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.q-item { 
    background: rgba(255,255,255,0.03); 
    padding: 15px; 
    border-radius: 8px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid transparent;
    transition: all 0.2s;
}

.q-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

.q-content {
    flex: 1;
    margin-right: 15px;
}

.q-tag { 
    color: var(--secondary-color); 
    font-weight: 800; 
    font-size: 0.75rem; 
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 8px; 
    background: rgba(58, 123, 213, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
}

.q-text-preview {
    font-weight: 500;
}

.q-meta { 
    font-size: 0.85rem; 
    color: #777; 
    margin-top: 6px; 
}

.btn-delete { 
    background: rgba(220, 53, 69, 0.1); 
    border: none; 
    color: #dc3545; 
    cursor: pointer; 
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* --- Refactored Display Styles --- */
.control-dock { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(15px); 
    padding: 10px 40px; 
    border-radius: 60px; 
    display: flex; 
    gap: 25px; 
    align-items: center; 
    border: 1px solid rgba(255,255,255,0.15); 
    z-index: 1000; 
    transition: opacity 0.3s; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dock-info { 
    color: #bbb; 
    font-size: 0.85rem;
    font-weight: 600; 
    margin-right: 15px; 
    border-right: 1px solid rgba(255,255,255,0.2); 
    padding-right: 30px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 120px; /* Garante espaço mínimo para não quebrar */
}

.dock-team-name { 
    color: white; 
    font-size: 1.6rem;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 0 0 20px currentColor;
    margin-top: 2px;
    white-space: nowrap; /* Impede quebra de linha no nome do time */
}

.dock-btn { 
    padding: 12px 25px; 
    font-size: 1rem; 
    border-radius: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-biblica { background: linear-gradient(135deg, #6f42c1, #563d7c); border: none; }
.btn-geral { background: linear-gradient(135deg, #20c997, #198754); border: none; }
.btn-decisao { background: linear-gradient(135deg, #fd7e14, #d35400); border: none; }
.btn-auto { background: linear-gradient(135deg, #6c757d, #343a40); border: none; }

.dock-settings { 
    border-left: 1px solid rgba(255,255,255,0.2); 
    padding-left: 25px; 
    margin-left: 5px; 
    height: 40px;
    display: flex;
    align-items: center;
}

.settings-link { 
    color: #666; 
    text-decoration: none; 
    font-size: 1.4rem; 
    transition: color 0.3s, transform 0.3s;
}

.settings-link:hover {
    color: white;
    transform: rotate(90deg);
}
.answer-section { display: none; margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); }
.answer-text { font-size: 2rem; color: #28a745; font-weight: bold; }
.presenter-controls { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.btn-reveal { background: #17a2b8; }
.validation-btns { display: none; gap: 20px; justify-content: center; margin-top: 20px; }

/* Victory Styles */
.victory-overlay {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
}

.victory-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 60px;
    text-align: center;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(255, 215, 0, 0.1);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-title {
    font-family: var(--font-display);
    font-size: 4rem;
    background: linear-gradient(to right, #FFD700, #FDB931);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.winner-text {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
}

.winner-name {
    color: #FFD700;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.winner-sub {
    color: #888;
    font-size: 1.2rem;
    margin-bottom: 40px;
    font-style: italic;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
    max-width: 600px;
}

.ranking-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-pos {
    font-weight: bold;
    color: #666;
    width: 40px;
    text-align: right;
}

.ranking-team {
    flex-grow: 1;
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: #eee;
}

.ranking-medal-2 { color: #C0C0C0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.5); } /* Silver */
.ranking-medal-3 { color: #CD7F32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.5); } /* Bronze */

/* Card Result Modal */
.card-result-modal {
    background: linear-gradient(135deg, #2c2c54 0%, #1e1e30 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 40px rgba(108, 92, 231, 0.3);
    animation: slideUp 0.5s ease-out;
}

.card-header {
    font-size: 1.2rem;
    color: #a29bfe;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: white;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.card-effect {
    font-size: 1.8rem;
    color: #dfe6e9;
    margin-bottom: 40px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
}

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

.btn-lg {
    padding: 15px 40px;
    font-size: 1.2rem;
}

/* --- Generic Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: white;
    font-family: var(--font-display);
}

.modal-message {
    color: #ccc;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}