:root {
    /* Sophisticated Pro Palette */
    --primary: #007aff;
    /* Apple/SaaS Blue */
    --primary-hover: #0066d6;
    --primary-light: rgba(0, 122, 255, 0.15);
    --secondary: #6366f1;
    /* Indigo */

    --bg-dark: #09090b;
    /* Zinc 950 */
    --bg-charcoal: #121212;
    --bg-sidebar: rgba(18, 18, 18, 0.85);

    --text-main: #f8fafc;
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --text-muted: #64748b;
    /* Slate 500 */

    --accent: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */

    /* SaaS Precision Glass */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.3);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --font-inter: 'Inter', -apple-system, system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-inter);
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* --- Sidebar (macOS Finder Style v2) --- */
aside {
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.logo-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
    stroke-width: 2.5px;
}

.logo span {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-main);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item i {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    opacity: 0.7;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

/* --- Main Content --- */
main {
    padding: 3rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Títulos e Textos --- */
header {
    margin-bottom: 3rem;
}

header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

/* --- Cards (Precision SaaS Style) --- */
.card,
.group-card,
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.group-card:hover,
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
}

.glass-card.drag-over {
    border-color: var(--primary) !important;
    background: rgba(0, 122, 255, 0.1) !important;
    transform: scale(1.02);
}

.card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3 i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* --- Grids --- */
.dashboard-grid,
.groups-grid,
.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Horizontal Config Bar */
.horizontal-config-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem !important;
    margin-bottom: 2rem;
    gap: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.config-item input {
    width: 65px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    text-align: center;
    font-family: inherit;
    font-weight: 600;
}

/* Specific layout for Registration View (3 main cards) */
#view-register .dashboard-grid {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: stretch;
}

#view-register .dashboard-grid>.card {
    min-width: 0;
}

@media (max-width: 1100px) {
    #view-register .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #view-register .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* --- Forms (Minimalist Dark) --- */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

input,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: 0.2s;
}

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

.checkbox-group input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    box-shadow: none;
    background: transparent;
    border: none;
}

.checkbox-group span {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* --- Buttons (Standardized SaaS) --- */
.btn {
    border: 1px solid transparent;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn i {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Listas e Tabelas --- */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ranking-item,
.group-member {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
    border: 1px solid transparent;
}

.ranking-item:hover,
.group-member:hover {
    background: rgba(255, 255, 255, 0.06);
}

.rank-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.rank-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    display: block;
    font-weight: 400;
}

/* Badges */
.badge-seed {
    background: rgba(0, 66, 109, 0.3);
    color: #60a5fa;
    /* Azul claro para contraste */
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 700;
    border: 1px solid rgba(0, 66, 109, 0.5);
}

.group-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.group-score-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent);
    /* Cor de destaque para o score total */
}

/* Explicit Score Styles */
.score-value,
.rank-score {
    color: var(--accent);
    font-weight: 700;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-light);
    /* Fallback */
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- Winner Styles --- */
/* --- Improved Winner Styles --- */
.group-card.is-winner {
    border: 3px solid #fbbf24;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(251, 191, 36, 0.15));
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.4), inset 0 0 20px rgba(251, 191, 36, 0.1);
    transform: scale(1.05);
    z-index: 10;
}

.winner-badge {
    background: var(--warning);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.winner-announcement {
    position: relative;
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--warning);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 3rem;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.winner-announcement::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.1), transparent 70%);
    pointer-events: none;
}

.winner-announcement h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--warning);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.winner-announcement p {
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 500;
    opacity: 0.9;
}

@keyframes slideDownFade {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scrollbar macOS Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ranking-item.is-winner {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

/* --- Admin Login Style --- */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-charcoal);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(0, 122, 255, 0.1), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 122, 255, 0.05), transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-premium);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.view-section {
    display: none;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
    display: block;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.98);
        opacity: 0;
    }

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

/* ==========================================================================
   PARTICIPANT DASHBOARD OVERRIDES (One-Page Premium)
   ========================================================================== */

.kpi-row {
    margin-bottom: 2rem;
}

.stat-card.compact {
    padding: 1.75rem;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
}

.stat-card.compact .stat-value {
    font-size: 2.75rem;
    line-height: 1.1;
}

.stat-card.compact .stat-label {
    font-size: 0.85rem;
    margin-top: 0;
    opacity: 0.7;
    font-weight: 700;
}

/* Dashboard Grid Layout - Balanced Heights */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: stretch;
    /* Garante que os cards tenham a mesma altura */
    margin-top: 2rem;
}

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

/* Tab System */
.ranking-card-tabs {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--primary);
    background: rgba(0, 122, 255, 0.1);
}

#tab-content {
    padding: 1.5rem;
    height: 500px;
    /* Altura fixa para simetria */
    overflow-y: auto;
}

/* List internal scroll sync */
#group-info {
    height: 500px;
    /* Mesma altura das abas */
    overflow-y: auto;
    padding-right: 8px;
}

/* Participant highlight visibility */
.ranking-item[style*="border: 2px solid"],
.group-member[style*="border: 2px solid"] {
    background: rgba(0, 122, 255, 0.1) !important;
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.2);
}

/* Unified Card Height */
.my-group-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.my-group-card .ranking-list {
    margin-top: 1rem;
    flex: 1;
}

/* Live Badge Pulse */
.live-badge {
    position: relative;
    padding-left: 24px !important;
}

.live-badge::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 1.5s infinite;
}

.score-changed {
    animation: pulse 0.4s;
    color: var(--accent);
}

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

    50% {
        transform: scale(1.2);
    }

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

/* --- Responsivo --- */
@media (max-width: 900px) {
    #app {
        grid-template-columns: 1fr;
    }

    aside {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        height: auto;
        flex-direction: row;
        padding: 0.8rem;
        background: rgba(20, 20, 20, 0.9);
        border-right: none;
        border-top: 1px solid var(--glass-border);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
    }

    nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .logo {
        display: none;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        font-size: 0.75rem;
        padding: 6px;
    }

    main {
        padding: 1.5rem;
        padding-bottom: 90px;
        /* Espaço para menu bottom */
    }
}

/* --- Modal Customizado --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.modal-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

/* --- Judge Portal specific --- */
.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    padding: 3rem;
    border-radius: var(--radius-md);
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-2xl);
    animation: slideUp 0.5s ease;
}

.login-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* --- Toasts --- */
.toast {
    background: #1a1a1a;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    animation: slideUp 0.3s ease;
    font-weight: 500;
}

/* --- Judge Portal Refinement --- */
.judge-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #111827, #020617);
    overflow: hidden;
}

.judge-sidebar {
    background: rgba(8, 8, 10, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 280px;
    /* Fixed width to prevent layout bugs */
}

.judge-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 3.5rem;
}

.judge-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.judge-nav-item i {
    opacity: 0.6;
    transition: transform 0.3s;
}

.judge-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.judge-nav-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.judge-nav-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(0, 122, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.1);
}

.judge-nav-item.active i {
    opacity: 1;
    color: var(--primary);
}

.judge-main {
    padding: 3.5rem 4rem;
    max-width: 1400px;
    margin: 0;
    width: 100%;
    overflow-y: auto;
    height: 100vh;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, border-color 0.3s;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.eval-grid {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.criteria-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.criteria-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.criteria-input-group:focus-within {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-2px);
}

.criteria-input-group label {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 600;
}

.criteria-input {
    width: 70px !important;
    background: #000 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    padding: 6px !important;
    color: var(--primary) !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.criteria-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

.tab-nav-compact {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    width: 100%;
}

.tab-nav-compact .tab-btn {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-nav-compact .tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.judge-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.judge-history-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(5px);
}


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

@media (max-width: 768px) {
    .judge-container {
        grid-template-columns: 80px 1fr;
    }

    .judge-sidebar {
        padding: 2rem 0.5rem;
        width: 80px;
    }

    .judge-nav-item span {
        display: none;
    }

    .judge-nav-item {
        justify-content: center;
        padding: 12px;
    }
}

/* --- Scored Result --- */
.score-display-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.score-display-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.score-label {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 950;
    color: var(--text-main);
    line-height: 1;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.judge-profile-brief {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.judge-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.judge-info-text {
    flex: 1;
    min-width: 0;
}

.judge-name-tag {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.judge-status-tag {
    font-size: 0.65rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.judge-status-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent);
}
/* --- Lucide Icon Fixes (Crucial for Visibility) --- */
.btn-icon svg,
.btn-icon i {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2px;
    display: inline-block;
    vertical-align: middle;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* --- CRITICAL FIX: Icon Button Visibility --- */
/* Overrides inherited padding from .btn that caused icons to shrink to 0px */
.btn-icon {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-icon svg,
.btn-icon i {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2px !important;
    display: block !important;
    margin: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}
