:root {
    --bg-base: #121212;
    --bg-surface: #1e1e1e;
    --bg-surface-elevated: #2c2c2c;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #4caf50;
    --accent-hover: #45a049;
    --nav-height: 65px;
    --header-height: 55px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Main Application Views */
#app {
    padding-bottom: var(--nav-height);
    height: 100vh;
    overflow-y: auto;
}

.view {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.view.active {
    display: block;
}

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

.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.content-padding {
    padding: 16px;
}

/* Typography & Utilities */
.text-muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.card {
    background-color: var(--bg-surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

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

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--bg-surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 25%;
    height: 100%;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Bottom Sheets (Modals) */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    z-index: 999;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    background-color: var(--bg-surface);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform var(--transition-speed) cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 5px;
    background-color: var(--bg-surface-elevated);
    border-radius: 3px;
    margin: 12px auto;
}

.bottom-sheet-header {
    padding: 0 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.bottom-sheet-content {
    padding: 20px;
    overflow-y: auto;
}

/* Data Tables (Mobile Responsive) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    background: var(--bg-surface-elevated);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.data-table th, .data-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table .sticky-col {
    position: sticky;
    left: 0;
    background-color: var(--bg-surface-elevated);
    z-index: 1;
    text-align: left;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
}

.data-table th.sticky-col {
    z-index: 3;
    background-color: var(--bg-surface);
}

.data-table tbody tr:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Tactics UI Elements */
.tactics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tactics-controls select {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
}

.lineup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.lineup-slot {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.1s;
}

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

.slot-pos {
    width: 45px;
    height: 45px;
    background: var(--bg-surface-elevated);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 12px;
}

.slot-info {
    flex-grow: 1;
}

.slot-name {
    font-weight: bold;
    font-size: 1rem;
}

.slot-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.slot-action {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0 10px;
}

.text-danger {
    color: #ff5252;
}

.player-select-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}

.player-select-item:active {
    background: rgba(255,255,255,0.05);
}

.player-select-item.active {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid var(--accent);
}

/* Match UI Elements */
.match-scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-bottom: 12px;
}

.match-scoreboard .team-name {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.match-scoreboard .score {
    flex: 0 0 auto;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    padding: 0 15px;
}

.match-timer {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.commentary-box {
    background: var(--bg-surface-elevated);
    border-radius: 8px;
    padding: 16px;
    height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.commentary-box div {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
    line-height: 1.4;
}

.event-goal {
    color: var(--accent);
    font-weight: bold;
}

.event-card {
    color: #ffeb3b;
}

.event-miss {
    color: var(--text-secondary);
}