/* ===== Base / Reset ===== */

:root {
    /* Core palette */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-darker: #0f1419;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent: #4fc3f7;
    --accent-dark: #29b6f6;
    --danger: #f44336;
    --success: #4caf50;
    --warning: #ff9800;

    /* Semantic colors */
    --color-positive: #81c784;
    --color-negative: #ef5350;
    --color-warning-gold: #ffd54f;
    --color-panel-header: #2e7d32;
    --color-chem-active: #00e676;
    --color-field-green: #1b5e20;
    --color-att: #f44336;
    --color-mid: #4caf50;
    --color-def: #2196f3;
    --color-gk: #ff9800;
    --color-any: #9c27b0;

    /* Sizing / spacing */
    --radius: 6px;
    --radius-small: 4px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --touch-target: 44px;
    --top-bar-height: 32px;
    --scoreboard-height: 80px;
    /* event ticker removed */
    --bottom-toolbar-height: 52px;
}

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

/* Triple height declaration: progressive enhancement for mobile viewport units */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    height: 100dvh;
    height: var(--vh, 100vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}


/* ===== Top Bar ===== */

.top-bar {
    height: var(--top-bar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-sm);
    flex-shrink: 0;
    z-index: 10;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    flex: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* SSE connection status indicator */
.sse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--success);
    transition: background 0.3s;
}
.sse-dot.disconnected {
    background: var(--danger);
}

.header-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.phase-progress {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--accent);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-stats {
    display: flex;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.compact-stat {
    white-space: nowrap;
}

.stat-cash {
    color: var(--color-positive);
}

.stat-score {
    color: var(--accent);
}

/* Auto-play toggle */
.auto-play-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.auto-play-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 28px;
    height: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.toggle-slider::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--text-secondary);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.auto-play-toggle input:checked + .toggle-slider {
    background: var(--success);
    border-color: var(--success);
}

.auto-play-toggle input:checked + .toggle-slider::after {
    transform: translateX(12px);
    background: white;
}


/* ===== Layout ===== */

/* Main Game Layout (desktop — hidden on mobile via inline style) */
.game-layout {
    flex: 1 1 0;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.action-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-column {
    display: none;
    width: 35%;
    border-left: 1px solid var(--border-color);
    background: var(--bg-darker);
    flex-direction: column;
    min-height: 0;
}

/* Action Panel */
.action-panel {
    flex: 1 1 auto;
    background: var(--bg-secondary);
    border: 2px solid var(--color-panel-header);
    border-radius: var(--radius);
    margin: var(--spacing-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(var(--vh, 100vh) - 190px);
}

.action-header {
    background: var(--color-panel-header);
    color: #fff;
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    text-align: center;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Scoreboard Strip */
.scoreboard-strip {
    height: var(--scoreboard-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.scoreboard-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-sm);
    gap: var(--spacing-md);
    overflow-x: auto;
    overflow-y: hidden;
}

.manager-strip {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-small);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 32px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.manager-strip:hover {
    background: rgba(255, 255, 255, 0.08);
}

.manager-strip.human {
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid var(--accent);
}

.manager-rank {
    font-weight: 700;
    color: var(--warning);
    min-width: 16px;
}

.manager-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.manager-score {
    color: var(--accent);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.manager-details {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.manager-status {
    font-size: var(--font-size-xs);
    color: var(--success);
    font-weight: 500;
}

/* Event Ticker */
/* Event ticker CSS removed - events now in panel */

/* No game prompt */
.no-game {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.no-game-content {
    text-align: center;
    max-width: 400px;
}

.no-game-content h2 {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
}

.no-game-content p {
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}


/* ===== Game Board ===== */

.game-board {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 50% 30%, var(--color-panel-header) 0%, var(--color-field-green) 50%, #14451a 100%);
    position: relative;
    padding-bottom: var(--bottom-toolbar-height);
}

/* Subtle field texture via repeating lines */
.game-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.015) 30px,
            rgba(255,255,255,0.015) 31px
        );
    pointer-events: none;
}

.game-board-inner {
    position: relative;
    z-index: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-height: 100%;
}

/* Board section cards */
.board-section {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: var(--spacing-md);
}

.board-section-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-warning-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding-bottom: var(--spacing-xs);
}

/* Superclub Trophy */
.board-trophy {
    text-align: center;
    padding: 8px 0;
}

.trophy-cup {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.trophy-text {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-warning-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Manager cards on game board */
.manager-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.manager-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.manager-card:active {
    background: rgba(0, 0, 0, 0.35);
}

.manager-card.manager-human {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 215, 0, 0.08);
}

.manager-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    position: relative;
}

.avatar-human {
    color: white;
}

.avatar-ai {
    color: white;
}

.avatar-rank {
    font-size: 9px;
    line-height: 1;
    opacity: 0.8;
}

.avatar-initials {
    font-size: 15px;
    line-height: 1;
}

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

.manager-stats-main {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.manager-stats {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.manager-facilities {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.mgr-streak {
    font-size: 10px;
    color: var(--color-gk);
}

/* Manager detail panel */
.manager-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-header-stats {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.detail-facilities {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.detail-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.detail-section-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    padding-left: 2px;
}

.detail-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
    font-size: 12px;
}

.detail-player-stars {
    color: #ffc107;
    font-size: 11px;
    min-width: 50px;
}

.detail-player-name {
    color: rgba(255, 255, 255, 0.8);
}

.detail-staff {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

.detail-staff-ability {
    color: rgba(255, 255, 255, 0.45);
}

.detail-no-staff {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}

/* Facilities row */
.board-facilities {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.board-facility {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
}

.board-facility-icon {
    font-size: 16px;
}

.board-facility-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-xs);
}

.board-facility-value {
    font-weight: 700;
    color: var(--color-warning-gold);
}

/* Staff list */
/* Next match card */
.next-match-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm) var(--spacing-md);
}
.next-match-card.bye {
    text-align: center;
    padding: var(--spacing-md);
}
.next-match-label {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: rgba(255, 255, 255, 0.7);
}
.next-match-detail {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}
.next-match-vs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}
.next-match-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.next-match-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
}
.next-match-name {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-align: center;
}
.next-match-middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.next-match-ha {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}
.next-match-round {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.35);
}


/* ===== Bottom Toolbar ===== */

.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-toolbar-height);
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-sm);
    flex-shrink: 0;
    z-index: 320;
}

.toolbar-left {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.toolbar-buttons {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.toolbar-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.toolbar-btn-icon {
    line-height: 1;
}

.toolbar-xi-icon {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Continue button highlight */
.toolbar-btn.continue-ready {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.toolbar-btn.continue-ready:hover {
    background: var(--accent-dark);
}

/* Phase buttons styling */
.toolbar-phase-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.toolbar-phase-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

/* Red dot badge */
.toolbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-darker);
}


/* ===== Slide Panels ===== */

.slide-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--bottom-toolbar-height);
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide-panel-backdrop.visible {
    opacity: 1;
}

.slide-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bottom-toolbar-height);
    height: calc(85vh - var(--bottom-toolbar-height));
    background: var(--bg-secondary);
    border-top: 2px solid var(--color-panel-header);
    border-radius: 12px 12px 0 0;
    z-index: 310;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.slide-panel.open {
    transform: translateY(0);
}

.slide-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--color-panel-header);
    color: #fff;
}

.slide-panel-title {
    font-weight: 600;
    font-size: var(--font-size-base);
}

.slide-panel-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.slide-panel-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

.slide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Squad/Staff Overlay */
.squad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.overlay-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(400px, 90vw);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

.overlay-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.overlay-tabs {
    display: flex;
    gap: var(--spacing-sm);
}

.overlay-tab {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-small);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.overlay-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.overlay-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    flex: 1;
    overflow: hidden;
}

.overlay-tab-content {
    height: 100%;
    padding: var(--spacing-md);
    overflow-y: auto;
}

/* Squad/Staff Lists in Overlay */
.squad-list-overlay, .staff-list-overlay {
    display: grid;
    gap: var(--spacing-sm);
}

.player-item-overlay, .staff-item-overlay {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-small);
    border: 1px solid transparent;
}

.player-item-overlay:hover, .staff-item-overlay:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color);
}

.player-stars-overlay {
    color: var(--warning);
    min-width: 60px;
    font-size: var(--font-size-sm);
}

.potential-stars {
    color: #8b8000;
    opacity: 0.7;
}

.chem-indicators {
    font-size: 0.75em;
    margin-left: 3px;
}

.chem-half {
    display: inline-block;
    color: var(--color-chem-active);
    font-weight: 700;
    font-size: 0.85em;
    opacity: 0.9;
    width: 0.5em;
    overflow: hidden;
    line-height: 1;
}

/* Left arrow = right half-star (faces left neighbor) */
.chem-half.chem-left {
    margin-right: 1px;
    text-indent: -0.5em;
}

/* Right arrow = left half-star (faces right neighbor) */
.chem-half.chem-right {
    margin-left: 1px;
}

.chem-badge {
    background: var(--color-chem-active);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 0 3px;
    border-radius: 3px;
    margin-left: 2px;
}

.player-name-overlay, .staff-name-overlay {
    flex: 1;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.player-position-overlay {
    padding: 2px 6px;
    border-radius: var(--radius-small);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.position-ATT { background: var(--color-att); color: white; }
.position-MID { background: var(--color-mid); color: white; }
.position-DEF { background: var(--color-def); color: white; }
.position-GK { background: var(--color-gk); color: white; }
.position-ANY { background: var(--color-any); color: white; }

.player-injured-overlay {
    color: var(--danger);
    font-size: var(--font-size-xs);
}

.staff-ability-overlay {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}


/* ===== Pitch UI ===== */

.pitch-ui {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    height: 100%;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Formation tabs row (horizontal, above pitch) */
.formation-tabs-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Captain boost row (horizontal, below pitch) */
.captain-boost-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
    flex-shrink: 0;
}

.captain-boost-row .captain-boost-label {
    font-size: 12px;
    color: var(--warning);
    font-weight: 600;
}

/* Formation tabs */
.formation-tab {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-small);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.formation-tab:hover {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.08);
}

.formation-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Pitch container */
.pitch-container {
    background: linear-gradient(180deg, #1a5c2e 0%, #1e6b34 25%, #22793a 50%, #1e6b34 75%, #1a5c2e 100%);
    border-radius: var(--radius);
    padding: var(--spacing-xs) 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    flex-shrink: 1;
    flex-grow: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    max-width: 340px;
    min-width: 0;
}

.pitch-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Pitch rows */
.pitch-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 2px 0 2px 28px;
    position: relative;
}

.pitch-row-label {
    position: absolute;
    left: 2px;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.row-label-ATT { color: var(--color-att); }
.row-label-MID { color: var(--color-mid); }
.row-label-DEF { color: var(--color-def); }
.row-label-GK { color: var(--color-gk); }

/* Incomplete row: red outline on empty slots */
.pitch-row.row-incomplete .pitch-slot.empty {
    border-color: rgba(244, 67, 54, 0.7);
    border-style: dashed;
}

/* Pitch slots */
.pitch-slot {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.pitch-slot:active {
    transform: scale(0.95);
}

.pitch-slot.empty {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.15);
}

.pitch-slot.empty.valid-target {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.15);
    animation: pulse 1.2s ease-in-out infinite;
}

.pitch-slot.filled {
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.45);
}

.pitch-slot.filled.selected {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.5);
    background: rgba(79, 195, 247, 0.2);
}

.pitch-slot.filled.out-of-pos {
    border-color: var(--warning);
}

.pitch-slot.drop-highlight {
    border-color: var(--color-chem-active) !important;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.pitch-slot-label {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.pitch-slot-name {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pitch-slot-stars {
    font-size: 10px;
    color: var(--warning);
    font-weight: 600;
}

.pitch-slot-stars.stars-boosted {
    color: var(--color-chem-active);
}

.pitch-slot-stars.stars-penalty {
    color: #ff7043;
}

/* Chemistry half-stars on left/right edges — border-only style */
.slot-chem-l, .slot-chem-r {
    position: absolute;
    top: 50%;
    font-size: 40px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.55);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}
.slot-chem-l {
    right: 50%;
    clip-path: inset(0 0 0 50%);
}
.slot-chem-r {
    left: 50%;
    clip-path: inset(0 50% 0 0);
}

/* Chemistry link between slots */
.chemistry-link {
    font-size: 10px;
    color: var(--color-chem-active);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 12px;
    flex-shrink: 0;
    padding-bottom: 6px;
    text-shadow: 0 0 4px rgba(0, 230, 118, 0.5);
}

/* Row strength display */
.row-str {
    color: var(--warning);
    font-weight: 600;
    font-size: 9px;
}

/* Drag ghost */
.drag-ghost {
    position: fixed;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(79, 195, 247, 0.85);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-align: center;
    overflow: hidden;
}

/* Drop highlight on bench */
.bench-row.drop-highlight {
    background: rgba(0, 230, 118, 0.1);
    border-radius: var(--radius-small);
}

/* Captain boost buttons */
.captain-boost-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px;
    border-radius: var(--radius-small);
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    min-height: 26px;
    min-width: 33px;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.captain-boost-btn:hover {
    border-color: var(--accent);
}

.captain-boost-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Bench area */
.pitch-bench {
    flex-shrink: 0;
    min-height: 0;
}

.bench-header {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.bench-row {
    display: flex;
    gap: var(--spacing-xs);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
    flex-wrap: wrap;
    max-width: 360px;
    margin: 0 auto;
}

.bench-empty {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    padding: var(--spacing-sm);
}

.bench-card {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: var(--spacing-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bench-card:active {
    transform: scale(0.95);
}

.bench-card:hover {
    border-color: var(--accent);
}

.bench-card.selected {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.15);
    box-shadow: 0 0 6px rgba(79, 195, 247, 0.3);
}

.position-border-ATT { border-left: 3px solid var(--color-att); }
.position-border-MID { border-left: 3px solid var(--color-mid); }
.position-border-DEF { border-left: 3px solid var(--color-def); }
.position-border-GK { border-left: 3px solid var(--color-gk); }
.position-border-ANY { border-left: 3px solid #ab47bc; }

.pitch-slot.filled.position-border-ATT { border-left: 3px solid var(--color-att); }
.pitch-slot.filled.position-border-MID { border-left: 3px solid var(--color-mid); }
.pitch-slot.filled.position-border-DEF { border-left: 3px solid var(--color-def); }
.pitch-slot.filled.position-border-GK { border-left: 3px solid var(--color-gk); }
.pitch-slot.filled.position-border-ANY { border-left: 3px solid #ab47bc; }

.bench-card-name {
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.bench-card-info {
    font-size: 9px;
    color: var(--warning);
    font-weight: 600;
}

.bench-card-stars {
    font-size: 7px;
    color: var(--warning);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.5px;
}

.bench-card-stars .potential-stars {
    font-size: 7px;
}

.bench-injured {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.injured-tag {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    opacity: 0.6;
}

/* Pitch actions */
.pitch-with-sidebar {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: var(--spacing-xs);
}

.pitch-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    padding: var(--spacing-xs) 0;
}

.pitch-sidebar .btn {
    writing-mode: horizontal-tb;
    font-size: 11px;
    padding: 4px 8px;
}

.pitch-strength {
    color: var(--warning);
    font-weight: 700;
    font-size: var(--font-size-sm);
}


/* ===== Action Panel Content ===== */

/* Buttons */
.btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-small);
    font-family: inherit;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
}

.btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

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

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    min-height: 28px;
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-lg);
    min-height: 48px;
    width: 100%;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Draft picks */
.draft-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.draft-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.draft-card:hover,
.draft-card:active {
    background: var(--bg-secondary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.draft-card.selected {
    border: 2px solid var(--accent);
    background: rgba(79, 195, 247, 0.15);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
    transform: translateY(-2px);
}

.draft-card-stars {
    font-size: var(--font-size-sm);
    color: var(--warning);
}

.draft-card-name {
    font-weight: 600;
    font-size: var(--font-size-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draft-card-position {
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 3px;
}

.draft-actions {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

/* Investment */
.investment-options {
    display: grid;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    max-height: 40vh;
    overflow-y: auto;
}

.investment-option {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: var(--touch-target);
}

.investment-option:hover {
    background: var(--bg-secondary);
}

.investment-option.selected {
    background: rgba(79, 195, 247, 0.1);
    border-color: var(--accent);
}

.investment-option-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    color: var(--accent);
    flex-shrink: 0;
}

.investment-option.selected .investment-option-checkbox {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.investment-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    text-align: center;
}

.investment-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

/* Deadline bid */
.deadline-bid {
    display: grid;
    gap: var(--spacing-md);
}

.bid-player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-md);
    text-align: center;
}

.bid-info {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.bid-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.bid-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    text-align: center;
    color: var(--warning);
}

/* Training */
.training-select-info {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

/* Scouting */
.scouting-offer {
    text-align: center;
}

.scouting-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: var(--warning);
    font-size: var(--font-size-sm);
}

.scouting-player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: inline-block;
    min-width: 180px;
}

.scouting-player-value {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.scouting-info {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.scouting-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* Staff hire */
.staff-hire-info {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.staff-cards-row {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-md);
    padding: 0 var(--spacing-xs);
}

.staff-card {
    width: 150px;
    min-height: 200px;
    background: linear-gradient(165deg, #f5f5f0 0%, #e8e6e0 40%, #d9d6cf 100%);
    border-radius: 12px;
    padding: var(--spacing-md) var(--spacing-sm);
    padding-top: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

/* Face silhouette watermark */
.staff-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 90px;
    height: 110px;
    opacity: 0.1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' fill='none' stroke='%23333' stroke-width='1.8'%3E%3C!-- Head outline --%3E%3Cpath d='M50 8 C30 8 22 22 22 38 C22 46 24 52 28 58 C30 62 32 66 32 70 L68 70 C68 66 70 62 72 58 C76 52 78 46 78 38 C78 22 70 8 50 8Z'/%3E%3C!-- Jaw line --%3E%3Cpath d='M32 70 C34 82 42 90 50 92 C58 90 66 82 68 70'/%3E%3C!-- Neck --%3E%3Cpath d='M42 92 L42 102' /%3E%3Cpath d='M58 92 L58 102' /%3E%3C!-- Shoulders and suit --%3E%3Cpath d='M42 102 C30 103 14 108 8 120 L8 130' /%3E%3Cpath d='M58 102 C70 103 86 108 92 120 L92 130' /%3E%3C!-- Collar / lapels --%3E%3Cpath d='M42 102 L46 114 L50 108' /%3E%3Cpath d='M58 102 L54 114 L50 108' /%3E%3C!-- Tie --%3E%3Cpath d='M50 108 L47 122 L50 130 L53 122 Z' /%3E%3C/svg%3E") no-repeat center;
    pointer-events: none;
    z-index: 0;
}

.staff-card.staff-unaffordable {
    opacity: 0.5;
}

.staff-card-name {
    font-weight: 700;
    font-size: 15px;
    color: #2c2c2c;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.staff-card-ability,
.staff-card-price,
.staff-card .btn {
    position: relative;
    z-index: 1;
}

.staff-card-ability {
    font-size: 12px;
    color: #555;
    line-height: 1.3;
    padding: 0 var(--spacing-xs);
}

.staff-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

.staff-card .btn {
    margin-top: auto;
    font-size: 13px;
    padding: 6px 20px;
}

/* Reveal animation — slides in from above with fade */
.staff-reveal {
    opacity: 0;
    transform: translateY(-15px);
    animation: staffRevealIn 0.4s ease forwards;
}

@keyframes staffRevealIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.staff-actions {
    display: flex;
    justify-content: center;
}

/* Continue */
.continue-actions {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg);
}

/* Match formation comparison */
.match-formations {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--accent);
    font-weight: 600;
    padding: var(--spacing-xs) 0;
}

/* Match result */
.match-result-card {
    display: grid;
    gap: var(--spacing-md);
    padding: 12px;
}

.match-header-bar {
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
}

.match-result {
    font-size: var(--font-size-xl);
    font-weight: bold;
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-small);
    animation: scaleIn 0.5s ease-out;
}

.result-win {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.result-draw {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.result-loss {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger);
}

.thirds-breakdown {
    display: grid;
    gap: var(--spacing-xs);
}

.third-row {
    padding: var(--spacing-sm);
    margin-bottom: 4px;
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.third-won {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.third-lost {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.third-label {
    font-weight: 700;
    min-width: 24px;
    font-size: var(--font-size-sm);
}

.third-scores {
    flex: 1;
    min-width: 0;
}

.third-score-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    padding: 3px 0;
}

.third-opp-line {
    opacity: 0.7;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.third-line-tag {
    font-weight: 600;
    min-width: 28px;
}

.third-breakdown {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.third-icon {
    font-weight: 700;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

/* Captain boost selection */
.captain-boost-select {
    display: grid;
    gap: var(--spacing-sm);
}

.boost-info {
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.boost-option {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.boost-option:hover,
.boost-option:active {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.1);
}

.boost-line-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.boost-line-strength {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.boost-line-after {
    color: var(--success);
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin: 2px 0;
}

.boost-line-players {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Training result */
.training-result {
    text-align: center;
    display: grid;
    gap: var(--spacing-md);
}

.result-player {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.result-stars {
    font-size: var(--font-size-xl);
    color: var(--warning);
}

.result-rolls {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.result-text {
    font-weight: 600;
    padding: var(--spacing-sm);
    border-radius: var(--radius-small);
}

.result-text.success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.result-text.fail {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger);
}

.training-auto-continue {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

.training-continue-actions {
    margin-top: var(--spacing-lg);
    text-align: center;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

/* Events panel */
.events-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
}

.event-item {
    padding: var(--spacing-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.events-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

/* Season summary */
.season-summary {
    display: grid;
    gap: var(--spacing-md);
}

.season-standings {
    display: grid;
    gap: var(--spacing-xs);
    max-height: 50vh;
    overflow-y: auto;
}

.season-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.season-row-winner {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--success);
}

.season-pos {
    font-weight: 700;
    min-width: 32px;
}

.season-name {
    font-weight: 600;
    min-width: 60px;
}

.season-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-left: auto;
}

.season-score {
    font-weight: 600;
    color: var(--text-primary);
}

/* Game over */
.game-over {
    text-align: center;
    padding: var(--spacing-lg);
}

.game-over-trophy {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    animation: bounceIn 1s ease-out;
}

.game-over-winner {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.game-over-condition {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Off-season Overview */
.offseason-overview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.overview-manager {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 10px 12px;
}

.overview-human {
    background: rgba(33, 150, 243, 0.1);
}

.overview-manager-header {
    margin-bottom: 6px;
}

.overview-manager-name {
    font-size: 14px;
}

.overview-section {
    margin-left: 4px;
}

.overview-item {
    font-size: 12px;
    padding: 2px 0;
    color: var(--text-primary, #e0e0e0);
}

.overview-empty {
    color: var(--text-secondary, #888);
    font-style: italic;
}

/* Finance overview */
.finance-overview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.finance-row {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 10px 12px;
}

.finance-human {
    background: rgba(33, 150, 243, 0.1);
}

.finance-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.finance-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.fin-item {
    white-space: nowrap;
}

.fin-plus { color: var(--color-positive); }
.fin-minus { color: var(--color-negative); }


/* ===== Modal ===== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: scaleIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-form {
    padding: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
    min-height: var(--touch-target);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

/* Color picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.color-check {
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.color-swatch.selected .color-check {
    opacity: 1;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}


/* ===== Utilities / Animations ===== */

/* Visual Dice Faces */
.die-face {
    display: inline-grid;
    grid-template-columns: repeat(3, 6px);
    grid-template-rows: repeat(3, 6px);
    gap: 2px;
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
    margin: 0 2px;
    vertical-align: middle;
}

.die-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
}

.die-pip.active {
    background: #333;
}

/* Match animation styles */
.match-result-pending {
    text-align: center;
    font-size: 18px;
    padding: 12px;
    color: var(--text-secondary);
    animation: matchPulse 1s infinite;
}

@keyframes matchPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.dice-landed {
    animation: diceBounce 0.2s ease-out;
}

@keyframes diceBounce {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* ===== Mobile Adjustments ===== */

/* Small pitch devices */
@media (max-width: 360px) {
    .pitch-slot {
        width: 42px;
        height: 42px;
    }
    .pitch-container {
        max-width: 280px;
    }
    .formation-tab {
        padding: 2px 5px;
        font-size: 9px;
        min-height: 24px;
    }
    .bench-card {
        width: 46px;
    }
    .pitch-slot-name {
        font-size: 9px;
    }
    .pitch-slot-stars {
        font-size: 9px;
    }
    .slot-chem-l, .slot-chem-r {
        font-size: 32px;
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
    }
}

/* Small mobile general adjustments */
@media (max-width: 480px) {
    .top-bar {
        padding: 0 var(--spacing-xs);
    }

    .compact-stats {
        gap: var(--spacing-xs);
    }

    .manager-strip {
        padding: var(--spacing-xs);
        gap: 2px;
    }

    .manager-details {
        display: none;
    }

    .action-panel {
        margin: var(--spacing-xs);
    }

    .draft-picks-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .bid-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        padding: var(--spacing-xs);
    }
}

/* Desktop layout */
@media (min-width: 768px) {
    .scoreboard-strip {
        display: none !important;
    }

    /* event-ticker removed */

    .sidebar-column {
        display: flex;
    }

    .sidebar-scoreboard {
        flex: 1;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
        overflow-y: auto;
    }

    .sidebar-events {
        height: 40%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .sidebar-events-header {
        padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
        font-weight: 600;
        font-size: var(--font-size-base);
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .sidebar-events-list {
        flex: 1;
        overflow-y: auto;
        padding: var(--spacing-sm) var(--spacing-md);
        display: grid;
        gap: var(--spacing-xs);
        align-content: start;
    }

    .sidebar-event {
        font-size: var(--font-size-xs);
        color: var(--text-secondary);
        padding: var(--spacing-xs);
        background: rgba(255, 255, 255, 0.02);
        border-radius: var(--radius-small);
        line-height: 1.2;
    }

    .sidebar-event.latest {
        color: var(--accent);
        background: rgba(255, 255, 255, 0.05);
    }

    .manager-detailed {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-small);
        margin-bottom: var(--spacing-xs);
        border: 1px solid transparent;
    }

    .manager-detailed:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--border-color);
    }

    .manager-detailed.human {
        background: rgba(79, 195, 247, 0.1);
        border-color: var(--accent);
    }

    .manager-detailed-rank {
        font-weight: 700;
        color: var(--warning);
        min-width: 20px;
        font-size: var(--font-size-sm);
    }

    .manager-detailed-name {
        font-weight: 600;
        min-width: 60px;
    }

    .manager-detailed-stats {
        flex: 1;
        font-size: var(--font-size-xs);
        color: var(--text-secondary);
        display: flex;
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .manager-detailed-score {
        color: var(--accent);
        font-weight: 600;
    }

    .manager-detailed-status {
        font-size: var(--font-size-xs);
        color: var(--success);
        font-weight: 500;
        margin-left: auto;
    }

    .action-panel {
        margin: var(--spacing-md);
    }

    .draft-picks-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .staff-cards-row {
        gap: var(--spacing-sm);
    }

    .staff-card {
        width: 140px;
        min-height: 180px;
    }

    .investment-options {
        max-height: 60vh;
    }
}

/* Auto-action button */
.auto-action-bar {
    text-align: center;
    padding: 10px 0 5px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 10px;
}
.btn-auto-action {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-auto-action:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

/* ===== Training Batch Selection ===== */

.training-batch-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.training-batch-info {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.training-batch-count {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--accent);
}

.training-batch-actions {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
}

.training-batch-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.draft-card.training-batch-selected {
    border-color: var(--accent);
    background: rgba(79, 195, 247, 0.15);
    position: relative;
}

/* ===== Training Reveal Animation ===== */

.train-reveal-v2 {
    text-align: center;
    padding: 16px;
}

/* Search icon animations removed — star reveals carry the spectacle now */

.train-player-name {
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.train-player-stars {
    font-size: 22px;
    min-height: 28px;
    margin: 8px 0;
}

.train-star {
    display: inline-block;
    opacity: 0;
    color: var(--warning);
    animation: starPop 0.3s forwards;
}

/* Escalating spectacle for training stars too */
.train-star.star-level-3 { animation: starPop3 0.35s forwards; }
.train-star.star-level-4 { animation: starPop4 0.5s forwards; }
.train-star.star-level-5 { animation: starPop5 0.7s forwards; text-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
.train-star.star-level-6 { animation: starPop6 1.0s forwards; text-shadow: 0 0 20px rgba(255, 215, 0, 1); }

.train-star-gained {
    color: #4caf50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.train-star-failed {
    color: #f44336;
    text-shadow: 0 0 6px rgba(244, 67, 54, 0.4);
}

.train-result-text {
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.train-result-text.success {
    color: #4caf50;
}

.train-result-text.fail {
    color: var(--text-muted);
}

.train-dice-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Training Summary ===== */

.training-summary {
    padding: var(--spacing-md);
}

.training-summary-total {
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 700;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.training-summary-total.has-gains {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.training-summary-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.training-summary-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.03);
}

.training-summary-row.summary-success {
    background: rgba(76, 175, 80, 0.1);
}

.training-summary-row.summary-fail {
    opacity: 0.6;
}

.summary-name {
    flex: 1;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.summary-stars {
    color: var(--warning);
    font-size: var(--font-size-sm);
}

.summary-result {
    font-weight: 700;
    min-width: 32px;
    text-align: right;
    font-size: var(--font-size-sm);
}

.training-continue-actions {
    text-align: center;
    margin-top: 12px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.summary-success .summary-result {
    color: var(--success);
}

.summary-fail .summary-result {
    color: var(--text-muted);
}

/* Match day continue button */
.toolbar-btn.match-day {
    background: linear-gradient(135deg, #1b5e20, #2e7d32) !important;
    border-color: #4caf50 !important;
    animation: matchDayPulse 2s ease-in-out infinite;
}
.toolbar-btn.match-day .toolbar-btn-icon {
    font-size: 20px;
}
@keyframes matchDayPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(76, 175, 80, 0.3); }
}

/* ===== Scouting: Continent Selection ===== */

.continent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.continent-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 2px solid;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    min-height: 80px;
}

.continent-card:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.continent-card:hover {
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
}

.continent-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    color: currentColor;
}

.continent-icon svg {
    width: 100%;
    height: 100%;
}

.continent-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* ===== Scouting: Sequential Reveal Animation (v2) ===== */

.scout-reveal-v2 {
    text-align: center;
    padding: 16px;
}

.scout-search-icon {
    font-size: 40px;
    animation: revealSearch 1.5s ease forwards;
    margin-bottom: 12px;
}

@keyframes revealSearch {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    8%   { transform: translate(40px, -30px) scale(1.15); }
    17%  { transform: translate(0, -50px) scale(1.15); }
    25%  { transform: translate(-40px, -30px) scale(1.15); }
    33%  { transform: translate(0, 0) scale(1.15); }
    42%  { transform: translate(40px, 30px) scale(1.15); }
    50%  { transform: translate(0, 50px) scale(1.15); }
    58%  { transform: translate(-40px, 30px) scale(1.15); }
    67%  { transform: translate(0, 0) scale(1.15); }
    75%  { transform: translate(40px, -30px) scale(1.15); }
    83%  { transform: translate(0, -50px) scale(1.15); }
    92%  { transform: translate(-40px, -30px) scale(1.15); }
    100% { transform: translate(0, 0) scale(0.5); opacity: 0; }
}

.scout-player-name {
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.scout-player-stars {
    font-size: 22px;
    color: var(--warning);
    min-height: 28px;
    margin: 8px 0;
}

.scout-star {
    display: inline-block;
    opacity: 0;
    animation: starPop 0.2s forwards;
}

@keyframes starPop {
    from { opacity: 0; transform: scale(2); }
    to { opacity: 1; transform: scale(1); }
}

.scout-potential-stars {
    color: var(--text-muted);
}

.scout-player-position {
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    margin-bottom: 4px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.scout-player-value {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 4px 0 8px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.scout-reveal-v2 .scouting-warning {
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
    color: var(--warning);
    margin-bottom: 8px;
}

.scout-reveal-v2 .scouting-info {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.scout-reveal-v2 .scouting-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

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

/* ===== Deadline Reveal Animation ===== */

.deadline-reveal-v2 {
    text-align: center;
    padding: 16px;
}

.deadline-search-icon {
    font-size: 40px;
    animation: revealSearch 1.5s ease forwards;
    margin-bottom: 12px;
}

/* Consolidated into revealSearch above */

.deadline-player-name {
    font-size: 20px;
    font-weight: 700;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.deadline-player-stars {
    font-size: 22px;
    color: var(--warning);
    min-height: 28px;
    margin: 8px 0;
}

.deadline-star {
    display: inline-block;
    opacity: 0;
    animation: starPop 0.2s forwards;
}

.deadline-player-position {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.deadline-player-value {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 4px 0 8px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.deadline-cash-display {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 8px 0;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.deadline-bid-controls {
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.bid-slider-container {
    padding: 12px 0;
}

.bid-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    outline: none;
}

.bid-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2e7d32;
    border: 2px solid white;
    cursor: pointer;
}

.bid-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2e7d32;
    border: 2px solid white;
    cursor: pointer;
}

.bid-amount {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 8px 0;
    color: var(--warning);
}

.bid-amount.overbid {
    color: #f44336;
}

.bid-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.bid-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

/* Deadline celebration */
.deadline-celebration {
    text-align: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.deal-handshake {
    font-size: 48px;
    animation: dealBounce 0.6s ease-out;
    margin-bottom: 12px;
}

@keyframes dealBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.deal-player-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.deal-player-stars {
    font-size: 22px;
    color: var(--warning);
    margin-bottom: 8px;
}

.deal-details {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.deal-actions {
    margin-top: 12px;
}

/* Confetti animation */
.deal-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    background-image: 
        radial-gradient(circle, #f44336 2px, transparent 2px),
        radial-gradient(circle, #4caf50 2px, transparent 2px),
        radial-gradient(circle, #2196f3 2px, transparent 2px),
        radial-gradient(circle, #ff9800 2px, transparent 2px),
        radial-gradient(circle, #9c27b0 2px, transparent 2px);
    background-size: 10% 10%;
    background-position: 
        10% 0%, 30% 0%, 50% 0%, 70% 0%, 90% 0%;
    animation: confettiSpray 1.5s ease-out forwards;
}

@keyframes confettiSpray {
    0% { background-position: 10% -10%, 30% -10%, 50% -10%, 70% -10%, 90% -10%; opacity: 1; }
    100% { background-position: 5% 100%, 25% 80%, 50% 90%, 75% 85%, 95% 95%; opacity: 0; }
}

/* Lost result */
.deadline-result-lost {
    text-align: center;
    padding: 16px;
}

.deal-lost-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.deal-lost-details {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Golden spark animation for 5★+ players */
.deadline-legendary .deadline-player-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.deadline-legendary .deadline-player-stars {
    position: relative;
}

.deadline-legendary .deadline-player-stars::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: goldenPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
    pointer-events: none;
}

@keyframes goldenPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Golden sparkle particles */
.deadline-legendary::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    animation: sparkleFloat 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkleFloat {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    25% { opacity: 1; transform: translate(-70%, -70%) scale(1); }
    50% { opacity: 0.5; transform: translate(-30%, -80%) scale(0.8); }
    75% { opacity: 1; transform: translate(-60%, -40%) scale(1.1); }
}

/* Golden spark for scouting legendary players */
.scout-legendary .scout-player-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.scout-legendary .scout-player-stars {
    position: relative;
}

.scout-legendary .scout-player-stars::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: goldenPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
    pointer-events: none;
}

/* ===== Superclub-style Player Card ===== */

.player-card {
    width: 160px;
    height: 240px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 40%, #66bb6a 100%);
    position: relative;
    overflow: hidden;
    margin: 0 auto 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 12px;
    color: white;
}

/* Position-based card colours */
.player-card.card-ATT { background: linear-gradient(135deg, #c62828 0%, #e53935 40%, #ef5350 100%); }
.player-card.card-MID { background: linear-gradient(135deg, #2e7d32 0%, #43a047 40%, #66bb6a 100%); }
.player-card.card-DEF { background: linear-gradient(135deg, #1565c0 0%, #1e88e5 40%, #42a5f5 100%); }
.player-card.card-GK  { background: linear-gradient(135deg, #e65100 0%, #f57c00 40%, #ffa726 100%); }
.player-card.card-ANY { background: linear-gradient(135deg, #6a1b9a 0%, #9c27b0 40%, #ba68c8 100%); }

/* Diamond shape behind silhouette */
.card-diamond {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    margin-left: -40px;
    margin-top: -40px;
}

/* Player silhouette (CSS-only) */
.card-silhouette {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
}

/* Head */
.card-silhouette::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 4px;
}

/* Body with stripes */
.card-silhouette::after {
    content: '';
    display: block;
    width: 40px;
    height: 35px;
    background: repeating-linear-gradient(
        0deg,
        white 0px, white 3px,
        transparent 3px, transparent 6px
    );
    border-radius: 8px 8px 0 0;
    margin: 0 auto;
}

.card-header {
    z-index: 1;
}

.card-name {
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.card-stars {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    line-height: 1.3;
    text-align: center;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.card-position {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
}

.card-value {
    font-size: 14px;
    font-weight: 700;
}

/* Potential stars as hollow */
.card-stars .potential {
    opacity: 0.5;
}

/* Chemistry as large border-only half-stars */
.card-chem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.card-chem-left, .card-chem-right {
    position: absolute;
    top: 50%;
    font-size: 180px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

.card-chem-left {
    right: 50%;
    clip-path: inset(0 0 0 50%);
}

.card-chem-right {
    left: 50%;
    clip-path: inset(0 50% 0 0);
}

/* Legendary golden border for 5★+ — keeps position colour */
.player-card.legendary {
    border: 3px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.25);
    animation: legendaryShine 1.5s ease-out;
}

@keyframes legendaryShine {
    0%   { box-shadow: 0 0 0 rgba(255, 215, 0, 0); border-color: transparent; }
    30%  { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4); border-color: #fff8c4; }
    60%  { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3); border-color: #ffd700; }
    100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.25); border-color: #ffd700; }
}

/* Animated star reveal — escalating spectacle per star level */
.card-star-anim {
    display: inline-block;
    opacity: 0;
    animation: starPop 0.3s forwards;
}

.card-star-anim.potential {
    display: inline-block;
    opacity: 0;
    animation: starPop 0.3s forwards;
}

/* Level 1-2: simple pop */
.card-star-anim.star-level-1,
.card-star-anim.star-level-2 {
    animation: starPop 0.25s forwards;
}

/* Level 3: slightly bigger */
.card-star-anim.star-level-3 {
    animation: starPop3 0.35s forwards;
}

/* Level 4: pulse + glow */
.card-star-anim.star-level-4 {
    animation: starPop4 0.5s forwards;
}

/* Level 5: big shake + glow */
.card-star-anim.star-level-5 {
    animation: starPop5 0.7s forwards;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

/* Level 6: explosive with golden radiance */
.card-star-anim.star-level-6 {
    animation: starPop6 1.0s forwards;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.6);
}

@keyframes starPop3 {
    0%   { opacity: 0; transform: scale(0); }
    50%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes starPop4 {
    0%   { opacity: 0; transform: scale(0); }
    40%  { opacity: 1; transform: scale(1.6); }
    60%  { opacity: 1; transform: scale(0.9); }
    80%  { opacity: 1; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
}

@keyframes starPop5 {
    0%   { opacity: 0; transform: scale(0) rotate(0deg); }
    25%  { opacity: 1; transform: scale(2.0) rotate(-10deg); }
    40%  { transform: scale(0.8) rotate(5deg); }
    55%  { transform: scale(1.5) rotate(-3deg); }
    70%  { transform: scale(0.95) rotate(2deg); }
    85%  { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); text-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
}

@keyframes starPop6 {
    0%   { opacity: 0; transform: scale(0) rotate(0deg); }
    15%  { opacity: 1; transform: scale(2.5) rotate(-15deg); text-shadow: 0 0 30px #fff, 0 0 60px #ffd700; }
    30%  { transform: scale(0.6) rotate(10deg); }
    45%  { transform: scale(2.0) rotate(-8deg); text-shadow: 0 0 40px #ffd700; }
    60%  { transform: scale(0.85) rotate(5deg); }
    75%  { transform: scale(1.3) rotate(-2deg); }
    90%  { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.6); }
}

/* ===== Shared Reveal Container ===== */

.reveal-container {
    text-align: center;
    padding: 4px 8px 8px;
}

.reveal-card-wrapper {
    opacity: 1;
}

.reveal-card-wrapper.reveal-card-fadein {
    opacity: 0;
    animation: scoutFadeIn 0.4s 0.1s forwards;
}

.reveal-card-wrapper .player-card {
    margin: 0 auto 8px;
}

.reveal-warning {
    color: var(--warning);
    margin: 8px 0;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.reveal-info {
    color: var(--text-secondary);
    margin: 8px 0;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

.reveal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
    opacity: 0;
    animation: scoutFadeIn 0.3s forwards;
}

/* ===== Help System ===== */

.panel-help-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.panel-help-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.help-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.help-modal-backdrop.visible {
    opacity: 1;
}

.help-modal {
    background: var(--bg-secondary);
    border: 2px solid var(--color-panel-header);
    border-radius: 12px;
    max-width: 360px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-panel-header);
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.help-modal-title {
    font-size: 16px;
    font-weight: 600;
}

.help-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

.help-modal-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.help-modal-guide {
    max-width: 420px;
    max-height: 80vh;
}

.guide-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 16px 0 6px;
    color: var(--text-primary);
}

.guide-body h3:first-child {
    margin-top: 0;
}

.guide-body p {
    margin: 4px 0 8px;
    color: var(--text-secondary);
}

.guide-body ol, .guide-body ul {
    margin: 4px 0 8px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.guide-body li {
    margin-bottom: 3px;
}

.guide-body strong {
    color: var(--text-primary);
}

.toolbar-help-btn {
    font-size: 16px;
    font-weight: 700;
}

/* ===== End Help System ===== */
