:root {
    --bg: #f8fbff;
    --surface: #ffffff;
    --surface-soft: #eef7f3;
    --ink: #14213d;
    --muted: #5d6b82;
    --line: #d9e4ef;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --teal: #0f9f8f;
    --amber: #f3b23c;
    --coral: #ec6f5a;
    --green: #22a06b;
    --yellow: #d69e2e;
    --gray: #6b7280;
    --radius: 8px;
    --shadow: 0 18px 44px rgba(20, 33, 61, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    margin: 0;
}

body.wordless-dark {
    --bg: #101722;
    --surface: #172233;
    --surface-soft: #122b2a;
    --ink: #edf5ff;
    --muted: #b4c2d7;
    --line: #2d4059;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

a {
    color: inherit;
}

.container {
    width: min(1160px, 92vw);
}

.site-header {
    background: rgba(248, 251, 255, 0.92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

body.wordless-dark .site-header {
    background: rgba(16, 23, 34, 0.94);
}

.wordless-nav {
    padding: 0.7rem 0;
}

.navbar-brand,
.footer-brand {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    font-weight: 800;
    gap: 0.55rem;
    letter-spacing: 0;
    text-decoration: none;
}

.navbar-brand img,
.footer-brand img {
    border-radius: var(--radius);
}

.wordless-nav .nav-link {
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.93rem;
    font-weight: 700;
    margin-left: 0.2rem;
    padding: 0.48rem 0.72rem;
}

.wordless-nav .nav-link:hover {
    background: #e7f0ff;
    color: var(--primary);
}

body.wordless-dark .wordless-nav .nav-link:hover {
    background: #1d304c;
}

.hero-section,
.core-hero {
    padding: 44px 0 70px;
}

.hero-copy,
.core-hero-copy,
.section-heading,
.static-header {
    margin: 0 auto 1.7rem;
    max-width: 840px;
    text-align: center;
}

.eyebrow,
.game-heading p,
.section-heading p {
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

.hero-copy h1,
.core-hero-copy h1,
.static-header h1 {
    color: var(--ink);
    font-size: clamp(2.35rem, 7vw, 5.6rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 1rem;
}

.hero-copy p:last-child,
.core-hero-copy p,
.static-header p {
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    margin-top: 1.35rem;
}

.primary-button,
.secondary-button,
.custom-create-row button {
    align-items: center;
    border-radius: var(--radius);
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 0.68rem 1rem;
    text-decoration: none;
}

.primary-button,
.custom-create-row button {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
}

.primary-button:hover,
.custom-create-row button:hover {
    background: var(--primary-dark);
    color: #fff;
}

.secondary-button {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}

.secondary-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.game-shell {
    margin: 0 auto;
    max-width: 780px;
}

.game-heading {
    margin: 0 auto 1rem;
    max-width: 700px;
    text-align: center;
}

.game-heading h2 {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 0.35rem;
}

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

.game-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1rem, 3vw, 1.45rem);
}

.game-toolbar,
.length-row,
.game-bottom-actions,
.custom-create-row {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    justify-content: space-between;
}

.game-toolbar {
    flex-wrap: wrap;
}

.mode-tabs,
.length-buttons,
.game-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.mode-tab,
.length-buttons button,
.icon-button {
    background: #edf4ff;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 800;
    min-height: 38px;
}

body.wordless-dark .mode-tab,
body.wordless-dark .length-buttons button,
body.wordless-dark .icon-button {
    background: #213149;
    color: var(--ink);
}

.mode-tab {
    padding: 0 0.72rem;
}

.mode-tab.is-active,
.length-buttons button.is-active {
    background: var(--primary);
    color: #fff;
}

.icon-button {
    align-items: center;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    padding: 0;
    width: 38px;
}

.length-row {
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.85rem 0;
}

.length-row span {
    color: var(--muted);
    font-weight: 800;
}

.length-buttons button {
    min-width: 38px;
}

.length-row strong {
    color: var(--teal);
    font-variant-numeric: tabular-nums;
    min-width: 54px;
    text-align: right;
}

.custom-panel {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
}

.custom-panel label {
    display: block;
    font-weight: 800;
    margin-bottom: 0.55rem;
}

.custom-create-row input {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    flex: 1;
    min-height: 42px;
    min-width: 0;
    padding: 0.6rem 0.7rem;
    text-transform: uppercase;
}

.custom-panel p {
    color: var(--muted);
    margin: 0.6rem 0 0;
    overflow-wrap: anywhere;
}

.status-line {
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
    min-height: 1.7rem;
    text-align: center;
}

.board-wrap {
    display: flex;
    justify-content: center;
    margin: 0.7rem auto 1rem;
}

.word-board {
    display: grid;
    gap: 0.45rem;
    grid-template-rows: repeat(6, 1fr);
    width: min(100%, 420px);
}

.board-row {
    display: grid;
    gap: 0.45rem;
}

.tile {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    display: flex;
    font-size: clamp(1.05rem, 5vw, 1.65rem);
    font-weight: 800;
    justify-content: center;
    text-transform: uppercase;
}

.tile.correct,
.key.correct {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.tile.present,
.key.present {
    background: var(--yellow);
    border-color: var(--yellow);
    color: #111827;
}

.tile.absent,
.key.absent {
    background: var(--gray);
    border-color: var(--gray);
    color: #fff;
}

.keyboard {
    display: grid;
    gap: 0.45rem;
    margin: 0 auto;
    max-width: 620px;
}

.key-row {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
}

.key {
    align-items: center;
    background: #e3ecf8;
    border: 0;
    border-radius: var(--radius);
    color: var(--ink);
    display: inline-flex;
    font-size: clamp(0.72rem, 2.6vw, 0.92rem);
    font-weight: 800;
    height: 44px;
    justify-content: center;
    min-width: 0;
    padding: 0 0.48rem;
    text-transform: uppercase;
    width: min(8.4vw, 42px);
}

.key.wide {
    width: min(16vw, 76px);
}

body.wordless-dark .key {
    background: #23344e;
}

.game-bottom-actions {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.stats-dialog {
    align-items: center;
    background: rgba(20, 33, 61, 0.42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 50;
}

.stats-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 520px;
    padding: 1.3rem;
    position: relative;
    width: 100%;
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.stats-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-right: 3rem;
}

.stats-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(4, 1fr);
    margin: 1rem 0;
}

.stats-grid div {
    background: var(--surface-soft);
    border-radius: var(--radius);
    padding: 0.7rem;
    text-align: center;
}

.stats-grid strong,
.stats-grid span {
    display: block;
}

.stats-grid strong {
    font-size: 1.3rem;
}

.stats-grid span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.guess-bars {
    display: grid;
    gap: 0.45rem;
}

.guess-bar {
    align-items: center;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1.2rem 1fr 2rem;
}

.guess-fill {
    background: var(--teal);
    border-radius: var(--radius);
    height: 16px;
    min-width: 4px;
}

.content-section {
    padding: 72px 0;
}

.content-section:nth-of-type(even) {
    background: #f0f6fb;
}

body.wordless-dark .content-section:nth-of-type(even) {
    background: #121d2b;
}

.section-heading h2,
.split-layout h2,
.seo-copy h2 {
    font-size: clamp(1.65rem, 3.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 0.55rem;
}

.section-heading span,
.split-layout p,
.seo-copy p,
.info-card p,
.step-card p,
.copy-panel p,
.static-panel p,
.static-panel li {
    color: var(--muted);
}

.mode-grid,
.steps-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card,
.step-card,
.word-list-card,
.copy-panel,
.quick-facts,
.static-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(20, 33, 61, 0.07);
}

.info-card,
.step-card,
.word-list-card,
.copy-panel,
.quick-facts {
    padding: 1.15rem;
}

.info-card i {
    color: var(--coral);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.info-card h3,
.step-card h3,
.word-list-card h3 {
    font-size: 1.08rem;
    font-weight: 800;
}

.info-card a {
    color: var(--primary);
    display: inline-block;
    font-weight: 800;
    margin-top: 0.7rem;
    text-decoration: none;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
}

.comparison-table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.comparison-table th,
.comparison-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.95rem;
    vertical-align: top;
}

.comparison-table th {
    background: var(--surface-soft);
    font-size: 0.88rem;
    text-transform: uppercase;
}

.comparison-table td:first-child {
    color: var(--primary);
    font-weight: 800;
}

.step-card span {
    align-items: center;
    background: var(--amber);
    border-radius: var(--radius);
    color: #111827;
    display: inline-flex;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    margin-bottom: 0.8rem;
    width: 32px;
}

.split-layout {
    align-items: start;
    display: grid;
    gap: 1.3rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.word-list-card ul,
.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.word-list-card li {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 5.2rem 1fr;
    padding: 0.7rem 0;
}

.word-list-card li:last-child {
    border-bottom: 0;
}

.word-list-card strong {
    color: var(--teal);
}

.seo-copy article {
    margin: 0 auto;
    max-width: 900px;
}

.faq-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 auto;
    max-width: 900px;
}

.faq-list details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 800;
}

.faq-list p {
    color: var(--muted);
    margin: 0.75rem 0 0;
}

.core-hero {
    background: var(--surface-soft);
}

.quick-facts dl {
    margin: 0;
}

.quick-facts div {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.72rem 0;
}

.quick-facts div:last-child {
    border-bottom: 0;
}

.quick-facts dt {
    color: var(--muted);
    font-weight: 700;
}

.quick-facts dd {
    font-weight: 800;
    margin: 0;
    text-align: right;
}

.static-page {
    padding: 78px 0;
}

.static-panel {
    margin: 0 auto;
    max-width: 900px;
    padding: clamp(1.2rem, 4vw, 2.3rem);
}

.static-panel h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 1.8rem;
}

.static-panel h2:first-child {
    margin-top: 0;
}

.static-panel a {
    color: var(--primary);
    font-weight: 800;
}

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 48px 0 28px;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1.3fr 0.8fr 0.8fr;
}

.footer-grid p,
.footer-bottom p,
.site-footer a {
    color: var(--muted);
}

.site-footer h2 {
    font-size: 0.95rem;
    font-weight: 800;
}

.site-footer li + li {
    margin-top: 0.45rem;
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--line);
    margin-top: 2rem;
    padding-top: 1.2rem;
}

.footer-bottom p {
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
    .mode-grid,
    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .hero-section,
    .core-hero {
        padding: 34px 0 48px;
    }

    .mode-grid,
    .steps-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .game-toolbar,
    .length-row,
    .custom-create-row {
        align-items: stretch;
        flex-direction: column;
    }

    .mode-tabs,
    .length-buttons,
    .game-actions,
    .game-bottom-actions {
        justify-content: center;
        width: 100%;
    }

    .mode-tab {
        flex: 1 1 42%;
    }

    .length-row strong {
        text-align: center;
    }

    .word-board {
        gap: 0.32rem;
    }

    .board-row {
        gap: 0.32rem;
    }

    .key {
        height: 40px;
        padding: 0 0.3rem;
    }

    .word-list-card li {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 54px 0;
    }
}
