:root {
    color-scheme: dark;
    --page-bg: #080d13;
    --page-bg-2: #121915;
    --surface: rgba(18, 24, 29, 0.92);
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text: #f4f7fb;
    --muted: #b7c4d3;
    --subtle: #7f8b99;
    --cyan: #2dd4bf;
    --blue: #60a5fa;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #fb7185;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        linear-gradient(120deg, rgba(45, 212, 191, 0.14), transparent 34%),
        linear-gradient(240deg, rgba(251, 191, 36, 0.1), transparent 30%),
        linear-gradient(180deg, var(--page-bg) 0%, #0f151b 52%, var(--page-bg-2) 100%);
    line-height: 1.5;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2));
}

a,
button {
    font: inherit;
}

a {
    color: inherit;
}

button {
    border: 0;
}

.site-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 28px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, 100%);
    margin: 0 auto;
    gap: 16px;
}

.site-brand,
.site-nav a {
    text-decoration: none;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 800;
}

.brand-mark,
.button-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #061014;
    background: linear-gradient(135deg, var(--cyan), var(--amber));
    font-size: 0.78rem;
    font-weight: 900;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.home-layout,
.join-layout {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.minesweeper-panel,
.invite-surface {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.minesweeper-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
    gap: 30px;
    align-items: center;
    padding: 44px;
}

.section-heading {
    max-width: 560px;
}

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

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 16px;
    font-size: 3.15rem;
    line-height: 1.02;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: 1.25rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.lede,
.message {
    color: var(--muted);
    font-size: 1.04rem;
}

.lede {
    max-width: 620px;
    margin-bottom: 28px;
}

.primary-actions,
.play-actions,
.install-actions,
.actions,
.resource-grid {
    display: grid;
    gap: 12px;
}

.primary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.install-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button,
.resource-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 62px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    background: var(--surface-soft);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible,
.resource-card:hover,
.resource-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: var(--surface-strong);
    outline: none;
}

.button-primary {
    border-color: rgba(96, 165, 250, 0.46);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.26), rgba(45, 212, 191, 0.2));
}

.button-green {
    border-color: rgba(52, 211, 153, 0.42);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.24), rgba(45, 212, 191, 0.14));
}

.button-amber {
    border-color: rgba(251, 191, 36, 0.42);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.21), rgba(251, 113, 133, 0.13));
}

.button-hero {
    min-height: 92px;
    padding: 18px;
}

.button-hero .button-mark {
    width: 44px;
    height: 44px;
}

.button-hero .button-title {
    font-size: 1.18rem;
}

.button-title,
.resource-title {
    display: block;
    color: var(--text);
    font-weight: 800;
    line-height: 1.18;
}

.button-subtitle,
.resource-subtitle {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

.button-mark {
    width: 34px;
    height: 34px;
    font-size: 0.68rem;
}

.mark-blue {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.mark-green {
    background: linear-gradient(135deg, var(--green), var(--cyan));
}

.mark-amber {
    background: linear-gradient(135deg, var(--amber), var(--red));
}

.mark-red {
    background: linear-gradient(135deg, var(--red), var(--amber));
}

.project-list {
    padding: 0;
}

.project-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.project-heading p {
    max-width: 560px;
    margin-bottom: 0;
    color: var(--muted);
}

.resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-card {
    width: 100%;
}

/* ── Footer ──
   Every page ends on the same VladJ Software line, so the studio name and the
   contact address are one click away from anywhere on the site. */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    width: min(1120px, 100%);
    margin: 4px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--subtle);
    font-size: 0.88rem;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 160ms ease, border-color 160ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text);
    border-bottom-color: var(--border-strong);
    outline: none;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

/* ── Contact ── */
.contact-panel {
    grid-template-columns: 1fr;
}

.contact-actions {
    grid-template-columns: 1fr;
    max-width: 560px;
}

.contact-note {
    margin: 22px 0 0;
    color: var(--subtle);
    font-size: 0.92rem;
}

.mark-cyan {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.join-page {
    justify-content: center;
}

.join-layout {
    width: min(720px, 100%);
}

.invite-surface {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
}

.invite-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.invite-header .eyebrow {
    margin-bottom: 2px;
}

.invite-header h1 {
    margin-bottom: 0;
    font-size: 2.35rem;
}

.game-id {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 38px;
    margin-bottom: 18px;
    padding: 7px 11px;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 8px;
    color: #cfe4ff;
    background: rgba(96, 165, 250, 0.12);
    font-weight: 800;
}

.message {
    margin-bottom: 22px;
}

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

.fallback {
    display: none;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.fallback.visible {
    display: block;
}

.not-found .join-only {
    display: none;
}

.not-found .message {
    margin-bottom: 0;
}

@media (max-width: 920px) {
    .minesweeper-panel {
        grid-template-columns: 1fr;
    }

    .resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .site-page {
        gap: 20px;
        padding: 18px;
    }

    .site-header,
    .project-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .minesweeper-panel,
    .invite-surface {
        padding: 22px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .invite-header h1 {
        font-size: 1.9rem;
    }

    .primary-actions,
    .install-actions,
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}