/* =============================================
   CLASSROOM DEBATE ENGINE — STYLES
   ============================================= */

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --pro-color: #16a34a;
    --pro-light: #dcfce7;
    --con-color: #dc2626;
    --con-light: #fee2e2;
    --accent: #0ea5e9;
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --secondary-border: #cbd5e1;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
    --pro-font-size: 1rem;
    --con-font-size: 1rem;
}

/* =============================================
   BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #2563eb 100%);
    color: white;
    text-align: center;
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
}

.subtitle {
    margin: 2px 0 0;
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.setup-card {
    max-width: 900px;
    margin: 0 auto 24px;
}

.full-width {
    width: 100%;
    box-sizing: border-box;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:active {
    transform: scale(0.97);
}

/* Fullscreen Toggle */
.fullscreen-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.fullscreen-cta {
    background: #ffffff;
    border: 2px solid var(--primary-light);
    color: var(--primary);
    padding: 10px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fullscreen-cta:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fullscreen-cta i {
    margin-right: 8px;
}

.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.primary:hover {
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.4);
    transform: translateY(-1px);
}

.secondary {
    background: transparent;
    border: 2px solid var(--secondary-border);
    color: var(--text-main);
}

.secondary:hover {
    background: #f1f5f9;
    border-color: var(--text-muted);
}

.danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.danger:hover {
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

.success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.success:hover {
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

.icon {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =============================================
   CATEGORY GRID
   ============================================= */
.category-selection {
    margin-bottom: 24px;
}

.instruction {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.category-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    box-shadow:
        0 4px 0 #e2e8f0,
        0 8px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    top: 0;
}

.category-btn .cat-icon {
    font-size: 2.2rem;
    transition: transform 0.2s;
}

.category-btn .cat-text {
    font-size: 0.95rem;
    font-weight: 700;
}

.category-btn:hover {
    border-color: var(--primary-light);
    top: -2px;
    box-shadow:
        0 6px 0 var(--primary-light),
        0 12px 20px rgba(30, 64, 175, 0.1);
    color: var(--primary);
}

.category-btn:active {
    top: 4px;
    box-shadow:
        0 0 0 #e2e8f0,
        0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-btn:hover span {
    transform: scale(1.2);
}

.category-btn.highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow:
        0 4px 0 var(--primary),
        0 8px 15px rgba(30, 64, 175, 0.15);
}

.category-btn.highlight:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow:
        0 6px 0 var(--primary),
        0 12px 20px rgba(30, 64, 175, 0.2);
}

.category-btn.active-cat {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* =============================================
   OR SEPARATOR
   ============================================= */
.or-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 24px 0;
    letter-spacing: 1px;
}

.or-separator::before,
.or-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.or-separator::before {
    margin-right: 15px;
}

.or-separator::after {
    margin-left: 15px;
}

/* =============================================
   ACTIONS
   ============================================= */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* =============================================
   LOGO & BANNERS
   ============================================= */
.logo-container {
    margin-top: 40px;
    text-align: center;
}

.app-logo {
    max-width: 900px;
    width: 90%;
    height: auto;
    display: block;
    margin: 0 auto 48px;
    transition: var(--transition);
}

.banners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-items: center;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

.banner-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-link:hover {
    transform: translateY(-4px);
    /* Slight lift on hover */
}

.banner-link img {
    height: 140px;
    width: auto;
    max-width: 100%;
    opacity: 0.85;
    transition: all 0.3s ease;
    border-radius: 25px;
    /* Curved rounded as requested */
    object-fit: contain;
    background-color: transparent;
    /* No outside box */
}

.banner-link:hover img {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    /* Polished hover shadow */
}

@media (min-width: 1000px) {
    .banners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .banners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .banner-link img {
        height: auto;
        max-height: 120px;
    }
}

/* =============================================
   CUSTOM TOPIC FORM
   ============================================= */
.form-box {
    background: #f8fafc;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    margin-top: 24px;
}

.form-box h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.custom-args-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 16px 0;
}

.custom-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-col h4 {
    margin: 0 0 4px 0;
    text-align: center;
    font-size: 0.95rem;
}

.custom-col input {
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-start;
}

.dynamic-args-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.dynamic-arg-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-arg-row input {
    flex: 1;
}

.remove-arg-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    flex-shrink: 0;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.remove-arg-btn:hover:not(:disabled) {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.remove-arg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.add-arg-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: var(--primary);
    transition: all 0.2s;
}

.add-arg-btn:hover {
    background: #f0f9ff;
    border-color: var(--primary-light);
}

/* =============================================
   INPUTS
   ============================================= */
select,
input[type="text"],
textarea {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-main);
}

select:focus,
input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea {
    resize: vertical;
    min-height: 64px;
    width: 100%;
}

/* =============================================
   INFO MODAL CONTENT
   ============================================= */
.info-card {
    padding: 32px;
    border-radius: var(--radius-lg);
}

.info-card h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.3rem;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.guide-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.guide-item h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--primary);
}

.guide-item ul {
    margin: 0;
    padding-left: 18px;
}

.guide-item li {
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.guide-item li strong {
    color: var(--text-main);
}

/* =============================================
   TOPIC BANNER
   ============================================= */
.topic-banner {
    text-align: center;
    background: white;
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border-bottom: 4px solid var(--primary-light);
}

.topic-banner h2 {
    margin: 10px 0 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.topic-header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.topic-info-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.topic-info-btn:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

/* =============================================
   TIMER
   ============================================= */
.timer-controls {
    text-align: center;
    background: var(--card-bg);
    padding: 28px 32px;
    margin-bottom: 28px;
}

.timer-display {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 5rem;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--primary);
    letter-spacing: -3px;
    line-height: 1;
    transition: color 0.3s;
}

.phase-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.timer-display.low-time {
    color: var(--danger);
    animation: pulse 1s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.timer-display.alarm-flash {
    animation: alarmFlash 0.4s ease-in-out 5;
}

@keyframes alarmFlash {

    0%,
    100% {
        color: var(--danger);
    }

    50% {
        color: #fca5a5;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.04);
        opacity: 0.85;
    }
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
}

#timer-phase {
    padding: 10px 16px;
    min-width: 220px;
    font-size: 0.9rem;
}

.timer-controls .controls .btn.icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    color: var(--text-main);
}

.timer-controls .controls .btn.icon:hover {
    background: #e2e8f0;
}

/* =============================================
   DEBATE GRID
   ============================================= */
.debate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.team-card {
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.team-card.pro {
    border-top: 5px solid var(--pro-color);
}

.team-card.con {
    border-top: 5px solid var(--con-color);
}

.team-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.curtain-btn {
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.curtain-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.curtain-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Header Actions & Font Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.font-ctrl {
    display: flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
}

.font-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    font-size: 0.8rem !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
}

.font-btn:hover {
    background: #e2e8f0 !important;
}

.font-btn:active {
    transform: scale(0.9);
}

.arg-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.curtain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: visibility 0.3s;
}

/* The left and right curtains */
.curtain-overlay::before,
.curtain-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    /* Velvet look: deep burgundy blue with fabric stripes */
    background: linear-gradient(90deg,
            #1e3a8a 0%, #1e40af 15%, #1e3a8a 30%,
            #1e40af 45%, #1e3a8a 60%, #1e40af 75%,
            #1e3a8a 90%, #1e40af 100%);
    background-size: 40px 100%;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Open state: Curtains are pushed to the far left/right */
.curtain-overlay.hidden::before {
    transform: translateX(-100%);
}

.curtain-overlay.hidden::after {
    transform: translateX(100%);
}

/* Closed state: Curtains meet in the middle */
.curtain-overlay:not(.hidden)::before,
.curtain-overlay:not(.hidden)::after {
    transform: translateX(0);
}

.curtain-overlay::before {
    left: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.curtain-overlay::after {
    right: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

/* Visibility management: don't hide with display:none instantly to allow animation */
.curtain-overlay {
    background: transparent;
    border: none;
    pointer-events: none;
    /* Allow interaction with content underneath when open if needed, but JS handles toggle */
}

.curtain-overlay:not(.hidden) {
    pointer-events: all;
}

.curtain-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    padding: 20px 30px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.curtain-overlay.hidden .curtain-content {
    opacity: 0;
    transform: scale(0.5);
}

.arg-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Argument list */
.arg-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    flex: 1;
}

.arg-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.arg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    transition: var(--transition);
}

.pro .arg-item,
.pro .arg-block p {
    font-size: var(--pro-font-size);
}

.con .arg-item,
.con .arg-block p {
    font-size: var(--con-font-size);
}

.arg-item:hover {
    border-color: #e2e8f0;
    background: #f1f5f9;
}

.arg-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

.team-card.pro .arg-num {
    background: var(--pro-light);
    color: var(--pro-color);
}

.team-card.con .arg-num {
    background: var(--con-light);
    color: var(--con-color);
}

.arg-text {
    flex: 1;
    line-height: 1.5;
}

.arg-block {
    padding: 14px 16px;
    margin-top: 12px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    border: 1.5px dashed #e2e8f0;
    background: white;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.arg-block p {
    margin: 4px 0 0;
    color: var(--text-main);
    line-height: 1.5;
}

.rebuttal-block {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.question-block {
    border-color: #d1fae5;
    background: #f0fdf4;
}

.arg-label {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

/* =============================================
   EVALUATION SECTION
   ============================================= */
.evaluation-columns {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.eval-column {
    flex: 1;
    background: #ffffff;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.pro-eval {
    border-top: 4px solid var(--pro-color);
}

.con-eval {
    border-top: 4px solid var(--con-color);
}

.eval-column h3 {
    margin: 0 0 20px;
    font-size: 1rem;
    font-weight: 700;
}

.score-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-item label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weight {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.score-item .val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    min-width: 24px;
    text-align: center;
}

.name-entry {
    margin-top: 20px;
}

.name-entry label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.total-score {
    margin-top: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-md);
    border-top: 2px solid #f1f5f9;
}

.pro-score {
    color: var(--pro-color);
    background: var(--pro-light);
}

.con-score {
    color: var(--con-color);
    background: var(--con-light);
}

.total-score span {
    font-size: 2.2rem;
    font-weight: 800;
}

.total-score small {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
}

/* =============================================
   WINNER BADGE
   ============================================= */
.winner-badge {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    padding: 24px;
    margin: 32px 0;
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
    letter-spacing: -0.5px;
}

.pro-win {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

.con-win {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.draw {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

/* =============================================
   VOTING
   ============================================= */
.voting-area {
    text-align: center;
    margin: 40px 0;
    padding: 32px;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
}

.voting-area h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.vote-instruction {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 24px;
}

.vote-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.vote-btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: 2.5px solid;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.vote-btn:active {
    transform: scale(0.97);
}

.reset-votes-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.reset-votes-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
    border-color: var(--primary-light);
    transform: rotate(-30deg);
}

.pro-vote {
    color: var(--pro-color);
    border-color: var(--pro-color);
}

.pro-vote:hover {
    background: var(--pro-light);
}

.con-vote {
    color: var(--con-color);
    border-color: var(--con-color);
}

.con-vote:hover {
    background: var(--con-light);
}

.vote-bars {
    display: flex;
    height: 44px;
    border-radius: 22px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 36px;
}

.pro-bar {
    background: linear-gradient(90deg, #15803d, #16a34a);
}

.con-bar {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.vote-totals {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.vote-total-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.pro-label {
    color: var(--pro-color);
}

.con-label {
    color: var(--con-color);
}

/* =============================================
   FINAL ACTIONS
   ============================================= */
.final-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    padding: 20px 32px;
    border-top: 1px solid #e2e8f0;
    margin-top: 48px;
    background: white;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Mobile Responsiveness for Footer & Banners */
@media (max-width: 900px) {
    /* No banner-specific styles needed here anymore */
}

@media (max-width: 600px) {
    footer {
        padding: 40px 20px 30px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

.version-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

footer strong {
    color: var(--text-main);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.35s ease-out forwards;
}

.hidden {
    display: none !important;
}

/* =============================================
   MODAL
   ============================================= */
.modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: var(--text-muted);
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-main);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .debate-grid {
        grid-template-columns: 1fr;
    }

    .evaluation-columns {
        flex-direction: column;
    }

    .guidelines-grid {
        grid-template-columns: 1fr;
    }

    .custom-args-grid {
        grid-template-columns: 1fr;
    }

    .timer-display {
        font-size: 3.5rem;
    }
}

@media (max-width: 600px) {
    header {
        padding: 8px 12px;
    }

    header h1 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .header-content {
        margin: 0 8px;
    }

    .header-content .subtitle {
        display: none;
    }

    header .btn.icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
        padding: 4px !important;
    }

    header > div {
        gap: 6px !important;
    }

    main {
        padding: 16px;
    }

    .card {
        padding: 20px;
    }

    .vote-buttons {
        flex-direction: column;
        align-items: center;
    }

    .final-actions {
        flex-direction: column;
        align-items: center;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .banners-grid {
        gap: 24px;
    }

    .banner-link img {
        height: 100px;
    }
}

/* =============================================
   PRINT
   ============================================= */
@media print {

    /* Hide navigational and interactive elements */
    header,
    footer,
    .timer-controls,
    #setup-section,
    .vote-buttons,
    .final-actions,
    #info-btn,
    #home-btn,
    .modal,
    .curtain-btn,
    .topic-info-btn,
    .reset-votes-btn,
    .fullscreen-toggle-container,
    .add-arg-btn,
    .remove-arg-btn {
        display: none !important;
    }

    /* Reset background and layout for print */
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    main {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .card,
    .team-card,
    .eval-column {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
        padding: 20px !important;
    }

    /* Hide sliders but keep their values */
    input[type="range"] {
        display: none !important;
    }

    .score-item .val {
        margin-left: auto;
    }

    /* Ensure textareas show all content */
    textarea {
        border: none !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        font-family: inherit !important;
        font-size: 0.95rem !important;
        color: var(--text-main) !important;
    }

    /* Winner badge styling for print */
    .winner-badge {
        box-shadow: none !important;
        border-radius: var(--radius-md) !important;
        margin: 20px 0 !important;
    }

    /* Respect CSS visibility - don't force hidden sections to show */
    .hidden {
        display: none !important;
    }

    /* Ensure categories and titles are prominent */
    .badge {
        box-shadow: none !important;
    }

    .topic-banner {
        box-shadow: none !important;
        border-bottom-width: 2px !important;
    }

    .debate-fullscreen-bar {
        display: none !important;
    }
}

/* =====================
   DEBATE FULLSCREEN BAR
   ===================== */
.debate-fullscreen-bar {
    display: flex;
    justify-content: flex-end;
    padding: 6px 0 10px 0;
    margin-bottom: 6px;
}

.fullscreen-cta-debate {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.2s ease;
}

.fullscreen-cta-debate:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* =============================================
   NAVIGATION TABS
   ============================================= */
.main-nav {
    background: white;
    padding: 10px 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
    position: sticky;
    top: 60px;
    /* Below header */
    z-index: 999;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 12px;
}

#nav-league {
    opacity: 0.6;
    transition: opacity 0.3s;
}

#nav-league:hover {
    opacity: 1;
}

.nav-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
}

.nav-tab:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-tab.active {
    background: var(--primary-light);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
    opacity: 1;
}

/* =============================================
   DEBATE LEAGUE (BETA) STYLES
   ============================================= */
.beta-banner {
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    color: #92400e;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.5s ease-out;
}

.beta-badge {
    font-size: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 800;
    border: 1px solid #fbbf24;
    vertical-align: middle;
    margin-left: 8px;
}

.beta-badge-small {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 800;
    margin-left: 4px;
}

.nav-tab:not(.active) .beta-badge-small {
    background: #fef3c7;
    color: #92400e;
}

.league-header-card {
    padding: 20px 32px;
}

.league-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.league-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.league-grid .full-width {
    grid-column: span 2;
}

/* Setup Card */
.league-setup-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.danger-outline {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
}

.danger-outline:hover {
    background: #fef2f2;
}

/* Team Management */
.add-team-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.add-team-box input[type="text"] {
    flex: 1;
}

.add-team-box input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.team-item {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
    transition: var(--transition);
}

.team-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.team-color-strip {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.team-name-small {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: block;
}

.team-stats-mini {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.delete-team-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-team-btn:hover {
    color: var(--danger);
}

.count-badge {
    font-size: 0.8rem;
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
}

/* Matchup Box */
.matchup-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.team-select {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-select label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.vs-text {
    margin-top: 20px;
    font-weight: 900;
    color: #cbd5e1;
    font-size: 1.2rem;
}

.result-selector {
    margin-bottom: 24px;
}

.result-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Leaderboard */
.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.scoreboard-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scoreboard-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.scoreboard-table tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-weight: 800;
    color: #94a3b8;
    width: 40px;
}

.team-cell {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.points-cell {
    font-weight: 800;
    color: var(--primary);
}

.trophy-row {
    background-color: #fffbeb;
}

.trophy-row .rank-cell {
    color: #fbbf24;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-matchup {
    font-weight: 700;
    font-size: 1rem;
}

.history-topic {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-winner {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.history-winner.draw {
    background: #f1f5f9;
    color: #475569;
}

.delete-history-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.delete-history-btn:hover {
    color: var(--danger);
}

/* Beta Footer Note */
.beta-footer-note {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px dashed #cbd5e1;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.small-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

#league-section.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        top: 0;
        /* Sticky to top if header is small or hidden */
    }

    .league-grid {
        grid-template-columns: 1fr;
    }

    .league-grid .full-width {
        grid-column: span 1;
    }

    .league-title-flex {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}