:root {
    --ink: #18233b;
    --muted: #6f7890;
    --cream: #fbf8f1;
    --paper: #fff;
    --purple: #7047d8;
    --purple-dark: #5130b2;
    --purple-soft: #eee8ff;
    --orange: #ff9d3d;
    --gold: #f3b13d;
    --green: #38b887;
    --line: #e9e6ef;
    --shadow: 0 24px 70px rgba(44, 29, 88, .12);
    --radius: 24px;
    --container: 1160px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "Anuphan", system-ui, sans-serif;
    line-height: 1.65;
}
body::selection { color: white; background: var(--purple); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
    position: relative;
    z-index: 50;
    height: 82px;
    background: rgba(251, 248, 241, .94);
    border-bottom: 1px solid rgba(31, 26, 50, .07);
    backdrop-filter: blur(14px);
}
.nav-wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    color: white;
    background: var(--purple);
    border-radius: 14px 14px 14px 5px;
    font: 700 26px/1 "Fredoka", sans-serif;
    transform: rotate(-4deg);
    box-shadow: 0 7px 18px rgba(112, 71, 216, .24);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font: 700 23px/1 "Fredoka", sans-serif; letter-spacing: -.4px; }
.brand small { margin-top: 4px; color: var(--purple); font-size: 8px; font-weight: 700; letter-spacing: 2px; }
.main-nav { display: flex; align-items: center; gap: 31px; font-size: 14px; font-weight: 600; }
.main-nav > a:not(.btn) { transition: color .2s; }
.main-nav > a:not(.btn):hover { color: var(--purple); }
.nav-toggle { display: none; border: 0; background: transparent; padding: 8px; }
.nav-toggle > span:not(.sr-only) { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--ink); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.user-dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--purple); }
.nav-avatar { width: 32px; height: 32px; object-fit: cover; border: 2px solid white; border-radius: 50%; box-shadow: 0 3px 10px rgba(44,29,88,.16); }
.pwa-install-button {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; color: var(--purple);
    background: var(--purple-soft); border: 0; border-radius: 9px; font-size: 11px; font-weight: 700;
}
.pwa-install-button:hover { background: #e3d9ff; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    padding: 12px 21px;
    font-weight: 700;
    line-height: 1.2;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: var(--purple); box-shadow: 0 10px 26px rgba(112, 71, 216, .24); }
.btn-primary:hover { background: var(--purple-dark); box-shadow: 0 14px 30px rgba(112, 71, 216, .3); }
.btn-small { padding: 10px 17px; font-size: 13px; }
.btn-large { min-height: 53px; padding: 15px 24px; }
.btn-light { color: var(--purple-dark); background: white; box-shadow: 0 15px 35px rgba(37, 19, 88, .2); }
.btn-outline { color: var(--purple); border-color: #cfc4ed; background: transparent; }
.btn-block { width: 100%; }

.hero { position: relative; min-height: 670px; overflow: hidden; background: linear-gradient(135deg, #fbf8f1 0%, #f7f1ff 100%); }
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 75px; min-height: 615px; padding-top: 22px; }
.hero-copy { padding-bottom: 25px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--purple); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow > span { color: var(--orange); }
.eyebrow-gold { color: #bd7829; }
.eyebrow-light { color: #e9deff; }
.hero h1, .auth-art h1 {
    margin: 0;
    font: 700 clamp(48px, 5.7vw, 76px)/.99 "Fredoka", sans-serif;
    letter-spacing: -2.5px;
}
.hero h1 em { color: var(--purple); font-style: normal; }
.hero-copy > p { max-width: 540px; margin: 25px 0 30px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; align-items: center; gap: 28px; }
.text-link { color: var(--ink); font-size: 14px; font-weight: 700; }
.text-link span { display: inline-block; margin-left: 5px; color: var(--purple); }
.hero-stats { display: flex; gap: 0; margin-top: 43px; }
.hero-stats > div { display: flex; flex-direction: column; min-width: 118px; padding-right: 28px; margin-right: 28px; border-right: 1px solid #ddd8e4; }
.hero-stats > div:last-child { border: 0; margin: 0; padding: 0; }
.hero-stats strong { font: 700 25px/1 "Fredoka", sans-serif; color: var(--purple); }
.hero-stats span { margin-top: 8px; color: var(--muted); font-size: 11px; }
.hero-game { position: relative; display: grid; place-items: center; min-height: 500px; }
.hero-game::before {
    content: "";
    position: absolute;
    width: 470px;
    height: 470px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e8ddff, #f9d9bb);
    opacity: .75;
}
.game-card { position: relative; z-index: 2; width: min(100%, 405px); padding: 28px; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.9); border-radius: 29px; box-shadow: 0 32px 80px rgba(56, 35, 117, .2); transform: rotate(2.4deg); }
.game-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.game-card-top > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.game-card-top span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.game-card-top strong { font: 700 24px/1 "Fredoka", sans-serif; color: var(--purple); }
.timer { padding: 7px 11px; color: var(--purple-dark); background: var(--purple-soft); border-radius: 9px; font: 700 12px "Fredoka", sans-serif; }
.timer span { margin-right: 4px; color: var(--purple); }
.word-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.word-grid > span {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    color: #4e5260;
    background: #f7f5fa;
    border-radius: 9px;
    font: 600 16px "Fredoka", sans-serif;
}
.word-grid .found { z-index: 1; color: white; background: var(--purple); box-shadow: 0 4px 11px rgba(112,71,216,.28); }
.word-grid .found:nth-child(3)::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 50%;
    width: 100%;
    height: 150px;
    background: rgba(112, 71, 216, .3);
    transform: translateY(0);
}
.game-progress { margin-top: 21px; }
.game-progress > div:first-child { display: flex; justify-content: space-between; font-size: 11px; }
.game-progress span { color: var(--muted); }
.game-progress strong { color: var(--purple); }
.progress-track { height: 6px; margin-top: 8px; overflow: hidden; background: #ece9f2; border-radius: 99px; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), #9c79ee); border-radius: inherit; }
.floating-tag { position: absolute; z-index: 3; padding: 11px 15px; color: var(--purple-dark); background: white; border-radius: 13px; box-shadow: var(--shadow); font: 700 15px "Fredoka", sans-serif; }
.floating-tag span { display: block; color: var(--muted); font: 500 9px "Anuphan", sans-serif; }
.tag-one { top: 78px; right: -5px; transform: rotate(5deg); }
.tag-two { bottom: 72px; left: -12px; color: var(--orange); letter-spacing: 2px; transform: rotate(-5deg); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.hero-orb-one { top: 80px; left: -110px; width: 250px; height: 250px; background: rgba(255, 198, 135, .25); }
.hero-orb-two { right: 8%; bottom: -100px; width: 300px; height: 300px; background: rgba(112, 71, 216, .1); }
.hero-wave { position: absolute; bottom: -45px; left: -2%; width: 104%; height: 90px; background: var(--paper); border-radius: 50% 50% 0 0 / 55% 55% 0 0; }

.section { padding: 100px 0; }
.section-heading { max-width: 620px; margin: 0 auto 50px; text-align: center; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section h2 { margin: 0; font: 700 clamp(34px, 4vw, 50px)/1.1 "Fredoka", sans-serif; letter-spacing: -1.2px; }
.section-heading p { margin: 14px 0 0; color: var(--muted); }
.steps-section { background: var(--paper); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.step-card { position: relative; padding: 36px 30px 31px; overflow: hidden; background: #fcfbff; border: 1px solid var(--line); border-radius: 22px; transition: transform .25s, box-shadow .25s; }
.step-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); }
.step-card.featured { background: #fffbf4; border-color: #f3e4cd; }
.step-number { position: absolute; top: 17px; right: 21px; color: #e7e3ed; font: 700 36px "Fredoka", sans-serif; }
.step-icon { display: grid; place-items: center; width: 57px; height: 57px; margin-bottom: 23px; border-radius: 17px; font-size: 25px; font-weight: 700; }
.step-icon-purple { color: var(--purple); background: var(--purple-soft); }
.step-icon-orange { color: #d8771b; background: #ffebcf; }
.step-icon-green { color: #13845e; background: #dff7ee; }
.step-card h3 { margin: 0 0 10px; font: 700 21px "Fredoka", "Anuphan", sans-serif; }
.step-card p { margin: 0; color: var(--muted); font-size: 14px; }

.feature-section { background: #f8f4ec; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 105px; }
.feature-visual { position: relative; min-height: 430px; display: grid; place-items: center; }
.feature-visual::before { content: ""; position: absolute; width: 390px; height: 390px; border-radius: 40% 60% 55% 45%; background: #e8ddff; transform: rotate(15deg); }
.mini-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 55px); gap: 9px; padding: 27px; background: white; border-radius: 24px; box-shadow: var(--shadow); transform: rotate(-4deg); }
.mini-grid span { display: grid; place-items: center; aspect-ratio: 1; color: var(--purple-dark); background: var(--purple-soft); border-radius: 12px; font: 700 20px "Fredoka", sans-serif; }
.mini-grid span:nth-child(n+11) { color: white; background: var(--purple); }
.streak-badge { position: absolute; z-index: 2; right: 12px; bottom: 40px; display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: white; border-radius: 16px; box-shadow: var(--shadow); }
.streak-badge strong { color: var(--orange); font: 700 25px "Fredoka", sans-serif; }
.streak-badge span { color: var(--muted); font-size: 11px; }
.feature-copy > p { color: var(--muted); font-size: 16px; }
.check-list { padding: 0; margin: 30px 0 0; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 14px; margin: 19px 0; }
.check-list li > span { display: grid; place-items: center; flex: 0 0 29px; height: 29px; color: var(--green); background: #dcf5ec; border-radius: 50%; font-weight: 700; }
.check-list div { display: flex; flex-direction: column; }
.check-list strong { font-size: 14px; }
.check-list small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.cta-section { padding: 75px 0; background: white; }
.cta-card { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 300px; padding: 55px 70px; overflow: hidden; color: white; background: linear-gradient(125deg, #5f39c4, #8057df); border-radius: 30px; box-shadow: 0 30px 70px rgba(74, 42, 160, .25); }
.cta-card::after { content: "WORD"; position: absolute; right: -10px; bottom: -63px; color: rgba(255,255,255,.05); font: 700 130px "Fredoka", sans-serif; }
.cta-card > * { position: relative; z-index: 1; }
.cta-card .eyebrow { margin-bottom: 10px; }
.cta-card h2 { font-size: 43px; }
.cta-card p { margin-bottom: 0; color: #e8defd; }

.site-footer { padding: 58px 0 22px; color: #b9bfd0; background: #172037; }
.brand-footer { color: white; }
.brand-footer .brand-mark { background: #8865e8; }
.brand-footer small { color: #bdaaff; }
.footer-grid { display: flex; align-items: flex-start; justify-content: space-between; }
.footer-grid p { max-width: 370px; margin: 17px 0 0; font-size: 13px; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 13px 45px; font-size: 13px; }
.footer-links a:hover { color: white; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 45px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); font-size: 11px; }

/* Authentication */
.auth-page .site-header { background: white; }
.auth-page .site-footer { display: none; }
.auth-shell { display: grid; grid-template-columns: minmax(380px, .84fr) minmax(540px, 1.16fr); min-height: calc(100vh - 82px); background: white; }
.auth-art { position: relative; display: grid; place-items: center; overflow: hidden; color: white; background: linear-gradient(145deg, #5632b9 0%, #7852d5 70%, #8b64e4 100%); }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.auth-art::before { width: 460px; height: 460px; left: -200px; top: -190px; }
.auth-art::after { width: 340px; height: 340px; right: -170px; bottom: -130px; }
.auth-art-inner { position: relative; z-index: 1; width: min(75%, 440px); }
.auth-art h1 { font-size: clamp(43px, 4.8vw, 65px); letter-spacing: -1.5px; }
.auth-art p { margin: 23px 0 35px; color: #e3daf9; font-size: 15px; }
.auth-grid-art { display: grid; grid-template-columns: repeat(4, 54px); gap: 8px; width: max-content; padding: 22px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 21px; backdrop-filter: blur(8px); transform: rotate(-3deg); }
.auth-grid-art span { display: grid; place-items: center; aspect-ratio: 1; color: white; background: rgba(255,255,255,.12); border-radius: 11px; font: 700 19px "Fredoka", sans-serif; }
.auth-grid-art span:nth-child(n+5):nth-child(-n+8) { color: var(--purple-dark); background: #ffd79e; }
.auth-panel { display: grid; place-items: center; padding: 55px 40px; }
.auth-form-wrap { width: min(100%, 455px); }
.register-form-wrap { width: min(100%, 620px); }
.form-kicker { color: var(--purple); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-form-wrap h2 { margin: 8px 0 4px; font: 700 38px "Fredoka", "Anuphan", sans-serif; letter-spacing: -.7px; }
.form-intro { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label > span:first-child:not(.input-icon) { display: inline-block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
    width: 100%;
    height: 49px;
    padding: 0 44px 0 42px;
    color: var(--ink);
    background: #fbfafc;
    border: 1px solid #dedbe5;
    border-radius: 12px;
    outline: 0;
    transition: border .2s, box-shadow .2s, background .2s;
}
.input-wrap input::placeholder { color: #aca8b5; }
.input-wrap input:focus { background: white; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(112, 71, 216, .11); }
.input-wrap.has-error input { border-color: #d94c68; }
.input-icon { position: absolute; left: 15px; z-index: 1; color: #9e98ad; font-size: 13px; font-weight: 700; }
.password-toggle { position: absolute; right: 8px; padding: 7px; color: var(--purple); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.field-error { display: block; min-height: 0; margin-top: 4px; color: #c73956; font-size: 10px; }
.field-error:not(:empty) { min-height: 14px; }
.form-row { display: flex; justify-content: space-between; align-items: center; }
.form-row-end { justify-content: flex-end; }
.checkbox-label { display: inline-flex !important; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 500 !important; }
.checkbox-label input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--purple); }
.checkbox-label span { margin: 0 !important; font-size: inherit !important; font-weight: inherit !important; }
.muted-link { color: var(--purple); font-size: 11px; font-weight: 600; }
.terms-check { margin-top: -2px; }
.auth-switch { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.auth-switch a { color: var(--purple); font-weight: 700; }
.form-alert { padding: 11px 13px; margin-bottom: 17px; color: #a22d44; background: #fff0f3; border: 1px solid #f4ccd4; border-radius: 10px; font-size: 12px; }
.form-alert.success { color: #176849; background: #e8f8f1; border-color: #bde7d7; }
.auth-form.is-loading { opacity: .7; pointer-events: none; }
.perk-list { display: grid; gap: 13px; }
.perk-list div { display: flex; align-items: center; gap: 10px; color: #eee8ff; font-size: 13px; }
.perk-list span { display: grid; place-items: center; width: 23px; height: 23px; color: white; background: rgba(255,255,255,.16); border-radius: 50%; font-weight: 700; }

/* Dashboard */
.dashboard-hero { min-height: 650px; padding: 70px 0 100px; background: linear-gradient(145deg, #f9f6ef, #f0eaff); }
.welcome-card { display: flex; align-items: center; justify-content: space-between; padding: 50px; color: white; background: linear-gradient(120deg, #5933bd, #8158dd); border-radius: 28px; box-shadow: var(--shadow); }
.welcome-card h1 { margin: 0; font: 700 45px "Fredoka", "Anuphan", sans-serif; }
.welcome-card p { max-width: 620px; margin-bottom: 0; color: #e8e0fa; }
.profile-orb { display: grid; place-items: center; flex: 0 0 100px; height: 100px; border: 7px solid rgba(255,255,255,.16); border-radius: 50%; background: #ffaf56; font: 700 46px "Fredoka", sans-serif; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 25px 0; }
.stat-card { display: flex; flex-direction: column; padding: 27px; background: white; border: 1px solid var(--line); border-radius: 19px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card span { font-size: 12px; }
.stat-card strong { margin: 8px 0; color: var(--purple); font: 700 35px "Fredoka", sans-serif; }
.stat-card small { font-size: 11px; }
.dashboard-actions { display: flex; gap: 12px; }

@media (max-width: 960px) {
    .main-nav { gap: 18px; }
    .hero-grid { gap: 25px; }
    .hero-game::before { width: 390px; height: 390px; }
    .feature-grid { gap: 50px; }
    .auth-shell { grid-template-columns: .8fr 1.2fr; }
    .auth-art-inner { width: 82%; }
    .auth-panel { padding: 45px 28px; }
    .form-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .container { width: min(calc(100% - 30px), var(--container)); }
    .site-header { height: 70px; }
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute;
        top: 69px;
        right: 15px;
        left: 15px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        background: white;
        border: 1px solid var(--line);
        border-radius: 15px;
        box-shadow: var(--shadow);
    }
    .main-nav.is-open { display: flex; }
    .main-nav > a { padding: 12px; }
    .main-nav .btn { margin-top: 5px; }
    .main-nav .pwa-install-button { justify-content: center; margin-bottom: 5px; padding: 11px; }
    .hero { min-height: 0; }
    .hero-grid { grid-template-columns: 1fr; padding: 65px 0 100px; }
    .hero-copy { text-align: center; }
    .hero h1 { font-size: clamp(45px, 13vw, 65px); }
    .hero-copy > p { margin-inline: auto; }
    .hero-actions { justify-content: center; flex-wrap: wrap; }
    .hero-stats { justify-content: center; }
    .hero-game { min-height: 450px; }
    .game-card { width: min(90%, 390px); padding: 24px; }
    .tag-one { right: 1%; }
    .tag-two { left: 2%; }
    .section { padding: 75px 0; }
    .steps-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; gap: 30px; }
    .feature-visual { min-height: 360px; order: 2; transform: scale(.9); }
    .feature-copy { text-align: center; }
    .check-list { text-align: left; }
    .cta-card { flex-direction: column; align-items: flex-start; gap: 30px; padding: 42px 30px; }
    .cta-card h2 { font-size: 35px; }
    .footer-grid { flex-direction: column; gap: 35px; }
    .footer-bottom { gap: 20px; }
    .auth-shell { grid-template-columns: 1fr; min-height: calc(100vh - 70px); }
    .auth-art { display: none; }
    .auth-panel { padding: 50px 22px 70px; }
    .auth-form-wrap h2 { font-size: 34px; }
    .form-columns { grid-template-columns: 1fr; }
    .welcome-card { align-items: flex-start; padding: 35px 28px; }
    .welcome-card h1 { font-size: 36px; }
    .profile-orb { flex-basis: 66px; height: 66px; font-size: 30px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .brand-mark { width: 39px; height: 39px; }
    .hero-grid { padding-top: 50px; }
    .hero-stats > div { min-width: 95px; padding-right: 14px; margin-right: 14px; }
    .hero-game { min-height: 390px; }
    .hero-game::before { width: 325px; height: 325px; }
    .game-card { padding: 19px; }
    .word-grid { gap: 5px; }
    .mini-grid { grid-template-columns: repeat(5, 44px); padding: 20px; }
    .feature-visual::before { width: 315px; height: 315px; }
    .footer-bottom { flex-direction: column; }
    .dashboard-actions { flex-direction: column; }
    .dashboard-actions > *, .dashboard-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Player dashboard and level route */
.player-page { background: #f8f6f0; }
.player-hero { padding: 62px 0 58px; color: white; background: linear-gradient(120deg, #5230b1, #7950d5); }
.player-welcome { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.player-welcome h1 { margin: 0; font: 700 clamp(36px, 4.5vw, 55px)/1.08 "Fredoka", "Anuphan", sans-serif; }
.player-welcome p { margin: 14px 0 0; color: #e5dcf9; }
.player-summary { display: flex; flex: 0 0 auto; overflow: hidden; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; backdrop-filter: blur(8px); }
.player-summary div { min-width: 95px; padding: 17px 20px; text-align: center; border-right: 1px solid rgba(255,255,255,.12); }
.player-summary div:last-child { border: 0; }
.player-summary span { display: block; color: #d9cef4; font-size: 10px; }
.player-summary strong { display: block; margin-top: 3px; font: 700 22px "Fredoka", sans-serif; }
.category-section { padding-top: 72px; }
.player-heading { margin-bottom: 38px; text-align: left; margin-left: 0; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.category-card { position: relative; display: flex; flex-direction: column; min-height: 290px; padding: 28px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 23px; transition: transform .25s, box-shadow .25s; }
.category-card::after { content: ""; position: absolute; right: -55px; bottom: -65px; width: 170px; height: 170px; border-radius: 50%; opacity: .5; }
.category-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); }
.category-icon { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 19px; font: 700 25px "Fredoka", sans-serif; }
.theme-purple .category-icon { color: var(--purple); background: var(--purple-soft); }
.theme-purple::after { background: var(--purple-soft); }
.theme-orange .category-icon { color: #c56a15; background: #ffecd6; }
.theme-orange::after { background: #ffecd6; }
.theme-green .category-icon { color: #158461; background: #dcf5eb; }
.theme-green::after { background: #dcf5eb; }
.category-card-copy { margin-top: auto; }
.category-card-copy > span { color: var(--purple); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.category-card h3 { margin: 5px 0 7px; font: 700 24px "Fredoka", "Anuphan", sans-serif; }
.category-card p { margin: 0; color: var(--muted); font-size: 12px; }
.category-arrow { position: absolute; z-index: 1; right: 25px; bottom: 24px; display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--purple); border-radius: 50%; font-weight: 700; }
.theme-orange .category-arrow { background: var(--orange); }
.theme-green .category-arrow { background: var(--green); }

.levels-hero { padding: 42px 0 63px; color: white; background: linear-gradient(120deg, #5230b1, #7b53d8); }
.back-link { display: inline-block; margin-bottom: 38px; color: #ded3f6; font-size: 12px; font-weight: 600; }
.levels-title { display: flex; align-items: flex-end; justify-content: space-between; }
.levels-title .eyebrow { margin-bottom: 8px; }
.levels-title h1 { margin: 0; font: 700 52px "Fredoka", sans-serif; }
.levels-title p { margin: 8px 0 0; color: #ded5f5; }
.route-progress { padding: 15px 22px; background: rgba(255,255,255,.12); border-radius: 15px; text-align: right; }
.route-progress span { display: block; color: #dcd1f5; font-size: 10px; }
.route-progress strong { font: 700 24px "Fredoka", sans-serif; }
.level-section { padding-top: 55px; }
.level-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 880px; margin: auto; }
.level-card { display: flex; align-items: center; gap: 18px; min-height: 116px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 19px; transition: transform .2s, box-shadow .2s; }
a.level-card:hover { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(52,37,92,.1); }
.level-card.is-complete { border-color: #d9cdf5; }
.level-card.is-locked { opacity: .58; background: #f0eef2; }
.level-number { display: grid; place-items: center; flex: 0 0 65px; height: 65px; color: white; background: var(--purple); border-radius: 18px; font: 700 25px "Fredoka", sans-serif; }
.is-complete .level-number { background: var(--green); }
.is-locked .level-number { color: #77717f; background: #e2dfe5; font-size: 20px; }
.level-info { flex: 1; }
.level-info > span { color: var(--purple); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.level-info h3 { margin: 2px 0 4px; font: 700 18px "Fredoka", sans-serif; }
.level-info .level-meta { display: block; max-width: none; margin-bottom: 4px; color: var(--muted); font-size: 8px; text-align: left; }
.level-stars { color: #dcd8e3; letter-spacing: 2px; }
.level-stars .earned { color: var(--gold); }
.level-play { display: grid; place-items: center; width: 38px; height: 38px; color: var(--purple); background: var(--purple-soft); border-radius: 50%; font-size: 12px; }
.level-card small { max-width: 100px; color: var(--muted); font-size: 9px; text-align: right; }

/* Gameplay */
.game-page { overflow-x: hidden; background: #f5f2fa; }
.game-page .site-header, .game-page .site-footer { display: none; }
.game-shell { min-height: 100vh; padding: 22px 0 45px; background: radial-gradient(circle at 15% 0%, #fff7e9 0, transparent 30%), radial-gradient(circle at 90% 20%, #e9e0ff 0, transparent 33%), #f7f5fa; }
.game-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 68px; }
.game-exit { justify-self: start; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.game-exit:first-letter { font-size: 24px; }
.game-level-label { text-align: center; }
.game-level-label span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.game-level-label strong { color: var(--purple); font: 700 18px "Fredoka", sans-serif; }
.game-score { justify-self: end; display: flex; align-items: baseline; gap: 8px; padding: 9px 15px; background: white; border-radius: 12px; box-shadow: 0 7px 20px rgba(46,35,75,.08); }
.game-score span { color: var(--muted); font-size: 10px; }
.game-score strong { color: var(--purple); font: 700 20px "Fredoka", sans-serif; }
.game-layout { display: grid; grid-template-columns: minmax(470px, 1fr) 330px; align-items: start; gap: 28px; max-width: 1040px; margin-top: 22px; }
.puzzle-panel, .word-panel { background: white; border: 1px solid rgba(57,43,88,.08); border-radius: 25px; box-shadow: 0 24px 60px rgba(55,38,95,.1); }
.puzzle-panel { min-height: 620px; display: grid; place-items: center; padding: 35px; }
.game-loading { display: flex; flex-direction: column; align-items: center; text-align: center; }
.loader-orbit { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 20px; color: white; background: var(--purple); border: 7px solid #e9e1fc; border-radius: 50%; font: 700 28px "Fredoka", sans-serif; animation: pulse-loader 1.3s infinite alternate; }
@keyframes pulse-loader { to { transform: scale(1.08) rotate(5deg); box-shadow: 0 0 0 12px rgba(112,71,216,.08); } }
.game-loading strong { font: 700 20px "Fredoka", "Anuphan", sans-serif; }
.game-loading small { margin-top: 5px; color: var(--muted); }
.game-error { text-align: center; }
.game-error strong { color: #bd354f; font-size: 20px; }
.game-error p { color: var(--muted); }
.play-grid { display: grid; grid-template-columns: repeat(var(--grid-size), 1fr); gap: 8px; width: min(100%, 545px); touch-action: none; user-select: none; }
.grid-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; color: #343448; background: #f3f1f6; border: 0; border-radius: 12px; font: 700 clamp(16px, 2vw, 22px) "Fredoka", sans-serif; transition: color .12s, background .12s, transform .12s; }
.play-grid[data-size="9"], .play-grid[data-size="10"] { gap: 6px; }
.play-grid[data-size="11"], .play-grid[data-size="12"] { gap: 4px; }
.play-grid[data-size="11"] .grid-cell, .play-grid[data-size="12"] .grid-cell { border-radius: 9px; font-size: clamp(14px, 1.65vw, 19px); }
.grid-cell:hover { background: #ece7f7; }
.grid-cell.is-selected { color: white; background: #9b7ce9; transform: scale(.94); }
.grid-cell.is-found { color: white; background: var(--found-background, var(--purple)); box-shadow: 0 5px 12px rgba(46,35,78,.22); }
.play-grid.is-checking { pointer-events: none; }
.play-grid.has-wrong { animation: grid-shake .25s linear; }
@keyframes grid-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.word-panel { padding: 27px; }
.word-panel-heading { display: flex; align-items: center; justify-content: space-between; }
.word-panel-heading span { color: var(--purple); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.word-panel-heading h2 { margin: 2px 0 0; font: 700 22px "Fredoka", "Anuphan", sans-serif; }
.found-counter { display: flex; align-items: baseline; gap: 3px; }
.found-counter strong { color: var(--purple); font: 700 29px "Fredoka", sans-serif; }
.found-counter span { color: var(--muted); font-size: 13px; }
.find-progress { height: 6px; margin: 18px 0 22px; overflow: hidden; background: #ece9f1; border-radius: 99px; }
.find-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--purple), #a383ee); transition: width .3s; }
.target-words { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.target-words li { position: relative; display: flex; flex-direction: column; min-height: 51px; padding: 8px 42px 8px 12px; overflow: hidden; background: linear-gradient(90deg, var(--word-color-soft, #f0ebff), #f8f6fa 72%); border-left: 4px solid var(--word-color, var(--purple)); border-radius: 11px; transition: background .2s ease, box-shadow .2s ease, opacity .2s ease; }
.target-words li span { font: 700 14px "Fredoka", sans-serif; letter-spacing: .05em; }
.target-words li small { color: var(--muted); font-size: 10px; }
.target-words li b { position: absolute; right: 13px; top: 50%; display: none; place-items: center; width: 23px; height: 23px; color: white; background: var(--word-color, var(--green)); border-radius: 50%; transform: translateY(-50%); }
.target-words li.is-found { background: var(--word-color-soft, #f0ebff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--word-color, var(--purple)) 28%, transparent); }
.target-words li.is-found span { text-decoration: line-through; }
.target-words li.is-found b { display: grid; }
.game-message { min-height: 42px; margin-top: 17px; padding: 11px; color: var(--muted); background: #f7f5f9; border-radius: 10px; font-size: 11px; text-align: center; }
.game-message.is-success { color: #167252; background: #e5f8f0; }
.game-message.is-wrong { color: #aa354d; background: #fff0f3; }
.game-tip { display: flex; gap: 10px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.game-tip p { margin: 0; color: var(--muted); font-size: 10px; }
.game-tip strong { display: block; color: var(--ink); }
.result-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,15,35,.62); backdrop-filter: blur(8px); }
.result-overlay[hidden] { display: none; }
.result-card { position: relative; width: min(100%, 440px); padding: 43px 38px 35px; overflow: hidden; background: white; border-radius: 27px; box-shadow: 0 35px 90px rgba(17,11,35,.35); text-align: center; }
.result-burst { position: absolute; top: 20px; right: 25px; color: var(--orange); font-size: 25px; }
.result-card .eyebrow { margin-bottom: 6px; }
.result-card h2 { margin: 0; font: 700 38px "Fredoka", "Anuphan", sans-serif; }
.result-stars { margin: 16px 0; color: #ded9e5; font-size: 41px; letter-spacing: 5px; }
.result-stars .earned { color: var(--gold); text-shadow: 0 5px 15px rgba(243,177,61,.3); }
.result-score { display: flex; flex-direction: column; margin: 18px auto; }
.result-score span { color: var(--muted); font-size: 10px; }
.result-score strong { color: var(--purple); font: 700 42px "Fredoka", sans-serif; }
.result-card > p { color: var(--muted); font-size: 11px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 25px; }

@media (max-width: 860px) {
    .player-welcome { align-items: flex-start; flex-direction: column; }
    .category-grid { grid-template-columns: 1fr 1fr; }
    .game-layout { grid-template-columns: 1fr; max-width: 650px; }
    .puzzle-panel { min-height: auto; }
    .word-panel { order: -1; }
    .target-words { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .player-hero { padding: 45px 0; }
    .player-summary { width: 100%; }
    .player-summary div { flex: 1; min-width: 0; padding-inline: 8px; }
    .category-grid, .level-grid { grid-template-columns: 1fr; }
    .category-card { min-height: 240px; }
    .levels-title { align-items: flex-start; flex-direction: column; gap: 25px; }
    .route-progress { text-align: left; }
    .game-shell { padding-top: 8px; }
    .game-topbar { width: calc(100% - 24px); }
    .game-exit span { display: none; }
    .game-layout { width: calc(100% - 18px); gap: 12px; margin-top: 8px; }
    .word-panel { padding: 18px; }
    .target-words { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .target-words li { min-height: 45px; }
    .puzzle-panel { padding: 14px; border-radius: 19px; }
    .play-grid { gap: 4px; }
    .grid-cell { border-radius: 8px; font-size: clamp(14px, 5vw, 19px); }
    .play-grid[data-size="9"], .play-grid[data-size="10"] { gap: 3px; }
    .play-grid[data-size="11"], .play-grid[data-size="12"] { gap: 2px; }
    .play-grid[data-size="11"] .grid-cell, .play-grid[data-size="12"] .grid-cell { border-radius: 5px; font-size: clamp(11px, 3.7vw, 15px); }
    .game-tip { display: none; }
    .result-card { padding-inline: 23px; }
    .result-actions { grid-template-columns: 1fr; }
}

/* Profile */
.profile-hero { padding: 52px 0; color: white; background: linear-gradient(120deg, #4f2caf, #7a52d8); }
.profile-hero-inner { display: flex; align-items: center; gap: 24px; }
.profile-avatar-large, .avatar-preview, .podium-avatar, .ranking-avatar {
    display: grid; place-items: center; overflow: hidden; color: white; background: linear-gradient(145deg, #ffad52, #ff845f); border-radius: 50%; font-family: "Fredoka", sans-serif;
}
.profile-avatar-large { flex: 0 0 108px; height: 108px; border: 6px solid rgba(255,255,255,.22); font-size: 48px; }
.profile-avatar-large img, .avatar-preview img, .podium-avatar img, .ranking-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero .eyebrow { margin-bottom: 4px; }
.profile-hero h1 { margin: 0; font: 700 clamp(37px, 4.4vw, 53px) "Fredoka", "Anuphan", sans-serif; }
.profile-hero p { margin: 3px 0 0; color: #ded3f5; font-size: 12px; }
.rank-chip { display: flex; flex-direction: column; margin-left: auto; padding: 14px 23px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); border-radius: 15px; text-align: right; }
.rank-chip span { color: #ded4f5; font-size: 9px; }
.rank-chip strong { font: 700 28px "Fredoka", sans-serif; }
.profile-content { padding-top: 48px; }
.profile-notice { margin-bottom: 20px; padding: 14px 18px; border-radius: 12px; font-size: 13px; }
.profile-notice.is-success { color: #176949; background: #e6f8ef; border: 1px solid #b9e8d3; }
.profile-notice.is-error { color: #9f3048; background: #fff0f3; border: 1px solid #f3c8d1; }
.profile-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 24px; }
.profile-stat-grid article { display: flex; flex-direction: column; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.profile-stat-grid span { color: var(--muted); font-size: 10px; }
.profile-stat-grid strong { margin: 6px 0 3px; color: var(--purple); font: 700 29px "Fredoka", "Anuphan", sans-serif; }
.profile-stat-grid .stat-time { font-size: 23px; }
.profile-stat-grid small { color: var(--muted); font-size: 9px; }
.profile-main-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; }
.profile-edit-card, .recent-card, .leaderboard-card { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 21px; box-shadow: 0 15px 40px rgba(50,35,90,.06); }
.card-heading, .leaderboard-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.card-heading h2, .leaderboard-heading h2 { margin: 3px 0 0; font: 700 25px "Fredoka", "Anuphan", sans-serif; }
.secure-badge { padding: 6px 9px; color: #167552; background: #e4f7ef; border-radius: 8px; font-size: 9px; }
.profile-form { display: grid; gap: 18px; }
.avatar-upload-row { display: flex; align-items: center; gap: 19px; padding: 18px; background: #faf8fc; border: 1px dashed #d9d2e5; border-radius: 15px; }
.avatar-preview { flex: 0 0 78px; height: 78px; font-size: 32px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-button { display: inline-flex; padding: 9px 14px; color: var(--purple); background: var(--purple-soft); border-radius: 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.avatar-upload-row small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.profile-field { display: grid; gap: 7px; }
.profile-field > span { font-size: 11px; font-weight: 700; }
.profile-field input { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: #fbfafc; border: 1px solid #dedae5; border-radius: 11px; outline: none; }
.profile-field input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(112,71,216,.1); }
.profile-field.is-readonly input { color: #888293; background: #f2f0f4; }
.profile-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.profile-field-error { display: block; margin-top: 5px; color: #bc3b55 !important; font-size: 10px !important; }
.recent-list { display: grid; gap: 9px; }
.recent-game { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 10px; background: #f9f7fb; border-radius: 11px; }
.recent-level { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--purple); border-radius: 11px; font: 700 16px "Fredoka", sans-serif; }
.recent-game div:nth-child(2) { display: flex; flex-direction: column; }
.recent-game strong { font-size: 11px; }
.recent-game small { color: var(--muted); font-size: 9px; }
.recent-game > span { color: var(--purple); font: 700 14px "Fredoka", sans-serif; }
.empty-recent { padding: 40px 15px; color: var(--muted); text-align: center; }
.empty-recent > span { color: var(--purple); font-size: 35px; }
.empty-recent p { font-size: 11px; }

/* Ranking */
.ranking-hero { padding: 60px 0 80px; color: white; background: radial-gradient(circle at 80% 20%, rgba(255,184,98,.25), transparent 30%), linear-gradient(120deg, #4e2bac, #7950d4); }
.ranking-hero-inner { display: flex; align-items: center; justify-content: space-between; }
.ranking-hero .eyebrow { margin-bottom: 5px; }
.ranking-hero h1 { margin: 0; font: 700 clamp(43px, 5vw, 61px) "Fredoka", "Anuphan", sans-serif; }
.ranking-hero p { margin: 9px 0 0; color: #e3d9f8; }
.my-rank-card { display: flex; flex-direction: column; min-width: 165px; padding: 18px 22px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 17px; text-align: right; }
.my-rank-card span, .my-rank-card small { color: #ddd2f4; font-size: 9px; }
.my-rank-card strong { font: 700 36px "Fredoka", sans-serif; }
.ranking-content { position: relative; padding-top: 0; }
.ranking-podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; max-width: 750px; margin: -42px auto 30px; }
.podium-player { position: relative; display: flex; flex-direction: column; align-items: center; width: 210px; min-height: 245px; padding: 30px 18px 20px; background: white; border: 1px solid var(--line); border-radius: 21px; box-shadow: var(--shadow); text-align: center; }
.podium-player.rank-1 { min-height: 280px; padding-top: 40px; border-color: #edd49a; }
.podium-player.is-me { box-shadow: 0 0 0 3px var(--purple), var(--shadow); }
.podium-medal { position: absolute; top: -21px; font-size: 35px; }
.podium-avatar { width: 76px; height: 76px; background: linear-gradient(145deg, #7047d8, #a27df0); font-size: 31px; }
.rank-1 .podium-avatar { width: 88px; height: 88px; }
.podium-player h3 { margin: 14px 0 0; font: 700 16px "Fredoka", "Anuphan", sans-serif; }
.podium-player > span { color: var(--muted); font-size: 9px; }
.podium-player > strong { margin-top: auto; color: var(--purple); font: 700 26px "Fredoka", sans-serif; }
.podium-player > small { color: var(--muted); font-size: 8px; }
.leaderboard-card { max-width: 1050px; margin: 0 auto; }
.ranking-rule { color: var(--muted); font-size: 10px; }
.ranking-table-wrap { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th { padding: 10px 13px; color: var(--muted); font-size: 9px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); }
.ranking-table th:not(:nth-child(2)), .ranking-table td:not(:nth-child(2)) { text-align: center; }
.ranking-table td { padding: 13px; font-size: 11px; border-bottom: 1px solid #f0edf3; }
.ranking-table tbody tr:last-child td { border: 0; }
.ranking-table tr.is-me { background: #f3eeff; }
.table-rank { font-size: 16px; font-weight: 700; }
.ranking-player { display: flex; align-items: center; gap: 10px; min-width: 190px; text-align: left; }
.ranking-avatar { flex: 0 0 39px; height: 39px; background: var(--purple); font-size: 16px; }
.ranking-player > div:last-child { display: flex; flex-direction: column; }
.ranking-player strong { font-size: 11px; }
.ranking-player small { color: var(--muted); font-size: 8px; }
.table-stars { color: #d58c1f; font-weight: 700; }
.table-score { color: var(--purple); font: 700 15px "Fredoka", sans-serif; }
.empty-ranking { padding: 50px; color: var(--muted); text-align: center; }

@media (max-width: 780px) {
    .profile-hero-inner { flex-wrap: wrap; }
    .rank-chip { margin-left: 0; }
    .profile-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-main-grid { grid-template-columns: 1fr; }
    .ranking-hero-inner { align-items: flex-start; flex-direction: column; gap: 25px; }
    .my-rank-card { text-align: left; }
    .ranking-podium { gap: 7px; }
    .podium-player { width: 31%; padding-inline: 7px; }
}

@media (max-width: 520px) {
    .profile-avatar-large { flex-basis: 82px; height: 82px; font-size: 36px; }
    .profile-hero-inner > div:nth-child(2) { flex: 1; }
    .profile-hero p { font-size: 10px; }
    .profile-stat-grid { gap: 9px; }
    .profile-stat-grid article { padding: 17px; }
    .profile-stat-grid strong { font-size: 24px; }
    .profile-edit-card, .recent-card, .leaderboard-card { padding: 20px; }
    .secure-badge { display: none; }
    .avatar-upload-row { align-items: flex-start; }
    .profile-columns { grid-template-columns: 1fr; }
    .ranking-hero { padding: 45px 0 70px; }
    .ranking-podium { display: none; }
    .ranking-content { padding-top: 20px; }
    .ranking-rule { display: none; }
}

/* Admin */
.nav-admin { padding: 7px 11px; color: #5b35ba !important; background: #eee8ff; border-radius: 9px; }
.admin-page { background: #f5f3f8; }
.admin-hero { padding: 45px 0 66px; color: white; background: radial-gradient(circle at 86% 8%, rgba(255,181,94,.25), transparent 27%), linear-gradient(120deg, #35216f, #6840c7); }
.admin-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.admin-hero h1 { margin: 3px 0; font: 700 clamp(35px, 4vw, 52px) "Fredoka", "Anuphan", sans-serif; }
.admin-hero p { margin: 0; color: #ddd3f3; }
.admin-identity { display: flex; flex-direction: column; min-width: 210px; padding: 16px 20px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.17); border-radius: 16px; text-align: right; }
.admin-identity span, .admin-identity small { color: #ded5f3; font-size: 9px; }
.admin-identity strong { margin: 3px 0; font-size: 15px; }
.admin-content { padding-top: 0; }
.admin-tabs { display: flex; gap: 5px; width: fit-content; max-width: 100%; margin: -24px 0 28px; padding: 6px; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 14px 35px rgba(42,29,75,.1); }
.admin-tabs a { flex: 0 0 auto; padding: 10px 16px; color: var(--muted); border-radius: 10px; font-size: 11px; font-weight: 700; }
.admin-tabs a.is-active { color: white; background: var(--purple); }
.admin-notice { margin-bottom: 18px; padding: 13px 17px; border-radius: 11px; font-size: 12px; }
.admin-notice.is-success { color: #176949; background: #e5f8ef; border: 1px solid #b7e6d0; }
.admin-notice.is-error { color: #9f3048; background: #fff0f3; border: 1px solid #f0c8d0; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.admin-stat-grid article { display: flex; flex-direction: column; padding: 23px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px rgba(50,35,90,.05); }
.admin-stat-grid span { color: var(--muted); font-size: 10px; }
.admin-stat-grid strong { margin: 5px 0 2px; color: var(--purple); font: 700 34px "Fredoka", sans-serif; }
.admin-stat-grid small { color: #aaa4b2; font-size: 9px; }
.admin-welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 20px; padding: 34px; background: white; border: 1px solid var(--line); border-radius: 21px; }
.admin-welcome-card h2 { margin: 4px 0; font: 700 28px "Fredoka", "Anuphan", sans-serif; }
.admin-welcome-card p { max-width: 650px; margin: 0; color: var(--muted); }
.admin-quick-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .5fr); align-items: start; gap: 18px; }
.admin-words-layout { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .35fr); }
.admin-card { padding: 25px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 35px rgba(50,35,90,.05); }
.admin-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.admin-card-heading h2 { margin: 3px 0 0; font: 700 24px "Fredoka", "Anuphan", sans-serif; }
.admin-card-heading > span { padding: 6px 9px; color: var(--purple); background: var(--purple-soft); border-radius: 8px; font-size: 9px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 9px 10px; color: var(--muted); font-size: 9px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 12px 10px; font-size: 10px; border-bottom: 1px solid #f0edf3; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td > strong:not(.word-code) { display: block; font-size: 11px; }
.admin-table td > small { display: block; color: var(--muted); font-size: 8px; }
.word-code { color: var(--purple); font: 700 13px "Fredoka", sans-serif; letter-spacing: .06em; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.status-badge.is-active { color: #14704e; background: #e3f7ed; }
.status-badge.is-inactive { color: #8d5862; background: #f5e9ec; }
.admin-row-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.admin-row-actions a, .admin-row-actions button { padding: 0; color: var(--purple); background: none; border: 0; font: inherit; cursor: pointer; }
.admin-row-actions form { margin: 0; }
.admin-row-actions button { color: #9b5362; }
.admin-form { display: grid; gap: 14px; }
.admin-form label { display: grid; gap: 6px; }
.admin-form label > span { font-size: 10px; font-weight: 700; }
.admin-form input, .admin-form select, .admin-form textarea,
.admin-toolbar input, .admin-toolbar select { width: 100%; min-height: 43px; padding: 9px 11px; color: var(--ink); background: #fbfafc; border: 1px solid #dcd7e3; border-radius: 10px; font: inherit; outline: none; }
.admin-form textarea { resize: vertical; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus,
.admin-toolbar input:focus, .admin-toolbar select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(112,71,216,.1); }
.admin-form label > small { color: #b83d55; font-size: 9px; }
.admin-form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-cancel { color: var(--muted); font-size: 10px; text-align: center; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.admin-toolbar form { display: grid; grid-template-columns: 180px minmax(220px, 1fr) auto; gap: 8px; width: min(100%, 650px); }
.admin-toolbar > span { color: var(--muted); font-size: 9px; }
.admin-empty { padding: 40px !important; color: var(--muted); text-align: center; }
.audit-table td { white-space: nowrap; }
.audit-table code { color: #585266; font-size: 9px; }
.access-denied { max-width: 600px; margin: 30px auto; padding: 50px; background: white; border: 1px solid var(--line); border-radius: 22px; text-align: center; }
.access-denied > span { color: var(--purple); font: 700 60px "Fredoka", sans-serif; }
.access-denied h1 { margin: 3px 0; }
.access-denied p { margin: 0 0 22px; color: var(--muted); }

@media (max-width: 980px) {
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-split, .admin-words-layout { grid-template-columns: 1fr; }
    .admin-form-card { order: -1; }
}

@media (max-width: 650px) {
    .admin-hero-inner, .admin-welcome-card { align-items: flex-start; flex-direction: column; }
    .admin-identity { width: 100%; text-align: left; }
    .admin-tabs { width: calc(100% + 12px); margin-left: -6px; }
    .admin-stat-grid { gap: 8px; }
    .admin-stat-grid article { padding: 17px; }
    .admin-quick-actions { width: 100%; flex-direction: column; }
    .admin-toolbar { align-items: stretch; flex-direction: column; }
    .admin-toolbar form { grid-template-columns: 1fr; }
    .admin-form-columns { grid-template-columns: 1fr; }
    .admin-card { padding: 18px; }
}
