:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('/media/hockey1.jpg') center/cover no-repeat fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #001a4d;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav a {
    padding: 0.5rem 1rem;
    background: #c41e3a;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

nav a:hover {
    background: #a01830;
    transform: translateY(-2px);
}

nav .logout-btn {
    background: #c41e3a;
    margin-left: auto;
}

nav .logout-btn:hover {
    background: #a01830;
}

main {
    flex: 1;
}

.section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

/* Rankings Section */
.rankings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ranking-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.ranking-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.ranking-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.ranking-item .elo {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.ranking-item .stats {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.ranking-item .win-rate {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Voting Section */
.voting-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.player-card {
    background: #001a4d;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
    transition: var(--transition);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.player-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.player-card:nth-child(3) {
    background: #b0b0b0;
    color: #333;
}

.player-image {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background-size: cover;
    background-position: center;
    border: 3px solid white;
}

.player-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.player-elo {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.vote-btn {
    background: #c41e3a;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.vote-btn:hover {
    background: #a01830;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

@keyframes voteAnimationPlayer1 {
    0% {
        transform: scale(1) translateX(0);
    }
    100% {
        transform: scale(1.25) translateX(100px);
    }
}

@keyframes voteAnimationPlayer2 {
    0% {
        transform: scale(1) translateX(0);
    }
    100% {
        transform: scale(1.25) translateX(-100px);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.vote-animation.player1 {
    animation: voteAnimationPlayer1 1.5s ease-in-out forwards;
    z-index: 100;
}

.vote-animation.player2 {
    animation: voteAnimationPlayer2 1.5s ease-in-out forwards;
    z-index: 100;
}

.fade-out-card {
    animation: fadeOut 1.5s ease-in-out forwards;
}

.divider {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    text-align: center;
}

/* Buttons */
.btn-secondary {
    background: #c41e3a;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.btn-secondary:hover {
    background: #a01830;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Footer */
footer {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: #666;
    margin-top: auto;
}

/* Loading and Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .voting-container {
        grid-template-columns: 1fr;
    }

    .divider {
        display: none;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .rankings-container {
        grid-template-columns: 1fr;
    }

    .player-card {
        padding: 1.5rem;
    }

    .player-image {
        height: 200px;
    }

    nav {
        flex-direction: column;
    }

    nav a {
        text-align: center;
    }
}

/* Rankings Tabs */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.6rem 1.4rem;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

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

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

/* Seasons Controls */
#seasons-controls {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.seasons-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.seasons-header label {
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
}

.season-dropdown {
    padding: 0.5rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    color: var(--dark-color);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
}

.season-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Team Buttons */
.team-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.team-btn {
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--dark-color);
    border-radius: 20px;
    background: white;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.team-btn.active {
    background: var(--dark-color);
    color: white;
}

.no-teams-msg {
    color: #888;
    font-style: italic;
}

/* Team Roster Header */
.team-roster-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.team-roster-header h2 {
    margin: 0;
    color: var(--dark-color);
}

.avg-elo-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Rankings Table */
.rankings-stats {
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.1rem;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rankings-table thead {
    background: var(--dark-color);
    color: white;
}

.rankings-table th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.rankings-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #eee;
}

.ranking-row:hover {
    background: #f9f9f9;
    transition: var(--transition);
}

.ranking-row:nth-child(even) {
    background: #fafafa;
}

.rank {
    text-align: center;
    font-weight: bold;
    width: 60px;
}

.rank-badge {
    position: static;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
}

.name {
    font-weight: 600;
    color: var(--dark-color);
}

.elo {
    text-align: center;
}

.elo-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
}

.wins,
.losses,
.matches {
    text-align: center;
    font-weight: 500;
}

.winrate {
    text-align: center;
}

.winrate-badge {
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
}

/* Season Complete Card */
.season-complete-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    margin: 4rem auto;
}

.season-complete-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.season-complete-card p {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.season-complete-card .total-votes-label {
    font-size: 1.3rem;
    opacity: 1;
}

.season-complete-card strong {
    font-size: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: #f9f9f9;
    border-radius: var(--border-radius);
    border: 2px dashed #ddd;
}

.empty-state p {
    font-size: 1.1rem;
    color: #666;
}

.empty-state a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* ── Season Wizard ──────────────────────────────────────────────────────── */

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    transition: var(--transition);
}

.wizard-step.active .step-circle {
    background: var(--primary-color);
    color: white;
}

.wizard-step.completed .step-circle {
    background: var(--secondary-color);
    color: white;
}

.wizard-step span {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
}

.wizard-step.active span { color: var(--primary-color); font-weight: 600; }
.wizard-step.completed span { color: var(--secondary-color); }

.wizard-connector {
    height: 2px;
    width: 80px;
    background: #ddd;
    margin: 0 0.5rem 1.4rem;
}

.wizard-panel h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.wizard-context {
    color: #666;
    margin-bottom: 1.5rem;
}

.wizard-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Step 2 — team list */
.team-input-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-name-field {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.team-list { margin-bottom: 1rem; }

.team-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Step 3 — split layout */
.assignment-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.5rem;
    min-height: 380px;
    margin-bottom: 1rem;
}

.team-sidebar h4,
.roster-panel h4 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.team-selector-list {
    list-style: none;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.team-selector-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.team-selector-item:last-child { border-bottom: none; }
.team-selector-item:hover { background: #f0f4ff; }
.team-selector-item.selected { background: #e8f0fe; font-weight: 600; color: var(--primary-color); }

.team-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.72rem;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.roster-panel {
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 1rem;
}

.player-search-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    box-sizing: border-box;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    list-style: none;
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.suggestion-item:hover { background: #f0f4ff; }

.new-player-form {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.new-player-form h5 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    font-weight: 600;
}

.new-player-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.roster-list { list-style: none; margin-top: 0.5rem; }

.roster-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.75rem;
}

.roster-item:last-child { border-bottom: none; }
.roster-name { flex: 1; font-weight: 500; }
.roster-elo  { font-size: 0.82rem; color: #888; }

/* Shared wizard buttons */
.btn-add {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-add:hover { background: #3dbdb5; transform: translateY(-1px); }

.btn-back {
    background: #eee;
    color: #333;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-back:hover { background: #ddd; }

.btn-remove {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.2rem;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.btn-remove:hover { color: var(--primary-color); }

/* Done screen */
.wizard-done {
    text-align: center;
    padding: 3rem 1rem;
}

.done-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.wizard-done h3 { font-size: 2rem; margin-bottom: 0.75rem; }
.wizard-done p  { color: #666; font-size: 1.1rem; margin-bottom: 2rem; }

.wizard-done-actions { justify-content: center; }

.optional { font-size: 0.82rem; color: #aaa; font-weight: normal; }
.empty-hint { color: #aaa; font-style: italic; font-size: 0.9rem; }

@media (max-width: 768px) {
    .assignment-layout { grid-template-columns: 1fr; }
    .wizard-form .form-row { grid-template-columns: 1fr; }
    .wizard-connector { width: 40px; }
}

/* Register / approval links */
.register-prompt {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.register-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.register-link:hover {
    text-decoration: underline;
}

.field-error {
    color: #721c24;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.approval-message {
    text-align: center;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    display: none;
}

.error-message.show {
    display: block;
}

/* ── Season Manager ─────────────────────────────────────────────────────── */

.sm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sm-toolbar h2 { margin-bottom: 0; }

.sm-toolbar-actions {
    display: flex;
    gap: 0.75rem;
}

.sm-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Sidebar */
.sm-sidebar {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    background: #fafafa;
    overflow: hidden;
}

.sm-season-item {
    border-bottom: 1px solid #e8e8e8;
}

.sm-season-item:last-child { border-bottom: none; }

.sm-season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0f4ff;
    gap: 0.5rem;
}

.sm-season-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.sm-season-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.sm-badge-active   { background: #d4edda; color: #155724; }
.sm-badge-inactive { background: #e2e3e5; color: #495057; }

.sm-toggle-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.sm-toggle-btn:hover { opacity: 0.8; }

.sm-btn-activate   { background: #28a745; color: white; }
.sm-btn-deactivate { background: #6c757d; color: white; }

/* Teams inside sidebar */
.sm-teams-list {
    list-style: none;
    padding: 0.25rem 0;
}

.sm-team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem 0.55rem 1.5rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.5rem;
}

.sm-team-item:last-child { border-bottom: none; }
.sm-team-item:hover { background: #e8f0fe; }
.sm-team-item.selected { background: #dbeafe; font-weight: 600; }

.sm-team-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-team-empty {
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    font-size: 0.82rem;
    color: #aaa;
    font-style: italic;
    list-style: none;
}

.sm-player-count {
    background: #6c757d;
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

/* Main assignment panel */
.sm-main {
    min-height: 400px;
}

.sm-assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.sm-assignment-header h3 {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 0.2rem;
}

.assign-season-label {
    font-size: 0.88rem;
    color: #888;
    margin: 0;
}

.roster-count-badge {
    background: var(--dark-color);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Roster list */
.sm-roster-list {
    list-style: none;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.sm-roster-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.75rem;
}

.sm-roster-item:last-child { border-bottom: none; }

.sm-roster-rank {
    font-size: 0.78rem;
    font-weight: 700;
    color: #aaa;
    width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.sm-roster-name {
    flex: 1;
    font-weight: 500;
    color: var(--dark-color);
}

.sm-roster-elo {
    font-size: 0.82rem;
    color: #888;
    flex-shrink: 0;
}

.sm-roster-empty {
    list-style: none;
    padding: 1.5rem;
    text-align: center;
    color: #aaa;
    font-style: italic;
    font-size: 0.9rem;
}

/* Modals */
.sm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-modal-dialog {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    overflow: hidden;
}

.sm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    background: var(--dark-color);
    color: white;
}

.sm-modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.sm-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.2rem;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.sm-modal-close:hover { opacity: 1; }

.sm-modal-body {
    padding: 1.5rem;
}

.sm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.sm-modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sm-modal-body select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.sm-modal-body select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Season manager responsive */
@media (max-width: 768px) {
    .sm-layout {
        grid-template-columns: 1fr;
    }

    .sm-modal-body .form-row {
        grid-template-columns: 1fr;
    }

    .sm-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Responsive Table */
@media (max-width: 768px) {
    .rankings-table {
        font-size: 0.9rem;
    }

    .rankings-table th,
    .rankings-table td {
        padding: 0.7rem 0.5rem;
    }

    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .rankings-stats {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile Enhancements ─────────────────────────────────────────────────── */

/* 480px breakpoint — small phones */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 1.25rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .section {
        padding: 1.25rem;
    }

    nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .player-image {
        height: 160px;
    }

    .player-card {
        padding: 1rem;
    }

    .player-card h3 {
        font-size: 1.2rem;
    }

    .login-container {
        margin-top: 20px !important;
    }
}

/* Rankings table — mobile card layout */
@media (max-width: 768px) {
    .rankings-table {
        display: block;
    }

    .rankings-table thead {
        display: none;
    }

    .rankings-table tbody {
        display: block;
    }

    .rankings-table tr.ranking-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 0.2rem 0.75rem;
        align-items: center;
        border: 1px solid #eee;
        border-radius: var(--border-radius);
        margin-bottom: 0.6rem;
        padding: 0.75rem;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .rankings-table tr.ranking-row:nth-child(even) {
        background: white;
    }

    .rankings-table td {
        display: block;
        padding: 0;
        border: none;
    }

    .rankings-table td.rank {
        grid-column: 1;
        grid-row: 1 / 3;
        display: flex;
        align-items: center;
    }

    .rankings-table td.name {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: flex-end;
    }

    .rankings-table td.elo {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        align-items: flex-start;
        text-align: left;
    }

    .rankings-table td.winrate {
        grid-column: 3;
        grid-row: 1 / 3;
        display: flex;
        align-items: center;
    }

    .rankings-table td.wins,
    .rankings-table td.losses,
    .rankings-table td.matches {
        display: none;
    }

    /* Compact variant — seasons roster (no winrate column) */
    .rankings-table--compact tr.ranking-row {
        grid-template-columns: auto 1fr;
    }

    /* Team nav — horizontally scrollable pill row */
    .team-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .team-nav::-webkit-scrollbar {
        display: none;
    }

    .team-btn {
        flex-shrink: 0;
    }
}

/* Position sub-tabs (Skaters / Goalies) — mobile only */
.position-tab-nav {
    display: none;
}

@media (max-width: 768px) {
    .position-tab-nav {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }

    .position-section {
        display: none;
    }

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