:root {
    --bg: #07111f;
    --bg-soft: rgba(7, 17, 31, 0.78);
    --panel: rgba(9, 21, 39, 0.74);
    --panel-strong: rgba(11, 27, 49, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f7f2e9;
    --muted: #afbacb;
    --gold: #d9b06f;
    --gold-strong: #f2ca86;
    --ice: #88c5d9;
    --success: #7fd0ad;
    --warning: #e8c46a;
    --error: #ef8d78;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(136, 197, 217, 0.17), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(217, 176, 111, 0.18), transparent 34%),
        linear-gradient(135deg, #05101c 0%, #091726 46%, #122338 100%);
    color: var(--text);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.project-topbar {
    position: relative;
    z-index: 3;
    padding: 18px 20px 0;
}

.project-topbar__inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(8, 20, 36, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.project-topbar__brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.project-topbar__logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(31, 41, 55, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.project-topbar__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-topbar__logo-fallback {
    display: none;
    width: 100%;
    height: 100%;
    place-items: center;
    font-weight: 800;
    color: var(--gold-strong);
}

.project-topbar__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project-topbar__title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f8fafc;
}

.project-topbar__subtitle {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-topbar__hub-link {
    margin-left: auto;
    color: #dbe7f5;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.project-topbar__hub-link:hover,
.project-topbar__brand:hover .project-topbar__title {
    color: var(--gold-strong);
}

button {
    font: inherit;
}

.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
}

.ambient-one {
    width: 320px;
    height: 320px;
    background: rgba(136, 197, 217, 0.18);
    top: 8%;
    right: -60px;
}

.ambient-two {
    width: 380px;
    height: 380px;
    background: rgba(217, 176, 111, 0.15);
    bottom: 6%;
    left: -90px;
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.hero-card,
.glass-panel {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    padding: 32px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(217, 176, 111, 0.08), transparent 35%),
        linear-gradient(135deg, rgba(8, 21, 39, 0.95), rgba(8, 21, 39, 0.72));
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    inset: auto -20% -65% 40%;
    height: 220px;
    background: radial-gradient(circle, rgba(136, 197, 217, 0.16), transparent 60%);
    transform: rotate(-7deg);
}

.eyebrow {
    margin: 0 0 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-strong);
    font-size: 0.75rem;
    font-weight: 800;
}

.hero-copy h1,
.panel-head h2 {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    line-height: 0.96;
    font-weight: 700;
}

.hero-copy h1 {
    font-size: clamp(3.2rem, 7vw, 5.4rem);
    max-width: 700px;
}

.lead {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.hero-stats {
    display: grid;
    gap: 14px;
    align-content: center;
}

.stat-card {
    position: relative;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.25rem;
}

.stat-card small,
.stat-label {
    color: var(--muted);
}

.stat-label {
    display: block;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.control-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 22px;
    margin-top: 22px;
}

.glass-panel {
    background: linear-gradient(180deg, rgba(11, 24, 43, 0.86), rgba(10, 18, 31, 0.74));
    border-radius: 26px;
    padding: 26px;
}

.panel-head {
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.level-switches {
    display: grid;
    gap: 14px;
}

.level-button {
    width: 100%;
    text-align: left;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.level-button span {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.level-button small {
    display: block;
    line-height: 1.6;
    color: var(--muted);
}

.level-button:hover,
.level-button.active {
    transform: translateY(-2px);
    border-color: rgba(217, 176, 111, 0.42);
    background: linear-gradient(180deg, rgba(217, 176, 111, 0.1), rgba(255, 255, 255, 0.02));
}

.prompt-box,
.hint-box,
.feedback {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-box {
    padding: 18px 20px;
    background: var(--panel-strong);
}

.prompt-label,
.section-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ice);
    font-weight: 700;
}

.prompt-box p {
    margin: 0;
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.hint-box {
    margin-top: 14px;
    padding: 14px 18px;
    color: var(--gold-strong);
    background: rgba(217, 176, 111, 0.08);
    min-height: 58px;
    display: flex;
    align-items: center;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 20px;
}

.answer-zone,
.word-bank {
    min-height: 96px;
    padding: 16px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.answer-zone[data-state='correct'] {
    border-color: rgba(127, 208, 173, 0.42);
    background: rgba(127, 208, 173, 0.12);
}

.answer-zone[data-state='incorrect'] {
    border-color: rgba(239, 141, 120, 0.42);
    background: rgba(239, 141, 120, 0.12);
}

.word-chip {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 150ms ease, filter 150ms ease;
    max-width: 100%;
    overflow-wrap: anywhere;
    touch-action: none;
    user-select: none;
}

.word-chip:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.word-chip.is-dragging {
    opacity: 0.55;
    transform: scale(0.98);
}

.is-dragging-word {
    cursor: grabbing;
}

.word-chip.bank {
    background: linear-gradient(135deg, rgba(136, 197, 217, 0.15), rgba(136, 197, 217, 0.05));
    color: #dff5ff;
    border: 1px solid rgba(136, 197, 217, 0.18);
}

.word-chip.answer {
    background: linear-gradient(135deg, rgba(217, 176, 111, 0.18), rgba(217, 176, 111, 0.08));
    color: #fff4dc;
    border: 1px solid rgba(217, 176, 111, 0.2);
}

.placeholder {
    color: var(--muted);
    font-size: 0.95rem;
}

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

.primary-action,
.secondary-action {
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease;
}

.primary-action:hover,
.secondary-action:hover {
    transform: translateY(-1px);
}

.primary-action {
    border: 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    color: #1d160b;
    font-weight: 800;
}

.secondary-action {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.feedback {
    margin-top: 18px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    line-height: 1.7;
}

.feedback[data-status='success'] {
    color: var(--success);
    border-color: rgba(127, 208, 173, 0.2);
    background: rgba(127, 208, 173, 0.07);
}

.feedback[data-status='warning'] {
    color: var(--warning);
    border-color: rgba(232, 196, 106, 0.2);
    background: rgba(232, 196, 106, 0.07);
}

.feedback[data-status='error'] {
    color: var(--error);
    border-color: rgba(239, 141, 120, 0.2);
    background: rgba(239, 141, 120, 0.07);
}

@media (max-width: 980px) {
    .hero-card,
    .control-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .project-topbar {
        padding: 14px 14px 0;
    }

    .project-topbar__inner {
        padding: 10px 12px;
    }

    .project-topbar__subtitle {
        max-width: 150px;
    }

    .shell {
        padding: 18px 14px 40px;
    }

    .hero-card,
    .glass-panel {
        padding: 20px;
        border-radius: 22px;
    }

    .hero-copy h1,
    .panel-head h2 {
        line-height: 1;
    }

    .actions {
        flex-direction: column;
    }

    .primary-action,
    .secondary-action {
        width: 100%;
    }

    .answer-zone,
    .word-bank {
        padding: 12px;
        gap: 8px;
    }

    .word-chip {
        padding: 10px 12px;
        font-size: 0.92rem;
    }
}
