/* Sudoku City — presentation site
   Styled after the app: Material 3 Expressive color scheme
   (expressiveLightColorScheme / brand purple dark scheme). */

:root {
    color-scheme: light;

    /* M3 Expressive light scheme (same tokens the app uses) */
    --primary: #6750A4;
    --on-primary: #FFFFFF;
    --primary-container: #EADDFF;
    --on-primary-container: #4F378B;
    --inverse-primary: #D0BCFF;
    --secondary: #625B71;
    --on-secondary: #FFFFFF;
    --secondary-container: #E8DEF8;
    --on-secondary-container: #4A4458;
    --tertiary: #7D5260;
    --tertiary-container: #FFD8E4;
    --on-tertiary-container: #633B48;
    --error: #B3261E;
    --on-error: #FFFFFF;
    --error-container: #F9DEDC;
    --on-error-container: #8C1D18;
    --background: #FEF7FF;
    --on-background: #1D1B20;
    --surface: #FEF7FF;
    --on-surface: #1D1B20;
    --surface-variant: #E7E0EC;
    --on-surface-variant: #49454F;
    --outline: #79747E;
    --outline-variant: #CAC4D0;
    --inverse-surface: #322F35;
    --inverse-on-surface: #F5EFF7;
    --surface-container-lowest: #FFFFFF;
    --surface-container-low: #F7F2FA;
    --surface-container: #F3EDF7;
    --surface-container-high: #ECE6F0;
    --surface-container-highest: #E6E0E9;

    /* M3 shape scale (dp -> px, expressive cards lean to extraLarge) */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-extra-large: 28px;
    --radius-full: 999px;

    --shadow-card: 0 6px 16px rgba(29, 27, 32, 0.12), 0 2px 6px rgba(29, 27, 32, 0.08);
    --shadow-button: 0 1px 3px rgba(29, 27, 32, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        /* App dark scheme: darkColorScheme(Purple80, PurpleGrey80, Pink80) */
        --primary: #D0BCFF;
        --on-primary: #381E72;
        --primary-container: #4F378B;
        --on-primary-container: #EADDFF;
        --inverse-primary: #6750A4;
        --secondary: #CCC2DC;
        --on-secondary: #332D41;
        --secondary-container: #4A4458;
        --on-secondary-container: #E8DEF8;
        --tertiary: #EFB8C8;
        --on-tertiary: #492532;
        --tertiary-container: #633B48;
        --on-tertiary-container: #FFD8E4;
        --error: #F2B8B5;
        --on-error: #601410;
        --error-container: #8C1D18;
        --on-error-container: #F9DEDC;
        --background: #141218;
        --on-background: #E6E0E9;
        --surface: #141218;
        --on-surface: #E6E0E9;
        --surface-variant: #49454F;
        --on-surface-variant: #CAC4D0;
        --outline: #938F99;
        --outline-variant: #49454F;
        --inverse-surface: #E6E0E9;
        --inverse-on-surface: #322F35;
        --surface-container-lowest: #0F0D13;
        --surface-container-low: #1D1B20;
        --surface-container: #211F26;
        --surface-container-high: #2B2930;
        --surface-container-highest: #36343B;

        --shadow-card: 0 6px 16px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
        --shadow-button: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--on-background);
    font-family: "Roboto", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- top app bar (shared by every page) ---------- */

.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--outline-variant);
}

.top-bar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--on-surface);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.top-bar .brand:hover {
    text-decoration: none;
}

.top-bar .brand img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-small);
}

.top-bar nav {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.top-bar nav a {
    color: var(--on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.top-bar nav a:hover {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    text-decoration: none;
}

.top-bar nav a[aria-current="page"] {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
}

/* ---------- main content ---------- */

main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertically center the hero between top bar and footer */
}

/* ---------- home hero (mirrors the app's Home screen) ---------- */

.hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 48px;
}

.hero .banner {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
}

/* ---------- in-game board (mirrors the app's PlayTable) ---------- */
/* Same proportions as the app's BoardStyle.kt for a 4x4 grid (box = 2):
   the whole table is cell * (4 + 2 + 0.68) wide, with little padding
   0.08*cell inside a box, group padding 0.16*cell across box boundaries,
   and the clue strips one 0.18*cell gap away from the grid. */
.play-table {
    --table-w: min(360px, 78vw);
    --cell: calc(var(--table-w) / 6.68);
    --little: calc(var(--cell) * 0.08);
    --group: calc(var(--cell) * 0.16);
    --sgap: calc(var(--cell) * 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sgap);
    padding: 10px; /* BoardTokens.tablePadding */
}

.play-table .mid {
    display: flex;
    align-items: center;
}

.play-table .strip {
    display: flex;
}

.play-table .strip.vert {
    flex-direction: column;
}

.play-table .board {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.play-table .brow {
    display: flex;
}

/* spacers: little inside a box, group across a box boundary */
.play-table .sp {
    flex: none;
}

.brow > .sp,
.strip:not(.vert) > .sp {
    width: var(--little);
    height: 0;
}

.brow > .sp.g,
.strip:not(.vert) > .sp.g {
    width: var(--group);
}

.board > .sp,
.strip.vert > .sp {
    width: 0;
    height: var(--little);
}

.board > .sp.g,
.strip.vert > .sp.g {
    height: var(--group);
}

.mid > .sp.sg {
    width: var(--sgap);
    height: 0;
}

/* cells — colors follow the app's highlight priority:
   conflict > selected > same number > line/box tint > base */
.cell {
    width: var(--cell);
    height: var(--cell);
    flex: none;
    border-radius: 4px; /* M3 extraSmall */
    background: var(--inverse-primary); /* editable cell */
    color: var(--on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell) * 0.5);
    line-height: 1;
}

.cell.given {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
}

.cell.sel {
    background: var(--primary);
    color: var(--on-primary);
}

.cell.same {
    background: var(--tertiary-container);
    color: var(--on-tertiary-container);
}

.cell.tint {
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--primary) 12%, transparent);
}

.cell.notes {
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--cell) * 0.045);
}

.cell.notes .n {
    font-size: calc(var(--cell) * 0.24);
    line-height: 1;
    text-align: left;
    white-space: nowrap;
}

/* skyscraper clue boxes around the board */
.hint {
    width: var(--cell);
    height: var(--cell);
    flex: none;
    border-radius: 4px; /* M3 extraSmall */
    background: var(--tertiary-container);
    color: var(--on-tertiary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell) * 0.5);
    line-height: 1;
}

.hero .description {
    flex: 0 1 480px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--on-surface);
}

.hero h1 .accent {
    color: var(--primary);
}

.hero .tagline {
    margin: 16px 0 0;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--on-surface-variant);
}

/* Google Play badge as a filled M3-style button */
.playnow {
    display: inline-flex;
    align-items: center;
}

.playnow img {
    width: 220px;
    height: auto;
    box-shadow: var(--shadow-button);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.playnow:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(29, 27, 32, 0.2);
}

@media (prefers-color-scheme: dark) {
    .playnow:hover img {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    }
}

/* ---------- document pages (privacy policy, delete account) ---------- */

.page {
    max-width: 840px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.page > .card,
.document {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-extra-large);
    box-shadow: var(--shadow-card);
    padding: 40px 48px;
}

.document h1 {
    margin: 0 0 4px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--on-surface);
}

.document .subtitle {
    margin: 0 0 32px;
    color: var(--on-surface-variant);
    font-size: 1rem;
}

.document h2 {
    margin: 32px 0 12px;
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--on-surface);
}

.document h3 {
    margin: 24px 0 8px;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--on-surface);
}

.document h4 {
    margin: 20px 0 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--on-surface);
}

.document p {
    margin: 0 0 12px;
    color: var(--on-surface);
    line-height: 1.65;
}

.document ul {
    margin: 0 0 12px;
    padding-left: 24px;
    color: var(--on-surface);
    line-height: 1.65;
}

.document li {
    margin-bottom: 6px;
}

.document small {
    color: var(--on-surface-variant);
}

.document table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 0.95rem;
}

.document th,
.document td {
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--outline-variant);
    vertical-align: top;
    line-height: 1.5;
}

.document th {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    font-weight: 500;
}

/* info / option boxes inside documents */
.section,
.option-box {
    background: var(--surface-container);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-large);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.option-box {
    border-style: dashed;
    background: var(--surface-container-low);
}

/* destructive action — M3 error colors */
.btn {
    display: inline-block;
    background: var(--error-container);
    color: var(--on-error-container);
    font-weight: 500;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    margin-top: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    background: var(--error);
    color: var(--on-error);
    text-decoration: none;
    box-shadow: var(--shadow-button);
}

/* ---------- footer (shared by every page) ---------- */

.footer {
    border-top: 1px solid var(--outline-variant);
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    color: var(--on-surface-variant);
    font-size: 14px;
}

.footer .links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer a {
    color: var(--on-surface-variant);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px 32px;
        gap: 32px;
    }

    .hero .description {
        align-items: center;
        flex-basis: auto;
    }

    .playnow {
        justify-content: center;
    }

    .page > .card,
    .document {
        padding: 28px 22px;
    }

    .top-bar {
        flex-wrap: wrap;
    }
}
