/* =========================================================
   MATHFORGE FULL STYLE.CSS — CLEAN REPLICA
========================================================= */

/* =====================
   GLOBAL RESET
===================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.35), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.35), transparent 35%),
        linear-gradient(135deg, #020617, #0f172a);
}

main {
    padding: 30px;
}

a {
    color: inherit;
}

/* =====================
   NAVBAR
===================== */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 30px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    justify-content: center;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: white;
}

.theme-select {
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background: white;
    color: #0f172a;
}

/* Dropdown */

.more-menu {
    position: relative;
}

.more-menu summary {
    list-style: none;
    color: #cbd5e1;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.more-menu summary::-webkit-details-marker {
    display: none;
}

.more-menu summary:hover {
    color: white;
}

.more-dropdown {
    position: absolute;
    top: 34px;
    right: 0;
    min-width: 230px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    display: grid;
    gap: 6px;
}

.more-dropdown a {
    padding: 11px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: bold;
}

.more-dropdown a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* =====================
   BUTTONS
===================== */

.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    padding: 13px 18px;
    border-radius: 15px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.3);
}

.btn.secondary {
    background: linear-gradient(135deg, #059669, #0ea5e9);
}

.btn.dark {
    background: rgba(255,255,255,0.12);
}

.disabled-btn,
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* =====================
   SHARED CARDS / LAYOUT
===================== */

.card,
.arena-card,
.battle-card,
.result-card,
.dash-card,
.tracker-box,
.shop-card,
.battle-summary-panel,
.fighter-card,
.timer-box,
.boss-answer-box,
.mission-card,
.skill-node,
.mode-card,
.mastery-card,
.cosmetic-card,
.streak-main-card,
.streak-side-card,
.coach-main-card,
.coach-side-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
}

.card {
    padding: 25px;
    border-radius: 24px;
    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.13);
}

.clickable-card {
    text-decoration: none;
    color: white;
}

.card h3 {
    margin-bottom: 10px;
    color: white;
}

.card p {
    color: #cbd5e1;
    line-height: 1.6;
}

.page-header {
    max-width: 1000px;
    margin: 50px auto 35px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 12px;
}

.page-header p {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
}

.player-pill {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.15);
    font-weight: bold;
    color: white;
}

.centered-stats {
    justify-content: center;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* =====================
   HOME PAGE — CLEAN FINAL
===================== */

.home-pro,
.home-pro * {
    box-sizing: border-box;
}

.home-pro {
    max-width: 1100px;
    margin: 0 auto;
    padding: 34px 20px 80px;
}

.home-pro-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 340px;
    gap: 22px;
    align-items: stretch;
}

.home-pro-main,
.home-pro-profile,
.home-pro-plan-card,
.home-pro-tools,
.home-pro-box {
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
    backdrop-filter: blur(14px);
}

.home-pro-main {
    min-height: 350px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 40%),
        rgba(255,255,255,0.08);
}

.home-pro-pill {
    width: fit-content;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-weight: 900;
    font-size: 0.88rem;
}

.home-pro-main h1 {
    max-width: 650px;
    color: white;
    font-size: clamp(2.6rem, 4vw, 3.9rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    margin-bottom: 16px;
}

.home-pro-main p {
    max-width: 610px;
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.65;
}

.home-pro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.home-pro-profile {
    min-height: 350px;
    padding: 24px;
    display: grid;
    gap: 16px;
    align-content: space-between;
    position: relative;
    overflow: hidden;
}

.home-pro-profile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.26), transparent 42%);
    pointer-events: none;
}

.home-pro-avatar,
.home-pro-profile-text,
.home-pro-stat-row,
.home-pro-profile-btn {
    position: relative;
    z-index: 1;
}

.home-pro-avatar {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255,255,255,0.18);
    font-size: 2.75rem;
}

.home-pro-profile-text span {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    color: white;
    font-size: 0.8rem;
    font-weight: 900;
}

.home-pro-profile-text h2 {
    color: white;
    font-size: 1.55rem;
    line-height: 1.1;
    margin-bottom: 6px;
}

.home-pro-profile-text p {
    color: #e2e8f0;
    font-weight: 900;
}

.home-pro-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.home-pro-stat-row div {
    padding: 14px;
    border-radius: 17px;
    background: rgba(255,255,255,0.16);
}

.home-pro-stat-row strong {
    display: block;
    color: white;
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 6px;
}

.home-pro-stat-row span {
    color: #e2e8f0;
    font-size: 0.84rem;
    font-weight: 900;
}

.home-pro-profile-btn {
    display: block;
    text-align: center;
    padding: 13px 15px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    color: white;
    text-decoration: none;
    font-weight: 900;
    transition: 0.2s ease;
}

.home-pro-profile-btn:hover {
    background: rgba(15, 23, 42, 0.94);
    transform: translateY(-2px);
}

.home-pro-plan-card,
.home-pro-tools {
    margin-top: 22px;
    padding: 28px;
}

.home-pro-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 20px;
}

.home-pro-section-head span {
    display: inline-block;
    margin-bottom: 7px;
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-pro-section-head h2 {
    color: white;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

.home-pro-section-head p {
    color: #cbd5e1;
    margin-top: 5px;
    line-height: 1.5;
}

.home-pro-section-head a {
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.home-pro-tasks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.home-pro-task {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.095);
    text-decoration: none;
    transition: 0.2s ease;
}

.home-pro-task:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.13);
}

.home-pro-task-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    font-size: 1.7rem;
}

.home-pro-task span {
    color: #bfdbfe;
    font-size: 0.78rem;
    font-weight: 900;
}

.home-pro-task h3 {
    color: white;
    font-size: 1rem;
    line-height: 1.2;
    margin-top: 4px;
}

.home-pro-bento {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    grid-template-areas:
        "train improve progress"
        "train rewards rewards";
    gap: 15px;
}

.home-pro-box {
    padding: 20px;
    border-radius: 26px;
    box-shadow: none;
}

.home-pro-box:nth-child(1) {
    grid-area: train;
}

.home-pro-box:nth-child(2) {
    grid-area: improve;
}

.home-pro-box:nth-child(3) {
    grid-area: progress;
}

.home-pro-box:nth-child(4) {
    grid-area: rewards;
}

.home-pro-box-large {
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.15), rgba(255,255,255,0.08));
}

.home-pro-box-rewards {
    background:
        linear-gradient(180deg, rgba(250, 204, 21, 0.13), rgba(255,255,255,0.08));
}

.home-pro-box-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.home-pro-box-title div {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255,255,255,0.12);
    font-size: 1.55rem;
}

.home-pro-box-title h3 {
    color: white;
    font-size: 1.18rem;
}

.home-pro-links {
    display: grid;
    gap: 10px;
}

.home-pro-box-rewards .home-pro-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-pro-links a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 14px;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.30);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    text-align: center;
    text-decoration: none;
    font-weight: 900;
    line-height: 1.2;
    transition: 0.2s ease;
}

.home-pro-links a:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.14);
    color: white;
}

/* =====================
   OLD HERO/FALLBACK HOME
===================== */

.hero {
    max-width: 1150px;
    margin: 60px auto;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 30px;
    align-items: center;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 22px;
}

.hero p {
    font-size: 1.2rem;
    color: #cbd5e1;
    line-height: 1.7;
    max-width: 650px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
}

.hero-card {
    padding: 35px;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.35);
}

.hero-emoji {
    font-size: 5rem;
    margin-bottom: 18px;
}

.hero-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.hero .button-row {
    justify-content: flex-start;
}

.features {
    max-width: 1150px;
    margin: 30px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}

/* =====================
   ARENAS
===================== */

.arena-grid {
    max-width: 1150px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.arena-card {
    padding: 28px;
    border-radius: 26px;
    text-align: center;
    transition: 0.25s ease;
}

.arena-card:hover {
    transform: translateY(-7px);
    background: rgba(255,255,255,0.13);
}

.arena-emoji {
    font-size: 3.3rem;
    margin-bottom: 14px;
}

.arena-card h2 {
    color: white;
    margin-bottom: 10px;
}

.arena-card p {
    color: #cbd5e1;
    line-height: 1.6;
    min-height: 72px;
}

.arena-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* =====================
   BATTLE PAGE
===================== */

.battle-card {
    max-width: 920px;
    margin: 50px auto;
    padding: 32px;
    border-radius: 28px;
}

.battle-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #cbd5e1;
    font-weight: bold;
    margin-bottom: 18px;
}

.difficulty-pill {
    display: inline-block;
    margin: 10px 0 18px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: bold;
}

.boss-stage {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: center;
    margin: 22px 0;
}

.fighter-card {
    border-radius: 22px;
    padding: 20px;
    text-align: center;
}

.fighter-avatar {
    font-size: 3rem;
    margin-bottom: 10px;
}

.versus {
    font-size: 1.5rem;
    font-weight: bold;
    color: #facc15;
}

.hp-label {
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 0.9rem;
    margin: 12px 0 6px;
}

.hp-bar,
.timer-bar,
.boss-answer-bar,
.bar,
.mission-bar,
.mastery-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
}

.hp-fill,
#timer-fill,
#boss-answer-fill,
.fill,
.mission-fill,
.mastery-fill {
    height: 100%;
    border-radius: 999px;
}

.player-hp {
    background: linear-gradient(90deg, #22c55e, #84cc16);
}

.boss-hp {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.battle-event,
.boss-banner {
    margin: 18px 0;
    padding: 15px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-weight: bold;
    text-align: center;
}

.powerup-panel {
    margin: 22px 0;
    padding: 18px;
    border-radius: 20px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.28);
}

.powerup-panel h3 {
    margin-bottom: 12px;
}

.powerup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.powerup-btn {
    border: none;
    cursor: pointer;
    padding: 10px 13px;
    border-radius: 14px;
    font-weight: bold;
    background: rgba(255,255,255,0.12);
    color: white;
    transition: 0.2s ease;
}

.powerup-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

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

.powerup-btn span {
    margin-left: 5px;
    color: #bfdbfe;
}

.active-power {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-weight: bold;
}

.timer-box {
    padding: 16px;
    border-radius: 18px;
    margin: 20px 0;
}

.timer-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

#timer-fill {
    width: 100%;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    transition: width 0.3s ease;
}

#timer-fill.danger {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.danger-text {
    color: #f87171;
}

.boss-answer-box {
    padding: 15px;
    border-radius: 18px;
    margin: 18px 0;
}

#boss-answer-fill {
    width: 100%;
    background: linear-gradient(90deg, #facc15, #ef4444);
    animation-name: bossThinking;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes bossThinking {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.frozen-box {
    color: #bfdbfe;
    font-weight: bold;
}

.battle-card h2 {
    font-size: 1.8rem;
    margin: 25px 0 18px;
}

.answers {
    display: grid;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.2s ease;
}

.answer-option:hover {
    background: rgba(255,255,255,0.14);
}

.answer-option input {
    transform: scale(1.2);
}

.submit-btn {
    margin-top: 12px;
}

/* Combo */

.combo-box {
    margin: 18px 0;
    padding: 16px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.28);
}

.combo-box div {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    text-align: center;
}

.combo-box span {
    display: block;
    color: #cbd5e1;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.combo-box strong {
    display: block;
    color: #facc15;
    font-size: 1.2rem;
}

/* =====================
   RESULT PAGE
===================== */

.result-layout {
    max-width: 1200px;
    margin: 60px auto;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.result-card {
    padding: 32px;
    border-radius: 28px;
    text-align: center;
}

.result-title {
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.result-title.win {
    color: #22c55e;
}

.result-title.lose {
    color: #f97316;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 22px 0;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.result-stats div {
    padding: 15px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
}

.result-stats h3 {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.result-stats p {
    font-weight: bold;
    font-size: 1.2rem;
}

.battle-grade-card {
    margin: 24px auto;
    padding: 20px;
    border-radius: 22px;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    background: rgba(168, 85, 247, 0.16);
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.grade-badge {
    min-width: 90px;
    height: 90px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    font-weight: bold;
    background: linear-gradient(135deg, #38bdf8, #a855f7, #ec4899);
    color: white;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.35);
}

.battle-grade-card h3 {
    margin-bottom: 8px;
    color: white;
}

.battle-grade-card p {
    color: #cbd5e1;
    line-height: 1.5;
}

.battle-summary-panel {
    padding: 28px;
    border-radius: 26px;
}

.battle-summary-panel h2 {
    color: white;
    margin-bottom: 12px;
}

.battle-summary-panel h3 {
    margin: 22px 0 12px;
    color: #bfdbfe;
}

.battle-summary-panel p {
    color: #cbd5e1;
    line-height: 1.6;
}

.summary-tip,
.summary-moment {
    padding: 14px;
    margin: 10px 0;
    border-radius: 14px;
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
}

.diamond-win {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.28);
    font-weight: bold;
}

.centered-review {
    max-width: 1000px;
    margin: 20px auto 80px;
}

.explanation-list h3 {
    margin-bottom: 18px;
}

.review-item {
    margin: 14px 0;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.review-item.correct {
    border-color: rgba(34,197,94,0.4);
}

.review-item.wrong {
    border-color: rgba(239,68,68,0.4);
}

.review-item h4 {
    margin-bottom: 10px;
}

.review-item p {
    color: #cbd5e1;
    margin: 7px 0;
    line-height: 1.5;
}

/* =====================
   DASHBOARD / TRACKER
===================== */

.dashboard-grid {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.dash-card {
    padding: 24px;
    border-radius: 22px;
    text-align: center;
}

.dash-card h3 {
    color: #cbd5e1;
    margin-bottom: 10px;
}

.dash-card p {
    font-size: 1.4rem;
    font-weight: bold;
}

.tracker-box {
    max-width: 900px;
    margin: 35px auto;
    padding: 28px;
    border-radius: 24px;
}

.tracker-box h2,
.tracker-box h3 {
    margin-bottom: 12px;
}

.tracker-box p {
    color: #cbd5e1;
    margin: 8px 0;
}

.skill-row {
    margin: 18px 0;
}

.skill-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: #e2e8f0;
    font-weight: bold;
}

.fill {
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
}

/* =====================
   SHOP / REVIVE
===================== */

.shop-grid {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.shop-card {
    padding: 26px;
    border-radius: 24px;
    text-align: center;
    transition: 0.3s ease;
}

.shop-card:hover {
    transform: translateY(-7px);
    background: rgba(255,255,255,0.13);
}

.shop-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
}

.shop-card h2 {
    color: white;
    margin-bottom: 10px;
}

.shop-card p {
    color: #cbd5e1;
    line-height: 1.5;
    min-height: 70px;
}

.shop-info {
    margin: 18px 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: bold;
    color: #e0f2fe;
}

.revive-card {
    max-width: 720px;
    margin: 80px auto;
    padding: 40px;
    border-radius: 28px;
    text-align: center;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.revive-card h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.revive-stats {
    margin: 25px 0;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
}

.revive-text {
    color: #cbd5e1;
    margin-bottom: 25px;
}

/* =====================
   SKILL TREE
===================== */

.skill-tree-wrapper {
    max-width: 1150px;
    margin: 30px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-node {
    position: relative;
    padding: 26px;
    border-radius: 28px;
    transition: 0.25s ease;
    overflow: hidden;
}

.skill-node::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
}

.skill-node.unlocked::before {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.skill-node.mastered::before {
    background: linear-gradient(135deg, #22c55e, #facc15);
    opacity: 0.18;
}

.skill-node.locked {
    opacity: 0.62;
    filter: grayscale(0.4);
}

.skill-node:hover {
    transform: translateY(-7px);
}

.skill-node-top {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.skill-node-emoji {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    font-size: 2.3rem;
    background: rgba(255,255,255,0.11);
}

.skill-node h2 {
    color: white;
    font-size: 1.4rem;
}

.node-arena {
    color: #93c5fd;
    font-weight: bold;
    margin-top: 4px;
}

.node-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.node-status-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.node-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: bold;
}

.node-status.locked {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.node-status.unlocked {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.node-status.mastered {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
}

.node-requirement {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.node-progress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
    position: relative;
    z-index: 1;
}

.node-progress div {
    padding: 14px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255,255,255,0.08);
}

.node-progress strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.node-progress span {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.locked-message {
    padding: 14px;
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-weight: bold;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* =====================
   MISSIONS
===================== */

.missions-grid {
    max-width: 1150px;
    margin: 30px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.mission-card {
    padding: 26px;
    border-radius: 26px;
    transition: 0.25s ease;
}

.mission-card:hover {
    transform: translateY(-6px);
}

.mission-card.completed {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 35px rgba(34, 197, 94, 0.12);
}

.mission-card.claimed {
    opacity: 0.7;
}

.mission-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.mission-emoji {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 2rem;
    background: rgba(255,255,255,0.11);
}

.mission-card h2 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 7px;
}

.mission-card p {
    color: #cbd5e1;
    line-height: 1.5;
}

.mission-progress-row {
    display: flex;
    justify-content: space-between;
    margin: 16px 0 8px;
    color: #e2e8f0;
    font-weight: bold;
}

.mission-fill {
    background: linear-gradient(90deg, #22c55e, #38bdf8);
}

.mission-rewards {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 0;
    padding: 13px;
    border-radius: 15px;
    background: rgba(255,255,255,0.08);
    color: #e0f2fe;
    font-weight: bold;
}

/* =====================
   STREAKS
===================== */

.streak-layout {
    max-width: 1100px;
    margin: 35px auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: stretch;
}

.streak-main-card,
.streak-side-card {
    padding: 34px;
    border-radius: 30px;
    text-align: center;
}

.streak-flame {
    font-size: 5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.35));
}

.streak-main-card h2 {
    font-size: 3rem;
    margin-bottom: 8px;
}

.streak-main-card p,
.streak-side-card p {
    color: #cbd5e1;
    line-height: 1.6;
}

.streak-status {
    margin: 24px auto;
    padding: 16px;
    border-radius: 18px;
    font-weight: bold;
}

.streak-status.active {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.32);
    color: #bbf7d0;
}

.streak-status.inactive {
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #fed7aa;
}

.streak-reward-box {
    margin: 24px 0;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
}

.streak-reward-box h3 {
    margin-bottom: 8px;
}

.milestone-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
}

.streak-side-card h2 {
    margin-bottom: 18px;
}

.streak-side-card h3 {
    margin-bottom: 10px;
}

.milestone-rewards {
    margin-top: 22px;
    display: grid;
    gap: 12px;
}

.milestone-rewards span {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    font-weight: bold;
    color: #e0f2fe;
}

.streak-tips {
    max-width: 1100px;
    margin: 45px auto 80px;
}

.streak-tips h2 {
    text-align: center;
    margin-bottom: 22px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

/* =====================
   WEAKNESS COACH
===================== */

.coach-layout {
    max-width: 1150px;
    margin: 35px auto;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
    align-items: start;
}

.coach-main-card,
.coach-side-card {
    padding: 32px;
    border-radius: 30px;
}

.coach-badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
    font-weight: bold;
}

.coach-main-card h2,
.coach-side-card h2 {
    margin-bottom: 12px;
    color: white;
}

.coach-main-card p,
.coach-side-card p {
    color: #cbd5e1;
    line-height: 1.6;
}

.coach-stats-grid {
    margin: 24px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.coach-stats-grid div {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
}

.coach-stats-grid span {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 7px;
}

.coach-stats-grid strong {
    color: white;
    font-size: 1.1rem;
}

.coach-plan {
    margin: 28px 0;
}

.coach-plan h3 {
    margin-bottom: 14px;
}

.coach-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 12px 0;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
}

.coach-step span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.coach-step p {
    margin: 0;
}

.focus-area-card {
    margin: 16px 0;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
}

.focus-area-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.focus-area-top strong {
    color: white;
}

.focus-area-top span {
    color: #facc15;
    font-weight: bold;
}

.focus-area-card p {
    margin: 10px 0;
    font-size: 0.95rem;
}

.focus-area-card a {
    color: #93c5fd;
    font-weight: bold;
    text-decoration: none;
}

/* =====================
   MODES + REVIEW ROOM
===================== */

.modes-grid {
    max-width: 1100px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.mode-card {
    padding: 30px;
    border-radius: 28px;
    text-align: center;
    transition: 0.25s ease;
}

.mode-card:hover {
    transform: translateY(-7px);
    background: rgba(255,255,255,0.13);
}

.mode-emoji {
    font-size: 3.5rem;
    margin-bottom: 14px;
}

.mode-card h2 {
    color: white;
    margin-bottom: 10px;
}

.mode-card p {
    color: #cbd5e1;
    line-height: 1.6;
    min-height: 80px;
}

.mode-pill {
    display: inline-block;
    margin: 15px 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
    font-weight: bold;
}

.no-timer-box {
    text-align: center;
    color: #bfdbfe;
    font-weight: bold;
}

/* =====================
   SKILL MASTERY
===================== */

.mastery-summary-grid {
    max-width: 1100px;
    margin: 25px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
}

.mastery-summary-card {
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
}

.mastery-summary-card h3 {
    color: #cbd5e1;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.mastery-summary-card p {
    color: white;
    font-weight: bold;
    font-size: 1.4rem;
}

.mastery-grid {
    max-width: 1150px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
}

.mastery-card {
    padding: 28px;
    border-radius: 28px;
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.mastery-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
}

.mastery-card.level-1::before {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.mastery-card.level-2::before {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.mastery-card.level-3::before {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
}

.mastery-card.level-4::before {
    background: linear-gradient(135deg, #22c55e, #84cc16);
}

.mastery-card.level-5::before {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

.mastery-card.level-6::before {
    background: linear-gradient(135deg, #facc15, #f97316);
}

.mastery-card.level-7::before {
    background: linear-gradient(135deg, #facc15, #ec4899, #8b5cf6);
    opacity: 0.2;
}

.mastery-card:hover {
    transform: translateY(-7px);
}

.mastery-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.mastery-emoji {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255,255,255,0.11);
    font-size: 2.2rem;
}

.mastery-top h2 {
    color: white;
    font-size: 1.35rem;
    margin-bottom: 4px;
}

.mastery-top p {
    color: #bfdbfe;
    font-weight: bold;
}

.mastery-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.mastery-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
    position: relative;
    z-index: 1;
}

.mastery-stats div {
    padding: 13px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255,255,255,0.08);
}

.mastery-stats span {
    display: block;
    color: #cbd5e1;
    font-size: 0.82rem;
    margin-bottom: 5px;
}

.mastery-stats strong {
    color: white;
    font-size: 1.15rem;
}

.mastery-progress-row {
    display: flex;
    justify-content: space-between;
    margin: 16px 0 8px;
    color: #e2e8f0;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.mastery-fill {
    background: linear-gradient(90deg, #38bdf8, #a855f7, #facc15);
}

.mastery-goal {
    margin: 16px 0;
    color: #cbd5e1;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.empty-state-card {
    max-width: 700px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
    border-radius: 28px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.empty-state-card h2 {
    margin-bottom: 12px;
}

.empty-state-card p {
    color: #cbd5e1;
    margin-bottom: 22px;
}

/* =====================
   DAILY PLAN
===================== */

.daily-plan-preview,
.daily-plan-hero,
.daily-plan-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
}

.daily-plan-preview {
    max-width: 1150px;
    margin: 35px auto;
    padding: 28px;
    border-radius: 30px;
}

.daily-plan-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.daily-plan-preview-header h2 {
    color: white;
    margin-bottom: 6px;
}

.daily-plan-preview-header p {
    color: #cbd5e1;
    line-height: 1.5;
}

.daily-plan-preview-grid,
.daily-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.daily-preview-card,
.daily-plan-card {
    text-decoration: none;
    color: white;
    padding: 22px;
    border-radius: 24px;
    transition: 0.25s ease;
}

.daily-preview-card {
    display: flex;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

.daily-preview-card:hover,
.daily-plan-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.13);
}

.daily-plan-hero {
    max-width: 1050px;
    margin: 35px auto;
    padding: 34px;
    border-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
}

.daily-plan-hero h2,
.daily-plan-card h2 {
    color: white;
}

.daily-plan-hero p,
.daily-plan-card p,
.daily-preview-card p {
    color: #cbd5e1;
    line-height: 1.6;
}

.daily-plan-grid {
    max-width: 1150px;
    margin: 35px auto 60px;
}

.daily-plan-top {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.daily-plan-emoji {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 2rem;
    background: rgba(255,255,255,0.11);
    flex-shrink: 0;
}

.daily-plan-card span,
.daily-preview-card span {
    color: #bfdbfe;
    font-weight: bold;
}

.daily-plan-bottom {
    max-width: 1050px;
    margin: 30px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* =====================
   COSMETIC SHOP
===================== */

.shop-message {
    margin: 18px auto 0;
    max-width: 500px;
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    font-weight: bold;
}

.shop-cosmetic-cta {
    max-width: 1050px;
    margin: 28px auto;
    padding: 26px;
    border-radius: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.32);
}

.shop-cosmetic-cta h2 {
    color: white;
    margin-bottom: 8px;
}

.shop-cosmetic-cta p {
    color: #cbd5e1;
}

.profile-preview-wrapper {
    max-width: 900px;
    margin: 30px auto;
}

.profile-showcase {
    padding: 28px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid rgba(255,255,255,0.16);
    box-shadow: 0 22px 70px rgba(0,0,0,0.25);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: rgba(255,255,255,0.18);
    font-size: 3rem;
    flex-shrink: 0;
}

.profile-showcase h2 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.profile-showcase p {
    color: #e2e8f0;
}

.banner-blue {
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
}

.banner-neon {
    background: linear-gradient(135deg, #7c3aed, #0891b2, #0f172a);
}

.banner-sunset {
    background: linear-gradient(135deg, #f97316, #ec4899, #312e81);
}

.banner-gold {
    background: linear-gradient(135deg, #facc15, #f97316, #7c2d12);
}

.frame-basic {
    border-color: rgba(255,255,255,0.16);
}

.frame-ice {
    border-color: #67e8f9;
    box-shadow: 0 0 35px rgba(103, 232, 249, 0.28);
}

.frame-fire {
    border-color: #fb7185;
    box-shadow: 0 0 35px rgba(251, 113, 133, 0.3);
}

.frame-royal {
    border-color: #facc15;
    box-shadow: 0 0 42px rgba(250, 204, 21, 0.35);
}

.cosmetic-section {
    max-width: 1150px;
    margin: 45px auto;
}

.cosmetic-section h2 {
    color: white;
    margin-bottom: 20px;
}

.cosmetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}

.cosmetic-card {
    padding: 26px;
    border-radius: 28px;
    text-align: center;
    transition: 0.25s ease;
}

.cosmetic-card:hover {
    transform: translateY(-7px);
    background: rgba(255,255,255,0.13);
}

.equipped-card {
    border-color: rgba(250, 204, 21, 0.55);
    box-shadow: 0 0 28px rgba(250, 204, 21, 0.2);
}

.cosmetic-emoji {
    font-size: 3.3rem;
    margin-bottom: 12px;
}

.cosmetic-card h3 {
    color: white;
    margin-bottom: 10px;
}

.cosmetic-card p {
    color: #cbd5e1;
    line-height: 1.5;
    min-height: 72px;
    margin: 14px 0;
}

.rarity-pill {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 0.82rem;
}

.rarity-free {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.rarity-rare {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.rarity-epic {
    background: rgba(168, 85, 247, 0.22);
    color: #e9d5ff;
}

.rarity-legendary {
    background: rgba(250, 204, 21, 0.2);
    color: #fef08a;
}

/* =====================
   THEMES
===================== */

body.theme-dark {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.35), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.35), transparent 35%),
        linear-gradient(135deg, #020617, #0f172a);
    color: white;
}

body.theme-light {
    background: linear-gradient(135deg, #f8fafc, #dbeafe);
    color: #0f172a;
}

body.theme-neon {
    background:
        radial-gradient(circle at top left, rgba(236, 72, 153, 0.4), transparent 35%),
        radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.35), transparent 35%),
        linear-gradient(135deg, #020617, #1e1b4b);
    color: white;
}

body.theme-contrast {
    background: #000000;
    color: #ffffff;
}

body.theme-ocean {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.4), transparent 35%),
        radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.25), transparent 35%),
        linear-gradient(135deg, #022c43, #0f172a);
    color: white;
}

/* Light theme cards */

body.theme-light .navbar,
body.theme-light .card,
body.theme-light .arena-card,
body.theme-light .battle-card,
body.theme-light .result-card,
body.theme-light .dash-card,
body.theme-light .battle-summary-panel,
body.theme-light .tracker-box,
body.theme-light .revive-card,
body.theme-light .fighter-card,
body.theme-light .timer-box,
body.theme-light .boss-answer-box,
body.theme-light .shop-card,
body.theme-light .review-item,
body.theme-light .mission-card,
body.theme-light .skill-node,
body.theme-light .mode-card,
body.theme-light .mastery-card,
body.theme-light .mastery-summary-card,
body.theme-light .empty-state-card,
body.theme-light .cosmetic-card,
body.theme-light .shop-cosmetic-cta,
body.theme-light .streak-main-card,
body.theme-light .streak-side-card,
body.theme-light .streak-reward-box,
body.theme-light .coach-main-card,
body.theme-light .coach-side-card,
body.theme-light .coach-stats-grid div,
body.theme-light .coach-step,
body.theme-light .focus-area-card,
body.theme-light .home-pro-main,
body.theme-light .home-pro-plan-card,
body.theme-light .home-pro-tools,
body.theme-light .home-pro-box,
body.theme-light .home-pro-task,
body.theme-light .daily-plan-preview,
body.theme-light .daily-plan-hero,
body.theme-light .daily-plan-card,
body.theme-light .daily-preview-card {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light .nav-brand,
body.theme-light .arena-card h2,
body.theme-light .battle-card h2,
body.theme-light .shop-card h2,
body.theme-light .battle-grade-card h3,
body.theme-light .home-pro-main h1,
body.theme-light .home-pro-section-head h2,
body.theme-light .home-pro-task h3,
body.theme-light .home-pro-box-title h3,
body.theme-light .home-pro-links a,
body.theme-light .mission-card h2,
body.theme-light .skill-node h2,
body.theme-light .mode-card h2,
body.theme-light .mastery-top h2,
body.theme-light .mastery-summary-card p,
body.theme-light .cosmetic-card h3,
body.theme-light .coach-main-card h2,
body.theme-light .coach-side-card h2 {
    color: #0f172a;
}

body.theme-light p,
body.theme-light .nav-links a,
body.theme-light .card p,
body.theme-light .arena-card p,
body.theme-light .battle-summary-panel p,
body.theme-light .tracker-box p,
body.theme-light .shop-card p,
body.theme-light .review-item p,
body.theme-light .home-pro-main p,
body.theme-light .home-pro-section-head p,
body.theme-light .mission-card p,
body.theme-light .node-description,
body.theme-light .node-requirement,
body.theme-light .mode-card p,
body.theme-light .mastery-description,
body.theme-light .mastery-goal,
body.theme-light .cosmetic-card p,
body.theme-light .coach-main-card p,
body.theme-light .coach-side-card p {
    color: #475569;
}

body.theme-light .player-pill,
body.theme-light .boss-banner,
body.theme-light .battle-event,
body.theme-light .answer-option,
body.theme-light .result-stats div,
body.theme-light .revive-stats,
body.theme-light .home-pro-task-icon,
body.theme-light .home-pro-box-title div,
body.theme-light .mission-emoji,
body.theme-light .skill-node-emoji,
body.theme-light .node-progress div,
body.theme-light .mastery-stats div,
body.theme-light .daily-plan-emoji {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .home-pro-pill {
    background: #dbeafe;
    color: #2563eb;
}

body.theme-light .home-pro-links a {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
    color: #334155;
}

body.theme-light .home-pro-links a:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

body.theme-light .more-menu summary {
    color: #475569;
}

body.theme-light .more-menu summary:hover {
    color: #0f172a;
}

body.theme-light .more-dropdown {
    background: rgba(255,255,255,0.98);
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .more-dropdown a {
    color: #475569;
}

body.theme-light .more-dropdown a:hover {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .powerup-panel {
    background: white;
    color: #0f172a;
    border-color: rgba(15,23,42,0.12);
}

body.theme-light .powerup-btn {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .battle-grade-card {
    background: white;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .battle-grade-card p {
    color: #475569;
}

body.theme-light .shop-message {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

/* Contrast theme */

body.theme-contrast .navbar,
body.theme-contrast .card,
body.theme-contrast .arena-card,
body.theme-contrast .battle-card,
body.theme-contrast .result-card,
body.theme-contrast .dash-card,
body.theme-contrast .battle-summary-panel,
body.theme-contrast .tracker-box,
body.theme-contrast .revive-card,
body.theme-contrast .fighter-card,
body.theme-contrast .timer-box,
body.theme-contrast .boss-answer-box,
body.theme-contrast .shop-card,
body.theme-contrast .review-item,
body.theme-contrast .more-dropdown {
    background: #111111;
    color: white;
    border: 2px solid white;
}

body.theme-contrast a,
body.theme-contrast h1,
body.theme-contrast h2,
body.theme-contrast h3,
body.theme-contrast p,
body.theme-contrast .more-menu summary {
    color: white;
}

/* =====================
   RESPONSIVE
===================== */

@media (max-width: 1000px) {
    .home-pro {
        max-width: 880px;
    }

    .home-pro-hero {
        grid-template-columns: 1fr;
    }

    .home-pro-profile {
        min-height: auto;
    }

    .home-pro-tasks {
        grid-template-columns: 1fr;
    }

    .home-pro-bento {
        grid-template-columns: 1fr;
        grid-template-areas:
            "train"
            "improve"
            "progress"
            "rewards";
    }

    .home-pro-box-rewards .home-pro-links {
        grid-template-columns: 1fr;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .result-layout {
        grid-template-columns: 1fr;
    }

    .boss-stage {
        grid-template-columns: 1fr;
    }

    .versus {
        text-align: center;
    }

    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .more-dropdown {
        position: static;
        margin-top: 10px;
        width: 100%;
    }

    .theme-select {
        align-self: center;
    }

    .coach-layout,
    .streak-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .profile-showcase,
    .shop-cosmetic-cta,
    .daily-plan-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 650px) {
    main {
        padding: 18px;
    }

    .home-pro {
        padding: 22px 14px 70px;
    }

    .home-pro-main,
    .home-pro-profile,
    .home-pro-plan-card,
    .home-pro-tools {
        padding: 22px;
        border-radius: 24px;
    }

    .home-pro-main h1 {
        font-size: 2.35rem;
    }

    .home-pro-actions {
        flex-direction: column;
    }

    .home-pro-actions .btn {
        width: 100%;
        text-align: center;
    }

    .home-pro-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-pro-stat-row {
        grid-template-columns: 1fr;
    }

    .battle-grade-card {
        flex-direction: column;
        text-align: center;
    }

    .battle-top {
        flex-direction: column;
    }

    .streak-main-card h2 {
        font-size: 2.3rem;
    }
}

/* =====================
   ACHIEVEMENTS + BADGES
===================== */

.achievement-unlock-banner {
    max-width: 950px;
    margin: 30px auto;
    padding: 28px;
    border-radius: 30px;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.25), transparent 35%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(250, 204, 21, 0.28);
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
}

.achievement-unlock-banner h2 {
    color: white;
    margin-bottom: 18px;
}

.recent-achievement-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.recent-achievement {
    min-width: 180px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.1);
}

.recent-achievement div {
    font-size: 2.8rem;
    margin-bottom: 8px;
}

.recent-achievement strong {
    display: block;
    color: white;
    margin-bottom: 6px;
}

.recent-achievement span {
    color: #fef08a;
    font-weight: bold;
    font-size: 0.9rem;
}

.featured-badge-card {
    max-width: 850px;
    margin: 28px auto;
    padding: 28px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    background:
        linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(168, 85, 247, 0.13)),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(250, 204, 21, 0.25);
    backdrop-filter: blur(14px);
}

.featured-badge-emoji {
    width: 90px;
    height: 90px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: rgba(255,255,255,0.13);
    font-size: 3.2rem;
    flex-shrink: 0;
}

.featured-badge-card span {
    display: inline-block;
    color: #fef08a;
    font-weight: 900;
    margin-bottom: 7px;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.featured-badge-card h2 {
    color: white;
    margin-bottom: 6px;
}

.featured-badge-card p {
    color: #cbd5e1;
    line-height: 1.5;
}

.achievement-grid {
    max-width: 1150px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.achievement-card {
    padding: 26px;
    border-radius: 28px;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
}

.achievement-card.unlocked::before {
    background: linear-gradient(135deg, #facc15, #38bdf8, #a855f7);
}

.achievement-card.locked {
    opacity: 0.58;
    filter: grayscale(0.45);
}

.achievement-card:hover {
    transform: translateY(-7px);
}

.achievement-emoji {
    font-size: 3.4rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.achievement-category {
    display: inline-block;
    margin-bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
    font-weight: 900;
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
}

.achievement-card h2 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.achievement-card p {
    color: #cbd5e1;
    line-height: 1.5;
    min-height: 70px;
    position: relative;
    z-index: 1;
}

.achievement-rewards {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
    position: relative;
    z-index: 1;
}

.achievement-rewards span {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    color: #fef08a;
    font-weight: bold;
    font-size: 0.86rem;
}

.achievement-card form,
.achievement-card button,
.locked-badge-text {
    position: relative;
    z-index: 1;
}

.locked-badge-text {
    padding: 13px;
    border-radius: 15px;
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    font-weight: bold;
}

.home-badge-mini {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-radius: 16px;
    background: rgba(255,255,255,0.16);
    text-decoration: none;
    color: white;
    font-weight: 900;
    transition: 0.2s ease;
}

.home-badge-mini:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.22);
}

.home-badge-mini span {
    font-size: 1.5rem;
}

.home-badge-mini strong {
    font-size: 0.95rem;
}

body.theme-light .achievement-unlock-banner,
body.theme-light .featured-badge-card,
body.theme-light .achievement-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .achievement-unlock-banner h2,
body.theme-light .featured-badge-card h2,
body.theme-light .achievement-card h2 {
    color: #0f172a;
}

body.theme-light .featured-badge-card p,
body.theme-light .achievement-card p {
    color: #475569;
}

body.theme-light .recent-achievement {
    background: #f1f5f9;
}

body.theme-light .recent-achievement strong {
    color: #0f172a;
}

body.theme-light .achievement-rewards span {
    background: #fef9c3;
    color: #854d0e;
}

body.theme-light .locked-badge-text {
    background: #e2e8f0;
    color: #475569;
}

@media (max-width: 700px) {
    .featured-badge-card {
        flex-direction: column;
        text-align: center;
    }
}

/* =====================
   REALISTIC BOSS SYSTEM
===================== */

.boss-personality-panel {
    margin: 24px 0;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.12);
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.13), transparent 34%),
        rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
    position: relative;
    overflow: hidden;
}

.boss-personality-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.13;
    pointer-events: none;
}

.boss-personality-panel.phase-calm::before {
    background: linear-gradient(135deg, #38bdf8, transparent);
}

.boss-personality-panel.phase-angry::before {
    background: linear-gradient(135deg, #f97316, transparent);
}

.boss-personality-panel.phase-final::before {
    background: linear-gradient(135deg, #ef4444, #7c3aed, transparent);
    opacity: 0.2;
}

.boss-personality-top,
.boss-phase-line,
.boss-info-grid {
    position: relative;
    z-index: 1;
}

.boss-personality-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.boss-personality-emoji {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255,255,255,0.13);
    font-size: 3rem;
    flex-shrink: 0;
}

.boss-personality-top span {
    display: inline-block;
    margin-bottom: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.32);
    color: #bfdbfe;
    font-size: 0.8rem;
    font-weight: 900;
}

.boss-personality-top h3 {
    color: white;
    font-size: 1.45rem;
    margin-bottom: 4px;
}

.boss-personality-top p {
    color: #cbd5e1;
    font-weight: bold;
}

.boss-phase-line {
    margin: 16px 0;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
    color: white;
    font-weight: 900;
    line-height: 1.5;
    text-align: center;
}

.boss-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.boss-info-grid div {
    padding: 15px;
    border-radius: 18px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.08);
}

.boss-info-grid strong {
    display: block;
    color: #bfdbfe;
    margin-bottom: 7px;
    font-size: 0.86rem;
}

.boss-info-grid p {
    color: #e2e8f0;
    line-height: 1.45;
    font-size: 0.92rem;
}

.phase-angry .boss-personality-top span {
    color: #fed7aa;
}

.phase-final .boss-personality-top span {
    color: #fecaca;
}

.phase-angry .boss-phase-line {
    background: rgba(249, 115, 22, 0.16);
    border: 1px solid rgba(249, 115, 22, 0.28);
}

.phase-final .boss-phase-line {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.32);
}

body.theme-light .boss-personality-panel,
body.theme-light .boss-info-grid div {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .boss-personality-top h3,
body.theme-light .boss-phase-line {
    color: #0f172a;
}

body.theme-light .boss-personality-top p,
body.theme-light .boss-info-grid p {
    color: #475569;
}

body.theme-light .boss-personality-top span {
    background: #dbeafe;
    color: #2563eb;
}

body.theme-light .boss-phase-line {
    background: #f1f5f9;
}

body.theme-light .boss-personality-emoji {
    background: #e2e8f0;
}

@media (max-width: 700px) {
    .boss-personality-top {
        flex-direction: column;
        text-align: center;
    }

    .boss-info-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================
   BOSS WORLD SYSTEM
===================== */

.boss-world-grid {
    max-width: 1150px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.boss-world-card {
    padding: 28px;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.boss-world-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
}

.boss-world-card.completed::before {
    background: linear-gradient(135deg, #22c55e, #facc15);
    opacity: 0.18;
}

.boss-world-card.locked {
    opacity: 0.55;
    filter: grayscale(0.55);
}

.boss-world-card:hover {
    transform: translateY(-7px);
}

.boss-world-top,
.boss-world-card p,
.boss-world-progress,
.boss-mini-path,
.boss-world-card .btn {
    position: relative;
    z-index: 1;
}

.boss-world-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
}

.boss-world-emoji {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255,255,255,0.12);
    font-size: 2.5rem;
}

.boss-world-top span {
    display: inline-block;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-weight: 900;
    font-size: 0.78rem;
}

.boss-world-top h2 {
    color: white;
    font-size: 1.35rem;
}

.boss-world-card p {
    color: #cbd5e1;
    line-height: 1.55;
    min-height: 72px;
}

.boss-world-progress {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 20px 0;
}

.boss-world-progress div {
    padding: 14px;
    border-radius: 17px;
    background: rgba(255,255,255,0.08);
}

.boss-world-progress strong {
    display: block;
    color: white;
    margin-bottom: 5px;
}

.boss-world-progress span {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: bold;
}

.boss-mini-path {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 18px 0 22px;
}

.boss-mini-path span {
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
}

.boss-mini-path span.done {
    background: linear-gradient(90deg, #22c55e, #38bdf8);
}

/* Boss select path */

.boss-path-wrapper {
    max-width: 1180px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.boss-path-card {
    padding: 24px;
    border-radius: 28px;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.boss-path-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: linear-gradient(135deg, #38bdf8, #7c3aed);
    pointer-events: none;
}

.boss-path-card.defeated::before {
    background: linear-gradient(135deg, #22c55e, #facc15);
    opacity: 0.18;
}

.boss-path-card.locked {
    opacity: 0.52;
    filter: grayscale(0.55);
}

.boss-path-card:hover {
    transform: translateY(-7px);
}

.boss-path-tier,
.boss-path-emoji,
.boss-path-card h2,
.boss-path-card p,
.boss-attack-box,
.boss-reward-row,
.boss-path-card .btn {
    position: relative;
    z-index: 1;
}

.boss-path-tier {
    display: inline-block;
    margin-bottom: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    font-weight: 900;
    font-size: 0.76rem;
}

.boss-path-emoji {
    font-size: 3.6rem;
    margin-bottom: 14px;
}

.boss-path-card h2 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.boss-path-card p {
    color: #cbd5e1;
    line-height: 1.45;
    font-size: 0.92rem;
    min-height: 82px;
}

.boss-attack-box {
    margin: 16px 0;
    padding: 13px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.26);
}

.boss-attack-box span {
    display: block;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 900;
    margin-bottom: 5px;
}

.boss-attack-box strong {
    color: white;
    font-size: 0.95rem;
}

.boss-reward-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.boss-reward-row span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.15);
    color: #fef08a;
    font-weight: bold;
    font-size: 0.82rem;
}

/* Active boss battle banner */

.active-boss-banner {
    margin-bottom: 22px;
    padding: 20px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.18), transparent 34%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.active-boss-emoji {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255,255,255,0.12);
    font-size: 3rem;
}

.active-boss-banner span {
    display: inline-block;
    margin-bottom: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    font-weight: 900;
    font-size: 0.78rem;
}

.active-boss-banner h2 {
    color: white;
    margin-bottom: 5px;
}

.active-boss-banner p {
    color: #cbd5e1;
    line-height: 1.45;
}

.active-boss-attack {
    min-width: 150px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.26);
    text-align: center;
}

.active-boss-attack small {
    display: block;
    color: #93c5fd;
    font-weight: 900;
    margin-bottom: 5px;
}

.active-boss-attack strong {
    color: white;
}

/* Boss reward result */

.boss-reward-banner {
    margin: 24px auto;
    padding: 24px;
    border-radius: 26px;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.24), transparent 34%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(250, 204, 21, 0.28);
}

.boss-reward-banner div {
    font-size: 4rem;
    margin-bottom: 10px;
}

.boss-reward-banner h2 {
    color: white;
    margin-bottom: 6px;
}

.boss-reward-banner p {
    color: #cbd5e1;
    margin-bottom: 10px;
}

.boss-reward-banner strong {
    color: #fef08a;
}

/* Light mode */

body.theme-light .boss-world-card,
body.theme-light .boss-path-card,
body.theme-light .active-boss-banner,
body.theme-light .boss-reward-banner {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .boss-world-top h2,
body.theme-light .boss-world-progress strong,
body.theme-light .boss-path-card h2,
body.theme-light .boss-attack-box strong,
body.theme-light .active-boss-banner h2,
body.theme-light .active-boss-attack strong,
body.theme-light .boss-reward-banner h2 {
    color: #0f172a;
}

body.theme-light .boss-world-card p,
body.theme-light .boss-world-progress span,
body.theme-light .boss-path-card p,
body.theme-light .active-boss-banner p,
body.theme-light .boss-reward-banner p {
    color: #475569;
}

body.theme-light .boss-world-emoji,
body.theme-light .active-boss-emoji {
    background: #e2e8f0;
}

body.theme-light .boss-attack-box,
body.theme-light .active-boss-attack {
    background: #f1f5f9;
}

@media (max-width: 1050px) {
    .boss-path-wrapper {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 700px) {
    .boss-path-wrapper {
        grid-template-columns: 1fr;
    }

    .active-boss-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .active-boss-emoji {
        margin: 0 auto;
    }
}

/* =====================
   REWARD VAULT + ARENA UNLOCKS
===================== */

.vault-message {
    max-width: 520px;
    margin: 18px auto 0;
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    font-weight: bold;
}

.vault-grid {
    max-width: 1150px;
    margin: 35px auto 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.vault-card {
    padding: 28px;
    border-radius: 30px;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.13), transparent 34%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.vault-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #facc15, #38bdf8, #a855f7);
    opacity: 0.1;
    pointer-events: none;
}

.vault-card.locked {
    opacity: 0.62;
    filter: grayscale(0.35);
}

.vault-card:hover {
    transform: translateY(-7px);
}

.vault-emoji,
.vault-card h2,
.vault-card p,
.vault-cost,
.vault-reward-preview,
.vault-card form,
.vault-card button {
    position: relative;
    z-index: 1;
}

.vault-emoji {
    font-size: 3.6rem;
    margin-bottom: 14px;
}

.vault-card h2 {
    color: white;
    margin-bottom: 10px;
}

.vault-card p {
    color: #cbd5e1;
    line-height: 1.5;
    min-height: 70px;
}

.vault-cost {
    margin: 18px auto;
    padding: 14px;
    border-radius: 17px;
    background: rgba(15, 23, 42, 0.28);
}

.vault-cost span {
    display: block;
    color: #93c5fd;
    font-weight: 900;
    margin-bottom: 5px;
}

.vault-cost strong {
    color: #fef08a;
    font-size: 1.25rem;
}

.vault-reward-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.vault-reward-preview span {
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: bold;
}

/* Arena Unlock Celebration */

.arena-unlock-celebration {
    max-width: 780px;
    margin: 28px auto;
    padding: 38px;
    border-radius: 34px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.35), transparent 34%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.24), transparent 38%),
        rgba(255,255,255,0.09);
    border: 1px solid rgba(250, 204, 21, 0.35);
    box-shadow:
        0 30px 90px rgba(0,0,0,0.28),
        0 0 50px rgba(250, 204, 21, 0.15);
    animation: unlockPop 0.7s ease both, unlockGlow 2.2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.arena-unlock-celebration::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle, rgba(255,255,255,0.28) 0 2px, transparent 3px);
    background-size: 42px 42px;
    animation: sparkleDrift 8s linear infinite;
    opacity: 0.35;
}

.unlock-sparkles,
.unlock-emoji,
.arena-unlock-celebration h1,
.arena-unlock-celebration h2,
.arena-unlock-celebration p,
.arena-unlock-celebration a {
    position: relative;
    z-index: 1;
}

.unlock-sparkles {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.unlock-emoji {
    width: 105px;
    height: 105px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 32px;
    background: rgba(255,255,255,0.16);
    font-size: 4rem;
    animation: unlockFloat 1.8s ease-in-out infinite alternate;
}

.arena-unlock-celebration h2 {
    color: #fef08a;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.arena-unlock-celebration h1 {
    color: white;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1;
    margin-bottom: 14px;
}

.arena-unlock-celebration p {
    color: #e2e8f0;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 24px;
}

@keyframes unlockPop {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(20px);
    }

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

@keyframes unlockGlow {
    from {
        box-shadow:
            0 30px 90px rgba(0,0,0,0.28),
            0 0 35px rgba(250, 204, 21, 0.12);
    }

    to {
        box-shadow:
            0 30px 90px rgba(0,0,0,0.28),
            0 0 70px rgba(250, 204, 21, 0.28);
    }
}

@keyframes unlockFloat {
    from {
        transform: translateY(0) rotate(-2deg);
    }

    to {
        transform: translateY(-8px) rotate(2deg);
    }
}

@keyframes sparkleDrift {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(-80px) rotate(12deg);
    }
}

body.theme-light .vault-card,
body.theme-light .arena-unlock-celebration {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .vault-card h2,
body.theme-light .arena-unlock-celebration h1 {
    color: #0f172a;
}

body.theme-light .vault-card p,
body.theme-light .arena-unlock-celebration p {
    color: #475569;
}

body.theme-light .vault-cost {
    background: #f1f5f9;
}

body.theme-light .vault-reward-preview span {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .vault-message {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

@media (max-width: 700px) {
    .arena-unlock-celebration {
        padding: 28px 22px;
    }
}

/* =========================================================
   POLISH PACK 1
   Active Nav + Toasts + Battle FX + Result Animations
========================================================= */

/* =====================
   ACTIVE NAVBAR
===================== */

.nav-link,
.more-menu summary {
    position: relative;
    padding: 9px 11px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-link:hover,
.more-menu summary:hover {
    background: rgba(255,255,255,0.08);
}

.nav-link.active,
.more-menu summary.active {
    color: white;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(124, 58, 237, 0.24));
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.12),
        0 8px 24px rgba(37, 99, 235, 0.18);
}

.nav-link.active::after,
.more-menu summary.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #38bdf8, #a855f7);
}

/* =====================
   GLOBAL TOASTS
===================== */

.toast-stack {
    position: fixed;
    top: 86px;
    right: 22px;
    z-index: 999;
    display: grid;
    gap: 12px;
    width: min(380px, calc(100vw - 28px));
}

.toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 13px;
    align-items: center;
    padding: 15px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 34%),
        rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    backdrop-filter: blur(16px);
    animation: toastSlideIn 0.35s ease both;
}

.toast-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.11);
    font-size: 1.65rem;
}

.toast strong {
    display: block;
    color: white;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.toast p {
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.35;
}

.toast-close {
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.15rem;
    line-height: 1;
}

.toast-close:hover {
    background: rgba(255,255,255,0.18);
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.35);
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.18);
}

.toast-legendary {
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.35),
        0 0 35px rgba(250, 204, 21, 0.18);
}

.toast-legendary .toast-icon {
    background: rgba(250, 204, 21, 0.18);
}

.toast-hide {
    animation: toastSlideOut 0.25s ease both;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(28px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(28px) scale(0.96);
    }
}

/* =====================
   BOSS BATTLE ANIMATIONS
===================== */

.boss-stage {
    position: relative;
}

.boss-stage .fighter-card {
    transition: 0.25s ease;
}

.boss-stage .fighter-card:first-child {
    animation: playerIdleFloat 2.4s ease-in-out infinite alternate;
}

.boss-stage .fighter-card:last-child {
    animation: bossIdleFloat 2.1s ease-in-out infinite alternate;
}

.boss-stage.player-hit-fx .fighter-card:last-child {
    animation:
        bossDamageShake 0.42s ease,
        bossDamageFlash 0.55s ease,
        bossIdleFloat 2.1s ease-in-out 0.55s infinite alternate;
}

.boss-stage.player-hit-fx .fighter-card:first-child {
    box-shadow: 0 0 38px rgba(56, 189, 248, 0.28);
}

.boss-stage.boss-hit-fx .fighter-card:first-child {
    animation:
        playerDamageShake 0.42s ease,
        bossDamageFlash 0.55s ease,
        playerIdleFloat 2.4s ease-in-out 0.55s infinite alternate;
}

.boss-stage.boss-hit-fx .fighter-card:last-child {
    box-shadow: 0 0 42px rgba(239, 68, 68, 0.25);
}

.fighter-avatar {
    display: inline-block;
    transform-origin: center;
}

.boss-stage.player-hit-fx .fighter-card:first-child .fighter-avatar {
    animation: castSpell 0.55s ease;
}

.boss-stage.boss-hit-fx .fighter-card:last-child .fighter-avatar {
    animation: castSpell 0.55s ease;
}

@keyframes playerIdleFloat {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

@keyframes bossIdleFloat {
    from {
        transform: translateY(-2px);
    }

    to {
        transform: translateY(5px);
    }
}

@keyframes bossDamageShake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(9px);
    }

    45% {
        transform: translateX(-8px);
    }

    70% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes playerDamageShake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-9px);
    }

    45% {
        transform: translateX(8px);
    }

    70% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes bossDamageFlash {
    0% {
        filter: brightness(1);
    }

    35% {
        filter: brightness(1.65) saturate(1.3);
    }

    100% {
        filter: brightness(1);
    }
}

@keyframes castSpell {
    0% {
        transform: scale(1) rotate(0deg);
    }

    40% {
        transform: scale(1.18) rotate(-4deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* =====================
   SPELL EVENT BANNER
===================== */

.spell-event-banner {
    margin: 18px 0;
    padding: 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    animation: spellBannerPop 0.35s ease both;
}

.spell-event-banner > div:first-child {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    font-size: 1.9rem;
    flex-shrink: 0;
}

.spell-event-banner strong {
    display: block;
    color: white;
    margin-bottom: 4px;
}

.spell-event-banner p {
    color: #cbd5e1;
    line-height: 1.4;
}

.spell-event-banner.player-hit-fx {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
}

.spell-event-banner.boss-hit-fx {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}

@keyframes spellBannerPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

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

/* =====================
   RESULT + REWARD ANIMATIONS
===================== */

.result-card,
.battle-summary-panel,
.boss-reward-banner,
.arena-unlock-celebration,
.featured-badge-card,
.achievement-unlock-banner {
    animation: resultRiseIn 0.45s ease both;
}

.result-title.win,
.result-title.lose {
    animation: resultTitlePop 0.5s ease both;
}

.result-title.win {
    text-shadow: 0 0 22px rgba(34, 197, 94, 0.35);
}

.result-title.lose {
    text-shadow: 0 0 22px rgba(249, 115, 22, 0.35);
}

.score-display {
    animation: scorePulse 0.65s ease both;
}

.result-stats div {
    transition: 0.2s ease;
    animation: resultStatPop 0.45s ease both;
}

.result-stats div:nth-child(2) {
    animation-delay: 0.05s;
}

.result-stats div:nth-child(3) {
    animation-delay: 0.1s;
}

.result-stats div:nth-child(4) {
    animation-delay: 0.15s;
}

.result-stats div:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.12);
}

.boss-reward-banner {
    animation:
        rewardPop 0.55s ease both,
        rewardGlow 1.8s ease-in-out infinite alternate;
}

.boss-reward-banner div {
    animation: rewardFloat 1.6s ease-in-out infinite alternate;
}

.arena-unlock-celebration {
    animation:
        unlockPop 0.7s ease both,
        unlockGlow 2.2s ease-in-out infinite alternate;
}

@keyframes resultRiseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

@keyframes resultTitlePop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scorePulse {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    55% {
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes resultStatPop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

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

@keyframes rewardPop {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(16px);
    }

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

@keyframes rewardGlow {
    from {
        box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    }

    to {
        box-shadow:
            0 20px 60px rgba(0,0,0,0.18),
            0 0 45px rgba(250, 204, 21, 0.25);
    }
}

@keyframes rewardFloat {
    from {
        transform: translateY(0) rotate(-2deg);
    }

    to {
        transform: translateY(-7px) rotate(2deg);
    }
}

/* =====================
   GLOBAL CLICK POLISH
===================== */

.btn,
.card,
.arena-card,
.shop-card,
.mission-card,
.achievement-card,
.vault-card,
.boss-world-card,
.boss-path-card,
.mode-card,
.mastery-card,
.skill-node {
    will-change: transform;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.answer-option:active,
.home-pro-links a:active,
.vault-card form button:active,
.boss-path-card .btn:active {
    transform: scale(0.98);
}

.locked,
.disabled-btn,
button:disabled {
    cursor: not-allowed;
}

/* =====================
   LIGHT THEME POLISH
===================== */

body.theme-light .nav-link.active,
body.theme-light .more-menu summary.active {
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

body.theme-light .toast {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .toast strong {
    color: #0f172a;
}

body.theme-light .toast p {
    color: #475569;
}

body.theme-light .toast-icon,
body.theme-light .toast-close {
    background: #e2e8f0;
    color: #0f172a;
}

body.theme-light .spell-event-banner {
    background: rgba(255,255,255,0.96);
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .spell-event-banner strong {
    color: #0f172a;
}

body.theme-light .spell-event-banner p {
    color: #475569;
}

/* =====================
   MOBILE POLISH
===================== */

@media (max-width: 700px) {
    .toast-stack {
        top: 12px;
        right: 14px;
        left: 14px;
        width: auto;
    }

    .spell-event-banner {
        flex-direction: column;
        text-align: center;
    }

    .nav-link.active::after,
    .more-menu summary.active::after {
        display: none;
    }
}

/* =========================================================
   HOME PAGE PLACEMENT TRIAL
========================================================= */

.home-placement-section {
    max-width: 1150px;
    margin: 34px auto;
    padding: 32px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.17), transparent 34%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.15), transparent 36%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: 0 26px 80px rgba(0,0,0,0.22);
}

.placement-home-header {
    text-align: center;
    margin-bottom: 26px;
}

.placement-home-header h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.6rem);
    margin: 14px 0 8px;
}

.placement-home-header p {
    color: #cbd5e1;
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.6;
}

.home-placement-shell {
    max-width: 880px;
    margin: 0 auto;
}

.home-placement-card {
    padding: 34px;
    border-radius: 32px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.2), transparent 38%),
        rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(255,255,255,0.12);
    animation: resultRiseIn 0.35s ease both;
}

.hidden-placement-question {
    display: none;
}

.placement-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.placement-topbar > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.placement-timer {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.2), transparent 55%),
        rgba(255,255,255,0.09);
    border: 1px solid rgba(250, 204, 21, 0.28);
    color: #fef08a;
    font-size: 1.45rem;
    font-weight: 1000;
    box-shadow: 0 0 30px rgba(250, 204, 21, 0.12);
}

.placement-progress-wrap {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    margin-bottom: 24px;
}

.placement-progress-bar {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
    transition: width 0.1s linear;
}

.placement-progress-bar.warning {
    background: linear-gradient(90deg, #facc15, #fb923c);
}

.placement-progress-bar.danger {
    background: linear-gradient(90deg, #ef4444, #fb7185);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.35);
}

.placement-topic-emoji,
.placement-result-emoji {
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 30px;
    background: rgba(255,255,255,0.1);
    font-size: 3.4rem;
    animation: emptyFloat 1.8s ease-in-out infinite alternate;
}

.home-placement-card h3 {
    color: white;
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 8px;
}

.placement-subtitle {
    color: #93c5fd;
    font-weight: 900;
    margin-bottom: 24px;
}

.home-placement-card h2 {
    color: white;
    font-size: clamp(1.3rem, 4vw, 2.1rem);
    line-height: 1.3;
    margin-bottom: 26px;
}

.placement-options {
    display: grid;
    gap: 14px;
    margin-bottom: 26px;
}

.placement-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s ease;
}

.placement-option:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.11);
    border-color: rgba(56, 189, 248, 0.28);
}

.placement-option input {
    display: none;
}

.placement-letter {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
    color: #bfdbfe;
    font-weight: 1000;
    flex-shrink: 0;
}

.placement-option span:last-child {
    color: #e2e8f0;
    font-weight: 800;
}

.placement-option:has(input:checked) {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.12);
}

.placement-option:has(input:checked) .placement-letter {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
}

/* Result inside home */

.home-placement-result {
    animation: resultRiseIn 0.45s ease both;
}

.placement-result-main {
    text-align: center;
    padding: 34px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.18), transparent 38%),
        rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(255,255,255,0.12);
}

.placement-result-main h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 10px;
}

.placement-result-main p {
    color: #cbd5e1;
    line-height: 1.6;
}

.placement-result-main p strong {
    color: #fef08a;
}

.placement-rank-card {
    max-width: 420px;
    margin: 22px auto;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(250, 204, 21, 0.24);
}

.placement-rank-card span {
    display: block;
    color: #93c5fd;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 7px;
}

.placement-rank-card strong {
    color: white;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.placement-result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.placement-summary-grid {
    margin: 24px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.placement-summary-card,
.placement-potential-card,
.placement-breakdown-card {
    padding: 24px;
    border-radius: 28px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.12);
}

.placement-summary-card span {
    display: block;
    color: #93c5fd;
    font-weight: 1000;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.placement-summary-card strong {
    display: block;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.placement-summary-card p,
.placement-potential-card p,
.placement-breakdown-card p {
    color: #cbd5e1;
    line-height: 1.55;
}

.placement-potential-card {
    text-align: center;
    margin-bottom: 24px;
}

.placement-potential-card h2 {
    color: white;
    margin-bottom: 10px;
}

.placement-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 18px;
}

.placement-breakdown-emoji {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 22px;
    background: rgba(255,255,255,0.1);
    font-size: 2.4rem;
}

.placement-breakdown-card h3 {
    color: white;
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.placement-mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.placement-mini-stats span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 900;
}

.rating-super {
    background: rgba(250, 204, 21, 0.16);
    color: #fef08a;
    border-color: rgba(250, 204, 21, 0.38);
}

.rating-strong {
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.32);
}

.rating-developing {
    background: rgba(56, 189, 248, 0.14);
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.32);
}

.rating-needs-work {
    background: rgba(249, 115, 22, 0.15);
    color: #fed7aa;
    border-color: rgba(249, 115, 22, 0.34);
}

body.theme-light .home-placement-section,
body.theme-light .home-placement-card,
body.theme-light .placement-result-main,
body.theme-light .placement-summary-card,
body.theme-light .placement-potential-card,
body.theme-light .placement-breakdown-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

body.theme-light .placement-home-header h2,
body.theme-light .home-placement-card h2,
body.theme-light .home-placement-card h3,
body.theme-light .placement-result-main h2,
body.theme-light .placement-rank-card strong,
body.theme-light .placement-summary-card strong,
body.theme-light .placement-potential-card h2,
body.theme-light .placement-breakdown-card h3 {
    color: #0f172a;
}

body.theme-light .placement-home-header p,
body.theme-light .placement-result-main p,
body.theme-light .placement-summary-card p,
body.theme-light .placement-potential-card p,
body.theme-light .placement-breakdown-card p {
    color: #475569;
}

body.theme-light .placement-option {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.theme-light .placement-option span:last-child {
    color: #0f172a;
}

body.theme-light .placement-letter,
body.theme-light .placement-topic-emoji,
body.theme-light .placement-result-emoji,
body.theme-light .placement-breakdown-emoji {
    background: #f1f5f9;
}

@media (max-width: 850px) {
    .placement-summary-grid {
        grid-template-columns: 1fr;
    }

    .placement-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .placement-timer {
        width: 100%;
        height: 58px;
        border-radius: 18px;
    }
}

@media (max-width: 600px) {
    .home-placement-section {
        padding: 22px;
    }

    .home-placement-card,
    .placement-result-main {
        padding: 24px 18px;
    }

    .placement-result-actions .btn {
        width: 100%;
    }
}

/* =====================
   PLACEMENT READY CARD
===================== */

.hidden-placement-form {
    display: none;
}

.placement-ready-card {
    max-width: 880px;
    margin: 0 auto;
    padding: 38px;
    border-radius: 32px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.16), transparent 38%),
        radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.16), transparent 38%),
        rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 70px rgba(0,0,0,0.22);
    animation: resultRiseIn 0.4s ease both;
}

.placement-ready-card h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.3rem);
    margin-bottom: 12px;
}

.placement-ready-card p {
    color: #cbd5e1;
    max-width: 680px;
    margin: 0 auto 22px;
    line-height: 1.6;
}

.placement-ready-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

body.theme-light .placement-ready-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

body.theme-light .placement-ready-card h2 {
    color: #0f172a;
}

body.theme-light .placement-ready-card p {
    color: #475569;
}

@media (max-width: 600px) {
    .placement-ready-card {
        padding: 28px 20px;
    }

    .placement-ready-card .btn {
        width: 100%;
    }
}

/* =========================================================
   NEW HOME.HTML COMPATIBILITY PATCH
   This preserves the old 5000+ line CSS and adds the new
   homepage classes: clean-home-hero, placement, dashboard,
   flow cards, quick actions, and light/mobile support.
========================================================= */

.clean-home-hero,
.home-dashboard-grid,
.home-flow-section,
.home-quick-actions,
.home-placement-section {
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
}

.clean-home-hero {
    margin-top: 34px;
    margin-bottom: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 360px;
    gap: 24px;
    align-items: stretch;
}

.home-hero-content,
.home-hero-panel,
.home-dashboard-card,
.home-flow-section,
.home-quick-actions,
.quick-action-card,
.home-flow-card {
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 70px rgba(0,0,0,0.20);
}

.home-hero-content {
    padding: 46px;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 38%),
        rgba(255,255,255,0.08);
}

.home-hero-content h1 {
    color: white;
    font-size: clamp(2.7rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin: 16px 0;
    max-width: 760px;
}

.home-hero-content p {
    color: #cbd5e1;
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 690px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.home-hero-panel {
    padding: 28px;
    min-height: 390px;
    text-align: center;
    display: grid;
    align-content: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.18), transparent 40%),
        rgba(255,255,255,0.08);
}

.home-hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.22), transparent 44%);
    pointer-events: none;
}

.home-hero-panel > * {
    position: relative;
    z-index: 1;
}

.hero-big-icon {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 34px;
    background: rgba(255,255,255,0.13);
    font-size: 4.4rem;
    animation: emptyFloat 1.9s ease-in-out infinite alternate;
}

.home-hero-panel h2 {
    color: white;
    font-size: 1.8rem;
}

.hero-stat-list {
    display: grid;
    gap: 12px;
}

.hero-stat-list div {
    padding: 15px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.08);
}

.hero-stat-list span {
    color: #cbd5e1;
    font-weight: 900;
}

.hero-stat-list strong {
    color: white;
    font-size: 1.25rem;
}

.home-dashboard-grid {
    margin-top: 34px;
    margin-bottom: 34px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
}

.home-dashboard-card {
    padding: 28px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.home-dashboard-card h2 {
    color: white;
    margin: 14px 0 10px;
    font-size: 1.75rem;
}

.home-dashboard-card p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 22px;
}

.home-dashboard-card strong {
    color: #fef08a;
}

.home-dashboard-card .btn {
    margin-top: auto;
}

.continue-card {
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 38%),
        rgba(255,255,255,0.08);
}

.section-heading {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 26px;
}

.section-heading h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.6rem);
    margin: 14px 0 8px;
    letter-spacing: -0.04em;
}

.section-heading p {
    color: #cbd5e1;
    line-height: 1.6;
}

.home-flow-section,
.home-quick-actions {
    margin-top: 36px;
    margin-bottom: 36px;
    padding: 34px;
}

.home-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.home-flow-card {
    padding: 24px;
    text-align: center;
    box-shadow: none;
    transition: 0.22s ease;
}

.home-flow-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.12);
}

.home-flow-card > div {
    width: 72px;
    height: 72px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255,255,255,0.11);
    font-size: 2.5rem;
}

.home-flow-card h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.home-flow-card p {
    color: #cbd5e1;
    line-height: 1.55;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.quick-action-card {
    display: block;
    padding: 22px;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    transition: 0.22s ease;
}

.quick-action-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.13);
    border-color: rgba(56, 189, 248, 0.28);
}

.quick-action-card div {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255,255,255,0.11);
    font-size: 2.25rem;
}

.quick-action-card h3 {
    color: white;
    margin-bottom: 8px;
}

.quick-action-card p {
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.45;
}

.hidden-placement-form,
.hidden-placement-question {
    display: none !important;
}

.placement-option input:checked + .placement-letter {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
}

body.theme-light .home-hero-content,
body.theme-light .home-hero-panel,
body.theme-light .home-dashboard-card,
body.theme-light .home-flow-section,
body.theme-light .home-quick-actions,
body.theme-light .home-flow-card,
body.theme-light .quick-action-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

body.theme-light .home-hero-content h1,
body.theme-light .home-hero-panel h2,
body.theme-light .home-dashboard-card h2,
body.theme-light .section-heading h2,
body.theme-light .home-flow-card h3,
body.theme-light .quick-action-card h3,
body.theme-light .hero-stat-list strong {
    color: #0f172a;
}

body.theme-light .home-hero-content p,
body.theme-light .home-dashboard-card p,
body.theme-light .section-heading p,
body.theme-light .home-flow-card p,
body.theme-light .quick-action-card p,
body.theme-light .hero-stat-list span {
    color: #475569;
}

body.theme-light .hero-stat-list div,
body.theme-light .hero-big-icon,
body.theme-light .home-flow-card > div,
body.theme-light .quick-action-card div {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 1150px) {
    .quick-action-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .home-flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 950px) {
    .clean-home-hero,
    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .home-hero-content,
    .home-hero-panel {
        min-height: auto;
    }

    .home-dashboard-card {
        min-height: auto;
    }
}

@media (max-width: 700px) {
    .clean-home-hero,
    .home-dashboard-grid,
    .home-flow-section,
    .home-quick-actions,
    .home-placement-section {
        margin-top: 22px;
        margin-bottom: 22px;
    }

    .home-hero-content,
    .home-hero-panel,
    .home-dashboard-card,
    .home-flow-section,
    .home-quick-actions {
        padding: 22px;
        border-radius: 26px;
    }

    .hero-actions,
    .placement-result-actions {
        flex-direction: column;
    }

    .hero-actions .btn,
    .home-dashboard-card .btn,
    .placement-result-actions .btn {
        width: 100%;
        text-align: center;
    }

    .quick-action-grid,
    .home-flow-grid {
        grid-template-columns: 1fr;
    }

    .hero-stat-list div {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .home-hero-content h1 {
        font-size: 2.35rem;
    }

    .hero-big-icon,
    .placement-topic-emoji,
    .placement-result-emoji {
        width: 78px;
        height: 78px;
        font-size: 3rem;
    }
}

/* =========================================================
   FEATURE PACK 2-4: MISTAKE REPLAY + BOSS INTRO + ARENA MAP
========================================================= */

/* Mistake Replay */

.mistake-replay-form {
    max-width: 950px;
    margin: 30px auto 80px;
    display: grid;
    gap: 22px;
}

.mistake-question-card,
.replay-result-card,
.replay-review-card {
    padding: 28px;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.mistake-question-card h2 {
    color: white;
    font-size: 1.45rem;
    line-height: 1.35;
    margin-bottom: 22px;
}

.replay-result-card {
    max-width: 780px;
    margin: 25px auto;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 40%),
        rgba(255,255,255,0.08);
}

.replay-result-emoji {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: rgba(255,255,255,0.12);
    font-size: 3.4rem;
}

.replay-result-card h2 {
    color: white;
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.replay-result-card p {
    color: #cbd5e1;
    margin-bottom: 18px;
}

.replay-result-card strong {
    color: #fef08a;
}

.replay-review-grid {
    max-width: 1100px;
    margin: 25px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.replay-review-card.correct {
    border-color: rgba(34, 197, 94, 0.34);
}

.replay-review-card.wrong {
    border-color: rgba(249, 115, 22, 0.34);
}

.replay-review-card h3 {
    color: white;
    margin-bottom: 14px;
    line-height: 1.35;
}

.replay-review-card p {
    color: #cbd5e1;
    line-height: 1.55;
    margin-top: 10px;
}

/* Boss Intro */

.boss-intro-screen {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 35px 0;
}

.boss-intro-card {
    width: min(950px, 100%);
    padding: 42px;
    border-radius: 36px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(239, 68, 68, 0.18), transparent 36%),
        radial-gradient(circle at bottom left, rgba(250, 204, 21, 0.13), transparent 36%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 30px 90px rgba(0,0,0,0.28);
    backdrop-filter: blur(16px);
    animation: resultRiseIn 0.4s ease both;
}

.boss-intro-arena {
    margin: 18px auto;
    width: fit-content;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #bae6fd;
    font-weight: 1000;
}

.boss-intro-emoji {
    width: 130px;
    height: 130px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 38px;
    background: rgba(255,255,255,0.12);
    font-size: 5rem;
    animation: emptyFloat 1.8s ease-in-out infinite alternate;
}

.boss-intro-card h1 {
    color: white;
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
}

.boss-intro-type {
    color: #fef08a;
    font-weight: 1000;
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.boss-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 28px 0;
}

.boss-intro-grid div {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.085);
    border: 1px solid rgba(255,255,255,0.10);
}

.boss-intro-grid span {
    display: block;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.boss-intro-grid strong {
    color: white;
    line-height: 1.35;
}

.boss-intro-warning {
    margin: 22px auto;
    padding: 15px;
    border-radius: 18px;
    max-width: 650px;
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.32);
    color: #fed7aa;
    font-weight: 900;
}

/* Arena Map */

.arena-map-path {
    max-width: 950px;
    margin: 35px auto 45px;
    display: grid;
    gap: 22px;
    position: relative;
}

.arena-map-node {
    position: relative;
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 18px;
    align-items: stretch;
}

.map-node-connector {
    position: relative;
}

.map-node-connector::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: -22px;
    width: 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
}

.arena-map-node:last-child .map-node-connector::before {
    bottom: 50%;
}

.map-node-connector::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 30px;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #334155;
    border: 4px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 0 8px rgba(255,255,255,0.04);
}

.arena-map-node.completed .map-node-connector::after {
    background: linear-gradient(135deg, #22c55e, #84cc16);
}

.arena-map-node.unlocked .map-node-connector::after {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.arena-map-node.locked .map-node-connector::after {
    background: #475569;
}

.map-node-card {
    padding: 26px;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.22s ease;
}

.map-node-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.12);
}

.arena-map-node.completed .map-node-card {
    border-color: rgba(34, 197, 94, 0.28);
}

.arena-map-node.unlocked .map-node-card {
    border-color: rgba(56, 189, 248, 0.30);
}

.arena-map-node.locked .map-node-card {
    opacity: 0.62;
    filter: grayscale(0.35);
}

.map-boss-emoji {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255,255,255,0.11);
    font-size: 3rem;
    margin-bottom: 14px;
}

.map-node-card h2 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.65rem;
}

.map-node-card p {
    color: #cbd5e1;
    line-height: 1.55;
}

.boss-reward-row {
    margin: 16px 0;
    padding: 13px;
    border-radius: 16px;
    background: rgba(250, 204, 21, 0.10);
    border: 1px solid rgba(250, 204, 21, 0.22);
    color: #fef08a;
}

/* Light mode support */

body.theme-light .mistake-question-card,
body.theme-light .replay-result-card,
body.theme-light .replay-review-card,
body.theme-light .boss-intro-card,
body.theme-light .map-node-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .mistake-question-card h2,
body.theme-light .replay-result-card h2,
body.theme-light .replay-review-card h3,
body.theme-light .boss-intro-card h1,
body.theme-light .boss-intro-grid strong,
body.theme-light .map-node-card h2 {
    color: #0f172a;
}

body.theme-light .replay-result-card p,
body.theme-light .replay-review-card p,
body.theme-light .map-node-card p {
    color: #475569;
}

body.theme-light .boss-intro-grid div,
body.theme-light .map-boss-emoji,
body.theme-light .replay-result-emoji {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
}

/* Mobile */

@media (max-width: 850px) {
    .boss-intro-grid {
        grid-template-columns: 1fr;
    }

    .arena-map-node {
        grid-template-columns: 46px 1fr;
        gap: 12px;
    }

    .boss-intro-card {
        padding: 26px;
        border-radius: 28px;
    }
}

@media (max-width: 600px) {
    .map-node-card,
    .mistake-question-card,
    .replay-result-card,
    .replay-review-card {
        padding: 20px;
        border-radius: 24px;
    }

    .boss-intro-emoji {
        width: 96px;
        height: 96px;
        font-size: 3.7rem;
    }

    .arena-map-node {
        grid-template-columns: 1fr;
    }

    .map-node-connector {
        display: none;
    }
}

/* =========================================================
   DEPLOY POLISH PACK
   Daily Popup + World Clear + Result Reactions + Nav Dots
========================================================= */

/* Navbar notification dots */

.nav-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    margin-left: 5px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
    vertical-align: middle;
}

/* Deploy popups */

.deploy-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
    animation: deployFadeIn 0.22s ease both;
}

.deploy-popup-card {
    width: min(520px, 100%);
    position: relative;
    padding: 34px;
    border-radius: 34px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.22), transparent 42%),
        rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 30px 95px rgba(0,0,0,0.45);
    animation: deployPopupRise 0.32s ease both;
}

.deploy-popup-card.world-clear-popup {
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.22), transparent 42%),
        radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.16), transparent 40%),
        rgba(15, 23, 42, 0.96);
}

.deploy-popup-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 1.35rem;
    font-weight: 1000;
}

.deploy-popup-emoji {
    width: 98px;
    height: 98px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 30px;
    background: rgba(255,255,255,0.12);
    font-size: 4rem;
    animation: emptyFloat 1.6s ease-in-out infinite alternate;
}

.deploy-popup-card h2 {
    color: white;
    font-size: 2.35rem;
    margin-bottom: 10px;
    letter-spacing: -0.04em;
}

.deploy-popup-card p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 20px;
}

.deploy-popup-card p strong {
    color: #fef08a;
}

.deploy-popup-rewards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.deploy-popup-rewards span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #bbf7d0;
    font-weight: 1000;
}

/* Result reaction card */

.result-reaction-card {
    max-width: 900px;
    margin: 24px auto;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-radius: 28px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    animation: deployPopupRise 0.28s ease both;
}

.result-reaction-emoji {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 26px;
    background: rgba(255,255,255,0.12);
    font-size: 3rem;
}

.result-reaction-card h2 {
    color: white;
    margin-bottom: 6px;
    font-size: 1.8rem;
}

.result-reaction-card p {
    color: #cbd5e1;
    line-height: 1.55;
}

.result-reaction-card.reaction-perfect {
    border-color: rgba(250, 204, 21, 0.36);
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.15), transparent 36%),
        rgba(255,255,255,0.08);
}

.result-reaction-card.reaction-strong {
    border-color: rgba(34, 197, 94, 0.32);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 36%),
        rgba(255,255,255,0.08);
}

.result-reaction-card.reaction-training {
    border-color: rgba(249, 115, 22, 0.34);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.14), transparent 36%),
        rgba(255,255,255,0.08);
}

/* Demo mode helper banner */

.demo-mode-banner {
    max-width: 1050px;
    margin: 20px auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border-radius: 20px;
    background: rgba(236, 72, 153, 0.14);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.demo-mode-banner p {
    color: #fce7f3;
    font-weight: 900;
}

/* Light mode */

body.theme-light .deploy-popup-card,
body.theme-light .result-reaction-card,
body.theme-light .demo-mode-banner {
    background: rgba(255,255,255,0.97);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .deploy-popup-card h2,
body.theme-light .result-reaction-card h2 {
    color: #0f172a;
}

body.theme-light .deploy-popup-card p,
body.theme-light .result-reaction-card p,
body.theme-light .demo-mode-banner p {
    color: #475569;
}

body.theme-light .deploy-popup-emoji,
body.theme-light .result-reaction-emoji {
    background: #f1f5f9;
}

/* Animations */

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

@keyframes deployPopupRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile */

@media (max-width: 650px) {
    .deploy-popup-card {
        padding: 26px;
        border-radius: 28px;
    }

    .deploy-popup-card h2 {
        font-size: 2rem;
    }

    .result-reaction-card,
    .demo-mode-banner {
        flex-direction: column;
        text-align: center;
    }

    .result-reaction-emoji {
        margin: 0 auto;
    }
}

/* =========================================================
   PLAYER SETUP SYSTEM
   Name + Avatar + Grade + Math Confidence
========================================================= */

.player-setup-page {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 35px 0;
}

.player-setup-card {
    width: min(980px, 100%);
    padding: 42px;
    border-radius: 38px;
    text-align: center;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.20), transparent 36%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 38%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 30px 90px rgba(0,0,0,0.28);
    backdrop-filter: blur(16px);
    animation: resultRiseIn 0.35s ease both;
}

.setup-main-emoji {
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
    margin: 22px auto 18px;
    border-radius: 34px;
    background: rgba(255,255,255,0.12);
    font-size: 4.2rem;
    animation: emptyFloat 1.8s ease-in-out infinite alternate;
}

.player-setup-card h1 {
    color: white;
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    margin-bottom: 14px;
}

.player-setup-card > p {
    max-width: 680px;
    margin: 0 auto 30px;
    color: #cbd5e1;
    line-height: 1.65;
    font-size: 1.06rem;
}

.player-setup-form {
    display: grid;
    gap: 26px;
    text-align: left;
}

.setup-field {
    padding: 22px;
    border-radius: 26px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.10);
}

.setup-field > label {
    display: block;
    color: white;
    font-weight: 1000;
    font-size: 1.05rem;
    margin-bottom: 14px;
}

.setup-field input[type="text"],
.setup-field select {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 18px;
    outline: none;
    background: rgba(15, 23, 42, 0.55);
    color: white;
    font-size: 1rem;
    font-weight: 900;
}

.setup-field input[type="text"]::placeholder {
    color: #94a3b8;
}

.setup-field select {
    cursor: pointer;
}

.avatar-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.avatar-choice {
    cursor: pointer;
}

.avatar-choice input,
.confidence-choice input {
    display: none;
}

.avatar-choice {
    min-height: 130px;
    padding: 18px;
    display: grid;
    place-items: center;
    gap: 9px;
    text-align: center;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    transition: 0.22s ease;
}

.avatar-choice:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.12);
}

.avatar-choice input:checked + .avatar-emoji {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.28);
}

.avatar-emoji {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255,255,255,0.11);
    font-size: 2.4rem;
    transition: 0.22s ease;
}

.avatar-name {
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 900;
}

.confidence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.confidence-choice {
    cursor: pointer;
    padding: 20px;
    display: grid;
    gap: 8px;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    transition: 0.22s ease;
}

.confidence-choice:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.12);
}

.confidence-choice:has(input:checked) {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.12);
}

.confidence-emoji {
    font-size: 2.2rem;
}

.confidence-choice strong {
    color: white;
    font-size: 1.1rem;
}

.confidence-choice small {
    color: #cbd5e1;
    line-height: 1.45;
}

.setup-submit-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.05rem;
}

/* Navbar player chip */

.player-navbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.13);
    color: white;
    font-weight: 1000;
    white-space: nowrap;
}

.player-navbar-chip span {
    font-size: 1.25rem;
}

.player-navbar-chip strong {
    font-size: 0.9rem;
}

/* Home player welcome */

.home-player-welcome {
    margin: 18px 0 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 520px;
    border-radius: 24px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.10);
}

.home-player-avatar {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 22px;
    background: rgba(255,255,255,0.12);
    font-size: 2.5rem;
}

.home-player-welcome span {
    color: #93c5fd;
    font-size: 0.82rem;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-player-welcome h2 {
    color: white;
    margin: 4px 0;
    font-size: 1.55rem;
}

.home-player-welcome p {
    color: #cbd5e1;
    line-height: 1.4;
}

/* Light mode */

body.theme-light .player-setup-card,
body.theme-light .setup-field,
body.theme-light .avatar-choice,
body.theme-light .confidence-choice,
body.theme-light .player-navbar-chip,
body.theme-light .home-player-welcome {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .player-setup-card h1,
body.theme-light .setup-field > label,
body.theme-light .confidence-choice strong,
body.theme-light .home-player-welcome h2 {
    color: #0f172a;
}

body.theme-light .player-setup-card > p,
body.theme-light .confidence-choice small,
body.theme-light .home-player-welcome p,
body.theme-light .avatar-name {
    color: #475569;
}

body.theme-light .setup-main-emoji,
body.theme-light .avatar-emoji,
body.theme-light .home-player-avatar {
    background: #f1f5f9;
}

body.theme-light .setup-field input[type="text"],
body.theme-light .setup-field select {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

/* Mobile */

@media (max-width: 850px) {
    .avatar-choice-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .confidence-grid {
        grid-template-columns: 1fr;
    }

    .player-setup-card {
        padding: 28px;
        border-radius: 30px;
    }
}

@media (max-width: 520px) {
    .avatar-choice-grid {
        grid-template-columns: 1fr;
    }

    .home-player-welcome {
        flex-direction: column;
        text-align: center;
    }

    .player-navbar-chip {
        justify-content: center;
    }
}

/* =========================================================
   FINAL HOME.HTML + PLACEMENT RESULT COMPATIBILITY PATCH
   Added for the latest MathForge home.html with:
   - player welcome
   - placement trial form
   - placement result answer checks
   - new dashboard cards
   - new quick action layout
========================================================= */

/* Home hero aliases for the newest home.html */

.home-hero-copy {
    padding: 46px;
    min-height: 390px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 38%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 70px rgba(0,0,0,0.20);
}

.home-hero-copy h1 {
    color: white;
    font-size: clamp(2.7rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin: 16px 0;
    max-width: 760px;
}

.home-hero-copy p {
    color: #cbd5e1;
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 690px;
}

.hero-panel-icon {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 34px;
    background: rgba(255,255,255,0.13);
    font-size: 4.4rem;
    animation: emptyFloat 1.9s ease-in-out infinite alternate;
}

/* New placement trial start card */

.placement-start-card {
    max-width: 880px;
    margin: 0 auto;
    padding: 38px;
    border-radius: 34px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.20), transparent 38%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 70px rgba(0,0,0,0.20);
    backdrop-filter: blur(14px);
    animation: resultRiseIn 0.35s ease both;
}

.placement-start-emoji {
    width: 100px;
    height: 100px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 32px;
    background: rgba(255,255,255,0.11);
    font-size: 4rem;
    animation: emptyFloat 1.8s ease-in-out infinite alternate;
}

.placement-start-card h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.35rem);
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

.placement-start-card p {
    color: #cbd5e1;
    max-width: 660px;
    margin: 0 auto 24px;
    line-height: 1.65;
}

.placement-rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 26px auto;
    max-width: 760px;
}

.placement-rules-grid div {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.09);
}

.placement-rules-grid strong {
    display: block;
    color: white;
    font-size: 1.35rem;
    margin-bottom: 5px;
}

.placement-rules-grid span {
    color: #cbd5e1;
    font-weight: 900;
    font-size: 0.92rem;
}

/* New placement form and question cards */

.placement-trial-form {
    max-width: 950px;
    margin: 0 auto;
    display: grid;
    gap: 22px;
}

.placement-question-card {
    padding: 30px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 36%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 22px 65px rgba(0,0,0,0.18);
    backdrop-filter: blur(14px);
}

.placement-question-card h2 {
    color: white;
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.35;
    margin: 22px 0;
}

.placement-question-card.placement-timeout {
    border-color: rgba(249, 115, 22, 0.38);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.13), transparent 36%),
        rgba(255,255,255,0.08);
}

.placement-submit-row {
    margin-top: 6px;
}

/* New placement result card */

.placement-result-card {
    max-width: 1050px;
    margin: 0 auto;
    padding: 34px;
    border-radius: 36px;
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.17), transparent 35%),
        radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 38%),
        rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: 0 28px 85px rgba(0,0,0,0.24);
    backdrop-filter: blur(14px);
    animation: resultRiseIn 0.45s ease both;
}

.placement-result-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 26px;
}

.placement-result-top .placement-result-emoji {
    margin: 0;
    flex-shrink: 0;
}

.placement-result-top h2 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.45rem);
    letter-spacing: -0.045em;
    margin: 10px 0 7px;
}

.placement-result-top p {
    color: #cbd5e1;
    line-height: 1.55;
}

.placement-result-top p strong {
    color: #fef08a;
}

.placement-summary-box {
    padding: 21px;
    border-radius: 24px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.09);
}

.placement-summary-box span {
    display: block;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.placement-summary-box strong {
    color: white;
    font-size: 1.22rem;
    line-height: 1.25;
}

.placement-message-box {
    margin: 24px 0;
    padding: 24px;
    border-radius: 26px;
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.20);
}

.placement-message-box h3,
.placement-breakdown h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.placement-message-box p {
    color: #cbd5e1;
    line-height: 1.65;
}

.placement-breakdown {
    margin: 26px 0;
}

.placement-breakdown-row {
    margin-top: 14px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border-radius: 24px;
    background: rgba(255,255,255,0.075);
    border: 1px solid rgba(255,255,255,0.09);
}

.placement-breakdown-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.placement-breakdown-main .placement-topic-emoji {
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 18px;
    font-size: 2rem;
    flex-shrink: 0;
    animation: none;
}

.placement-breakdown-main strong {
    color: white;
    display: block;
    margin-bottom: 5px;
}

.placement-breakdown-main p {
    color: #cbd5e1;
    line-height: 1.5;
    margin: 5px 0;
}

.placement-breakdown-side {
    min-width: 150px;
    display: grid;
    gap: 8px;
    justify-items: end;
    text-align: right;
}

.placement-breakdown-side small {
    color: #cbd5e1;
    font-weight: 900;
}

.placement-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 1000;
    white-space: nowrap;
}

.rating-super {
    background: rgba(250, 204, 21, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.34);
    color: #fef08a;
}

.rating-strong {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.32);
    color: #bbf7d0;
}

.rating-developing {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.30);
    color: #bae6fd;
}

.rating-needs-work {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.32);
    color: #fed7aa;
}

.placement-answer-check {
    margin-top: 10px !important;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0 !important;
    font-size: 0.92rem;
}

.placement-answer-check strong {
    color: #fef08a;
}

/* New step cards from latest home.html */

.home-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.home-step-card {
    padding: 24px;
    text-align: center;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    transition: 0.22s ease;
}

.home-step-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.12);
}

.step-number {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    font-size: 1.8rem;
    font-weight: 1000;
}

.home-step-card h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.home-step-card p {
    color: #cbd5e1;
    line-height: 1.55;
}

/* New quick-action-card child tags from latest home.html */

.quick-action-card span {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255,255,255,0.11);
    font-size: 2.25rem;
}

.quick-action-card strong {
    display: block;
    color: white;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.quick-action-card small {
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 800;
}

/* Better card top row support */

.card-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Light mode for latest home and placement result */

body.theme-light .home-hero-copy,
body.theme-light .placement-start-card,
body.theme-light .placement-question-card,
body.theme-light .placement-result-card,
body.theme-light .placement-summary-box,
body.theme-light .placement-message-box,
body.theme-light .placement-breakdown-row,
body.theme-light .home-step-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .home-hero-copy h1,
body.theme-light .placement-start-card h2,
body.theme-light .placement-question-card h2,
body.theme-light .placement-result-top h2,
body.theme-light .placement-summary-box strong,
body.theme-light .placement-message-box h3,
body.theme-light .placement-breakdown h3,
body.theme-light .placement-breakdown-main strong,
body.theme-light .home-step-card h3,
body.theme-light .quick-action-card strong {
    color: #0f172a;
}

body.theme-light .home-hero-copy p,
body.theme-light .placement-start-card p,
body.theme-light .placement-rules-grid span,
body.theme-light .placement-result-top p,
body.theme-light .placement-message-box p,
body.theme-light .placement-breakdown-main p,
body.theme-light .placement-breakdown-side small,
body.theme-light .home-step-card p,
body.theme-light .quick-action-card small {
    color: #475569;
}

body.theme-light .placement-rules-grid div,
body.theme-light .placement-start-emoji,
body.theme-light .hero-panel-icon,
body.theme-light .placement-topic-emoji,
body.theme-light .placement-result-emoji,
body.theme-light .quick-action-card span {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .placement-answer-check {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.10);
    color: #334155 !important;
}

body.theme-light .placement-answer-check strong {
    color: #1d4ed8;
}

/* Mobile fixes for latest home and placement */

@media (max-width: 1150px) {
    .home-steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    .placement-result-top,
    .placement-breakdown-row,
    .placement-breakdown-main {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .placement-breakdown-side {
        justify-items: start;
        text-align: left;
        width: 100%;
    }

    .placement-summary-grid,
    .placement-rules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .home-hero-copy,
    .placement-start-card,
    .placement-question-card,
    .placement-result-card {
        padding: 22px;
        border-radius: 26px;
    }

    .home-hero-copy h1 {
        font-size: 2.35rem;
    }

    .home-hero-copy .button-row,
    .placement-submit-row,
    .placement-result-card .button-row {
        flex-direction: column;
    }

    .home-hero-copy .btn,
    .placement-submit-row .btn,
    .placement-result-card .btn {
        width: 100%;
        text-align: center;
    }

    .home-steps-grid,
    .quick-action-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PLACEMENT TRIAL — SCROLL UNLOCK PATH
========================================================= */

.scroll-placement-mode {
    max-width: 940px;
    margin: 35px auto 80px;
    display: grid !important;
    gap: 26px;
}

.scroll-placement-mode .placement-question-card {
    display: block !important;
    position: relative;
    overflow: hidden;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        filter 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.scroll-placement-mode .placement-question-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: 0.3s ease;
}

.scroll-placement-mode .placement-question-card.placement-locked {
    opacity: 0.38;
    filter: grayscale(0.75) blur(0.2px);
    transform: scale(0.985);
    pointer-events: none;
}

.scroll-placement-mode .placement-question-card.placement-locked::after {
    content: "🔒 Answer the question above to unlock this one.";
    display: block;
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 16px;
    text-align: center;
    color: #cbd5e1;
    font-weight: 1000;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.scroll-placement-mode .placement-question-card.placement-active {
    opacity: 1;
    filter: none;
    transform: scale(1);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.12),
        0 24px 70px rgba(56, 189, 248, 0.12);
    animation: placementUnlockRise 0.42s ease both;
}

.scroll-placement-mode .placement-question-card.placement-active::before {
    opacity: 1;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 38%),
        radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.12), transparent 38%);
}

.scroll-placement-mode .placement-question-card.placement-completed {
    opacity: 0.82;
    filter: none;
    transform: scale(0.99);
    border-color: rgba(34, 197, 94, 0.30);
}

.scroll-placement-mode .placement-question-card.placement-completed::after {
    content: "✅ Locked in — next question unlocked.";
    display: block;
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 16px;
    text-align: center;
    color: #bbf7d0;
    font-weight: 1000;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.scroll-placement-mode .placement-question-card.placement-timeout::after {
    content: "⏰ Time ran out — next question unlocked.";
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.28);
}

.scroll-placement-mode .placement-question-card.placement-needs-answer {
    animation: placementShake 0.35s ease both;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.scroll-placement-mode .placement-question-card.placement-timer-danger {
    border-color: rgba(239, 68, 68, 0.5);
}

.scroll-placement-mode .placement-question-card.placement-timer-danger [data-question-timer] {
    color: #fecaca;
}

.scroll-placement-mode .placement-question-card.placement-completed .placement-options {
    pointer-events: none;
}

.scroll-placement-mode .placement-question-card.placement-completed .placement-option {
    opacity: 0.7;
}

.scroll-placement-mode .placement-question-card.placement-completed .placement-option:has(input:checked) {
    opacity: 1;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.14);
}

.scroll-placement-mode .placement-submit-row {
    position: sticky;
    bottom: 18px;
    z-index: 20;
    padding: 16px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.placement-submit-locked {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

@keyframes placementUnlockRise {
    from {
        opacity: 0.2;
        transform: translateY(24px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes placementShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-7px);
    }
    50% {
        transform: translateX(7px);
    }
    75% {
        transform: translateX(-4px);
    }
}

/* Light mode */

body.theme-light .scroll-placement-mode .placement-question-card.placement-locked::after {
    color: #64748b;
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .scroll-placement-mode .placement-question-card.placement-completed::after {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

body.theme-light .scroll-placement-mode .placement-question-card.placement-timeout::after {
    color: #9a3412;
    background: #ffedd5;
    border-color: #fdba74;
}

body.theme-light .scroll-placement-mode .placement-submit-row {
    background: rgba(255,255,255,0.88);
    border-color: rgba(15, 23, 42, 0.10);
}

/* =========================================================
   MOBILE NAVBAR FIX
========================================================= */

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: 0.25s ease;
}

.mobile-menu-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 760px) {
    .navbar,
    .top-navbar,
    .main-navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        min-height: 64px;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links,
    .navbar-links,
    .main-nav-links {
        position: fixed;
        top: 72px;
        left: 12px;
        right: 12px;
        z-index: 999;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        max-height: calc(100vh - 95px);
        overflow-y: auto;
        padding: 14px;
        border-radius: 22px;
        background: rgba(15, 23, 42, 0.96);
        border: 1px solid rgba(255,255,255,0.14);
        box-shadow: 0 24px 80px rgba(0,0,0,0.35);
        backdrop-filter: blur(18px);
    }

    .nav-links.mobile-menu-open,
    .navbar-links.mobile-menu-open,
    .main-nav-links.mobile-menu-open {
        display: flex !important;
        animation: mobileMenuIn 0.22s ease both;
    }

    .nav-links a,
    .navbar-links a,
    .main-nav-links a {
        width: 100%;
        justify-content: flex-start;
        padding: 13px 14px;
        border-radius: 16px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.08);
    }

    .more-dropdown,
    .dropdown-menu {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        margin-top: 8px;
    }

    .player-navbar-chip {
        max-width: 145px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

@keyframes mobileMenuIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.theme-light .nav-links,
body.theme-light .navbar-links,
body.theme-light .main-nav-links {
    background: rgba(255,255,255,0.97);
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .nav-links a,
body.theme-light .navbar-links a,
body.theme-light .main-nav-links a {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Player setup should not be crushed by nav on phones */
@media (max-width: 760px) {
    .player-setup-page .nav-links,
    .player-setup-page .navbar-links,
    .player-setup-page .main-nav-links {
        display: none !important;
    }

    .player-setup-page .mobile-menu-toggle {
        display: none !important;
    }

    .player-setup-page {
        padding-top: 10px;
    }
}

/* =========================================================
   FINAL MOBILE NAVBAR FIX
========================================================= */

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    color: inherit;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: 0.25s ease;
}

.mobile-menu-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-more-wrapper {
    position: relative;
}

.nav-more-button {
    border: 0;
    cursor: pointer;
    color: inherit;
}

.nav-more-menu,
.dropdown-menu.nav-more-menu {
    display: none !important;
}

.nav-more-menu.more-menu-open,
.dropdown-menu.nav-more-menu.more-menu-open {
    display: flex !important;
    flex-direction: column;
}

@media (min-width: 761px) {
    .nav-more-menu.more-menu-open {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        min-width: 220px;
        padding: 12px;
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.96);
        border: 1px solid rgba(255,255,255,0.14);
        box-shadow: 0 20px 60px rgba(0,0,0,0.25);
        z-index: 1001;
        gap: 8px;
    }
}

@media (max-width: 760px) {
    .navbar,
    .top-navbar,
    .main-navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        min-height: 64px;
        padding: 10px 14px;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap !important;
    }

    .navbar-logo,
    .logo {
        flex-shrink: 0;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .theme-toggle {
        display: inline-flex !important;
    }

    .nav-links,
    .navbar-links,
    .main-nav-links {
        position: fixed;
        top: 72px;
        left: 12px;
        right: 12px;
        z-index: 999;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        max-height: calc(100vh - 95px);
        overflow-y: auto;
        padding: 14px;
        border-radius: 22px;
        background: rgba(15, 23, 42, 0.97);
        border: 1px solid rgba(255,255,255,0.14);
        box-shadow: 0 24px 80px rgba(0,0,0,0.35);
        backdrop-filter: blur(18px);
    }

    .nav-links.mobile-menu-open,
    .navbar-links.mobile-menu-open,
    .main-nav-links.mobile-menu-open {
        display: flex !important;
        animation: mobileMenuIn 0.22s ease both;
    }

    .nav-links a,
    .navbar-links a,
    .main-nav-links a,
    .nav-more-button {
        width: 100%;
        justify-content: flex-start;
        padding: 13px 14px;
        border-radius: 16px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.08);
        text-align: left;
    }

    .nav-more-wrapper {
        width: 100%;
    }

    .nav-more-menu,
    .dropdown-menu.nav-more-menu {
        position: static !important;
        width: 100% !important;
        margin-top: 8px;
        padding: 0;
        box-shadow: none !important;
        background: transparent !important;
        border: 0 !important;
        gap: 8px;
    }

    .nav-more-menu.more-menu-open,
    .dropdown-menu.nav-more-menu.more-menu-open {
        display: flex !important;
    }

    .player-navbar-chip {
        max-width: 135px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

@keyframes mobileMenuIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.theme-light .nav-links,
body.theme-light .navbar-links,
body.theme-light .main-nav-links,
body.theme-light .nav-more-menu.more-menu-open {
    background: rgba(255,255,255,0.97);
    border-color: rgba(15, 23, 42, 0.10);
}

body.theme-light .nav-links a,
body.theme-light .navbar-links a,
body.theme-light .main-nav-links a,
body.theme-light .nav-more-button,
body.theme-light .theme-toggle,
body.theme-light .mobile-menu-toggle {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Player setup page should focus on setup, not nav */
@media (max-width: 760px) {
    .player-setup-page .nav-links,
    .player-setup-page .navbar-links,
    .player-setup-page .main-nav-links {
        display: none !important;
    }
}

/* =========================================================
   FINAL FIXED PHONE TOP BAR
   Name + hamburger stay side by side, fixed at top
========================================================= */

:root {
    --mobile-nav-height: 58px;
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body {
        padding-top: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;
    }

    /* Fixed top bar */
    .navbar,
    .main-navbar,
    .top-navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;

        height: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;
        min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;

        padding: calc(7px + env(safe-area-inset-top)) 10px 7px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 7px !important;

        overflow: visible !important;
        background: rgba(15, 23, 42, 0.96) !important;
        backdrop-filter: blur(18px) !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
    }

    body.theme-light .navbar,
    body.theme-light .main-navbar,
    body.theme-light .top-navbar {
        background: rgba(255,255,255,0.96) !important;
        border-bottom: 1px solid rgba(15,23,42,0.10) !important;
    }

    /* Logo should not eat the whole bar */
    .navbar-logo,
    .logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 38vw !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .logo-icon {
        font-size: 1.05rem !important;
        flex-shrink: 0 !important;
    }

    /* Player name stays beside hamburger, not stacked */
    .player-navbar-chip {
        flex: 0 1 auto !important;
        width: auto !important;
        max-width: 105px !important;
        min-width: 0 !important;

        height: 38px !important;
        padding: 6px 8px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: row !important;
        gap: 5px !important;

        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;

        font-size: 0.75rem !important;
        line-height: 1 !important;
        border-radius: 13px !important;
    }

    .player-navbar-chip span {
        flex: 0 0 auto !important;
        font-size: 0.95rem !important;
    }

    .player-navbar-chip strong {
        display: block !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        max-width: 70px !important;
    }

    /* Small fixed buttons */
    .theme-toggle,
    .mobile-menu-toggle {
        flex: 0 0 38px !important;
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 13px !important;
    }

    .mobile-menu-toggle {
        flex-direction: column !important;
        gap: 4px !important;
    }

    .mobile-menu-toggle span {
        width: 18px !important;
        height: 2px !important;
    }

    /* The page itself gets the full screen width */
    .page-shell {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 14px 12px 90px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
    }

    /* Mobile menu becomes a full-screen drawer below the fixed bar */
    .nav-links,
    .navbar-links,
    .main-nav-links {
        position: fixed !important;
        top: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9998 !important;

        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-top)) !important;

        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;

        padding: 14px 14px 30px !important;
        margin: 0 !important;

        overflow-y: auto !important;
        border-radius: 0 !important;

        background: rgba(15, 23, 42, 0.98) !important;
        border: 0 !important;
        box-shadow: none !important;
        backdrop-filter: blur(20px) !important;
    }

    body.theme-light .nav-links,
    body.theme-light .navbar-links,
    body.theme-light .main-nav-links {
        background: rgba(255,255,255,0.98) !important;
    }

    .nav-links.mobile-menu-open,
    .navbar-links.mobile-menu-open,
    .main-nav-links.mobile-menu-open {
        display: flex !important;
    }

    .nav-links a,
    .navbar-links a,
    .main-nav-links a,
    .nav-more-button {
        width: 100% !important;
        min-height: 48px !important;
        padding: 13px 14px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        border-radius: 16px !important;
        text-align: left !important;
        font-size: 0.95rem !important;
    }

    .nav-more-wrapper {
        width: 100% !important;
    }

    .nav-more-menu,
    .dropdown-menu.nav-more-menu {
        position: static !important;
        width: 100% !important;
        margin-top: 8px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        gap: 8px !important;
    }

    .nav-more-menu.more-menu-open,
    .dropdown-menu.nav-more-menu.more-menu-open {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Player setup page: still fixed small header */
    .setup-mini-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;

        height: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;
        padding: calc(7px + env(safe-area-inset-top)) 10px 7px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        background: rgba(15, 23, 42, 0.96) !important;
        backdrop-filter: blur(18px) !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    }

    body.theme-light .setup-mini-header {
        background: rgba(255,255,255,0.96) !important;
        border-bottom: 1px solid rgba(15,23,42,0.10) !important;
    }

    .player-setup-page {
        padding-top: calc(var(--mobile-nav-height) + env(safe-area-inset-top)) !important;
    }

    .player-setup-page .page-shell {
        padding-top: 12px !important;
    }
}

/* Extra small phones */
@media (max-width: 390px) {
    .navbar-logo,
    .logo {
        max-width: 31vw !important;
        font-size: 0.82rem !important;
    }

    .player-navbar-chip {
        max-width: 88px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .player-navbar-chip strong {
        max-width: 55px !important;
    }

    .theme-toggle,
    .mobile-menu-toggle {
        flex-basis: 36px !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
    }
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(8, 18, 48, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.mobile-brand-icon {
    font-size: 1.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.35));
}

.mobile-brand-text {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.6px;
    background: linear-gradient(90deg, #ffffff 0%, #c7d2fe 35%, #8fb8ff 70%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(76, 110, 245, 0.22);
    white-space: nowrap;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    transition: transform 0.18s ease, background 0.18s ease;
}

.topbar-icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
}

.topbar-icon-btn:active {
    transform: scale(0.97);
}

@media (max-width: 768px) {
    .mobile-topbar {
        padding: 14px 16px;
    }

    .mobile-brand-text {
        font-size: 1.85rem;
    }

    .topbar-icon-btn {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}

/* MathForge Guided Start Tutorial — clear spotlight version */
.mf-tutorial-hidden {
    display: none !important;
}

.mf-guided-tutorial {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    pointer-events: none;
}

.mf-tutorial-blocker {
    position: fixed;
    z-index: 9999999;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(5px);
    pointer-events: auto;
    transition: left 0.38s ease, top 0.38s ease, width 0.38s ease, height 0.38s ease;
}

.mf-tutorial-spotlight {
    position: fixed;
    z-index: 10000000;
    display: none;
    border: 3px solid #fbbf24;
    border-radius: 22px;
    box-shadow:
        0 0 0 5px rgba(251, 191, 36, 0.20),
        0 0 32px rgba(251, 191, 36, 0.72),
        inset 0 0 18px rgba(255, 255, 255, 0.16);
    pointer-events: none;
    transition: left 0.48s cubic-bezier(.22,.8,.24,1), top 0.48s cubic-bezier(.22,.8,.24,1), width 0.48s cubic-bezier(.22,.8,.24,1), height 0.48s cubic-bezier(.22,.8,.24,1);
    animation: mfSpotlightPulse 1.45s ease-in-out infinite;
}

.mf-tutorial-spotlight.is-visible {
    display: block;
}

.mf-tutorial-target {
    outline: 3px solid rgba(251, 191, 36, 0.92) !important;
    outline-offset: 4px !important;
    border-radius: 18px !important;
    filter: brightness(1.08) saturate(1.08);
}

.mf-tutorial-thumb {
    position: fixed;
    z-index: 10000002;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
    transition: left 0.55s cubic-bezier(.22,.9,.24,1), top 0.55s cubic-bezier(.22,.9,.24,1), opacity 0.22s ease, transform 0.32s ease;
    pointer-events: none;
}

.mf-tutorial-thumb.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mf-tutorial-thumb span {
    position: relative;
    z-index: 2;
    font-size: 3.25rem;
    line-height: 1;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.48));
    animation: mfHandTap 1.1s ease-in-out infinite;
}

.mf-tutorial-thumb i {
    position: absolute;
    inset: 12px;
    border-radius: 999px;
    border: 3px solid rgba(251, 191, 36, 0.72);
    animation: mfHandRing 1.1s ease-out infinite;
}

.mf-tutorial-skip {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 10000005;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: white;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.30);
    font-size: 0.83rem;
    font-weight: 950;
    cursor: pointer;
    pointer-events: auto;
}

.mf-tutorial-panel {
    position: fixed;
    z-index: 10000004;
    width: min(430px, calc(100vw - 24px));
    max-height: min(58vh, 440px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.19);
    border-radius: 25px;
    color: white;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.38), transparent 16rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.985), rgba(30, 41, 59, 0.985));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
    pointer-events: auto;
    transition: top 0.38s ease, opacity 0.25s ease, transform 0.38s ease;
}

.mf-tutorial-panel.is-collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mf-tutorial-kicker {
    margin: 0 0 7px;
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 1000;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mf-tutorial-panel h2 {
    margin: 0 0 8px;
    padding-right: 2px;
    font-size: clamp(1.45rem, 5vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.mf-tutorial-panel > p:not(.mf-tutorial-kicker):not(.mf-tutorial-action-hint) {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

.mf-tutorial-action-hint {
    margin: 13px 0 4px;
    padding: 11px 12px;
    border-radius: 14px;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.16);
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.35;
}

.mf-tutorial-primary,
.mf-tutorial-choice {
    min-height: 54px;
    border: 0;
    border-radius: 17px;
    color: white;
    font-weight: 1000;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.30);
}

.mf-tutorial-primary {
    width: 100%;
    margin-top: 11px;
}

.mf-tutorial-choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0 4px;
}

.mf-tutorial-choice:first-child {
    background: linear-gradient(135deg, #16a34a, #2563eb);
}

.mf-mode-free .mf-tutorial-panel {
    width: min(390px, calc(100vw - 24px));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

@keyframes mfSpotlightPulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.18), 0 0 25px rgba(251, 191, 36, 0.55); }
    50% { box-shadow: 0 0 0 9px rgba(251, 191, 36, 0.08), 0 0 42px rgba(251, 191, 36, 0.88); }
}

@keyframes mfHandTap {
    0%, 100% { transform: translateY(0) scale(1); }
    48% { transform: translateY(9px) scale(0.94); }
    72% { transform: translateY(0) scale(1.04); }
}

@keyframes mfHandRing {
    0% { opacity: 0.8; transform: scale(0.55); }
    100% { opacity: 0; transform: scale(1.55); }
}

@media (max-width: 720px) {
    .mf-tutorial-panel {
        padding: 17px;
        border-radius: 22px;
        max-height: 52vh;
    }

    .mf-tutorial-thumb {
        width: 62px;
        height: 62px;
    }

    .mf-tutorial-thumb span {
        font-size: 2.8rem;
    }

    .mf-tutorial-choice-row {
        grid-template-columns: 1fr;
    }

    .mf-tutorial-skip {
        top: max(8px, env(safe-area-inset-top));
        right: 8px;
    }
}


/* =========================================================
   MATHFORGE MOBILE POLISH — JULY 20, 2026
========================================================= */

.player-setup-card { position: relative; }

.profile-update-heading-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.profile-update-heading-row .ui-pill {
    margin: 0;
}

.profile-update-close {
    position: static;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    background: rgba(15, 23, 42, 0.84);
    text-decoration: none;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(0,0,0,0.22);
    transition: transform 0.18s ease, background 0.18s ease;
}

.profile-update-close span {
    display: block;
    transform: translateY(-1px);
}

.profile-update-close:hover,
.profile-update-close:focus-visible {
    transform: translateY(-1px) scale(1.04);
    background: rgba(30, 41, 59, 0.98);
    outline: 2px solid rgba(96,165,250,0.9);
    outline-offset: 2px;
}

.setup-field select:invalid { color: #94a3b8; }
.setup-field select option { color: #0f172a; }

.mathforge-creator-credit {
    margin: 24px 0;
    padding: 20px 22px;
    display: grid;
    gap: 5px;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: linear-gradient(135deg, rgba(37,99,235,0.16), rgba(124,58,237,0.12));
}

.mathforge-creator-credit span {
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mathforge-creator-credit strong {
    color: white;
    font-size: 1.45rem;
}

body.theme-light .profile-update-close {
    color: #0f172a;
    background: rgba(255,255,255,0.92);
    border-color: rgba(15,23,42,0.10);
}

body.theme-light .mathforge-creator-credit strong { color: #0f172a; }

.mf-global-controls { display: none; }

@media (max-width: 760px) {
    body { padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important; }

    .profile-update-heading-row {
        gap: 8px;
    }

    .profile-update-close {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 1.4rem;
    }

    .mf-global-controls {
        position: fixed;
        left: 50%;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 9997;
        width: min(250px, calc(100vw - 28px));
        min-height: 56px;
        padding: 7px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        transform: translateX(-50%);
        border-radius: 21px;
        border: 1px solid rgba(255,255,255,0.14);
        background: rgba(15, 23, 42, 0.90);
        box-shadow: 0 18px 42px rgba(0,0,0,0.32);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mf-global-control {
        min-height: 42px;
        padding: 7px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 0;
        border-radius: 15px;
        color: white;
        background: rgba(255,255,255,0.08);
        text-decoration: none;
        font: inherit;
        cursor: pointer;
    }

    .mf-global-control:last-child {
        background: linear-gradient(135deg, #2563eb, #7c3aed);
    }

    .mf-global-control span { font-size: 1.35rem; line-height: 1; }
    .mf-global-control strong { font-size: 0.82rem; }

    body.theme-light .mf-global-controls {
        background: rgba(255,255,255,0.94);
        border-color: rgba(15,23,42,0.10);
    }

    body.theme-light .mf-global-control:first-child {
        color: #0f172a;
        background: #eef2ff;
    }

    .home-dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   MATHFORGE PROFILE CLOSE — PHONE RELIABILITY FIX
   Keeps the X visible even when a phone has an older cached layout.
========================================================= */
.profile-update-heading-row {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

.profile-update-heading-row .ui-pill {
    min-width: 0 !important;
    max-width: calc(100% - 52px) !important;
}

.profile-update-close {
    position: relative !important;
    inset: auto !important;
    z-index: 50 !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

@media (max-width: 760px) {
    .profile-update-heading-row {
        width: 100% !important;
        padding-inline: 2px !important;
        gap: 8px !important;
    }

    .profile-update-heading-row .ui-pill {
        max-width: calc(100% - 48px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .profile-update-close {
        flex-basis: 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        border-radius: 14px !important;
        font-size: 1.55rem !important;
    }
}
