@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --orange: #F04A00;
    --orange-light: #FF6A00;
    --orange-dark: #C03B00;
    --orange-glow: rgba(240, 74, 0, 0.15);
    --orange-glow-strong: rgba(240, 74, 0, 0.3);
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --text-muted: #666;
    --border: #2a2a2a;
    --border-light: #333;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;
    --yellow: #eab308;
    --purple: #a855f7;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --tab-height: 64px;
    --status-bar: 44px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    opacity: 0.15;
    animation: particleFloat 12s infinite ease-in-out;
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 14s;
}

.particle:nth-child(2) {
    left: 80%;
    top: 15%;
    animation-delay: -3s;
    animation-duration: 11s;
}

.particle:nth-child(3) {
    left: 40%;
    top: 70%;
    animation-delay: -5s;
    animation-duration: 16s;
}

.particle:nth-child(4) {
    left: 65%;
    top: 50%;
    animation-delay: -8s;
    animation-duration: 13s;
}

.particle:nth-child(5) {
    left: 25%;
    top: 85%;
    animation-delay: -2s;
    animation-duration: 15s;
}

.particle:nth-child(6) {
    left: 90%;
    top: 60%;
    animation-delay: -6s;
    animation-duration: 12s;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.15;
    }

    25% {
        transform: translate(20px, -30px) scale(1.3);
        opacity: 0.25;
    }

    50% {
        transform: translate(-15px, -50px) scale(0.8);
        opacity: 0.1;
    }

    75% {
        transform: translate(25px, -20px) scale(1.1);
        opacity: 0.2;
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 2px solid rgba(212, 115, 26, 0.3);
}

.auth-brand {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.auth-brand span {
    color: var(--orange);
}

.auth-tagline {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.auth-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 14px;
    background: var(--orange-glow);
    border: 1px solid rgba(212, 115, 26, 0.25);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--orange);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.auth-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-card .auth-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--orange);
}

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

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input.with-icon {
    padding-left: 40px;
}

/* Student Auth Tabs & Signup */
.student-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.student-auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}
.student-auth-tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}
.student-auth-view {
    display: none;
}
.student-auth-view.active {
    display: block;
}
.signup-step {
    display: none;
}
.signup-step.active {
    display: block;
}

.signup-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}
.signup-option-card:hover {
    border-color: var(--border-light);
}
.signup-option-card.selected {
    border-color: var(--orange);
    background: rgba(240, 74, 0, 0.05);
}
.signup-option-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(240, 74, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    flex-shrink: 0;
}
.signup-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.signup-option-text strong {
    font-size: 14px;
    color: var(--text-primary);
}
.signup-option-text span {
    font-size: 12px;
    color: var(--text-muted);
}
.signup-option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}
.signup-option-card.selected .signup-option-check {
    border-color: var(--orange);
    background: var(--orange);
}
.signup-option-card.selected .signup-option-check::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.signup-detail-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 4px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.student-plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.student-plan-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.student-plan-card:hover {
    border-color: var(--border-light);
}
.student-plan-card.selected {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240, 74, 0, 0.15);
}
.student-plan-popular {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--orange);
    background: rgba(240, 74, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 4px;
}
.student-plan-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.student-plan-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--orange);
    margin-bottom: 8px;
}
.student-plan-price span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}
.student-plan-perks {
    list-style: none;
    padding: 0;
    margin: 0;
}
.student-plan-perks li {
    font-size: 10px;
    color: var(--text-secondary);
    padding: 2px 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.3;
}
.student-plan-perks li::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    margin-top: 4px;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    white-space: nowrap;
    min-height: 48px;
}

.btn-primary {
    background: var(--orange);
    color: #fff;
    width: 100%;
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--orange-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 115, 26, 0.3);
}

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

.btn-secondary:active {
    background: var(--bg-card-hover);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.auth-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 20px;
}

/* ===== MAIN APP SHELL ===== */
.app-shell {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-shell.active {
    display: flex;
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.top-bar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 0.5px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
}

.top-bar-btn:active {
    background: var(--bg-card-hover);
}

.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    border: 2px solid var(--orange);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom, 0px) + 16px);
    overflow-y: auto;
}

.tab-page {
    display: none;
    padding: 20px 16px;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 15px;
}

.stat-card-icon.orange {
    background: var(--orange-glow);
    color: var(--orange);
}

.stat-card-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.stat-card-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin: 2px 0;
}

.stat-change {
    font-size: 11px;
    font-weight: 600;
}

.stat-change.up {
    color: var(--green);
}

.stat-change.down {
    color: var(--red);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    padding: 16px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.badge-orange {
    background: var(--orange-glow);
    color: var(--orange);
}

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

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.badge-yellow {
    background: rgba(234, 179, 8, 0.15);
    color: var(--yellow);
}

.badge-purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.badge-xs {
    font-size: 9px;
    padding: 2px 6px;
}

/* ===== INLINE ICON ===== */
.ic {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: -2px;
}

.ic svg {
    width: 100%;
    height: 100%;
}

/* ===== CARD BODY VARIANTS ===== */
.card-body-list {
    padding: 0 16px;
}

.card-body-flush {
    padding: 0;
}

.card-body-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== INSIGHT CARDS ===== */
.insight-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.insight-card-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.insight-card-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-card.strength {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.insight-card.strength .insight-card-title {
    color: var(--green);
}

.insight-card.focus {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.insight-card.focus .insight-card-title {
    color: var(--yellow);
}

.insight-card.trending {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.insight-card.trending .insight-card-title {
    color: var(--blue);
}

/* ===== BUTTON UTILITIES ===== */
.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn-back {
    flex: 1;
}

.btn-group .btn-submit {
    flex: 2;
}

.badge-btn {
    cursor: pointer;
    border: none;
}

/* ===== GAME HISTORY ===== */
.game-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

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

.game-item:active {
    background: rgba(255, 255, 255, 0.02);
}

.game-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-item-teams {
    font-size: 14px;
    font-weight: 600;
}

.game-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

.game-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.game-item-score {
    font-size: 16px;
    font-weight: 800;
}

.game-item-stats {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== PERFORMANCE SECTION ===== */
.perf-bar-group {
    margin-bottom: 14px;
}

.perf-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.perf-bar-label span:first-child {
    color: var(--text-secondary);
}

.perf-bar-label span:last-child {
    font-weight: 700;
}

.perf-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.perf-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--orange-dark), var(--orange-light));
}

.perf-bar-fill.green {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.perf-bar-fill.blue {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* ===== SPARKLINE ===== */
.sparkline-container {
    height: 50px;
    position: relative;
    margin: 8px 0;
}

.sparkline-container canvas {
    width: 100%;
    height: 100%;
}

/* ===== UPLOAD SECTION ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:active {
    border-color: var(--orange);
    background: var(--orange-glow);
}

.upload-zone svg {
    margin-bottom: 10px;
    color: var(--text-muted);
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 13px;
}

.upload-zone .highlight {
    color: var(--orange);
    font-weight: 600;
}

.upload-progress {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: var(--orange-glow);
    border: 1px solid rgba(212, 115, 26, 0.25);
    border-radius: var(--radius-sm);
}

.upload-progress.active {
    display: block;
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.upload-progress-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-progress-pct {
    font-size: 12px;
    color: var(--orange);
    font-weight: 700;
}

.upload-bar {
    height: 4px;
    background: rgba(212, 115, 26, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.upload-bar-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== MY CLIPS LIST ===== */
.clip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.clip-thumb {
    width: 56px;
    height: 40px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 16px;
}

.clip-item-info {
    flex: 1;
    min-width: 0;
}

.clip-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== MESSAGES ===== */
.message-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

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

.message-item:active {
    background: rgba(255, 255, 255, 0.02);
}

.message-item.unread {
    position: relative;
}

.message-item.unread::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.message-from {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-category {
    margin-bottom: 6px;
}

.message-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-detail {
    display: none;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.message-detail.active {
    display: block;
}

.message-detail-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--orange);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    margin-bottom: 16px;
    padding: 0;
}

.message-detail-body {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
}

.message-detail-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.attached-clip {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.attached-clip svg {
    color: var(--orange);
    flex-shrink: 0;
}

/* ===== PROFILE ===== */
.profile-hero {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, rgba(212, 115, 26, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    border: 3px solid var(--orange);
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 20px;
    font-weight: 800;
}

.profile-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--orange-glow);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--orange);
}

/* ===== PROFILE STATS GRID ===== */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.profile-stats-grid .stat-big {
    font-size: 20px;
    font-weight: 800;
}

.profile-stats-grid .stat-small {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.settings-group {
    margin-bottom: 16px;
}

.settings-group-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 4px;
    margin-bottom: 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.settings-item:first-of-type {
    border-radius: var(--radius) var(--radius) 0 0;
}

.settings-item:last-of-type {
    border-radius: 0 0 var(--radius) var(--radius);
}

.settings-item:only-of-type {
    border-radius: var(--radius);
}

.settings-item+.settings-item {
    border-top: none;
}

.settings-item:active {
    background: var(--bg-card-hover);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.settings-icon.orange {
    background: var(--orange-glow);
    color: var(--orange);
}

.settings-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.settings-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.settings-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.settings-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.settings-item-label {
    font-size: 14px;
    font-weight: 500;
}

.settings-item-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-light);
    border-radius: 13px;
    transition: var(--transition);
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
    background: var(--orange);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

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

/* ===== BOTTOM TAB BAR ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-height);
    display: flex;
    align-items: stretch;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 8px 0;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    transition: all var(--transition);
}

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

.tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--orange);
    border-radius: 0 0 2px 2px;
}

.tab-btn .tab-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(12px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--orange);
    color: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== COACH BADGE ===== */
.coach-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--orange-glow);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 13px;
}

/* ===== FORM SELECT ===== */
.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition);
    outline: none;
    cursor: pointer;
    appearance: none;
}

.form-select:focus {
    border-color: var(--orange);
}

/* ===== SEASON TREND CHART ===== */
.trend-chart {
    position: relative;
    height: 60px;
    margin: 8px 0;
}

.trend-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.trend-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

/* ===== SETTINGS MODAL ===== */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.settings-modal {
    width: 100%;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-modal-overlay.active .settings-modal {
    transform: translateY(0);
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.settings-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.settings-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.settings-modal-close:active {
    background: var(--bg-card-hover);
}

.settings-modal-body {
    padding: 20px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.modal-info-row:last-child {
    border-bottom: none;
}

.modal-info-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    margin-top: 16px;
}

.modal-section-title:first-child {
    margin-top: 0;
}

/* ===== DRILL CARDS ===== */
.drill-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.drill-preview-item:last-child {
    border-bottom: none;
}

.drill-preview-item:active {
    opacity: 0.7;
}

.drill-preview-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--orange-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.drill-preview-info {
    flex: 1;
    min-width: 0;
}

.drill-preview-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drill-preview-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.drill-progress-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.drill-progress-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.drill-progress-ring svg {
    width: 100%;
    height: 100%;
}

.drill-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--orange);
}

.drill-progress-info {
    flex: 1;
}

.drill-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.drill-card:last-child {
    border-bottom: none;
}

.drill-card:active {
    background: rgba(255, 255, 255, 0.02);
}

.drill-card.completed {
    opacity: 0.6;
}

.drill-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.drill-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.drill-card-info {
    flex: 1;
    min-width: 0;
}

.drill-card-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drill-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 430px) {
    .auth-container {
        padding: 32px;
    }
}

@media (max-width: 374px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 20px;
    }

    .tab-btn {
        font-size: 9px;
    }

    .tab-btn svg {
        width: 20px;
        height: 20px;
    }

    .student-plan-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .student-plan-card {
        padding: 14px;
    }

    .student-plan-price {
        font-size: 18px;
    }

    .auth-container {
        padding: 16px;
    }
}

@media (max-width: 320px) {
    .tab-page {
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* ===== SKELETON LOADERS ===== */
.skeleton {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-text {
    height: 12px;
    margin-bottom: 6px;
    width: 75%;
}

.skeleton-text.short {
    width: 45%;
}

.skeleton-card {
    height: 60px;
    margin-bottom: 10px;
    border-radius: var(--radius);
}

/* ===== FORM VALIDATION ===== */
.form-input.error {
    border-color: var(--red);
}

.form-input.error:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-error-msg {
    font-size: 11px;
    color: var(--red);
    margin-top: 4px;
    display: none;
}

.form-error-msg.show {
    display: block;
}

/* ===== FOCUS-VISIBLE ===== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.btn:focus-visible,
.top-bar-btn:focus-visible,
.tab-btn:focus-visible,
.settings-item:focus-visible,
.toggle-slider:focus-visible,
.settings-modal-close:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240, 74, 0, 0.15);
}

/* ===== UPLOAD DRAG-AND-DROP ===== */
.upload-zone.dragover {
    border-color: var(--orange);
    background: rgba(240, 74, 0, 0.06);
    transform: scale(1.01);
}

.upload-zone.dragover svg {
    color: var(--orange);
}

/* ===== GAME DETAIL MODAL ===== */
.game-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.game-detail-modal {
    width: 100%;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-detail-overlay.active .game-detail-modal {
    transform: translateY(0);
}

.game-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.game-detail-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.game-detail-body {
    padding: 20px;
}

.game-detail-score {
    text-align: center;
    margin-bottom: 20px;
}

.game-detail-score .score-big {
    font-size: 32px;
    font-weight: 900;
    color: var(--orange);
}

.game-detail-score .score-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.game-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.game-detail-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.game-detail-stat .val {
    font-size: 20px;
    font-weight: 800;
}

.game-detail-stat .lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===== ANALYSIS OVERLAY (AI video processing) ===== */
.analysis-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.analysis-overlay.show {
    display: flex;
}

.analysis-overlay-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.analysis-overlay-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(240, 74, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: student-pulse-icon 2s ease-in-out infinite;
}

@keyframes student-pulse-icon {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240, 74, 0, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 16px 6px rgba(240, 74, 0, 0.15); }
}

.analysis-overlay-card h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.analysis-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.analysis-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--orange), var(--orange-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.analysis-progress-label {
    font-size: 12px;
    color: var(--orange);
    font-weight: 600;
    margin-bottom: 16px;
}

.analysis-stages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.analysis-stage {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.analysis-stage.active {
    color: var(--orange);
    font-weight: 600;
}

.analysis-stage.done {
    color: var(--green);
}

.stage-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.analysis-stage.active .stage-dot {
    background: var(--orange);
    box-shadow: 0 0 6px var(--orange);
}

.analysis-stage.done .stage-dot {
    background: var(--green);
}

/* Analysis entry (for My Clips / Analysis History) */
.analysis-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.analysis-entry-icon.video svg {
    color: var(--orange);
}

.analysis-entry-info {
    flex: 1;
    min-width: 0;
}

.analysis-entry-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.analysis-entry-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.analysis-entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.analysis-entry-detail {
    width: 100%;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    display: none;
}

.analysis-entry-detail.show {
    display: block;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}