/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --secondary: #FFC107;
    --danger: #F44336;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --text: #212121;
    --text-secondary: #757575;
    --border: #E0E0E0;
    --shadow: rgba(0, 0, 0, 0.1);
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.version {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Navigation Tabs */
.tab-nav {
    background: var(--surface);
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 48px;
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
}

.tab-content {
    display: none;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
}

/* Roster Tab */
.roster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.player-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.player-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.player-details {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.player-jersey {
    background: var(--primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.player-skill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.player-prefs {
    display: flex;
    gap: 0.25rem;
}

.pref-badge {
    background: var(--primary-light);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.player-actions {
    display: flex;
    gap: 0.5rem;
}

.player-actions button {
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.roster-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    bottom: 1rem;
    background: var(--background);
    padding-top: 1rem;
}

/* Setup Tab */
.formation-selector {
    margin-bottom: 2rem;
}

.formation-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.formation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.formation-btn {
    padding: 0.75rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

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

.formation-preview {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.formation-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.position-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--background);
    border-radius: 4px;
}

.position-count {
    font-weight: 600;
    color: var(--primary);
}

.generate-actions {
    margin-top: 2rem;
}

/* Quarter Management Section */
.quarter-management {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quarter-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quarter-control, .halftime-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    min-width: 100px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.quarter-control.quarter-running {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
    animation: pulse 2s infinite;
}

.quarter-control.quarter-complete {
    border-color: var(--info);
    background: rgba(33, 150, 243, 0.1);
}

.quarter-control.quarter-paused {
    border-color: var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.quarter-label, .halftime-label {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timer-display, .halftime-timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    min-width: 80px;
    text-align: center;
}

.control-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    min-width: 32px;
    transition: all 0.2s ease;
}

.btn-small:hover:not(:disabled) {
    background: var(--primary-light);
    color: white;
}

.btn-small.btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 600;
    min-width: 44px;
}

.btn-small.btn-primary.active {
    background: var(--warning);
}

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

.quarter-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

/* Control Panel for Single Active Timer */
.control-panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.active-timer-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-info {
    text-align: center;
    flex: 1;
}

.active-period {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.active-timer {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.timer-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-controls button {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    min-width: 120px;
}

.lineup-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lineup-controls button {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    min-width: 120px;
}

/* Quarter Checkboxes */
.quarter-checkboxes {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.quarter-check {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.quarter-check:hover:not(:has(input:disabled)) {
    border-color: var(--primary-light);
    background: var(--primary-light);
    color: white;
}

.quarter-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.quarter-check input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.quarter-check:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--background);
}

.quarter-check:has(input:checked) {
    border-color: var(--primary);
    background: rgba(46, 125, 50, 0.1);
}

.quarter-check span {
    color: var(--text);
    font-weight: 600;
}

.quarter-check:has(input:disabled) span {
    color: var(--text-secondary);
}

/* Streamlined checkbox states: reflects quarter timer state */
.quarter-check.quarter-in-progress {
    /* Quarter started/completed/skipped: blue tone */
    border-color: var(--info, #2196F3);
    background: rgba(33, 150, 243, 0.1);
}

.quarter-check.quarter-active {
    /* Currently active quarter: pulsing border */
    animation: activeBorder 2s ease-in-out infinite;
}

@keyframes activeBorder {
    0%, 100% { border-color: var(--info, #2196F3); }
    50% { border-color: var(--success, #4CAF50); }
}

/* Enhanced tooltip support for checkboxes */
.quarter-check[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--text);
    color: var(--surface);
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quarter-check[title]:hover::before {
    /* Tooltip arrow */
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.25rem;
    border: 4px solid transparent;
    border-top-color: var(--text);
    z-index: 1000;
    pointer-events: none;
}

/* Position context for tooltips */
.quarter-check {
    position: relative;
}

/* Updated quarter cards without timers */

.quarter.quarter-active {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.quarter.quarter-complete {
    border-color: var(--info);
    opacity: 0.9;
}

.quarter.quarter-skipped {
    opacity: 0.6;
}

/* Lineups Tab */
.lineup-stats {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.stat-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
    padding: 0.5rem 0;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr;
    padding: 0.25rem 0;
    align-items: center;
}

.stat-row:hover {
    background: var(--background);
    border-radius: 4px;
}

.lineup-grid {
    margin-bottom: 1rem;
    height: 60vh;
    max-height: 1200px;
    min-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    background: var(--background);
}

/* Custom scrollbar for lineup grid */
.lineup-grid::-webkit-scrollbar {
    width: 8px;
}

.lineup-grid::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.lineup-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

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

.quarters-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quarter {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-height: 600px;
}

.quarter-header {
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Quarter timer sections removed - using single active timer */

.halftime-card {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-color: var(--info);
}

.halftime-info {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.position-slot {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
}

.position-slot.locked {
    background: #FFF3E0;
    border-color: var(--warning);
}

.position-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-assignment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bench-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.bench-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.bench-players {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bench-player {
    background: var(--background);
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Lineup actions moved to control panel */

/* Export Tab */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.export-content {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.skill-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.skill-slider input[type="range"] {
    flex: 1;
}

#skill-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 6rem;
    text-align: center;
    font-size: 0.875rem;
}

.position-prefs {
    display: flex;
    gap: 0.5rem;
}

.pref-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pref-toggle input {
    display: none;
}

.pref-toggle input:checked + span {
    color: white;
}

.pref-toggle:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: bottom 0.3s ease;
    z-index: 2000;
    max-width: 90%;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

.toast.show {
    bottom: 2rem;
}

.toast-message {
    flex: 1;
    text-align: left;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Tooltip System - Touch-friendly for mobile and desktop */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    margin-bottom: 5px;
    line-height: 1.3;
    font-weight: 500;
    text-align: center;
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Show tooltip on hover (desktop) */
.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Show tooltip on tap/touch (mobile) */
.tooltip-container:active .tooltip,
.tooltip-container.tooltip-active .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Alternative position for tooltips that would go off-screen */
.tooltip-container .tooltip.tooltip-top {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 5px;
}

.tooltip-container .tooltip.tooltip-top::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

/* Ensure tooltips work within stat rows and player cards */
.stat-row .tooltip-container,
.player-details .tooltip-container {
    display: inline;
}

/* Style for tooltip emojis to ensure they don't interfere with layout */
.tooltip-emoji {
    display: inline-block;
    cursor: help;
    user-select: none;
}

/* Prevent text selection on tooltip triggers for better mobile experience */
.tooltip-container {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toast-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Warning toast styling */
.toast.warning {
    background: var(--warning);
    color: white;
}

.toast.warning .toast-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Warnings */
.warnings {
    margin-top: 1rem;
}

.warning {
    background: #FFF3E0;
    border-left: 4px solid var(--warning);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.warning.dismissible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
}

.warning-close {
    background: none;
    border: none;
    color: var(--warning);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.warning-close:hover {
    background-color: rgba(255, 193, 7, 0.2);
}

.warning-close:focus {
    outline: 2px solid var(--warning);
    outline-offset: 2px;
}

.error {
    background: #FFEBEE;
    border-left-color: var(--error);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .app-header,
    .tab-nav,
    .roster-actions,
    .lineup-actions,
    .export-options,
    button {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .quarter {
        page-break-inside: avoid;
        border: 1px solid black;
        margin-bottom: 1rem;
    }
}

/* New feature styles */
.game-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.timer-settings {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
}

.timer-settings input {
    width: 80px;
    padding: 0.5rem;
    margin-left: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.game-status {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-status {
    font-weight: 600;
    color: var(--primary);
}

.quarter-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.timer-adjust {
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    min-width: 40px;
}

.timer-adjust:hover:not(:disabled) {
    background: var(--primary-light);
    color: white;
}

.timer-adjust:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-skip {
    padding: 0.25rem 0.5rem;
    background: var(--warning);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-left: auto;
}

.timer-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.125rem;
    min-width: 60px;
}

.timer-btn:disabled {
    background: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-display {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
}

.quarter.timer-active {
    background: #E8F5E9;
    border: 2px solid var(--success);
    animation: pulse 2s infinite;
}

.quarter.timer-paused {
    background: #FFF8E1;
    border: 2px solid var(--warning);
}

.quarter.timer-complete {
    background: #E3F2FD;
    border: 2px solid #2196F3;
}

.quarter.timer-skipped {
    background: #FAFAFA;
    border: 2px solid var(--text-secondary);
    opacity: 0.7;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.checkin-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
}

.checkin-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.checkin-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkin-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.swap-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.swap-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.swap-group-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.swap-btn {
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.swap-btn.warning {
    background: #FFF8E1;
    border-color: var(--warning);
}

.swap-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: translateX(2px);
}

.help-text {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #F0F7FF;
    border-radius: 4px;
    text-align: center;
}

.form-preview {
    padding: 1rem;
    background: var(--background);
    border-radius: 4px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* Position slot click styles */
.position-slot {
    cursor: pointer;
    transition: all 0.2s ease;
}

.position-slot:hover {
    background: var(--primary-light);
    color: white;
    transform: scale(1.02);
}

.position-slot:active {
    transform: scale(0.98);
}

/* Availability indicators */
.player-card.unavailable {
    opacity: 0.5;
    background: #FFEBEE;
}

.player-availability-toggle {
    padding: 0.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
}

.player-availability-toggle.unavailable {
    background: var(--danger);
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .content {
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
    
    .roster-actions {
        flex-direction: row;
    }
    
    .lineup-grid {
        height: 75vh;
        max-height: 900px;
        min-height: 600px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .quarters-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-controls {
        flex-direction: row;
    }
}
