/* Football Squares - Mobile-First CSS */

/* CSS Variables - Light Theme (default) */
:root,
[data-theme="light"] {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-raised: #f1f5f9;
    --color-border: #e2e8f0;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-primary: #059669;
    --color-primary-hover: #047857;
    --color-secondary: #0f172a;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-team1: #0f766e;
    --color-team2: #7c3aed;
    --color-winner-q1: #10b981;
    --color-winner-q2: #f59e0b;
    --color-winner-q3: #f97316;
    --color-winner-final: #8b5cf6;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-main);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-raised: #334155;
    --color-border: #475569;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-primary: #10b981;
    --color-primary-hover: #34d399;
    --color-secondary: #f1f5f9;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    --color-team1: #2dd4bf;
    --color-team2: #a78bfa;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.page-header {
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

@media (min-width: 800px) {
    .page-header {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--color-surface-raised);
    border-color: var(--color-text-muted);
    text-decoration: none;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

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

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

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    transition: border-color 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--color-primary);
}

/* Custom Message Box */
.custom-message {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    font-size: 0.9375rem;
}

/* Game Card - Main header card */
.game-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.teams-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.team-pill {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.vs-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.game-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.game-status-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.status-live {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-final {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.status-scheduled {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-text {
    color: var(--color-text-muted);
}

.game-cta {
    margin-top: 0.5rem;
}

.game-cta .btn {
    min-width: 150px;
}

/* Dark mode adjustments for game card */
[data-theme="dark"] .team-pill {
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

[data-theme="dark"] .status-live {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

[data-theme="dark"] .status-final {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

[data-theme="dark"] .status-scheduled {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* Legacy teams header (for backwards compatibility) */
.teams-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.team-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.team-name.team1 {
    color: var(--color-team1);
}

.team-name.team2 {
    color: var(--color-team2);
}

.vs {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ============================================
   SQUARES GRID - The main component
   ============================================ */
.grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.grid-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.grid-with-label {
    display: flex;
    width: 100%;
}

/* Team Labels */
.team-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-label-top {
    width: calc(100% - 28px);
    margin-left: 28px;
    height: 26px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.team-label-left {
    width: 26px;
    flex-shrink: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.team-label-left span {
    white-space: nowrap;
}

.squares-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 28px repeat(10, 1fr);
    grid-template-rows: 28px repeat(10, 1fr);
    gap: 2px;
}

/* Corner cell */
.grid-corner {
    background: var(--color-surface);
    border-radius: var(--radius-sm) 0 0 0;
}

/* Header cells (numbers) */
.grid-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    background: var(--color-surface-raised);
}

.grid-header.col-header {
    color: var(--color-team2);
}

.grid-header.row-header {
    color: var(--color-team1);
}

.grid-header.not-assigned {
    color: var(--color-text-muted);
    font-size: 0.625rem;
}

/* Square cells */
.square {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.5rem;
    text-align: center;
    padding: 2px;
    word-break: break-word;
    overflow: hidden;
    position: relative;
    min-height: 32px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.square:hover {
    background: var(--color-primary);
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--color-primary);
}

.square.claimed {
    background: var(--color-surface-raised);
    font-weight: 500;
}

.square.locked {
    cursor: default;
}

.square.locked:hover {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
}

/* Winner highlights */
.square.winner {
    z-index: 2;
}

/* Only pulse the current quarter's winner */
.square.winner.winner-current {
    animation: pulse 2s ease-in-out infinite;
}

.square.winner-q1 {
    background: #059669 !important;
    border-color: #047857 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #059669;
}

.square.winner-q2 {
    background: #d97706 !important;
    border-color: #b45309 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #d97706;
}

.square.winner-q3 {
    background: #ea580c !important;
    border-color: #c2410c !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #ea580c;
}

.square.winner-final {
    background: #7c3aed !important;
    border-color: #6d28d9 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px #7c3aed;
}

/* Pulse only final winner after game ends */
.square.winner-final.winner-current {
    animation: pulse-gold 2s ease-in-out infinite;
}

/* Dark mode winner adjustments */
[data-theme="dark"] .square.winner-q1 {
    background: #10b981 !important;
    border-color: #059669 !important;
    color: #000 !important;
    box-shadow: 0 0 0 2px #10b981;
}

[data-theme="dark"] .square.winner-q2 {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #000 !important;
    box-shadow: 0 0 0 2px #f59e0b;
}

[data-theme="dark"] .square.winner-q3 {
    background: #f97316 !important;
    border-color: #ea580c !important;
    color: #000 !important;
    box-shadow: 0 0 0 2px #f97316;
}

[data-theme="dark"] .square.winner-final {
    background: #8b5cf6 !important;
    border-color: #7c3aed !important;
    color: #000 !important;
    box-shadow: 0 0 0 2px #8b5cf6;
}
    color: #000;
}

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

@keyframes pulse-gold {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px 4px rgba(168, 85, 247, 0.3);
    }
}

/* Player name in square */
.square .player-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

/* Scores Display */
.scores-panel {
    margin-top: 1.5rem;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.score-box {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
}

.score-box.winner-q1 { border-color: var(--color-winner-q1); }
.score-box.winner-q2 { border-color: var(--color-winner-q2); }
.score-box.winner-q3 { border-color: var(--color-winner-q3); }
.score-box.winner-final { border-color: var(--color-winner-final); }

.score-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.score-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.score-winner {
    font-size: 0.6875rem;
    color: var(--color-success);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Winners Summary */
.winners-summary {
    margin-top: 1rem;
}

.winner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
    background: var(--color-surface-raised);
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.winner-row .quarter {
    font-weight: 600;
    min-width: 50px;
}

.winner-row .name {
    flex: 1;
    text-align: center;
    color: var(--color-success);
    font-weight: 500;
}

.winner-row .score {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* Change Log */
.change-log {
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8125rem;
}

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

.log-time {
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 50px;
}

.log-square {
    color: var(--color-primary);
    font-weight: 500;
    min-width: 30px;
}

.log-change {
    flex: 1;
}

.log-old {
    color: var(--color-danger);
    text-decoration: line-through;
}

.log-new {
    color: var(--color-success);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

/* Share Link */
.share-box {
    display: flex;
    gap: 0.5rem;
}

.share-box input {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.alert-info {
    background: rgba(79, 140, 255, 0.15);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--color-warning);
    color: var(--color-warning);
}

/* Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--color-success);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.badge-live {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.badge-scheduled {
    background: rgba(79, 140, 255, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.badge-final {
    background: rgba(168, 85, 247, 0.15);
    border-color: #a855f7;
    color: #a855f7;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Admin Controls */
.admin-bar {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-bar .btn {
    flex: 1;
    min-width: 120px;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--color-text);
}

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

/* Hero Card - Homepage */
.hero-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.hero-card h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.hero-card .tagline {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-card .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.hero-card .hero-sub {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (min-width: 480px) {
    .hero-card {
        padding: 3.5rem 2rem;
    }
    
    .hero-card h1 {
        font-size: 2.25rem;
    }
    
    .hero-card .tagline {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .hero-card {
        padding: 4rem 3rem;
        margin: 3rem 0;
    }
    
    .hero-card h1 {
        font-size: 2.75rem;
    }
}

/* Home Page - Legacy styles */
.home-hero {
    text-align: center;
    padding: 4rem 1rem;
}

.home-hero h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--color-text);
}

@media (min-width: 480px) {
    .home-hero h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .home-hero h1 {
        font-size: 3rem;
    }
    
    .home-hero {
        padding: 5rem 1rem;
    }
    
    /* Game card desktop styles */
    .game-card {
        padding: 2rem;
    }
    
    .team-pill {
        font-size: 1.25rem;
        padding: 0.625rem 1.5rem;
    }
    
    .game-info-row {
        gap: 1.5rem;
    }
}

.home-hero .tagline {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 1.125rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.home-hero .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.feature-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
}

.feature-text h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.feature-text p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Site Footer */
.site-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.footer-content {
    text-align: center;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-brand a {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.footer-brand a:hover {
    color: var(--color-primary);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

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

.footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-family: inherit;
    background: var(--color-surface-raised);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.footer-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* Theme toggle icon visibility */
[data-theme="dark"] .footer-btn .theme-icon-dark,
[data-theme="light"] .footer-btn .theme-icon-light {
    display: none;
}

[data-theme="dark"] .footer-btn .theme-icon-light,
[data-theme="light"] .footer-btn .theme-icon-dark {
    display: inline;
}

/* Legal Pages (Privacy, Terms, About, Contact) */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.legal-page h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.legal-page h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.legal-page ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-page section {
    margin-bottom: 1.5rem;
}

/* About Page Specific */
.about-page .feature-list {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.about-page .feature-item {
    background: var(--color-surface-raised);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.about-page .feature-item strong {
    display: block;
    margin-bottom: 0.5rem;
}

.about-page .feature-item p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Content Pages (How to Play, Tips, etc.) */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.content-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.content-page .lead {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.content-page h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.content-page h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-page ul, .content-page ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Table of Contents */
.toc-card {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.toc-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.toc-card li {
    margin: 0;
}

.toc-card a {
    color: var(--color-primary);
    text-decoration: none;
}

.toc-card a:hover {
    text-decoration: underline;
}

/* Info Boxes */
.info-box {
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.info-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.info-box p {
    margin: 0;
}

.info-box-tip {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--color-success);
}

.info-box-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--color-warning);
}

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 0.25rem 0;
}

.step-content p {
    margin: 0;
    color: var(--color-text-muted);
}

/* Quarters Explained */
.quarters-explained {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.quarter-box {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.quarter-box h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.quarter-box p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

@media (max-width: 500px) {
    .quarters-explained {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Example Box */
.example-box {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-box h4 {
    margin: 0 0 1rem 0;
}

.example-box p {
    margin-bottom: 0.75rem;
}

/* Tip Cards */
.tip-card {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1rem 0;
}

.tip-card h3 {
    margin: 0 0 0.75rem 0;
}

.tip-card p:last-child,
.tip-card ul:last-child {
    margin-bottom: 0;
}

.tip-warning {
    border-color: var(--color-warning);
    background: rgba(251, 191, 36, 0.05);
}

/* Prize Options */
.prize-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.prize-option {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.prize-option h4 {
    margin: 0 0 0.75rem 0;
}

.prize-option ul {
    margin: 0 0 0.75rem 0;
    padding-left: 1.25rem;
}

.prize-note {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* Odds Table */
.odds-table {
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.odds-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.odds-good { background: rgba(34, 197, 94, 0.15); }
.odds-ok { background: rgba(251, 191, 36, 0.15); }
.odds-bad { background: rgba(239, 68, 68, 0.15); }

.odds-nums {
    font-weight: 700;
    font-family: var(--font-display);
    min-width: 80px;
}

.odds-label {
    font-weight: 600;
    min-width: 100px;
}

.odds-desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 2rem;
    background: var(--color-surface-raised);
    border-radius: var(--radius-lg);
    margin-top: 3rem;
}

.cta-section h2 {
    border: none;
    padding: 0;
    margin-top: 0;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

/* FAQ Styles */
.faq-section {
    margin-bottom: 2rem;
}

.faq-section:last-child {
    margin-bottom: 0;
}

.faq-section h2 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.faq-item p {
    color: var(--color-text-muted);
    margin: 0;
}

/* Content Lists */
.content-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content-list li {
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
}

.content-list li strong {
    color: var(--color-text);
}

/* Game Info Section */
.game-info-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.game-info-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.game-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.game-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.game-info-item .icon {
    font-size: 1.25rem;
    line-height: 1;
}

.game-info-item .details {
    flex: 1;
}

.game-info-item .label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-info-item .value {
    font-weight: 500;
    color: var(--color-text);
}

/* Last Refresh Indicator */
.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 0.375rem 0.75rem;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

.refresh-indicator.live {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.refresh-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.refresh-indicator.live .dot {
    animation: pulse 2s infinite;
}

/* Hide "Updated" on very small screens, just show time */
@media (max-width: 360px) {
    .refresh-indicator .updated-text {
        display: none;
    }
    .refresh-indicator::after {
        content: "Updated ";
    }
    .refresh-indicator #last-refresh-time {
        display: inline;
    }
}

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

/* Page Refresh Bar */
.page-refresh-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.score-delay-notice {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Homepage Sections */
.section {
    margin: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.hero-sub {
    margin-top: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* How It Works Cards */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.step-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.step-num {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    margin: 0 0 0.5rem 0;
}

.step-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Content Card */
.content-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.content-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.content-card p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-card p:last-child {
    margin-bottom: 0;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.use-case {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.use-case-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.use-case h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.use-case p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Learn More Grid */
.learn-more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.learn-more-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.learn-more-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.learn-more-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.learn-more-card h3 {
    margin: 0 0 0.5rem 0;
}

.learn-more-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Contact Page Specific */
.contact-methods {
    margin: 1rem 0;
}

.contact-method {
    background: var(--color-surface-raised);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.contact-method h3 {
    margin-top: 0;
}

.faq {
    margin: 1rem 0;
}

.faq-item {
    background: var(--color-surface-raised);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.faq-item p {
    margin: 0;
    color: var(--color-text-muted);
}

@media (min-width: 640px) {
    .about-page .feature-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Enhancements */
@media (min-width: 640px) {
    h1 { font-size: 2rem; }
    
    .container {
        padding: 1.5rem;
    }
    
    .grid-outer {
        max-width: 550px;
    }
    
    .squares-grid {
        gap: 2px;
        grid-template-columns: 32px repeat(10, 1fr);
        grid-template-rows: 32px repeat(10, 1fr);
    }
    
    .square {
        min-height: 38px;
        font-size: 0.625rem;
    }
    
    .team-label-top {
        height: 30px;
        margin-left: 32px;
        width: calc(100% - 32px);
        font-size: 0.875rem;
    }
    
    .team-label-left {
        width: 30px;
        font-size: 0.75rem;
    }
    
    .grid-header {
        font-size: 0.875rem;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .home-hero h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 800px) {
    .grid-outer {
        max-width: 600px;
    }
    
    .squares-grid {
        grid-template-columns: 36px repeat(10, 1fr);
        grid-template-rows: 36px repeat(10, 1fr);
    }
    
    .square {
        min-height: 44px;
        font-size: 0.7rem;
    }
    
    .team-label-top {
        height: 34px;
        margin-left: 36px;
        width: calc(100% - 36px);
        font-size: 1rem;
    }
    
    .team-label-left {
        width: 34px;
        font-size: 0.875rem;
    }
    
    .grid-header {
        font-size: 1rem;
    }
    
    /* Game page header improvements for desktop */
    .teams-header {
        gap: 1.5rem;
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .team-name {
        font-size: 1.75rem;
    }
    
    .vs {
        font-size: 1rem;
    }
    
    .share-button-wrapper {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .share-button-wrapper .btn {
        padding: 0.625rem 1.25rem;
    }
    
    .flex-between.gap-1 {
        gap: 0.75rem;
    }
    
    .badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .custom-message {
        padding: 1.25rem;
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Site Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.site-logo {
    text-align: left;
    padding: 0;
}

.site-logo a {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-logo a:hover {
    color: var(--color-primary);
}

.site-header .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .site-logo a {
        font-size: 1.125rem;
    }
    
    .site-header .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Homepage header - centered logo only */
.site-header-home {
    justify-content: center;
}

/* Game Header */
.game-header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.game-status-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.game-actions .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}
}

/* Print Styles */
@media print {
    @page {
        size: landscape;
        margin: 0.5cm;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 10pt;
    }
    
    .btn, .admin-bar, .admin-assign-bar, .modal-overlay, 
    .footer-actions, .game-cta, .game-actions, .player-name-bar,
    #share-btn, .change-log, details, .scores-panel,
    .custom-message, .alert, .site-header, .site-footer {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    /* Hide the full game card but show teams */
    .game-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .game-card .game-info-row,
    .game-card .game-status-row,
    .game-card .game-cta {
        display: none !important;
    }
    
    .teams-display {
        margin-bottom: 0 !important;
    }
    
    .team-pill {
        padding: 0.25rem 0.5rem !important;
        font-size: 12pt !important;
    }
    
    .card {
        display: none !important;
    }
    
    /* Logo in print */
    .site-logo {
        display: block !important;
        padding: 0;
        margin-bottom: 0.25cm;
    }
    
    .site-logo a {
        color: black;
        font-size: 14pt;
    }
    
    .page-header {
        border: none;
        padding: 0;
        margin-bottom: 0.25cm;
    }
    
    .teams-header {
        display: none; /* Hide since we have labels on grid now */
    }
    
    /* Grid sizing for one page */
    .grid-wrapper {
        overflow: visible;
        margin: 0;
        padding: 0;
    }
    
    .grid-outer {
        max-width: 100%;
        width: 18cm;
        margin: 0 auto;
    }
    
    .grid-with-label {
        width: 100%;
    }
    
    .team-label {
        font-size: 11pt !important;
        font-weight: bold;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .team-label-top {
        height: 0.8cm;
        width: calc(100% - 0.8cm);
        margin-left: 0.8cm;
        border-radius: 0;
    }
    
    .team-label-left {
        width: 0.8cm;
        border-radius: 0;
    }
    
    .squares-grid {
        gap: 1px;
        border: 1px solid #333;
        grid-template-columns: 0.7cm repeat(10, 1fr);
        grid-template-rows: 0.7cm repeat(10, 1fr);
    }
    
    .grid-header {
        background: #e8e8e8 !important;
        color: black !important;
        font-size: 9pt;
        font-weight: bold;
        border: 1px solid #999;
    }
    
    .grid-corner {
        background: #333 !important;
    }
    
    .square {
        border: 1px solid #ccc;
        background: white !important;
        color: black !important;
        font-size: 6pt;
        padding: 1px;
    }
    
    .square.claimed {
        background: #f9f9f9 !important;
    }
    
    .square.winner {
        background: #ffeb3b !important;
        font-weight: bold;
    }
    
    /* Print footer with game code */
    .text-center.text-muted {
        display: block !important;
        margin-top: 0.25cm;
        font-size: 8pt;
        color: #666;
    }
    
    .text-center.text-muted a {
        color: #666;
    }
}

/* Print button (visible on screen only) */
.btn-print {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
}

@media print {
    .btn-print {
        display: none !important;
    }
}

/* Row/Column Highlighting */
.grid-header.highlight {
    background: var(--color-primary) !important;
    color: white !important;
    transform: scale(1.05);
    z-index: 5;
    position: relative;
}

.square.highlight-row {
    background: rgba(79, 140, 255, 0.15) !important;
    border-color: var(--color-primary) !important;
}

.square.highlight-col {
    background: rgba(244, 114, 182, 0.15) !important;
    border-color: var(--color-team2) !important;
}

.square.highlight-row.highlight-col {
    background: rgba(168, 85, 247, 0.25) !important;
    border-color: #a855f7 !important;
}

[data-theme="light"] .square.highlight-row {
    background: rgba(37, 99, 235, 0.1) !important;
}

[data-theme="light"] .square.highlight-col {
    background: rgba(219, 39, 119, 0.1) !important;
}

[data-theme="light"] .square.highlight-row.highlight-col {
    background: rgba(147, 51, 234, 0.15) !important;
}

/* Share Button */
.share-button-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.btn-share {
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
}

.btn-share:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-print {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    border-radius: 999px;
}

/* Grid Size Controls */
.grid-size-controls {
    display: none; /* Hidden on mobile */
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .grid-size-controls {
        display: flex;
    }
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid Size Variations */
.grid-outer.size-small {
    max-width: 400px;
}

.grid-outer.size-medium {
    max-width: 500px;
}

.grid-outer.size-large {
    max-width: 650px;
}

.grid-outer.size-xlarge {
    max-width: 800px;
}

@media (min-width: 640px) {
    .grid-outer.size-small {
        max-width: 450px;
    }
    
    .grid-outer.size-medium {
        max-width: 550px;
    }
    
    .grid-outer.size-large {
        max-width: 700px;
    }
    
    .grid-outer.size-xlarge {
        max-width: 900px;
    }
    
    .grid-outer.size-large .square,
    .grid-outer.size-xlarge .square {
        min-height: 50px;
        font-size: 0.75rem;
    }
    
    .grid-outer.size-xlarge .square {
        min-height: 60px;
        font-size: 0.875rem;
    }
}

/* Player Name Bar */
.player-name-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-name-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.player-name-display strong {
    color: var(--color-primary);
}

.player-name-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.player-name-input.hidden {
    display: none;
}

.player-name-display.hidden {
    display: none;
}

.player-claim-count {
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
}

/* Player Leaderboard */
.player-leaderboard {
    max-height: 300px;
    overflow-y: auto;
}

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

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.leaderboard-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-raised);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    background: #fbbf24;
    color: #000;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    background: #9ca3af;
    color: #000;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    background: #cd7f32;
    color: #fff;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Admin Quick-Assign Bar */
.admin-assign-bar {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-assign-bar .form-select,
.admin-assign-bar .form-input {
    padding: 0.5rem 0.75rem;
}

/* Color Pickers */
.color-pickers {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 140px;
}

.color-picker-group input[type="color"] {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 2px;
    background: var(--color-surface);
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-group span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Toggle Checkbox */
.toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.toggle-text {
    flex: 1;
    font-weight: 500;
}

/* League Tabs */
.league-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.league-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.league-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

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

.league-games {
    /* Container for game select */
}

.league-games.hidden {
    display: none;
}

/* Selected game info */
.selected-game-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.selected-game-info.hidden {
    display: none;
}

.selected-game-info strong {
    color: var(--color-success);
}

.btn-clear {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.btn-clear:hover {
    color: var(--color-error);
}

/* Multi-line select for CFB */
select[size] {
    height: auto;
    max-height: 250px;
}

select[size] option {
    padding: 0.5rem;
}

select optgroup {
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0.5rem 0;
}

/* Light mode adjustments for squares */
[data-theme="light"] .square {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="light"] .square:hover {
    background: var(--color-surface-raised);
}

[data-theme="light"] .square.claimed {
    background: var(--color-surface-raised);
}

[data-theme="light"] .grid-header {
    background: var(--color-surface-raised);
}

/* Ensure team colors are visible in both modes */
.team-name.team1 {
    color: var(--color-team1);
    text-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.team-name.team2 {
    color: var(--color-team2);
    text-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.grid-header.col-header {
    color: var(--color-team2);
    font-weight: 700;
}

.grid-header.row-header {
    color: var(--color-team1);
    font-weight: 700;
}

[data-theme="light"] .grid-header.col-header,
[data-theme="light"] .grid-header.row-header {
    text-shadow: none;
}

/* Ensure winner squares have good contrast */
.square.winner-q1,
.square.winner-q3,
.square.winner-final {
    color: white;
}

.square.winner-q2 {
    color: #1f2937;
}