/* 
   VOLLEY SCOUT PRO - PREMIUM DEKSTOP VERSION
   Restored state: Before mobile-first and proportional space experiments.
   Focus: High-end artistic flair, Glassmorphism, and fixed-height professional dashboard.
*/

:root {
    /* Modern Dark Theme Palette (Slate/Midnight) */
    --bg-app: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --bg-hover: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Brand Accents */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-glow: rgba(59, 130, 246, 0.4);

    --border-color: #334155;
    --border-subtle: #1e293b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-surface: linear-gradient(to bottom, #1e293b, #0f172a);
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-height: 100vh;
}

/* --- Match Header (Scoreboard) --- */
.match-header {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.match-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--gradient-primary);
}

.team {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.team h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    cursor: text;
}

.score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score {
    font-size: 5rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    min-width: 100px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.score-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
}

.match-header:hover .score-btn {
    opacity: 1;
    transform: scale(1);
}

.score-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.score-btn:active {
    transform: scale(0.9);
    transition: 0.1s;
}

.match-info {
    flex: 1.5;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 2;
}

.league {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: text;
}

.vs {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.2;
}

.match-time {
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: text;
}

.set-scores {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 8px;
    margin-top: 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Global Controls --- */
.global-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.action-btn {
    padding: 10px 20px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), 0 0 10px var(--accent-glow);
    border-color: var(--accent-blue);
    color: white;
}

.action-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    transition: 0.1s;
}

.action-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.action-btn.danger:hover { background: rgba(239, 68, 68, 0.15); border-color: var(--accent-red); color: var(--accent-red); box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.slider {
    width: 44px; height: 24px; background-color: var(--bg-hover);
    border-radius: 24px; position: relative; transition: 0.3s;
}

.slider::before {
    content: ""; position: absolute; width: 18px; height: 18px;
    left: 3px; bottom: 3px; background-color: #94a3b8;
    border-radius: 50%; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked+.slider { background-color: var(--accent-blue); }
input:checked+.slider::before { transform: translateX(20px); background-color: white; }

/* --- Table & View Tabs --- */
.set-controls {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-card); padding: 15px 30px; border-radius: 15px; border: 1px solid var(--border-color);
}

.player-charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.close-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

.close-btn:active {
    transform: translateY(1px) scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
    transition: 0.1s;
}

.set-nav-btn.live { border-color: var(--accent-green); color: var(--accent-green); }

.view-controls { display: flex; gap: 10px; margin: 20px 0; overflow-x: auto; padding-bottom: 5px; }

.tab-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 12px 24px; cursor: pointer; font-weight: 700; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative;
    border-radius: 10px;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.tab-btn.active { color: white; background: var(--bg-hover); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* --- Data Table (Full Width) --- */
.stats-container {
    background-color: var(--bg-card); border-radius: 20px;
    border: 1px solid var(--border-color); overflow: hidden;
    box-shadow: 0 15px 25px rgba(0,0,0,0.3);
    width: 100%;
}



.table-wrapper { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; white-space: nowrap; }

th { padding: 8px 6px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; font-size: 0.75rem; border-bottom: 2px solid var(--border-color); }
td { padding: 6px 6px; text-align: center; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); }


td:first-child, .sticky-col {
    position: sticky; left: 0; background-color: var(--bg-card); z-index: 20;
    border-right: 3px solid var(--border-color); text-align: left; padding-left: 20px; font-weight: 700; color: white;
}

.team-separator th {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 25px;
    font-size: 1.3rem;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: inset 0 -4px 10px rgba(0,0,0,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.action-row {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
}

.set-btn-group {
    display: flex;
    gap: 12px;
}

.set-nav-btn {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.set-nav-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.set-nav-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.set-nav-btn.live {
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--accent-green);
    position: relative;
}

.set-nav-btn.live::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.set-nav-btn:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.5);
    transition: 0.1s;
}

.add-player-btn {
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-player-btn:hover {
    border-color: var(--accent-blue);
    color: white;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), 0 0 15px var(--accent-glow);
    border-style: solid;
}

.add-player-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    transition: 0.1s;
}


/* Row Separations */
tr:not(.team-separator) {
    transition: background 0.2s ease;
}

tr:not(.team-separator):hover {
    background: rgba(255, 255, 255, 0.02);
}

td {
    padding: 6px 6px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Sharp separator */
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}


/* Interactive Quality Cells (Global) */
.q-cell {
    position: relative;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.q-cell b {
    display: inline-block;
    min-width: 26px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    font-size: 0.8rem;
}


/* Specific Quality Colors */
.q-pp b { color: #10b981; border-color: rgba(16, 185, 129, 0.2); text-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
.q-pl b { color: #34d399; border-color: rgba(52, 211, 153, 0.2); }
.q-ex b { color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.q-sl b { color: #f87171; border-color: rgba(248, 113, 113, 0.2); }
.q-min b { color: #fca5a5; border-color: rgba(252, 165, 165, 0.2); }
.q-eq b { color: #ef4444; border-color: rgba(239, 68, 68, 0.2); text-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }

/* Interactive Hover/Active Feedback */
.q-cell:hover b {
    background: var(--bg-hover);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), 0 0 10px var(--accent-glow);
    border-color: var(--accent-blue);
    color: white;
}

.q-cell:active b {
    transform: scale(0.9) translateY(0);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
    transition: all 0.05s;
}



/* --- Charts Section (Refined & Centralized) --- */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin: 30px auto;
    padding-bottom: 50px;
    align-items: center; /* Centralize the charts */
    width: 100%;
}

.team-charts {
    width: 100%;
    max-width: 900px; /* Constrain width for a more "balanced" single-column look */
    text-align: center;
}

.team-chart-title {
    margin-bottom: 20px;
}

.chart-wrapper {
    background: linear-gradient(150deg, var(--bg-card), rgba(15, 23, 42, 0.9));
    border-radius: 24px;
    padding: 30px;
    height: 500px; /* Increased height for better visibility */
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left; /* Keep internal text aligned left/standard */
}


.chart-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    border-radius: 30px 30px 0 0;
}

.chart-wrapper:hover {
    border-color: var(--accent-blue);
}

.chart-wrapper canvas {
    max-height: 90% !important;
    height: 90% !important;
    width: 100% !important;
}

.chart-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.chart-wrapper h3 { font-size: 1.35rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }

.chart-filter {
    appearance: none;
    background: rgba(30, 41, 59, 0.85);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    color: white; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 30px;
    padding: 10px 45px 10px 20px; font-weight: 700; cursor: pointer;
}

/* --- Player Stats --- */
.player-stats-section { padding: 80px 0; display: flex; flex-direction: column; gap: 60px; }
.section-title { text-align: center; font-size: 2.2rem; font-weight: 900; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 4px; }

.player-stats-team {
    background: rgba(30, 41, 59, 0.2);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.player-stats-team-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.individual-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.individual-charts-grid .chart-wrapper { height: 450px; }


.player-buttons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }

.player-btn {
    padding: 22px 15px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color); /* Sharper 1px border */
    border-radius: 16px;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
}

.player-btn strong { font-size: 1.2rem; color: white; display: block; margin-bottom: 4px; }

.player-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 15px var(--accent-glow);
    background: var(--bg-hover);
    color: white;
}

.player-btn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
    transition: all 0.1s;
}

.player-btn.active-view {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    box-shadow: 0 0 20px var(--accent-glow);
    border-width: 2px;
    color: white;
}

.player-btn.active-view::after {
    content: '👁️';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* --- Player Charts Hidden Panel --- */
.player-charts {
    margin-top: 50px; padding: 40px; background: var(--bg-card); border-radius: 30px;
    border: 2px solid var(--accent-blue); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideIn 0.4s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Logic & Utilities: Category Visibility Filtering (Total Freedom View) */
#scout-table:not([data-view="all"]) .set-col { 
    display: none; 
}

/* Hide all Category Headers that don't match the current view, EXCEPT sticky columns and team separators */
#scout-table[data-view="battuta"] thead:not(.team-separator) th:not([data-col-type="battuta"]):not(.sticky-col),
#scout-table[data-view="ricezione"] thead:not(.team-separator) th:not([data-col-type="ricezione"]):not(.sticky-col),
#scout-table[data-view="attacco"] thead:not(.team-separator) th:not([data-col-type="attacco"]):not(.sticky-col),
#scout-table[data-view="muro"] thead:not(.team-separator) th:not([data-col-type="muro"]):not(.sticky-col) {
    display: none;
}

/* Ensure the sticky name column remains clean */
#scout-table:not([data-view="all"]) .name-col {
    border-right-width: 3px;
}

.hidden { display: none !important; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 12px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* --- Precision Mobile Adaptation (App-Like UX) --- */

/* Tablet & Smaller Desktops (992px) */
@media (max-width: 950px) {
    .app-container { padding: 20px; align-items: center; }
    .match-header { padding: 20px; width: 100%; max-width: 800px; }
    .score { font-size: 3.5rem; }
}

/* Smartphone Portrait (Precision Focus < 768px) */
@media (max-width: 768px) and (orientation: portrait) {
    .app-container { gap: 20px; padding: 10px; }
    
    /* Centered Compact Scoreboard */
    .match-header {
        flex-direction: column;
        padding: 25px 15px;
        text-align: center;
        width: 100%;
        max-width: 420px; /* Precise iPhone/Android width */
        margin: 0 auto;
    }

    .team { width: 100%; gap: 10px; }
    .team h1 { font-size: 1.6rem; }
    .score-container { margin: 10px 0; }
    .score { font-size: 3rem; }
    
    /* 2x2 Grid for Precision Actions */
    .global-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        max-width: 420px;
        margin: 10px auto 0;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 5px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .toggle-switch { grid-column: span 2; justify-content: center; }

    /* Hide Metadata for Clarity */
    .league, .match-date { display: none !important; }
    .vs { margin: 5px 0; opacity: 0.1; font-size: 1.2rem; }

    /* Horizontal Swipe Tabs */
    .view-controls {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 0 10px;
        margin: 10px -10px;
        width: calc(100% + 20px);
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn { flex: 0 0 auto; padding: 10px 16px; font-size: 0.85rem; }

    /* Table & UI Centering */
    .stats-container { border-radius: 12px; width: 100%; }
    .team-charts { width: 100%; }
    .chart-wrapper { height: 320px; padding: 15px; }

    /* Center Grids */
    .player-stats-section { align-items: center; width: 100%; }
    .player-stats-team { width: 100%; max-width: 450px; }
    .player-buttons-grid { 
        display: grid; 
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
        justify-content: center;
        gap: 10px;
    }
}

/* Smartphone Landscape (Precision Focus < 950px) */
@media (max-width: 950px) and (orientation: landscape) {
    .app-container { gap: 12px; padding: 10px; align-items: center; }
    
    /* Ultra-Compact Scoreboard */
    .match-header { 
        flex-direction: row; 
        padding: 10px 25px; 
        width: 100%;
        max-width: 100%;
        gap: 15px;
    }
    .score { font-size: 2.2rem; min-width: 60px; }
    .team h1 { font-size: 1.3rem; }
    .score-btn { width: 32px; height: 32px; font-size: 1rem; }
    .match-info { padding-top: 5px; }
    
    /* Extreme Vertical Economy for Charts */
    .chart-wrapper { height: 260px; padding: 15px; }
    .chart-header-row { margin-bottom: 15px; }
    .individual-charts-grid .chart-wrapper { height: 300px; }
    
    /* Horizontal Scroll for Mobile Tools */
    .global-controls {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        width: 100%;
        justify-content: flex-start;
    }
    .action-btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 15px; }
}

/* Ultra-Small Devices (e.g. iPhone SE < 380px) */
@media (max-width: 380px) {
    .team h1 { font-size: 1.4rem; }
    .score { font-size: 2.5rem; }
    .set-scores { font-size: 1rem; }
    .action-btn { flex: 1 1 100%; } /* Single column actions */
    
    /* Ensure the sticky name column is readable but compact */
    td:first-child, .sticky-col {
        padding-left: 10px;
        min-width: 100px;
    }
}