:root {
    --bg: #fffaf2;
    --bg-2: #f7f2ff;
    --surface: rgba(255, 255, 255, .88);
    --surface-strong: #ffffff;
    --surface-soft: #fff8e9;
    --ink: #111827;
    --ink-2: #1f2d55;
    --muted: #68728b;
    --line: rgba(31, 45, 85, .11);
    --line-strong: rgba(92, 63, 255, .22);
    --violet: #5b3fff;
    --violet-2: #7c5cff;
    --violet-soft: #f0ecff;
    --blue: #1f2d55;
    --blue-2: #28477f;
    --blue-soft: #ecf2ff;
    --yellow: #ffca45;
    --yellow-soft: #fff2c5;
    --green: #22c55e;
    --green-soft: #e9fbf0;
    --coral: #ff7a59;
    --pink: #ffeff7;
    --danger: #d84b4b;
    --shadow: 0 22px 70px rgba(31, 45, 85, .15);
    --shadow-soft: 0 12px 32px rgba(31, 45, 85, .09);
    --shadow-color: 0 18px 44px rgba(92, 63, 255, .20);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    position: relative;
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(255, 202, 69, .25) 0%, rgba(255, 250, 242, 0) 30%),
        linear-gradient(225deg, rgba(124, 92, 255, .18) 0%, rgba(247, 242, 255, 0) 34%),
        linear-gradient(180deg, var(--bg), #f8fbff 58%, #fffaf2);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: .42;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(31, 45, 85, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 45, 85, .05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, #000, transparent 72%);
}

.ambient-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.ambient-layer::before,
.ambient-layer::after {
    content: "";
    position: absolute;
    width: 72vw;
    max-width: 920px;
    height: 42vh;
    min-height: 280px;
    filter: blur(36px);
    opacity: .72;
    transform: rotate(-12deg);
}

.ambient-layer::before {
    top: -110px;
    left: -12vw;
    background: linear-gradient(90deg, rgba(255, 202, 69, .42), rgba(255, 122, 89, .18), transparent);
}

.ambient-layer::after {
    right: -16vw;
    bottom: 6vh;
    background: linear-gradient(90deg, transparent, rgba(91, 63, 255, .26), rgba(34, 197, 94, .13));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

h1,
h2,
h3,
.brand,
.button,
.chip,
.tool-button,
.word-number {
    font-family: Poppins, Inter, system-ui, sans-serif;
}

.landing-shell,
.dashboard-shell,
.game-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.landing {
    min-height: 100vh;
}

.landing-shell {
    display: grid;
    gap: 18px;
    padding: 18px 0 54px;
}

.landing-nav,
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.landing-nav {
    position: sticky;
    top: 10px;
    z-index: 8;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .62);
    box-shadow: 0 18px 50px rgba(31, 45, 85, .08);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--blue);
    font-weight: 800;
}

.brand-mark,
.brand span,
.avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .26), transparent 42%),
        linear-gradient(135deg, var(--violet), var(--blue));
    box-shadow: 0 12px 28px rgba(91, 63, 255, .28);
    font-weight: 900;
}

.brand span {
    width: 36px;
    height: 36px;
    font-size: .8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-hero {
    display: grid;
    gap: 26px;
    min-height: 76vh;
    align-items: center;
    padding: 32px 0 18px;
}

.hero-copy-block {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--violet);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.landing-hero h1 {
    max-width: 780px;
    margin: 0 0 16px;
    color: var(--ink);
    font-size: clamp(3rem, 15vw, 6.8rem);
    line-height: .92;
}

.hero-copy {
    width: min(620px, 100%);
    margin: 0;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.button,
.chip,
.icon-link,
.tool-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.button:active,
.chip:active,
.tool-button:active,
.icon-link:active,
.grid-cell:not(.is-block):not(.is-black):active,
.word-item:active {
    transform: scale(.97);
}

.button:hover,
.chip:hover,
.icon-link:hover,
.tool-button:hover,
.game-card:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .24), transparent 38%),
        linear-gradient(135deg, var(--violet), #684df4 52%, var(--blue-2));
    box-shadow: var(--shadow-color);
}

.button-primary:hover {
    box-shadow: 0 24px 58px rgba(92, 63, 255, .28);
}

.button-ghost,
.icon-link,
.tool-button {
    color: var(--blue);
    border: 1px solid rgba(31, 45, 85, .10);
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 24px rgba(31, 45, 85, .06);
}

.button-soft {
    color: var(--violet);
    background: linear-gradient(135deg, var(--violet-soft), #eef5ff);
    box-shadow: 0 10px 24px rgba(92, 63, 255, .10);
}

.button-small {
    min-height: 40px;
    padding: 0 14px;
    font-size: .86rem;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-stats span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .62);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.hero-stats strong {
    color: var(--violet);
    font-family: Poppins, Inter, sans-serif;
}

.hero-showcase {
    position: relative;
    min-height: 420px;
    display: grid;
    place-items: center;
}

.phone-mockup,
.auth-phone {
    position: relative;
    width: min(310px, 82vw);
    border: 9px solid #142033;
    border-radius: 34px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 251, 242, .94)),
        #fff;
    box-shadow:
        0 34px 80px rgba(31, 45, 85, .22),
        inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.phone-mockup::before,
.auth-phone::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .22);
    transform: translateX(-50%);
}

.phone-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.phone-top span {
    color: var(--violet);
    font-family: Poppins, Inter, sans-serif;
    font-weight: 900;
}

.phone-top i {
    width: 26px;
    height: 20px;
    border-radius: 8px;
    background:
        linear-gradient(var(--blue), var(--blue)) 50% 5px / 14px 2px no-repeat,
        linear-gradient(var(--blue), var(--blue)) 50% 10px / 14px 2px no-repeat,
        linear-gradient(var(--blue), var(--blue)) 50% 15px / 14px 2px no-repeat,
        #f6f7ff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.phone-turn-card,
.floating-card {
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 8px;
    padding: 14px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .46)),
        linear-gradient(135deg, var(--yellow-soft), #ffffff);
    box-shadow: var(--shadow-soft);
}

.phone-turn-card {
    margin: 24px 0 14px;
}

.phone-turn-card small,
.floating-card small {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.phone-turn-card strong,
.floating-card strong {
    display: block;
    margin-top: 5px;
    color: var(--blue);
    font-family: Poppins, Inter, sans-serif;
    font-size: 1.28rem;
    line-height: 1.1;
}

.phone-turn-card strong {
    color: #9d6a00;
}

.mini-crossword {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
    padding: 8px;
    border-radius: 8px;
    background: #f8f7ff;
    box-shadow: inset 0 0 0 1px rgba(31, 45, 85, .08);
}

.mini-crossword span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 4px;
    color: var(--blue);
    background: rgba(255, 255, 255, .78);
    box-shadow: inset 0 0 0 1px rgba(31, 45, 85, .12);
    font-size: .62rem;
    font-weight: 900;
}

.mini-crossword .is-active {
    background: linear-gradient(135deg, #ffffff, var(--violet-soft));
    box-shadow: inset 0 0 0 1px rgba(91, 63, 255, .55), 0 5px 12px rgba(91, 63, 255, .12);
}

.mini-crossword .is-ink {
    background: #1b2440;
    box-shadow: none;
}

.compact-grid {
    grid-template-columns: repeat(7, 1fr);
}

.phone-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.phone-actions span {
    display: grid;
    min-height: 38px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--violet), var(--blue-2));
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}

.floating-card {
    position: absolute;
    left: 0;
    top: 44px;
    width: 166px;
    transform: rotate(-4deg);
    animation: floatCard 5.5s ease-in-out infinite;
}

.floating-card span {
    color: #a66f00;
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
}

@keyframes floatCard {
    0%,
    100% {
        transform: translateY(0) rotate(-4deg);
    }
    50% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

.duo-illustration,
.auth-people {
    position: absolute;
    right: 0;
    bottom: 42px;
    width: 170px;
    height: 136px;
}

.person {
    position: absolute;
    bottom: 0;
    width: 70px;
    height: 96px;
    border-radius: 28px 28px 8px 8px;
    background: linear-gradient(180deg, #745aff, #4932c9);
    box-shadow: 0 18px 34px rgba(91, 63, 255, .22);
}

.person::before {
    content: "";
    position: absolute;
    top: -34px;
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffd6a4;
    box-shadow: inset 9px 0 0 rgba(31, 45, 85, .14);
}

.person::after {
    content: "";
    position: absolute;
    top: -42px;
    left: 10px;
    width: 48px;
    height: 26px;
    border-radius: 20px 20px 10px 10px;
    background: #18233f;
}

.person-left {
    left: 12px;
}

.person-right {
    right: 14px;
    background: linear-gradient(180deg, #ffca45, #ff9f2f);
}

.person-right::after {
    background: #1f2d55;
}

.spark {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, .12);
}

.spark-one {
    top: 10px;
    left: 68px;
}

.spark-two {
    right: 0;
    top: 34px;
    background: var(--yellow);
    box-shadow: 0 0 0 8px rgba(255, 202, 69, .18);
}

.feature-strip {
    display: grid;
    gap: 12px;
}

.feature-strip article,
.panel,
.auth-card,
.game-card,
.mood-band,
.result-item,
.request-item,
.notification-item,
.activity-item,
.word-item,
.turn-banner,
.game-board-wrap {
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .66)),
        rgba(255, 255, 255, .74);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.feature-strip article {
    min-height: 156px;
    padding: 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.feature-strip article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-strip article span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    border-radius: 8px;
    color: var(--violet);
    background: var(--violet-soft);
    font-size: .75rem;
    font-weight: 900;
}

.feature-strip strong {
    display: block;
    margin: 14px 0 8px;
    color: var(--ink);
    font-family: Poppins, Inter, sans-serif;
    font-size: 1.08rem;
}

.feature-strip p,
.panel p,
.auth-card p,
.dashboard-intro p,
.mood-band p {
    color: var(--muted);
    line-height: 1.55;
}

.mood-band {
    display: grid;
    gap: 14px;
    padding: 16px;
    background:
        linear-gradient(110deg, rgba(240, 236, 255, .84), rgba(255, 248, 233, .88)),
        rgba(255, 255, 255, .7);
}

.mood-band > div {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

.mood-band strong {
    font-family: Poppins, Inter, sans-serif;
}

.mood-band p {
    grid-column: 2;
    margin: 4px 0 0;
}

.mini-icon {
    grid-row: span 2;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(31, 45, 85, .10);
}

.mini-icon::before {
    content: "";
    width: 23px;
    height: 23px;
    border-radius: 7px;
}

.mini-icon.trophy::before {
    background: linear-gradient(135deg, var(--yellow), #ff9f2f);
    clip-path: polygon(18% 0, 82% 0, 82% 44%, 64% 44%, 64% 70%, 76% 70%, 76% 100%, 24% 100%, 24% 70%, 36% 70%, 36% 44%, 18% 44%);
}

.mini-icon.light::before {
    background: linear-gradient(135deg, var(--violet), var(--blue-2));
    clip-path: polygon(50% 0, 64% 32%, 100% 36%, 72% 58%, 82% 94%, 50% 74%, 18% 94%, 28% 58%, 0 36%, 36% 32%);
}

.mini-icon.target::before {
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 0 18%, var(--coral) 19% 36%, #fff 37% 54%, var(--coral) 55% 100%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-shell {
    display: grid;
    gap: 18px;
    width: min(980px, 100%);
}

.auth-visual {
    position: relative;
    display: none;
    min-height: 540px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    padding: 22px;
    background:
        linear-gradient(150deg, rgba(240, 236, 255, .84), rgba(255, 242, 197, .58)),
        rgba(255, 255, 255, .66);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-phone {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%) rotate(-3deg);
    width: 250px;
}

.auth-people {
    right: 24px;
    bottom: 34px;
}

.auth-tip {
    left: 26px;
    top: auto;
    bottom: 34px;
    transform: rotate(3deg);
}

.auth-card {
    width: min(480px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.auth-card h1 {
    margin: 20px 0 8px;
    color: var(--ink);
    font-size: clamp(2rem, 9vw, 3.1rem);
    line-height: 1;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--violet);
    font-family: Poppins, Inter, sans-serif;
    font-weight: 900;
}

.stack-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.stack-form.compact {
    gap: 12px;
}

.stack-form label {
    display: grid;
    gap: 8px;
}

.stack-form span,
.answer-form span {
    color: var(--ink);
    font-size: .84rem;
    font-weight: 900;
}

input,
select {
    width: 100%;
    min-height: 52px;
    border: 1px solid rgba(31, 45, 85, .12);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 8px 18px rgba(31, 45, 85, .04);
    outline: none;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

input:focus,
select:focus {
    border-color: rgba(91, 63, 255, .72);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(91, 63, 255, .12), 0 12px 26px rgba(31, 45, 85, .08);
}

.form-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.auth-switch {
    margin: 16px 0 0;
    text-align: center;
}

.auth-switch a {
    color: var(--violet);
    font-weight: 900;
}

.alert {
    margin: 12px 0;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 800;
}

.alert-error {
    color: #8a2424;
    background: #ffe8e4;
}

.alert-success {
    color: #115c3b;
    background: var(--green-soft);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .72);
    background: rgba(255, 250, 242, .72);
    box-shadow: 0 12px 30px rgba(31, 45, 85, .06);
    backdrop-filter: blur(18px);
}

.user-pill {
    display: none;
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--blue);
    background: rgba(255, 255, 255, .66);
    font-weight: 900;
}

.dashboard-shell {
    padding: 22px 0 70px;
}

.dashboard-intro {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 20px 0 18px;
}

.dashboard-intro h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.3rem, 10vw, 5rem);
    line-height: .95;
}

.dashboard-intro p:last-child {
    max-width: 660px;
    margin-bottom: 0;
}

.dashboard-pieces {
    display: none;
    grid-template-columns: repeat(2, 54px);
    gap: 10px;
    align-content: center;
    justify-content: end;
}

.dashboard-pieces span {
    height: 54px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff, var(--violet-soft));
    box-shadow: var(--shadow-soft);
}

.dashboard-pieces span:nth-child(2) {
    background: linear-gradient(135deg, var(--yellow-soft), #fff);
}

.dashboard-pieces span:nth-child(3) {
    background: linear-gradient(135deg, var(--green-soft), #fff);
}

.dashboard-pieces span:nth-child(4) {
    background: linear-gradient(135deg, var(--blue-soft), #fff);
}

.dashboard-grid,
.content-columns,
.game-panels {
    display: grid;
    gap: 14px;
}

.content-columns {
    margin-top: 14px;
}

.panel {
    padding: 16px;
}

.panel-primary {
    border-color: rgba(255, 202, 69, .42);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(255, 242, 197, .74)),
        rgba(255, 255, 255, .74);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.22rem;
}

.search-box {
    display: grid;
    gap: 8px;
}

.result-list,
.request-list,
.notification-list,
.game-list,
.word-list,
.activity-list {
    display: grid;
    gap: 10px;
}

.result-list {
    margin-top: 12px;
}

.result-item,
.request-item,
.notification-item,
.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 11px;
}

.result-item > div,
.request-item > div {
    min-width: 0;
    flex: 1;
}

.result-item strong,
.request-item strong,
.game-card strong {
    display: block;
}

.result-item small,
.request-item small,
.notification-item small,
.game-card small,
.activity-item small {
    color: var(--muted);
}

.request-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.request-item.muted {
    opacity: .72;
}

.chip {
    min-height: 34px;
    padding: 0 11px;
    color: var(--violet);
    background: var(--violet-soft);
    font-size: .78rem;
}

.chip-muted {
    color: var(--muted);
    background: #f1eef9;
}

.chip-success {
    color: #10613d;
    background: var(--green-soft);
}

.empty-state {
    border: 1px dashed rgba(31, 45, 85, .18);
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, .56);
}

.empty-state strong {
    color: var(--ink);
}

.empty-state.mini {
    padding: 12px;
    font-size: .9rem;
}

.game-card {
    display: grid;
    gap: 12px;
    padding: 15px;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--violet), var(--yellow), var(--green));
}

.game-card:hover {
    border-color: rgba(91, 63, 255, .26);
    box-shadow: var(--shadow);
}

.game-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.game-card span {
    color: var(--muted);
}

.game-card em {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted);
    background: #f3f1f8;
    font-size: .76rem;
    font-style: normal;
    font-weight: 900;
}

.game-card em.turn-on {
    color: #805400;
    background: linear-gradient(135deg, var(--yellow), var(--yellow-soft));
    box-shadow: 0 10px 20px rgba(255, 202, 69, .18);
}

.progress-track,
.mini-progress div {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: rgba(31, 45, 85, .08);
}

.progress-track span,
.mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--violet));
}

.side-stack {
    display: grid;
    gap: 14px;
    align-content: start;
}

.notification-item {
    align-items: flex-start;
    justify-content: space-between;
}

.notification-item.is-unread {
    border-color: rgba(34, 197, 94, .30);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(233, 251, 240, .82)),
        var(--green-soft);
}

.game-page {
    background:
        linear-gradient(135deg, rgba(91, 63, 255, .16), transparent 32%),
        linear-gradient(225deg, rgba(255, 202, 69, .22), transparent 36%),
        var(--bg);
}

.game-shell {
    padding: 14px 0 104px;
}

.game-header {
    padding-bottom: 10px;
}

.turn-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.turn-banner h1 {
    margin: 0;
    font-size: clamp(1.55rem, 8vw, 3rem);
    line-height: 1.02;
}

.turn-banner.is-your-turn {
    border-color: rgba(255, 202, 69, .50);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(255, 242, 197, .86)),
        var(--yellow-soft);
}

.turn-banner.is-waiting .status-dot {
    background: var(--violet);
    box-shadow: 0 0 0 8px rgba(91, 63, 255, .14);
}

.status-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, .14);
}

.game-board-wrap {
    margin-top: 14px;
    padding: 12px;
}

.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mini-progress {
    display: grid;
    min-width: 126px;
    gap: 6px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 900;
    text-align: right;
}

.crossword-grid {
    --grid-size: 11;
    display: grid;
    grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
    width: min(100%, 630px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(31, 45, 85, .18);
    border-radius: 8px;
    background: rgba(31, 45, 85, .13);
    box-shadow: 0 24px 58px rgba(31, 45, 85, .17);
    gap: 1px;
    touch-action: manipulation;
}

.grid-cell {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    padding: 0;
    color: var(--blue);
    background: rgba(255, 255, 255, .94);
    font-weight: 900;
    font-size: clamp(.9rem, 4vw, 1.45rem);
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}

.grid-cell.is-black,
.grid-cell.is-block {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), transparent),
        rgba(31, 45, 85, .08);
    box-shadow: inset 0 0 0 1px rgba(31, 45, 85, .05);
}

.grid-cell.is-clue {
    align-content: center;
    justify-items: start;
    padding: 4px 5px;
    color: #1f2433;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .42), transparent 38%),
        linear-gradient(180deg, #ffe8a3, #ffd36a);
    box-shadow: inset 0 0 0 1px rgba(168, 109, 0, .18);
    font-size: clamp(.42rem, 1.55vw, .68rem);
    line-height: 1.05;
    text-align: left;
}

.grid-cell.is-clue::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7));
}

.grid-cell.is-clue.arrow-right::after {
    right: -1px;
    top: 50%;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--coral);
    transform: translateY(-50%);
}

.grid-cell.is-clue.arrow-down::after {
    left: 50%;
    bottom: -1px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--coral);
    transform: translateX(-50%);
}

.grid-cell.is-clue.is-selected {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .48), transparent 38%),
        linear-gradient(180deg, #ffe08b, #ffc84b);
    box-shadow: inset 0 0 0 2px var(--violet), 0 8px 20px rgba(255, 202, 69, .24);
}

.clue-number {
    position: absolute;
    left: 4px;
    top: 3px;
    color: var(--violet);
    font-size: .62em;
    font-weight: 900;
}

.clue-text {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    padding-top: 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 900;
    text-transform: uppercase;
}

.grid-cell.is-selected {
    z-index: 1;
    background: linear-gradient(135deg, #fff, var(--violet-soft));
    box-shadow: inset 0 0 0 2px var(--violet), 0 0 0 1px #fff;
}

.grid-cell.is-found {
    background: linear-gradient(135deg, #fff, var(--green-soft));
    color: #0f6b43;
}

.grid-cell.has-draft {
    color: var(--violet);
    background: linear-gradient(135deg, #fff, #f5f1ff);
}

.grid-cell.can-edit:not(.is-clue):not(.is-block) {
    cursor: text;
}

.cell-letter {
    line-height: 1;
}

.cell-start {
    position: absolute;
    top: 2px;
    left: 2px;
    max-width: calc(100% - 4px);
    color: var(--muted);
    font-size: clamp(.42rem, 1.8vw, .62rem);
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.game-panels {
    margin-top: 14px;
}

.word-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    color: inherit;
    text-align: left;
    transition: background .18s ease, border .18s ease, transform .18s ease, box-shadow .18s ease;
}

.word-item:hover,
.word-item.is-selected {
    border-color: rgba(91, 63, 255, .35);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .90), rgba(240, 236, 255, .82)),
        var(--violet-soft);
    box-shadow: 0 14px 34px rgba(91, 63, 255, .10);
}

.word-item.is-found {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .90), rgba(233, 251, 240, .82)),
        var(--green-soft);
}

.word-number {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--violet), var(--blue-2));
    box-shadow: 0 10px 20px rgba(91, 63, 255, .18);
    font-weight: 900;
}

.word-body {
    min-width: 0;
}

.word-body strong {
    display: block;
    line-height: 1.3;
}

.word-body small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.word-hint {
    margin: 7px 0 0;
    color: #10613d;
    font-size: .9rem;
}

.activity-item {
    display: grid;
    align-items: start;
}

.word-sheet[hidden] {
    display: none;
}

.word-sheet {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    align-items: end;
}

.word-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .42);
    backdrop-filter: blur(6px);
}

.word-sheet-card {
    position: relative;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .70);
    border-radius: 8px 8px 0 0;
    padding: 20px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(255, 250, 242, .92)),
        var(--surface-strong);
    box-shadow: 0 -28px 70px rgba(31, 45, 85, .24);
    animation: sheetIn .22s ease;
}

@keyframes sheetIn {
    from {
        transform: translateY(28px);
        opacity: .64;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 36px;
    border: 1px solid rgba(31, 45, 85, .10);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .82);
    font-weight: 900;
}

.word-sheet-card h2 {
    margin: 0 88px 8px 0;
    font-size: 1.7rem;
}

.sheet-clue {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.55;
}

.sheet-hint {
    display: grid;
    gap: 4px;
    margin: 14px 0;
    border: 1px solid rgba(34, 197, 94, .18);
    border-radius: 8px;
    padding: 12px;
    color: #10613d;
    background: var(--green-soft);
}

.answer-form {
    display: grid;
    gap: 12px;
}

.answer-form label {
    display: grid;
    gap: 8px;
}

.sheet-actions {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 8px;
}

.sheet-feedback {
    min-height: 22px;
    margin: 12px 0 0;
    color: var(--muted);
    font-weight: 900;
}

.toast-stack {
    position: fixed;
    z-index: 60;
    left: 12px;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    display: grid;
    gap: 2px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--ink);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 248, 233, .88)),
        rgba(255, 255, 255, .9);
    box-shadow: 0 22px 54px rgba(31, 45, 85, .20);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(14px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast strong {
    font-family: Poppins, Inter, sans-serif;
    font-size: .95rem;
}

.app-toast span {
    color: var(--muted);
    font-size: .88rem;
}

@media (min-width: 680px) {
    .landing-shell,
    .dashboard-shell,
    .game-shell {
        width: min(1180px, calc(100% - 48px));
    }

    .landing-hero {
        grid-template-columns: minmax(0, .95fr) minmax(340px, .85fr);
        min-height: 72vh;
    }

    .feature-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .mood-band {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-box {
        grid-template-columns: 1fr auto;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .user-pill {
        display: inline-flex;
    }

    .dashboard-intro {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .dashboard-pieces {
        display: grid;
    }

    .word-sheet {
        place-items: center;
        padding: 20px;
    }

    .word-sheet-card {
        width: min(540px, 100%);
        border-radius: 8px;
    }
}

@media (min-width: 900px) {
    .auth-shell {
        grid-template-columns: minmax(360px, 1fr) minmax(410px, .86fr);
        align-items: stretch;
    }

    .auth-visual {
        display: block;
    }

    .auth-card {
        align-self: center;
        padding: 30px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    }

    .content-columns {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    }

    .game-shell {
        display: grid;
        grid-template-columns: minmax(360px, 620px) minmax(320px, 1fr);
        gap: 18px;
        align-items: start;
    }

    .turn-banner {
        grid-column: 1 / -1;
    }

    .game-board-wrap {
        margin-top: 0;
    }

    .game-panels {
        margin-top: 0;
    }
}

@media (max-width: 420px) {
    .landing-nav .brand {
        font-size: 0;
    }

    .landing-nav .icon-link {
        display: none;
    }

    .hero-showcase {
        min-height: 360px;
    }

    .floating-card {
        left: 0;
        top: 12px;
    }

    .duo-illustration {
        right: -24px;
        bottom: 112px;
        transform: scale(.62);
    }

    .phone-mockup {
        width: min(286px, 86vw);
    }

    .phone-actions span {
        font-size: .7rem;
    }

    .sheet-actions {
        grid-template-columns: 1fr;
    }
}
