* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066FF;
    --primary-dark: #0052CC;
    --secondary-color: #1a1a1a;
    --success-color: #00C853;
    --danger-color: #FF1744;
    --warning-color: #FF6D00;
    --bg-color: #000000;
    --card-bg: #1a1a1a;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --border-color: #404040;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.9);
    --stat-flash: #10b981;
    --color-win: #10b981;
    --color-loss: #ef4444;
    --color-tie: #94a3b8;
    --color-opponent: #dc2626;
    --color-green-text: #16a34a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    max-width: 100%;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Headers */
header {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    border-bottom: 3px solid var(--primary-color);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

header h2 {
    font-size: 1.5rem;
}

header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.home-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
}

.back-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
}

.back-btn:active {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(0.95);
}

/* Navigation */
.main-nav {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
}

.nav-cards {
    grid-template-columns: 1fr 1fr;
}

.nav-btn {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.nav-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.2rem;
    gap: 0.5rem;
}

.nav-card .icon {
    font-size: 1.8rem;
}

.nav-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-card-title {
    font-size: 1rem;
    font-weight: 700;
}

.nav-card-desc {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.3;
}

@media (max-width: 420px) {
    .nav-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    .nav-card {
        padding: 1rem;
    }
    .nav-card-title {
        font-size: 0.9rem;
    }
    .nav-card-desc {
        font-size: 0.75rem;
    }
}

.nav-btn:active {
    transform: scale(0.96);
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.6);
}

.nav-btn .icon {
    font-size: 2rem;
}

/* Content Area */
.content {
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Forms */
.input-field {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    background: var(--bg-color);
    color: var(--text-primary);
    font-weight: 500;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.3);
}

.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Date and Time inputs */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--primary-color);
}

.btn-primary:active {
    background: var(--primary-dark);
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.8);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 3px solid var(--border-color);
}

.btn-secondary:active {
    background: var(--secondary-color);
    border-color: var(--text-primary);
    transform: scale(0.96);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 3px solid var(--danger-color);
}

.btn-danger:active {
    background: #D50000;
    transform: scale(0.96);
}

/* Roster Display */
.roster-list {
    margin-top: 2rem;
}

.roster-list h3 {
    margin-bottom: 1rem;
}

.player-item {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow);
}

.player-info {
    flex: 1;
}

.player-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 1rem;
}

.player-position {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.player-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.player-item-editing {
    flex-direction: column;
    align-items: stretch;
}

.player-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.player-edit-row {
    display: flex;
    gap: 0.5rem;
}

.player-edit-row .input-field {
    flex: 1;
}

.player-edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.player-edit-actions .btn-primary,
.player-edit-actions .btn-secondary {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* Game Form */
.game-form, .add-player-form {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 3px solid var(--border-color);
}

.radio-group {
    margin: 1rem 0;
}

.radio-group label {
    display: block;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-color);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.15s;
}

.radio-group label:active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
}

/* Scheduled Games */
.game-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 3px solid var(--border-color);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.15s;
}

.game-card:active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(0.98);
}

.game-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    margin: 1rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--primary-color);
}

.team {
    text-align: center;
}

.team h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.score {
    font-size: 5rem;
    font-weight: 900;
    color: #00FF00;
    margin: 1rem 0;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.score-btn {
    width: 60px;
    height: 60px;
    margin: 0.25rem;
    font-size: 2rem;
    font-weight: 900;
    border: 3px solid var(--primary-color);
    background: var(--bg-color);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.score-btn:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.9);
}

/* Clock */
.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.period {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--warning-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.clock {
    font-size: 3.5rem;
    font-weight: 900;
    color: #00FF00;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.clock-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.clock-controls button {
    width: auto;
    padding: 0.75rem 1.5rem;
}

.clock-control-btn {
    width: auto;
    padding: 2rem 1.5rem;
    background: var(--success-color);
    color: white;
    border: 3px solid var(--success-color);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    writing-mode: horizontal-tb;
}

.clock-control-btn:active {
    transform: scale(0.98);
    background: #00A843;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.8);
}

/* Stats Entry */
.stats-entry {
    padding: 1.5rem;
}

.stats-entry h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-btn {
    padding: 1.25rem 0.75rem;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    transition: all 0.15s;
}

.player-btn:active {
    background: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.8);
}

.player-btn:active .player-btn-number,
.player-btn:active .player-btn-name {
    color: white !important;
}

.player-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.player-btn.selected .player-btn-number,
.player-btn.selected .player-btn-name {
    color: white !important;
}

.player-btn-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.player-btn-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.stat-buttons {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-buttons.hidden {
    display: none;
}

.player-selection {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.player-selection.hidden {
    display: none;
}

.btn-opponent {
    width: 100%;
    padding: 1.5rem;
    background: var(--warning-color);
    color: white;
    border: 3px solid var(--warning-color);
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn-opponent:active {
    background: #E65100;
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 109, 0, 0.8);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.stat-btn {
    padding: 1.5rem;
    background: var(--success-color);
    color: white;
    border: 3px solid var(--success-color);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.stat-btn:active {
    transform: scale(0.95);
    background: #00A843;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.8);
}

/* Settings */
.settings-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-section h3 {
    margin-bottom: 1rem;
}

.danger-zone {
    border: 2px solid var(--danger-color);
}

/* Game Stats Summary */
.game-stats-summary {
    padding: 1.5rem;
    text-align: center;
}

/* History */
.history-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
}

.history-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.history-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

/* ===== OVERLAY SYSTEM ===== */

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes overlaySlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
    animation: overlayFadeIn 0.2s ease-out;
}

.overlay--centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay--z1100 {
    z-index: 1100;
}

.overlay-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--primary-color);
    color: var(--text-primary);
    margin: 0 auto;
    animation: overlaySlideUp 0.25s ease-out;
}

.overlay-content--wide {
    max-width: 1200px;
    width: 95%;
}

.overlay-content--medium {
    max-width: 900px;
}

.overlay-content--narrow {
    max-width: 400px;
}

/* ===== DARK STAT TABLES ===== */

.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stat-table th {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: 700;
}

.stat-table th:first-child {
    text-align: left;
}

.stat-table td {
    padding: 0.5rem;
    text-align: center;
    color: var(--text-primary);
}

.stat-table td:first-child {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.stat-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.stat-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.stat-table tbody tr:hover {
    background: rgba(0, 102, 255, 0.08);
}

.stat-table-sticky td:first-child,
.stat-table-sticky th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

.stat-table-sticky th:first-child {
    background: var(--primary-color);
}

.stat-table-sticky td:first-child {
    background: var(--card-bg);
}

.stat-table-sticky tbody tr:nth-child(even) td:first-child {
    background: #1c1c1c;
}

/* Lighter-weight table for game log / scoring summary */
.stat-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stat-log-table td {
    padding: 0.4rem 0.75rem;
    color: var(--text-primary);
}

.stat-log-table tr {
    border-bottom: 1px solid var(--border-color);
}

.stat-log-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Team stats sub-card */
.team-stats-card {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ===== EDIT LOG (dark-themed) ===== */

.edit-log-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-primary);
    animation: overlaySlideUp 0.25s ease-out;
}

.edit-log-header {
    background: var(--primary-dark);
    padding: 0.4rem 0.75rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    border-radius: 4px;
}

.edit-log-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.edit-log-time {
    min-width: 40px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.edit-log-desc {
    flex: 1;
}

.btn-action-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-action-sm--edit {
    background: var(--primary-color);
}

.btn-action-sm--delete {
    background: var(--danger-color);
}

/* Reassign stat picker grid */
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.picker-btn {
    padding: 0.6rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-primary);
}

.picker-btn:active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== DARK FORM INPUTS ===== */

.dark-input {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 1rem;
}

.dark-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.dark-input--score {
    width: 60px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}

.dark-input--stat {
    width: 44px;
    padding: 0.3rem;
    text-align: center;
    border-width: 1px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ===== STAT FLASH ANIMATION ===== */

.player-btn {
    transition: all 0.15s, background 0.2s;
}

.player-btn.stat-flash {
    background: var(--stat-flash) !important;
    color: white !important;
    border-color: var(--stat-flash) !important;
}

.player-btn.stat-flash .player-btn-number,
.player-btn.stat-flash .player-btn-name {
    color: white !important;
}

/* ===== SHOT LOCATION PICKER ===== */

.shot-picker {
    z-index: 2000;
    flex-direction: column;
    padding: 1.5rem;
}

.shot-picker-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-align: center;
}

.shot-picker-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.shot-picker-field {
    width: 100%;
    max-width: 500px;
    cursor: crosshair;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.2);
    overflow: hidden;
    animation: overlaySlideUp 0.25s ease-out;
}

.shot-picker-field svg {
    display: block;
    width: 100%;
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .clock-control-btn {
        order: -2;
        padding: 1.5rem;
        width: 100%;
    }

    .voice-mic-btn {
        order: -2;
        padding: 1.5rem;
        width: 100%;
    }

    .clock-container {
        order: -1;
        grid-column: 1 / -1;
    }

    .home-team {
        grid-column: 1;
    }

    .away-team {
        grid-column: 2;
    }

    .score {
        font-size: 3rem;
    }

    .clock {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Penalty System */
.penalty-time-btn {
    padding: 1.5rem;
    background: var(--danger-color);
    color: white;
    border: 3px solid var(--danger-color);
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.penalty-time-btn:active {
    transform: scale(0.95);
    background: #D50000;
    box-shadow: 0 2px 8px rgba(255, 23, 68, 0.8);
}

.stat-btn-penalty {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.stat-btn-penalty:active {
    background: #D50000;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

/* ===== VOICE INPUT SYSTEM ===== */

/* Mic Button - right side of scoreboard, mirrors clock control */
.voice-mic-btn {
    width: auto;
    padding: 2rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow);
    display: none; /* hidden by default, shown by JS if supported */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
}

.voice-mic-label {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.voice-mic-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.8);
}

.voice-mic-btn.listening {
    background: var(--danger-color);
    border-color: var(--danger-color);
    box-shadow: 0 4px 20px rgba(255, 23, 68, 0.6);
    animation: mic-pulse 1.2s ease-in-out infinite;
}

.voice-mic-btn.processing {
    background: var(--warning-color);
    border-color: var(--warning-color);
    box-shadow: 0 4px 16px rgba(255, 109, 0, 0.5);
    animation: none;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 23, 68, 0.6); transform: scale(1); }
    50% { box-shadow: 0 4px 32px rgba(255, 23, 68, 0.9); transform: scale(1.08); }
}

/* Voice Feedback Banner - fixed top */
.voice-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.92);
    color: white;
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

.voice-feedback.visible {
    opacity: 1;
    pointer-events: auto;
}

.voice-feedback.hidden {
    opacity: 0;
    pointer-events: none;
}

.voice-feedback.confirmed #voice-feedback-status {
    color: #22c55e;
    font-size: 2.5rem;
}

.voice-feedback.confirmed #voice-feedback-transcript {
    font-size: 2rem;
    color: #fff;
}

#voice-feedback-status {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--danger-color);
    margin-bottom: 0.5rem;
}

#voice-feedback-transcript {
    font-size: 1.5rem;
    color: var(--text-secondary);
    min-height: 1.4em;
}

/* Undo Toast - fixed bottom */
.undo-toast {
    position: fixed;
    bottom: 2rem;
    left: 1rem;
    right: 1rem;
    background: #333;
    color: white;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    transform: translateY(150%);
    transition: transform 0.25s ease-out;
}

.undo-toast.visible {
    transform: translateY(0);
}

.undo-toast.hidden {
    display: flex !important;
    transform: translateY(150%);
}

#undo-toast-text {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

#undo-toast-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#undo-toast-btn:active {
    background: var(--primary-dark);
    transform: scale(0.95);
}

/* ===== TEAM SYNC SECTION ===== */

.sync-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.sync-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-divider::before,
.sync-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.sync-divider span {
    padding: 0 1rem;
}

.team-code-display {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-color);
    border: 3px solid var(--primary-color);
    border-radius: 12px;
}

.sync-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.team-code-value {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    color: var(--success-color);
    letter-spacing: 0.5rem;
}

.sync-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ===== SIGN-IN SCREEN ===== */

.signin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.signin-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 50%;
}

.signin-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

.signin-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
    padding: 1rem 1.5rem;
    background: #FFFFFF;
    color: #333333;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}

.google-signin-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.google-signin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.signin-note {
    max-width: 300px;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== ACCOUNT SECTION ===== */

.account-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-details {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.account-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== ACTIVE TEAM BADGE (Home Header) ===== */

.active-team-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success-color);
    letter-spacing: 0.5px;
}

.active-team-badge:empty {
    display: none;
}

/* ===== TEAM SELECTOR DROPDOWN (Home Header) ===== */

.team-selector-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: 1px solid rgba(0, 200, 83, 0.4);
    border-radius: 6px;
    color: var(--success-color);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.3rem 1.4rem 0.3rem 0.5rem;
    cursor: pointer;
    outline: none;
    letter-spacing: 0.5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300C853'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 10px 6px;
    max-width: 200px;
    text-overflow: ellipsis;
}

.team-selector-dropdown:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.2);
}

.team-selector-dropdown option {
    background: var(--card-bg);
    color: var(--text-primary);
}

.team-selector-dropdown:empty {
    display: none;
}

/* ===== SCHEDULE TEAM BANNER ===== */

.schedule-team-banner {
    background: linear-gradient(135deg, #0d3320, #1a4d35);
    border: 2px solid var(--success-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

.schedule-team-banner strong {
    color: var(--success-color);
    font-weight: 800;
}

.ical-import-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 3px solid var(--border-color);
}

.ical-import-card h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.ical-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.ical-import-card .input-field {
    margin-bottom: 0.75rem;
}

.ical-last-sync {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
    text-align: center;
    font-style: italic;
}

/* ===== GETTING STARTED BANNER ===== */

.getting-started-banner {
    margin: 0 1.5rem 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #1e3a5f, #0f2439);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
}

.getting-started-banner h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.getting-started-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.getting-started-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.getting-started-step:hover {
    background: rgba(255, 255, 255, 0.2);
}

.getting-started-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ===== WELCOME MODAL ===== */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.welcome-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.welcome-modal h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-modal p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.welcome-actions .btn-primary,
.welcome-actions .btn-secondary {
    width: 100%;
}

/* ===== TEAM LIST / SWITCHER ===== */

.team-list {
    margin-bottom: 1.5rem;
}

.team-list-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    padding: 1.5rem 1rem;
    line-height: 1.5;
}

.team-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.team-list-item:active {
    transform: scale(0.98);
}

.team-list-item.active {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color), 0 0 12px rgba(0, 200, 83, 0.15);
    background: rgba(0, 200, 83, 0.05);
}

.team-list-item-info {
    flex: 1;
    min-width: 0;
}

.team-list-item-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.team-list-item-code {
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    letter-spacing: 0.15rem;
}

.team-list-item-active-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    background: var(--success-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.team-list-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.team-copy-btn,
.team-leave-btn {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-copy-btn {
    background: var(--primary-color);
    color: white;
}

.team-leave-btn {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.team-leave-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.team-leave-section .team-leave-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    opacity: 0.7;
}

.team-leave-section .team-leave-btn:hover {
    opacity: 1;
}

/* Move to Team button in game history */
.btn-move-team {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    width: 100%;
    transition: all 0.15s;
}

.btn-move-team:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.96);
}

.team-actions {
    margin-top: 1rem;
}

/* ===== ABOUT / GET STARTED PAGE ===== */
.about-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.about-hero {
    text-align: center;
    padding: 1rem 1rem 0.75rem;
}

.about-hero h1 {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), #00C853);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.about-tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.about-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.about-section-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.about-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.about-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Steps */
.about-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.about-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.about-step strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.about-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Cards */
.about-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 0.75rem;
}

.about-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 560px) {
    .about-card-grid {
        grid-template-columns: 1fr;
    }
}

.about-card-highlight-blue {
    border-color: var(--primary-color);
    border-width: 2px;
}

.about-card-highlight-blue h4 {
    color: var(--primary-color);
}

.about-card-highlight-green {
    border-color: var(--success-color);
    border-width: 2px;
}

.about-card-highlight-green h4 {
    color: var(--success-color);
}

.about-card ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Details & badges */
.about-detail {
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.about-detail:first-of-type {
    margin-top: 0.5rem;
}

.about-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.25rem;
}

/* Voice examples */
.about-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.about-examples code {
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
}

/* Lists */
.about-list {
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-top: 0.5rem;
}

.about-tips-list li {
    margin-bottom: 0.5rem;
}

/* Tip callout */
.about-tip {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 109, 0, 0.1);
    border-left: 3px solid var(--warning-color);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.about-tip strong {
    color: var(--warning-color);
}

/* Footer */
.about-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}
