/* =============================================================================
   Panel System - Mobile-First In-Game UI Layout
   Phase 6b: Panel Container Foundation
   ============================================================================= */

/* Panel Container - Full-screen container for game screen */
.game-screen-container {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100%;
    overflow: hidden;
    background: #f4f4f4;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    /* Cover the safe area (notch/dynamic island) */
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* Extend background behind safe area */
    box-sizing: border-box;
}

.game-screen-container.active {
    display: flex;
}

/* When game screen is active, prevent body scroll and override next-line-mode */
body.game-screen-active {
    overflow: hidden !important;
}

body.game-screen-active #beforePointScreen,
body.game-screen-active #simpleModeScreen,
body.game-screen-active #offensePlayByPlayScreen,
body.game-screen-active #defensePlayByPlayScreen {
    display: none !important;
}

body.game-screen-active header,
body.game-screen-active #bottomPanel,
body.game-screen-active #controllerRoleButtons {
    display: none !important;
}

/* =============================================================================
   Panel Stack - Vertical stack of collapsible panels
   ============================================================================= */

.panel-stack {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* =============================================================================
   Individual Panel Base Styles
   ============================================================================= */

.game-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    min-height: 0;
    transition: height 0.25s ease-out, flex 0.25s ease-out;
}

/* Panel states - height-based (no separate minimized/maximized classes)
   Panels are minimized by setting height to MIN_PANEL_HEIGHT (36px)
   Content naturally hides via overflow: hidden */

.game-panel.fills-remaining {
    flex: 1 1 auto; /* Only this panel grows to fill remaining space */
    min-height: 36px;
}


.game-panel.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.game-panel.hidden {
    display: none;
}

/* =============================================================================
   Panel Title Bar (handles resize and collapse)
   ============================================================================= */

.panel-title-bar {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content by default */
    padding: 4px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #ddd;
    cursor: default;
    user-select: none;
    min-height: 28px;
    flex-shrink: 0;
    transition: background 0.2s ease-out;
    position: relative; /* For absolute positioning of icons */
}

/* Draggable title bars get special cursor and touch handling */
.panel-title-bar.draggable {
    cursor: ns-resize;
    touch-action: none; /* Prevent browser handling of touch for drag */
}

/* Drag handle (left side of title bar) - visual indicator only */
.panel-drag-handle {
    position: absolute;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.1s;
}

/* Draggable title bars - visual indicators */
.panel-title-bar.draggable .panel-drag-handle {
    opacity: 0.5;
    cursor: ns-resize;
}

.panel-title-bar.draggable .panel-drag-handle.active {
    opacity: 0.6;
}

/* Not draggable - dim the handle */
.panel-title-bar.not-draggable .panel-drag-handle {
    opacity: 0.2;
    cursor: default;
}

.panel-title-bar.not-draggable {
    cursor: default;
}

.panel-drag-handle-line {
    width: 16px;
    height: 2px;
    background: #666;
    border-radius: 1px;
    transition: background 0.15s;
}

/* Highlight drag handle when panel is being dragged */
.game-panel.dragging .panel-drag-handle {
    opacity: 1;
    transform: scale(1.1);
}

.game-panel.dragging .panel-drag-handle-line {
    background: #007bff;
}

/* Panel title text - centered in title bar */
.panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

/* Panel subtitle (e.g., player names when minimized) */
.panel-subtitle {
    font-size: 0.75rem;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

/* Panel action buttons (expand/collapse) */
.panel-actions {
    position: absolute;
    right: 12px;
    display: flex;
    gap: 4px;
}

.panel-action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.panel-action-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
}

.panel-action-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.panel-action-btn i {
    font-size: 0.7rem;
}

/* =============================================================================
   Panel Content Area
   ============================================================================= */

/* Panel content fills available space in panel.
   When panel height is MIN_PANEL_HEIGHT (44px), there's no room for content
   and it naturally clips via overflow: hidden on the panel. */
.panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    min-height: 0;
    transition: opacity 0.2s ease-out;
}

/* When panel is expanding to fill remaining space */
.game-panel.expanding .panel-content {
    /* No max-height constraint */
}

/* Stub panel content (placeholder during development) */
.panel-stub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    text-align: center;
    min-height: 80px;
}

.panel-stub-icon {
    font-size: 2rem;
    color: #aaa;
}

.panel-stub-text {
    color: #666;
    font-size: 0.9rem;
}

.panel-stub-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.panel-stub-action:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-1px);
}

.panel-stub-action i {
    font-size: 0.85rem;
}

/* =============================================================================
   Header Panel (always visible, fixed height)
   ============================================================================= */

.panel-header {
    flex: 0 0 auto;
    background: #EB8232;
    color: #fff;
}

.panel-header .panel-title-bar {
    background: transparent;
    border-bottom: none;
    cursor: default;
    padding: 10px 12px;
}

.panel-header .panel-drag-handle {
    display: none;
}

.header-content-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.header-menu-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.header-menu-btn:hover {
    background: rgba(255,255,255,0.25);
}

.header-logo-container {
    position: relative;
    display: flex;
    align-items: center;
}

.header-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
    cursor: pointer;
}

.header-version-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.header-version-overlay.visible {
    opacity: 1;
}

/* Score display container - holds team identities and scores */
.header-score-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    justify-content: center;
}

/* Score numbers */
.header-score-value {
    min-width: 1.2em;
    text-align: center;
}

.header-score-us {
    color: #fff;
}

.header-score-separator {
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    font-size: 1.1rem;
}

.header-score-them {
    color: rgba(255,255,255,0.85);
}

/* Team identity containers */
.header-team-identity {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.header-team-identity.can-toggle {
    cursor: pointer;
}

.header-team-identity.can-toggle:active {
    opacity: 0.8;
}

.header-team-us {
    justify-content: flex-end;
}

.header-team-them {
    justify-content: flex-start;
}

/* Team identity text (name or fallback) */
.team-identity-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.team-identity-fallback {
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

/* Large team icon (main display) */
.team-identity-icon-large {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.15);
}

/* Large team symbol (4-char abbreviation, main display) */
.team-identity-symbol-large {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

/* Timer container */
.header-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    min-width: 60px;
    position: relative;
}

.header-timer-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    transition: color 0.3s;
}

.header-timer-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timer pause button */
.header-timer-pause-btn {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: #fff;
    cursor: pointer;
    display: none; /* Hidden by default, shown for point timer */
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.2s;
}

.header-timer-pause-btn:hover {
    background: rgba(255,255,255,0.4);
}

.header-timer-pause-btn.paused {
    background: rgba(40, 167, 69, 0.8);
}

/* Timer state colors */
.header-timer-value.timer-warning {
    color: #ffc107;
}

.header-timer-value.timer-danger {
    color: #ff6b6b;
    animation: timerPulse 1s infinite;
}

.header-timer-value.timer-negative {
    color: #ff4444;
    animation: timerPulse 0.5s infinite;
}

.header-timer-value.timer-paused {
    opacity: 0.7;
}

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

/* =============================================================================
   Role Buttons Panel (coaches only)
   ============================================================================= */

.panel-role-buttons {
    flex: 0 0 auto;
    background: #f4f4f4;
}

.panel-role-buttons .panel-title-bar {
    display: none;
}

.panel-role-buttons .panel-content {
    padding: 6px 8px;
    display: flex;
    gap: 6px;
}

.role-claim-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    margin: 0;
    border-radius: 6px;
    border: 2px solid #ccc;
    background: #e8e8e8;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-claim-btn:hover {
    background: #ddd;
    border-color: #aaa;
}

.role-claim-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.2;
}

.role-claim-holder {
    font-size: 0.7rem;
    color: #666;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* Role button states - green when YOU have the role */
.role-claim-btn.has-role {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border-color: #28a745;
    color: white;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.35);
}

.role-claim-btn.has-role .role-claim-holder {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* When someone else has the role - light orange */
.role-claim-btn.other-has-role {
    background: linear-gradient(135deg, #fde8d4 0%, #f8dcc4 100%);
    border-color: #e8a86e;
    color: #8b5a2b;
}

.role-claim-btn.other-has-role .role-claim-holder {
    color: #a0522d;
    font-weight: 500;
}

/* Role is available/unclaimed - grey, claimable */
.role-claim-btn.role-available {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-color: #999;
    color: #666;
}

.role-claim-btn.role-available .role-claim-holder {
    color: #888;
    font-weight: 400;
}

/* Pending handoff request animation */
.role-claim-btn.pending-handoff {
    animation: pendingPulse 1.5s infinite;
    border-color: #ffc107;
    background: #fff3cd;
}

/* =============================================================================
   Play-by-Play Panel (resizable)
   ============================================================================= */

.panel-playByPlay {
    background: #fff;
    flex: 0 0 auto;
    /* min-height controlled by JS during drag, not CSS */
    /* This allows chevron minimize to collapse to title bar only */
}

.panel-playByPlay .panel-title-bar {
    background: linear-gradient(135deg, #e8f4e8 0%, #d4edda 100%);
}

.panel-playByPlay .panel-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Role-disabled state - visual indicator but don't block all interaction */
.panel-playByPlay.role-disabled .pbp-panel-content {
    opacity: 0.6;
}

/* =============================================================================
   Play-by-Play Panel Content - Layout Modes
   Three modes based on panel height:
   - Expanded (>250px): Vertical layout like legacy Simple Mode
   - Medium (120-250px): We Score | They Score | Key Play row, then Undo | Sub | Events
   - Compact (<120px): Single compact row with "..." to expand
   ============================================================================= */

.pbp-panel-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

/* Main buttons row - We Score, They Score, Key Play */
.pbp-main-buttons {
    display: flex;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

/* Action buttons row - Undo, Sub, Events, More */
.pbp-action-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* =============================================================================
   COMPACT LAYOUT (single row - minimal height)
   All buttons in one row, action buttons hidden behind "..." 
   Used when panel height < 120px
   ============================================================================= */

.pbp-panel-content.layout-compact {
    flex-direction: row;
    align-items: stretch;
    gap: 4px;
}

.pbp-panel-content.layout-compact .pbp-main-buttons {
    flex: 1;
    gap: 4px;
}

/* All main buttons share space equally */
.pbp-panel-content.layout-compact .pbp-main-buttons .pbp-btn {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Hide icons in compact layout - show text only */
.pbp-panel-content.layout-compact .pbp-main-buttons .pbp-btn i {
    display: none;
}

/* Labels always visible in compact */
.pbp-panel-content.layout-compact .pbp-btn-label {
    display: inline;
}

.pbp-panel-content.layout-compact .pbp-action-buttons {
    flex: 0 0 auto;
    gap: 4px;
}

/* Hide action buttons in compact mode */
.pbp-panel-content.layout-compact .pbp-btn-action {
    display: none;
}

/* Show "more" button in compact mode */
.pbp-panel-content.layout-compact .pbp-btn-more {
    display: flex;
}

/* On very narrow screens, abbreviate text */
@media (max-width: 340px) {
    .pbp-panel-content.layout-compact .pbp-main-buttons .pbp-btn {
        font-size: 0.8rem;
        padding: 6px 4px;
    }
}

/* =============================================================================
   MEDIUM LAYOUT (two rows)
   Row 1: We Score | They Score | Key Play (evenly spaced)
   Row 2: Undo | Sub | Events
   Used when panel height 120-350px
   ============================================================================= */

.pbp-panel-content.layout-medium {
    flex-direction: column;
    gap: 8px;
}

.pbp-panel-content.layout-medium .pbp-main-buttons {
    flex: 1;
    gap: 8px;
    min-height: 0; /* Allow shrinking */
}

/* All three main buttons share space equally */
.pbp-panel-content.layout-medium .pbp-main-buttons .pbp-btn {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Hide icons in medium layout - more room for text */
.pbp-panel-content.layout-medium .pbp-main-buttons .pbp-btn i {
    display: none;
}

/* Action buttons row */
.pbp-panel-content.layout-medium .pbp-action-buttons {
    flex: 0 0 auto;
    gap: 8px;
}

/* Show action buttons in medium layout */
.pbp-panel-content.layout-medium .pbp-btn-action {
    display: flex;
    flex: 1;
}

/* Hide "more" button in medium mode */
.pbp-panel-content.layout-medium .pbp-btn-more {
    display: none;
}

/* Labels visible in medium mode */
.pbp-panel-content.layout-medium .pbp-btn-label {
    display: inline;
}

/* =============================================================================
   MEDIUM-TALL LAYOUT (modifier for medium when buttons are tall)
   Wraps text to two lines for larger font when there's vertical room
   Applied alongside layout-medium when content height 200-350px
   ============================================================================= */

.pbp-panel-content.layout-medium-tall .pbp-main-buttons .pbp-btn {
    font-size: 1.4rem;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

/* Stack the words vertically in medium-tall */
.pbp-panel-content.layout-medium-tall .pbp-main-buttons .pbp-btn-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.pbp-panel-content.layout-medium-tall .pbp-main-buttons .pbp-label-word {
    display: block;
}

/* Hide action labels on narrow screens */
@media (max-width: 400px) {
    .pbp-panel-content.layout-medium .pbp-btn-action .pbp-btn-label {
        display: none;
    }
}

/* =============================================================================
   EXPANDED LAYOUT (vertical, large squarish buttons like legacy Simple Mode)
   We Score, They Score, Key Play stacked vertically with spacing
   Then Undo | Sub | Events on a single line below
   Used when panel height > 250px
   ============================================================================= */

.pbp-panel-content.layout-expanded {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 12px;
}

.pbp-panel-content.layout-expanded .pbp-main-buttons {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex: 0 0 auto;
}

/* Score buttons - large, squarish */
.pbp-panel-content.layout-expanded .pbp-btn-score {
    width: 80%;
    max-width: 400px;
    padding: 28px 24px;
    font-size: 2rem;
    border-radius: 16px;
    flex: 0 0 auto;
}

.pbp-panel-content.layout-expanded .pbp-btn-score .pbp-btn-label {
    display: inline;
}

.pbp-panel-content.layout-expanded .pbp-btn-score i {
    display: none; /* Hide icons in expanded mode, show text only */
}

/* Key Play button - similar style but slightly smaller */
.pbp-panel-content.layout-expanded .pbp-btn-keyplay {
    width: 60%;
    max-width: 280px;
    padding: 18px 24px;
    font-size: 1.2rem;
    border-radius: 12px;
}

.pbp-panel-content.layout-expanded .pbp-btn-keyplay .pbp-btn-label {
    display: inline;
}

.pbp-panel-content.layout-expanded .pbp-btn-keyplay i {
    display: none;
}

/* Action buttons row - single line */
.pbp-panel-content.layout-expanded .pbp-action-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

/* Action buttons in expanded layout */
.pbp-panel-content.layout-expanded .pbp-btn-action {
    display: flex;
    padding: 12px 18px;
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.pbp-panel-content.layout-expanded .pbp-btn-action .pbp-btn-label {
    display: inline;
}

/* Hide "more" button in expanded mode */
.pbp-panel-content.layout-expanded .pbp-btn-more {
    display: none;
}

/* =============================================================================
   FULL LAYOUT (maximum vertical space - square buttons, spread vertically)
   Large square buttons with wrapped text, evenly spaced vertically
   Used when panel height > 500px content
   ============================================================================= */

.pbp-panel-content.layout-full {
    flex-direction: column;
    justify-content: space-between; /* Push main buttons and action row apart */
    align-items: center;
    padding: 16px 12px;
    height: 100%;
    overflow: hidden; /* Prevent button overflow */
}

.pbp-panel-content.layout-full .pbp-main-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    justify-content: space-evenly; /* Equal spacing between 3 main buttons */
    gap: 12px; /* Minimum gap between buttons */
    min-height: 0; /* Allow flex shrinking */
}

/* Large square score buttons with wrapped text */
.pbp-panel-content.layout-full .pbp-btn-score {
    width: 65%;
    max-width: 280px;
    min-height: 80px; /* Minimum touch target */
    flex: 1 1 auto; /* Allow growing and shrinking */
    max-height: 180px; /* Cap maximum size */
    padding: 16px 20px;
    font-size: clamp(1.4rem, 4vw, 2.2rem); /* Responsive font size */
    border-radius: 24px;
    flex-direction: column;
    line-height: 1.1;
}

/* Stack the words vertically in full layout */
.pbp-panel-content.layout-full .pbp-btn-score .pbp-btn-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.pbp-panel-content.layout-full .pbp-btn-score .pbp-label-word {
    display: block;
}

.pbp-panel-content.layout-full .pbp-btn-score i {
    display: none; /* Hide icons, show text only */
}

/* Key Play button in full layout - smaller than score buttons */
.pbp-panel-content.layout-full .pbp-btn-keyplay {
    width: 50%;
    max-width: 200px;
    min-height: 60px;
    flex: 0.6 1 auto; /* Grows less than score buttons */
    max-height: 120px;
    padding: 12px 16px;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    border-radius: 20px;
    flex-direction: column;
}

.pbp-panel-content.layout-full .pbp-btn-keyplay .pbp-btn-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.pbp-panel-content.layout-full .pbp-btn-keyplay .pbp-label-word {
    display: block;
}

.pbp-panel-content.layout-full .pbp-btn-keyplay i {
    display: none;
}

/* Action buttons row - stays at bottom */
.pbp-panel-content.layout-full .pbp-action-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    width: 100%;
    flex: 0 0 auto;
    padding-top: 12px; /* Minimum space above action row */
}

/* Action buttons in full layout */
.pbp-panel-content.layout-full .pbp-btn-action {
    display: flex;
    padding: 12px 18px;
    font-size: 0.95rem;
    flex: 0 0 auto;
}

.pbp-panel-content.layout-full .pbp-btn-action .pbp-btn-label {
    display: inline;
}

/* Hide "more" button in full mode */
.pbp-panel-content.layout-full .pbp-btn-more {
    display: none;
}

/* =============================================================================
   Base Button Styles (shared)
   ============================================================================= */

.pbp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    margin: 0;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pbp-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.pbp-btn:disabled,
.pbp-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pbp-btn i {
    font-size: 0.9rem;
}

/* Label words - inline by default, stacked only in full layout */
.pbp-label-word {
    display: inline;
}

/* We Score - green */
.pbp-btn-us {
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    color: #fff;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

.pbp-btn-us:hover:not(:disabled) {
    background: linear-gradient(135deg, #43A047 0%, #388E3C 100%);
}

/* They Score - red */
.pbp-btn-them {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    color: #fff;
    box-shadow: 0 3px 8px rgba(239, 83, 80, 0.3);
}

.pbp-btn-them:hover:not(:disabled) {
    background: linear-gradient(135deg, #E53935 0%, #D32F2F 100%);
}

/* Key Play button - blue */
.pbp-btn-keyplay {
    background: linear-gradient(135deg, #2196F3 0%, #1E88E5 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.pbp-btn-keyplay:hover:not(:disabled) {
    background: linear-gradient(135deg, #1E88E5 0%, #1976D2 100%);
}

/* More button (...) - gray */
.pbp-btn-more {
    flex: 0 0 40px;
    width: 40px;
    padding: 10px;
    background: linear-gradient(135deg, #78909C 0%, #607D8B 100%);
    color: #fff;
}

.pbp-btn-more:hover:not(:disabled) {
    background: linear-gradient(135deg, #607D8B 0%, #546E7A 100%);
}

.pbp-btn-more.active {
    background: linear-gradient(135deg, #546E7A 0%, #455A64 100%);
}

/* Action buttons in expanded row */
.pbp-btn-action {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.pbp-btn-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #ced4da;
}

.pbp-btn-action i {
    color: #6c757d;
}

/* =============================================================================
   Game Events Modal
   ============================================================================= */

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

.game-events-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.game-events-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.ge-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    margin: 0;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ge-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.ge-btn:disabled,
.ge-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ge-btn i {
    font-size: 1.4rem;
}

/* Timeout - blue (available anytime) */
.ge-btn-timeout {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.ge-btn-timeout:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* Half Time - purple */
.ge-btn-halftime {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.ge-btn-halftime:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a32a3 0%, #4a2885 100%);
}

/* Switch Sides - teal */
.ge-btn-switch {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.ge-btn-switch:hover:not(:disabled) {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

/* End Game - dark/warning */
.ge-btn-endgame {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
}

.ge-btn-endgame:hover:not(:disabled) {
    background: linear-gradient(135deg, #212529 0%, #1a1d20 100%);
}

/* =============================================================================
   Mobile Adjustments for Play-by-Play Panel
   ============================================================================= */

@media (max-width: 480px) {
    .pbp-panel-content {
        gap: 5px;
    }
    
    .pbp-score-row,
    .pbp-secondary-row {
        gap: 5px;
    }
    
    .pbp-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .pbp-btn i {
        font-size: 0.85rem;
    }
    
    .pbp-btn-more {
        flex: 0 0 36px;
        width: 36px;
        padding: 8px;
    }
    
    .pbp-btn-action {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    /* Full layout on mobile - slightly smaller text */
    .pbp-panel-content.layout-full .pbp-btn-score {
        font-size: 1.8rem;
        border-radius: 20px;
    }
    
    .pbp-panel-content.layout-full .pbp-btn-keyplay {
        font-size: 1.3rem;
        border-radius: 16px;
    }
    
    /* Expanded layout on mobile - slightly smaller */
    .pbp-panel-content.layout-expanded .pbp-btn-score {
        padding: 18px 16px;
        font-size: 1.5rem;
        width: 90%;
    }
    
    .pbp-panel-content.layout-expanded .pbp-btn-keyplay {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .ge-btn {
        padding: 14px 10px;
        font-size: 0.85rem;
    }
    
    .ge-btn i {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .pbp-btn-score {
        padding: 8px 6px;
    }
    
    .pbp-btn-keyplay {
        padding: 8px 10px;
    }
    
    /* Full layout on very small screens */
    .pbp-panel-content.layout-full .pbp-btn-score {
        font-size: 1.5rem;
        border-radius: 16px;
    }
    
    .pbp-panel-content.layout-full .pbp-btn-keyplay {
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    /* Expanded layout on very small screens */
    .pbp-panel-content.layout-expanded .pbp-btn-score {
        padding: 14px 12px;
        font-size: 1.3rem;
    }
}

/* Very small screens - handled by layout-specific media queries above */

/* =============================================================================
   Select Next Line Panel (resizable)
   ============================================================================= */

.panel-selectLine {
    background: #fff;
}

.panel-selectLine .panel-title-bar {
    background: linear-gradient(135deg, #e8f0f8 0%, #d4e5f7 100%);
}

.panel-selectLine .panel-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow flex children to shrink below content size */
}

/* Select Line panel content container */
.select-line-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0; /* Critical for nested flex scroll containers */
    position: relative;
    overflow: hidden;
}

/* Header row with stats toggle and O/D toggle */
.select-line-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    flex-shrink: 0;
}

.select-line-stats-toggle {
    font-size: 0.8rem;
    color: #007bff;
    cursor: pointer;
    user-select: none;
}

.select-line-stats-toggle:hover {
    text-decoration: underline;
}

.select-line-od-toggle {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    transition: all 0.15s;
}

.select-line-od-toggle:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.select-line-od-toggle.active-o {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.select-line-od-toggle.active-d {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Top row with Start Point and Lines buttons */
.select-line-top-row {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.select-line-start-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    transition: all 0.15s;
}

.select-line-start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
}

.select-line-start-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Feedback states when point NOT in progress (saturated colors) */
.select-line-start-btn.feedback-ok {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.select-line-start-btn.feedback-count-warning {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.select-line-start-btn.feedback-gender-warning {
    background: linear-gradient(135deg, #ff8800 0%, #e67700 100%);
}

.select-line-start-btn.inactive {
    background: linear-gradient(135deg, #adb5bd 0%, #868e96 100%);
    cursor: not-allowed;
}

/* Legacy warning class (keep for backwards compatibility) */
.select-line-start-btn.warning {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.select-line-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Point in progress base state (gray) */
.select-line-start-btn.point-in-progress {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    cursor: not-allowed;
}

/* Point in progress with feedback (desaturated colors) */
.select-line-start-btn.point-in-progress.feedback-ok {
    background: linear-gradient(135deg, #6b9b7a 0%, #5a8a6a 100%);
}

.select-line-start-btn.point-in-progress.feedback-count-warning {
    background: linear-gradient(135deg, #a87a7f 0%, #987075 100%);
}

.select-line-start-btn.point-in-progress.feedback-gender-warning {
    background: linear-gradient(135deg, #b89060 0%, #a88055 100%);
}

.select-line-start-btn.point-in-progress.inactive {
    background: linear-gradient(135deg, #8a9098 0%, #7a8088 100%);
}

.select-line-lines-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    transition: all 0.15s;
}

.select-line-lines-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Gender ratio display */
.select-line-gender-ratio {
    font-size: 0.85rem;
    color: #495057;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    flex-shrink: 0;
}

.select-line-starting-ratio {
    font-size: 0.85rem;
    padding: 4px 8px;
    background: #fff3cd;
    border-radius: 4px;
    flex-shrink: 0;
}

.select-line-starting-ratio label {
    margin-right: 8px;
}

.select-line-starting-ratio input[type="radio"] {
    margin-right: 4px;
}

/* Table container */
.select-line-table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
}

/* Panel player table */
.panel-player-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.panel-player-table th,
.panel-player-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.panel-player-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.75rem;
}

.panel-player-table .active-checkbox-column {
    width: 30px;
    text-align: center;
}

.panel-player-table .active-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.panel-player-table .active-name-column {
    min-width: 100px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-player-table .active-time-column {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #6c757d;
}

.panel-player-table .active-points-columns {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    text-align: center;
    min-width: 24px;
}

.panel-player-table .active-header-teams {
    font-size: 0.7rem;
    text-align: center;
}

/* Gender color coding */
.panel-player-table .player-fmp {
    color: #9c27b0;
}

.panel-player-table .player-mmp {
    color: #1976d2;
}

/* Score cell gender ratio colors */
.panel-player-table .score-cell-fmp {
    background-color: rgba(125, 60, 152, 0.2);
}

.panel-player-table .score-cell-mmp {
    background-color: rgba(45, 134, 89, 0.2);
}

/* Readonly overlay */
.select-line-readonly-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.readonly-badge {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Readonly state */
.panel-selectLine.readonly .select-line-start-btn,
.panel-selectLine.readonly .select-line-lines-btn,
.panel-selectLine.readonly .select-line-od-toggle {
    opacity: 0.6;
    pointer-events: none;
}

.panel-selectLine.readonly .panel-player-table .active-checkbox {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile adjustments for Select Line panel */
@media (max-width: 480px) {
    .select-line-top-row {
        gap: 6px;
    }
    
    .select-line-start-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .select-line-lines-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .panel-player-table {
        font-size: 0.8rem;
    }
    
    .panel-player-table th,
    .panel-player-table td {
        padding: 5px 6px;
    }
    
    .panel-player-table .active-checkbox {
        width: 16px;
        height: 16px;
    }
    
    .panel-player-table .active-name-column {
        min-width: 80px;
        max-width: 120px;
    }
}

@media (max-width: 360px) {
    .select-line-start-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .select-line-lines-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* =============================================================================
   Select Line Panel - Compact View
   Shown when panel is resized to very small height (~60px content area)
   ============================================================================= */

/* Compact view container - left-justified for consistent tap target */
.select-line-compact-view {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

/* Tappable line type link */
.compact-line-type-link {
    font-weight: bold;
    color: #007AFF;
    cursor: pointer;
    text-decoration: underline;
}

.compact-line-type-link:hover {
    color: #0056b3;
}

.compact-line-type-link:active {
    opacity: 0.7;
}

/* Player list - takes remaining space, truncates if needed */
.compact-player-list {
    color: #333;
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TBD placeholder styling */
.compact-tbd {
    color: #999;
    font-style: italic;
}

/* Gender colors in compact view (same as table view) */
.select-line-compact-view .player-fmp {
    color: #9c27b0;
}

.select-line-compact-view .player-mmp {
    color: #1976d2;
}

/* Full view container - uses flex for table layout */
.select-line-full-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Smooth transition between views */
.select-line-compact-view,
.select-line-full-view {
    transition: opacity 250ms ease-in-out;
}

/* =============================================================================
   Game Events Panel (resizable)
   ============================================================================= */

.panel-game-events {
    background: #fff;
}

.panel-game-events .panel-title-bar {
    background: linear-gradient(135deg, #f8f0e8 0%, #f7e5d4 100%);
}

/* =============================================================================
   Follow Panel (fills remaining space)
   ============================================================================= */

.panel-follow {
    background: #fff;
    /* Follow panel's flex is controlled by JS based on state */
    min-height: 36px;
}

/* When Follow panel is snapped to bottom (minimized), push title bar to bottom */
.panel-follow.snapped-to-bottom {
    /* margin-top: auto is set by JS */
}

.panel-follow .panel-title-bar {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

/* Event log in follow panel */
.follow-event-log {
    flex: 1;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 8px;
    background: #fafafa;
    border-radius: 4px;
}

.follow-event-item {
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.follow-event-item:last-child {
    border-bottom: none;
}

.follow-game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.follow-team-name {
    font-weight: 600;
    color: #333;
}

.follow-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: #EB8232;
}

/* =============================================================================
   Game Log Panel Content
   ============================================================================= */

.game-log-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Game status bar at top of Game Log */
.game-log-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.game-log-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.game-log-team-us {
    font-weight: 600;
    color: #28a745;
}

.game-log-vs {
    color: #6c757d;
    font-size: 0.8rem;
}

.game-log-team-them {
    font-weight: 600;
    color: #dc3545;
}

.game-log-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: #333;
    margin-top: 4px;
}

/* Event log area - scrollable */
.game-log-events {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #fff;
}

/* Placeholder when no events */
.game-log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    gap: 8px;
}

.game-log-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.game-log-placeholder span {
    font-size: 0.85rem;
}

/* Individual event lines */
.game-log-line {
    padding: 4px 0;
    border-bottom: 1px solid #f1f3f5;
}

.game-log-line:last-child {
    border-bottom: none;
}

/* Header lines (version, game summary header) */
.game-log-header {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

/* Point headers */
.game-log-point-header {
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    padding: 6px 8px;
    margin: 8px -12px 4px -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-top: 1px solid #dee2e6;
}

/* Roster lines */
.game-log-roster {
    color: #6c757d;
    font-size: 0.85rem;
    padding-left: 8px;
}

/* Pull events */
.game-log-pull {
    color: #6c757d;
    font-style: italic;
    padding-left: 8px;
}

/* Score events - highlighted */
.game-log-score-event {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 0;
}

.game-log-us-scores {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.game-log-them-scores {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Current score display */
.game-log-current-score {
    font-weight: 600;
    color: #495057;
    text-align: center;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 4px 0;
}

/* Panel content needs to fill height */
.panel-follow .panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

@media (max-width: 480px) {
    .panel-title-bar {
        padding: 4px 10px;
        min-height: 28px;
    }
    
    .panel-title {
        font-size: 0.85rem;
    }
    
    .panel-subtitle {
        font-size: 0.7rem;
    }
    
    .panel-action-btn {
        width: 26px;
        height: 26px;
    }
    
    .panel-content {
        padding: 10px;
    }
    
    .panel-stub {
        padding: 16px;
        gap: 12px;
    }
    
    .panel-stub-icon {
        font-size: 1.5rem;
    }
    
    .panel-stub-action {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Header score display - tighter on mobile */
    .header-score-display {
        font-size: 1.2rem;
        gap: 3px;
    }
    
    .header-team-identity {
        min-width: 32px;
        height: 32px;
    }
    
    .team-identity-text {
        font-size: 0.6rem;
    }
    
    .team-identity-icon-large {
        width: 30px;
        height: 30px;
    }
    
    .team-identity-symbol-large {
        font-size: 0.9rem;
    }
    
    .header-timer-container {
        min-width: 50px;
        padding: 3px 6px;
    }
    
    .header-timer-value {
        font-size: 0.9rem;
    }
    
    .header-timer-pause-btn {
        width: 20px;
        height: 20px;
        right: -6px;
        font-size: 0.55rem;
    }
    
    .role-claim-btn {
        padding: 5px 10px;
    }
    
    .role-claim-label {
        font-size: 0.8rem;
    }
    
    .role-claim-holder {
        font-size: 0.65rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .header-score-display {
        font-size: 1rem;
        gap: 2px;
    }
    
    .header-team-identity {
        min-width: 28px;
        height: 28px;
    }
    
    .team-identity-text {
        font-size: 0.55rem;
    }
    
    .team-identity-icon-large {
        width: 26px;
        height: 26px;
    }
    
    .team-identity-symbol-large {
        font-size: 0.8rem;
    }
    
    .header-menu-btn {
        width: 32px;
        height: 32px;
    }
}

/* =============================================================================
   Resize Handle (between panels)
   ============================================================================= */

.panel-resize-handle {
    height: 8px;
    background: linear-gradient(to bottom, transparent 0%, #ddd 50%, transparent 100%);
    cursor: ns-resize;
    position: relative;
    flex-shrink: 0;
}

.panel-resize-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: #bbb;
    border-radius: 2px;
}

.panel-resize-handle:hover::before {
    background: #999;
}

/* =============================================================================
   Panel Drag States
   ============================================================================= */

/* Body state when dragging any panel */
body.panel-dragging {
    cursor: ns-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Panel being actively dragged */
.game-panel.dragging {
    z-index: 10;
}

.game-panel.dragging .panel-title-bar {
    background: linear-gradient(135deg, #e3f0ff 0%, #cce5ff 100%);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* Subtle border highlight on panels adjacent to drag */
.game-panel.dragging + .game-panel,
.game-panel:has(+ .game-panel.dragging) {
    border-color: rgba(0, 123, 255, 0.3);
}

/* Disable transitions during drag for smoother resizing */
body.panel-dragging .game-panel {
    transition: none !important;
}

body.panel-dragging .panel-content {
    transition: none !important;
}

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

/* Panel animations are now handled via height changes with CSS transitions */

/* Visual feedback for full-screen maximized panel */
.game-panel.full-screen-maximized .panel-title-bar {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4e8f7 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Subtle indicator that other panels are minimized due to full-screen mode */
.game-panel.minimized-for-fullscreen .panel-title-bar {
    opacity: 0.85;
}

