/* HockeyStat — Bright ice rink theme */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
    /* Ice & rink */
    --ice-white: #f8fcff;
    --ice-surface: #eef7fc;
    --ice-shimmer: #e3f2fa;
    --ice-blue: #4a9ec4;
    --ice-blue-bright: #7ec8e8;
    --line-blue: #1e5a8a;
    --line-blue-light: rgba(30, 90, 138, 0.15);
    --line-red: #c8102e;
    --line-red-dim: #a00d25;
    --boards: #ffffff;
    --boards-rail: #c5dce8;

    /* Legacy token aliases (keep HTML/JS stable) */
    --rink-dark: #1e4a6e;
    --rink-mid: #2d6a9f;
    --rink-paper: var(--ice-surface);
    --rink-ice: var(--ice-white);
    --ice-blue-dim: rgba(74, 158, 196, 0.2);
    --ice-gray: #d0e8f2;

    /* Text */
    --ink: #1a3a52;
    --ink-muted: #5a7a92;
    --border: #b8d4e8;
    --border-dark: #8eb8d4;

    /* Semantic */
    --success: #1f6b45;
    --success-bg: #e0f5ea;
    --warn: #b45309;
    --warn-bg: #fef6e4;

    --radius: 8px;
    --nav-height: 58px;
    --header-height: 56px;
    --max-width: 480px;
    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --shadow-soft: 0 2px 12px rgba(30, 90, 138, 0.1);
    --shadow-card: 0 4px 16px rgba(30, 90, 138, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, #b8ddf0 0%, #d4ecf8 40%, #e8f4fa 100%);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 12px);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--line-blue); text-decoration: none; }
a:hover { color: var(--line-red); text-decoration: underline; }

.app-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--ice-white);
    position: relative;
    box-shadow: var(--shadow-card);
}

.app-shell::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    background:
        /* center red line */
        linear-gradient(90deg, transparent calc(50% - 2px), rgba(200, 16, 46, 0.35) calc(50% - 2px), rgba(200, 16, 46, 0.35) calc(50% + 2px), transparent calc(50% + 2px)),
        /* blue lines */
        linear-gradient(0deg, transparent 28%, rgba(30, 90, 138, 0.2) 28%, rgba(30, 90, 138, 0.2) 28.4%, transparent 28.4%),
        linear-gradient(0deg, transparent 72%, rgba(30, 90, 138, 0.2) 72%, rgba(30, 90, 138, 0.2) 72.4%, transparent 72.4%),
        /* ice shimmer */
        linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, transparent 50%, rgba(126, 200, 232, 0.08) 100%);
}

.app-main {
    padding: 18px 14px 8px;
    background: transparent;
}

.scoreboard-num {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.stat-card .stat-value,
.streak-pill,
.xp-pill,
.quiz-result .score-big {
    font-variant-numeric: tabular-nums;
}

.app-header,
.app-main,
.bottom-nav { position: relative; z-index: 1; }

/* —— Header (boards / glass) —— */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--ink);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 4px solid var(--line-blue);
    box-shadow: 0 2px 0 var(--line-red), var(--shadow-soft);
}

.app-header .logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    color: var(--line-red);
    flex-shrink: 0;
    display: flex;
}

.app-header .logo:hover { text-decoration: none; color: var(--line-blue); }

.app-header .logo .logo-mark {
    color: var(--line-red);
}

.app-header .logo .logo-sub {
    font-weight: 500;
    color: var(--ink-muted);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    display: block;
    margin-top: 2px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.streak-pill,
.xp-pill {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--ice-surface);
    color: var(--ink);
}

.streak-pill {
    border-color: #f0a060;
    background: #fff5eb;
    color: #b45309;
}

.xp-pill {
    border-color: var(--ice-blue);
    background: #e8f6fc;
    color: var(--line-blue);
}

.btn-logout {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    background: #fff;
}

.btn-logout:hover {
    color: var(--line-red);
    border-color: var(--line-red);
    text-decoration: none;
    background: #fff;
}

/* —— Main —— */

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--ink);
}

.page-subtitle {
    color: var(--ink-muted);
    font-size: 0.85rem;
    margin-bottom: 18px;
    font-weight: 500;
}

.section-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--line-blue);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--line-red);
    display: inline-block;
}

/* —— Bottom nav (ice dock) —— */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 4px solid var(--line-blue);
    box-shadow: 0 -2px 0 var(--line-red), 0 -4px 20px rgba(30, 90, 138, 0.1);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ink-muted);
    font-family: var(--font-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    min-height: 44px;
    border-right: 1px solid var(--border);
    transition: color 0.12s, background 0.12s;
    position: relative;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--line-blue);
    opacity: 0.7;
}

.bottom-nav a.active {
    color: var(--line-blue);
    background: var(--ice-surface);
}

.bottom-nav a.active .nav-icon {
    opacity: 1;
    color: var(--line-red);
}

.bottom-nav a.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--line-red);
    border-radius: 0 0 2px 2px;
}

.bottom-nav a .nav-dot { display: none; }

.bottom-nav a:last-child { border-right: none; }

/* —— Cards —— */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.15;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid;
    border-radius: var(--radius);
}

.badge-primary { background: var(--line-blue); color: #fff; border-color: var(--line-blue); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.badge-muted { background: transparent; color: var(--ink-muted); border-color: var(--border); }
.badge-accent { background: var(--line-red); color: #fff; border-color: var(--line-red); }
.badge-locked { background: #ddd8ce; color: #888; border-color: #bbb; }

/* —— Progress (scoreboard bars) —— */
.progress-bar {
    height: 10px;
    background: var(--ice-gray);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin: 6px 0;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent calc(25% - 1px),
        rgba(30, 90, 138, 0.12) calc(25% - 1px),
        rgba(30, 90, 138, 0.12) 25%
    );
    pointer-events: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--line-blue), var(--ice-blue-bright));
    border-radius: 4px;
    transition: width 0.35s ease;
    position: relative;
    z-index: 1;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-muted);
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

/* —— Buttons —— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 18px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 46px;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.1s, background 0.12s;
    width: 100%;
    box-shadow: var(--shadow-soft);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-primary {
    background: var(--line-blue);
    color: #fff;
    border-color: var(--line-blue);
}

.btn-primary:hover {
    background: var(--rink-mid);
    border-color: var(--rink-mid);
    text-decoration: none;
    color: #fff;
}

.btn-accent {
    background: var(--line-red);
    color: #fff;
    border-color: var(--line-red);
    box-shadow: 0 3px 12px rgba(200, 16, 46, 0.25);
}

.btn-accent:hover {
    background: var(--line-red-dim);
    text-decoration: none;
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--line-blue);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--ice-surface);
    border-color: var(--line-blue);
    text-decoration: none;
    color: var(--line-blue);
}

.btn-sm {
    padding: 7px 12px;
    min-height: 34px;
    font-size: 0.75rem;
    width: auto;
}

.btn-group { display: flex; gap: 8px; margin-top: 14px; }
.btn-group .btn { flex: 1; }

/* —— Forms —— */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: var(--ink-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    background: #fff;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid var(--ice-blue);
    outline-offset: 1px;
    border-color: var(--ice-blue);
}

.form-group textarea { min-height: 80px; resize: vertical; }

.level-cards { display: grid; gap: 8px; margin-bottom: 14px; }

.level-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    background: #fff;
    transition: background 0.12s, border-color 0.12s;
}

.level-card:has(input:checked) {
    background: var(--ice-surface);
    color: var(--ink);
    border-color: var(--line-blue);
    box-shadow: inset 0 0 0 2px var(--line-blue);
}

.level-card:has(input:checked) p { color: var(--ink-muted); }

.level-card input { display: none; }

.level-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.level-card p { font-size: 0.82rem; color: var(--ink-muted); }

.alert {
    padding: 11px 12px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 0.88rem;
    border: 1px solid;
}

.alert-error { background: #fde8e8; color: #8b1a1a; border-color: #c44; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-info { background: #e4eef8; color: #1a4a7a; border-color: #7eb8d8; }

/* —— Quick actions —— */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 12px;
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--line-blue);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    min-height: 88px;
}

.qa-icon {
    color: var(--line-blue);
    margin-bottom: 6px;
    display: flex;
}

.quick-action:hover {
    text-decoration: none;
    color: var(--ink);
    background: var(--ice-surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.quick-action .qa-label {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    line-height: 1;
    color: var(--line-blue);
}

.quick-action .qa-count {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-top: 6px;
    font-family: var(--font-display);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quick-action--train {
    background: var(--line-red);
    border-color: var(--line-red);
    color: #fff;
    box-shadow: 0 4px 16px rgba(200, 16, 46, 0.25);
}

.quick-action--train .qa-label { color: #fff; }
.quick-action--train .qa-count { color: rgba(255, 255, 255, 0.85); }

.quick-action--train:hover {
    color: #fff;
    background: var(--line-red-dim);
}

.quick-action--train .qa-icon { color: rgba(255, 255, 255, 0.9); }

.streak-banner {
    background: var(--warn-bg);
    border: 1px solid var(--warn);
    border-left: 4px solid var(--line-red);
    color: #7c3d0a;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.streak-banner a { font-weight: 700; color: var(--line-red-dim); text-decoration: none; }
.streak-banner a:hover { text-decoration: underline; }

.challenge-card {
    border-left: 4px solid var(--ice-blue);
    margin-bottom: 14px;
}

.challenge-card.complete {
    border-left-color: var(--success);
    background: var(--success-bg);
}

.challenge-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.challenge-icon { color: var(--line-red); flex-shrink: 0; display: flex; }

.resume-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-left: 4px solid var(--line-red);
    margin-bottom: 14px;
    background: #fff;
}

.resume-card:hover {
    text-decoration: none;
    color: inherit;
    background: var(--ice-surface);
}

.resume-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--line-red);
    margin-bottom: 4px;
}

.team-snapshot {
    border: 1px solid var(--border);
    border-top: 4px solid var(--line-blue);
    margin-bottom: 14px;
    background: #fff;
}

.event-feed { margin-bottom: 18px; }

.event-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.85rem;
}

.event-item:last-child { border-bottom: none; }

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line-red);
    margin-top: 6px;
    flex-shrink: 0;
}

.event-time {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-top: 2px;
}

.stat-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.stat-row .stat-card {
    flex: 1 0 100px;
    min-width: 100px;
}

.stat-card .stat-value {
    text-shadow: none;
}

.setup-banner {
    background: var(--warn-bg);
    border: 1px solid var(--warn);
    color: #7c3d0a;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.setup-banner a { font-weight: 600; color: var(--line-red-dim); }

/* —— Guides —— */
.guide-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--line-red);
    position: relative;
    border-top: 2px dashed var(--border);
}

.guide-card::before {
    content: attr(data-section);
    font-family: var(--font-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    display: block;
    margin-bottom: 8px;
}

.guide-card:hover {
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.guide-card.completed { border-left-color: var(--success); }

.guide-card .snippet-preview {
    font-size: 0.84rem;
    color: var(--ink-muted);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.guide-content { font-size: 0.95rem; line-height: 1.75; }
.guide-content p { margin-bottom: 12px; }

.guide-expand {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    color: var(--ink-muted);
    font-size: 0.88rem;
}

/* —— Quiz —— */
.quiz-question { margin-bottom: 20px; }

.quiz-question h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.quiz-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    min-height: 44px;
    background: #fff;
    transition: background 0.1s, border-color 0.1s;
}

.quiz-options label:has(input:checked) {
    background: var(--ice-surface);
    color: var(--line-blue);
    border-color: var(--line-blue);
    box-shadow: inset 0 0 0 1px var(--line-blue);
}

.quiz-options input { accent-color: var(--line-red); }

.quiz-result { text-align: center; padding: 20px 14px; }

.quiz-result .score-big {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--line-red);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* —— Training tabs —— */
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.tab-btn {
    padding: 11px;
    border: none;
    background: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 44px;
    color: var(--ink-muted);
    border-right: 1px solid var(--border);
}

.tab-btn:last-child { border-right: none; }

.tab-btn.active {
    background: var(--ice-surface);
    color: var(--line-blue);
    box-shadow: inset 0 -3px 0 var(--line-red);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* —— Chart —— */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 110px;
    padding: 8px 0;
    border-bottom: 2px solid var(--line-blue);
}

.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 28px;
    background: linear-gradient(180deg, var(--ice-blue-bright), var(--line-blue));
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: height 0.3s;
}

.chart-bar-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

.chart-bar-value {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ink);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.stat-card {
    background: #fff;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--line-blue);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.62rem;
    color: var(--ink-muted);
    margin-top: 4px;
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* —— Skills —— */
.skill-category { margin-bottom: 18px; }

.skill-category h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 5px;
}

.skill-item .skill-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.skill-item .skill-desc {
    font-size: 0.76rem;
    color: var(--ink-muted);
    margin-top: 2px;
}

.skill-status-btns { display: flex; gap: 3px; flex-shrink: 0; }

.skill-status-btn {
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--rink-ice);
    font-family: var(--font-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 30px;
    color: var(--ink-muted);
}

.skill-status-btn.active-learning { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.skill-status-btn.active-practiced { background: #e4eef8; border-color: #4a7ab0; color: #1a4a7a; }
.skill-status-btn.active-mastered { background: var(--success-bg); border-color: var(--success); color: var(--success); }

.skill-item.skill-highlight {
    border-color: var(--ice-blue);
    background: rgba(126, 184, 216, 0.12);
    box-shadow: inset 3px 0 0 var(--ice-blue);
}

/* —— Achievements —— */
.achievement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.achievement-card { text-align: center; padding: 14px 8px; }

.achievement-card .icon {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line-red);
}

.achievement-card .icon svg { filter: saturate(0.95); }

.achievement-card .name {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.achievement-card .desc {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.achievement-card.locked { opacity: 0.35; filter: grayscale(1); }

/* —— Glossary —— */
.search-box { margin-bottom: 14px; }

.search-box input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    font-family: var(--font-body);
    background: #fff;
}

.glossary-item .term {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.glossary-item .definition {
    font-size: 0.86rem;
    color: var(--ink-muted);
    margin-top: 4px;
}

/* —— Profile —— */
.profile-header {
    text-align: center;
    padding: 16px 0 20px;
    border-bottom: 2px solid var(--line-blue);
    margin-bottom: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ice-surface);
    color: var(--line-blue);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 3px solid var(--line-red);
    box-shadow: var(--shadow-soft);
}

.menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    color: var(--ink);
    text-decoration: none;
    min-height: 44px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-soft);
}

.menu-list a:hover {
    background: var(--ice-surface);
    border-color: var(--line-blue);
    text-decoration: none;
    color: var(--ink);
}

.menu-list a.menu-logout {
    color: var(--line-red);
    border-color: var(--line-red);
    box-shadow: none;
}

/* —— Modal —— */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 90, 138, 0.35);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.modal {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 4px solid var(--line-red);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    max-width: 300px;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.modal .modal-icon {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line-red);
}

.modal h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

/* —— Auth —— */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 14px;
    background: transparent;
}

.auth-brand .brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-brand .brand-logo-icon {
    color: var(--line-red);
    display: flex;
}

.auth-page .card {
    background: #fff;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
    color: var(--ink);
}

.auth-brand .brand-title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--line-blue);
}

.auth-brand .brand-title em {
    font-style: normal;
    color: var(--line-red);
    display: block;
    font-size: 1rem;
    letter-spacing: 0.35em;
    margin-top: 6px;
}

.auth-brand p {
    color: var(--ink-muted);
    margin-top: 10px;
    font-size: 0.88rem;
}

.auth-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.88rem;
    color: var(--ink-muted);
}

.auth-footer a { color: var(--line-blue); font-weight: 600; }

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-muted);
}

.empty-state h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 8px;
}

.level-locked { opacity: 0.65; }

.level-section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 4px solid var(--line-red);
}

.back-link {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    display: inline-block;
    margin-bottom: 12px;
}

.back-link:hover { color: var(--line-red); text-decoration: none; }

/* —— Admin —— */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.admin-table th,
.admin-table td {
    padding: 7px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    background: var(--line-blue);
    color: #fff;
}

.admin-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.team-code {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 14px;
    background: var(--ice-surface);
    color: var(--line-blue);
    border: 2px dashed var(--line-blue);
    border-radius: var(--radius);
    margin: 12px 0;
}

.roster-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.roster-item:last-child { border-bottom: none; }

.header-team-pill {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 7px;
    border: 1px solid var(--line-blue);
    border-radius: 4px;
    color: var(--line-blue);
    background: var(--ice-surface);
    text-decoration: none;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-team-pill:hover {
    background: var(--line-blue);
    text-decoration: none;
    color: #fff;
}

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--line-blue);
    text-decoration: none;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--line-red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.home-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.home-tab {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--ice-surface);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    cursor: pointer;
}

.home-tab.active {
    background: var(--line-blue);
    border-color: var(--line-blue);
    color: #fff;
}

.home-tab-panel { display: none; }
.home-tab-panel.active { display: block; }

.guide-position-pick {
    border-left: 4px solid var(--line-red);
}

.chart-bars--wide {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.app-toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #fff;
    color: var(--line-blue);
    padding: 10px 18px;
    border: 2px solid var(--line-blue);
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    z-index: 300;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(30, 90, 138, 0.15);
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 481px) {
    body { background: linear-gradient(180deg, #9ccce8 0%, #c5e4f5 50%, #dceef8 100%); }
    .app-shell {
        box-shadow: 0 8px 40px rgba(30, 90, 138, 0.2);
    }
}

/* —— Team chat —— */
.team-chat-page {
    display: flex;
    flex-direction: column;
    margin: -8px -4px 0;
    min-height: calc(100dvh - var(--header-height) - var(--nav-height) - 24px);
    max-height: calc(100dvh - var(--header-height) - var(--nav-height) - 24px);
}

.team-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 12px;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.team-chat-back {
    color: var(--line-blue);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
}

.team-chat-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.team-chat-subtitle {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin: 0;
}

.chat-pinned {
    background: var(--warn-bg);
    border-bottom: 2px solid var(--warn);
    padding: 8px 12px;
    flex-shrink: 0;
}

.chat-pinned-inner {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
}

.chat-pinned-label {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--warn);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.chat-pinned-text {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.chat-loading,
.chat-empty {
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
    padding: 24px 12px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
}

.chat-msg-own {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg-other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-msg-center {
    align-self: center;
    max-width: 95%;
    width: 100%;
}

.chat-msg-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 2px;
    padding: 0 4px;
}

.chat-bubble {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.chat-msg-own .chat-bubble {
    background: var(--ice-shimmer);
    border-color: var(--ice-blue);
}

.chat-text {
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-text .chat-emoji-char {
    font-size: 1.15em;
}

.chat-mention {
    color: var(--line-blue);
    font-weight: 600;
}

.chat-time {
    font-size: 0.65rem;
    color: var(--ink-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-image {
    max-width: 100%;
    max-height: 240px;
    border-radius: 4px;
    display: block;
}

.chat-card {
    font-size: 0.88rem;
}

.chat-card-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--line-red);
    margin-bottom: 4px;
}

.chat-card-meta {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin: 4px 0;
}

.chat-card-progress {
    margin: 8px 0 4px;
    height: 8px;
}

.chat-card-link {
    margin-top: 8px;
    display: inline-block;
}

.chat-msg-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    padding: 0 2px;
}

.chat-action-btn {
    background: none;
    border: none;
    font-size: 0.65rem;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
}

.chat-action-delete {
    color: var(--line-red);
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 4px 4px;
    border-top: 2px solid var(--border);
    background: var(--ice-white);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: #fff;
    color: var(--line-blue);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-input-wrap {
    flex: 1;
    min-width: 0;
}

.chat-input-wrap textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    background: #fff;
    color: var(--ink);
}

.chat-send-btn {
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius);
    background: var(--line-blue);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-mention-menu {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-height) + 70px);
    width: calc(100% - 32px);
    max-width: calc(var(--max-width) - 32px);
    background: #fff;
    border: 2px solid var(--line-blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    z-index: 200;
    max-height: 160px;
    overflow-y: auto;
}

.chat-mention-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 0.88rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.chat-mention-item:last-child {
    border-bottom: none;
}

.chat-mention-item:hover {
    background: var(--ice-shimmer);
}

.header-team-pill {
    position: relative;
}

.chat-unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--line-red);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.team-chat-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.team-chat-entry-btn {
    position: relative;
    flex: 1;
}

.team-chat-entry-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--line-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab {
    position: fixed;
    right: max(16px, calc(50% - var(--max-width) / 2 + 16px));
    bottom: calc(var(--nav-height) + 16px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--line-blue);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(30, 90, 138, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 150;
    transition: transform 0.15s;
}

.chat-fab:active {
    transform: scale(0.95);
}

.chat-fab-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.chat-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--line-red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.chat-emoji-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-emoji-picker {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-height) + 70px);
    width: calc(100% - 24px);
    max-width: calc(var(--max-width) - 24px);
    background: #fff;
    border: 2px solid var(--line-blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    z-index: 210;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    max-height: 160px;
    overflow-y: auto;
}

.chat-emoji-item {
    border: none;
    background: none;
    font-size: 1.35rem;
    line-height: 1.2;
    padding: 6px 2px;
    cursor: pointer;
    border-radius: 4px;
}

.chat-emoji-item:hover {
    background: var(--ice-shimmer);
}

