@media screen and (max-width: 900px) {
    body {
        min-width: 0;
    }

    .site-header {
        height: auto;
        min-height: 78px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 16px 12px;
    }

    .brand {
        width: 230px;
        height: 54px;
        margin: 0 auto;
        gap: 9px;
    }

    .brand-mark {
        width: 46px;
        height: 50px;
    }

    .brand-text {
        width: 146px;
    }

    .main-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .main-nav a {
        min-width: 70px;
        height: 40px;
        padding: 0 10px;
        font-size: 12px;
        gap: 6px;
        flex: 0 0 auto;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
    }

    .main-nav svg {
        width: 16px;
        height: 16px;
    }

    .hero {
        min-height: auto;
        display: block;
        padding: 42px 18px 54px;
    }

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

    h1 {
        font-size: 38px;
        line-height: 1.02;
    }

    .hero-text {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
    }

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

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

    .featured-panel,
    .featured-rotator {
        margin-top: 26px;
    }

    .featured-rotator > .featured-panel {
        margin-top: 0;
    }

    .featured-panel img {
        height: 220px;
    }

    .featured-body {
        padding: 20px;
    }

    .featured-body h2 {
        font-size: 24px;
    }

    .community-strip {
        width: calc(100% - 32px);
        flex-direction: column;
        align-items: stretch;
        margin-top: -20px;
        padding: 16px;
    }

    .social-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .social-row a {
        width: 100%;
        min-width: 0;
    }

    .community-tools {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .community-strip .newsletter-form {
        width: 100%;
        min-width: 0;
    }

    .registry-search {
        width: 100%;
        max-width: none;
        flex-basis: 100%;
    }

    .collection,
    .updates,
    .dispatch-panel {
        width: calc(100% - 32px);
    }

    .collection {
        padding-top: 50px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    .section-heading h2,
    .updates h2 {
        font-size: 27px;
    }

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

    .game-card,
    .game-card.wide {
        grid-column: auto;
        min-height: 0;
    }

    .game-card img,
    .game-card.wide img,
    .game-slideshow,
    .placeholder-art {
        height: 210px;
    }

    .game-info p {
        min-height: 0;
    }

    .updates {
        grid-template-columns: 1fr;
        padding-bottom: 34px;
    }

    .updates article {
        padding: 20px;
    }

    .updates ul {
        grid-template-columns: 1fr;
    }

    .page-hero {
        min-height: auto;
        padding: 46px 18px;
    }

    .page-hero > div {
        width: 100%;
    }

    .page-hero h1 {
        font-size: 36px;
    }

    .contact-layout,
    .about-grid,
    .about-showcase {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
    }

    .contact-layout {
        padding: 34px 0;
    }

    .form-card,
    .about-panel {
        padding: 20px;
    }

    .form-heading h2,
    .about-panel h2 {
        font-size: 26px;
    }

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

    .about-grid {
        padding-top: 34px;
    }

    .about-lead {
        grid-row: auto;
    }

    .about-lead h2 {
        font-size: 29px;
    }

    .image-panel {
        min-height: 190px;
    }

    .stat-panel strong {
        font-size: 40px;
    }

    .about-showcase {
        padding-bottom: 34px;
    }

    .about-showcase img {
        height: 190px;
    }

    .wiki-shell,
    .forum-board,
    .board-page,
    .gcp-shell,
    .legal-content-panel {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
        padding: 34px 0;
    }

    .wiki-sidebar {
        position: static;
        max-height: none;
    }

    .wiki-nav-list {
        max-height: 380px;
    }

    .wiki-content {
        padding: 20px;
    }

    .wiki-content h2 {
        font-size: 28px;
    }

    .wiki-body .codex-grid {
        grid-template-columns: 1fr;
    }

    .forum-category-head,
    .forum-row {
        padding: 18px;
    }

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

    .forum-row em {
        width: max-content;
    }

    .legal-content-panel,
    .board-header-panel,
    .board-form-panel,
    .thread-card,
    .gcp-panel,
    .admin-message-card,
    .disclaimer-card {
        padding: 20px;
    }

    .thread-title {
        font-size: 21px;
    }

    .gcp-grid,
    .analytics-metrics,
    .admin-card-grid {
        grid-template-columns: 1fr;
    }

    .admin-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-action-row .primary-button,
    .admin-action-row .danger-btn {
        width: 100%;
    }

    .floating-status {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }

    .registry-teaser-panel,
    .game-detail-top {
        grid-template-columns: 1fr;
    }

    .game-detail-page,
    .board-page {
        width: calc(100% - 32px);
        padding: 34px 0 50px;
    }

    .game-detail-intro,
    .game-detail-lore,
    .supporter-panel,
    .board-header-panel,
    .board-form-panel,
    .thread-card {
        padding: 20px;
    }

    .game-detail-intro h1 {
        font-size: 32px;
    }

    .game-detail-slider,
    .game-detail-slider.game-slideshow,
    .game-detail-slider img,
    .game-detail-slider .placeholder-art {
        min-height: 220px;
    }

    .stage-nav {
        width: 36px;
        height: 52px;
        font-size: 28px;
    }

    .stage-prev { left: 8px; }
    .stage-next { right: 8px; }

    .game-stage-strip button {
        flex-basis: 112px;
    }

    .game-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .card-view-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .membership-card-head {
        flex-direction: column;
    }

    .membership-status-row {
        width: 100%;
        justify-content: space-between;
    }

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

    .ownership-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ownership-checks {
        width: 100%;
        justify-content: space-between;
    }

    .registry-card {
        min-height: 0;
    }

    .search-hero form,
    .donate-grid,
    .dispatch-row {
        display: block;
    }

    .dispatch-row span {
        display: block;
        margin-top: 4px;
    }

    .chip-preview {
        width: 160px;
        height: 90px;
    }

    .teaser-chip {
        font-size: 12px;
    }

    .account-access {
        min-height: auto;
        padding: 42px 18px;
    }

    .account-card h1 {
        font-size: 34px;
    }

    .account-card .form-heading {
        padding: 22px;
    }

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

    .captcha-grid .primary-button,
    .captcha-grid input {
        width: 100%;
    }

    .dashboard-shell {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
        padding: 34px 0;
    }

    .profile-card {
        position: static;
    }

    .account-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .footer-main {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px 18px 16px;
    }

    .footer-column {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    .footer-column nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-brand {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .footer-brand img {
        width: 138px;
        height: 58px;
    }
}

/* Phones: the nav wraps to two or three rows, so the header scrolls away instead of covering the screen. */
@media screen and (max-width: 767px) {
    .site-header {
        position: static;
    }
}

@media screen and (max-width: 480px) {
    .main-nav {
        gap: 5px;
    }

    .main-nav a {
        min-width: 0;
        padding: 0 8px;
        gap: 5px;
    }
}

@media screen and (max-width: 420px) {
    .main-nav {
        gap: 4px;
    }

    .main-nav a {
        padding: 0 6px;
        gap: 4px;
    }

    .site-header .main-nav a.cart-link {
        min-width: 40px;
        width: 40px;
    }
}

@media screen and (min-width: 901px) and (max-width: 1260px) {
    body {
        min-width: 0;
    }

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

    .featured-panel {
        max-width: 760px;
    }

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

    .game-card.wide {
        grid-column: span 2;
    }

    .footer-main {
        grid-template-columns: auto auto;
        justify-content: start;
        gap: 18px 42px;
    }

    .footer-column nav {
        flex-wrap: wrap;
    }

    .footer-brand {
        grid-column: 1 / -1;
        justify-content: center;
    }
}


/* ---------- Launch build v2: phones */
@media screen and (max-width: 900px) {
    .contact-desk, .gcp-columns, .gcp-ticket-layout { grid-template-columns: 1fr; }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-row, .form-row--end { grid-template-columns: 1fr; }
    .gcp-topbar { flex-wrap: wrap; padding: 10px 16px; }
    .gcp-who { display: none; }
    .gcp-sections { top: 0; position: relative; padding: 0 8px; }
    .gcp-search { flex-wrap: wrap; }
    .gcp-search input { width: 100%; }
    .gcp-desk-table th:nth-child(4), .gcp-desk-table td:nth-child(4),
    .gcp-desk-table th:nth-child(5), .gcp-desk-table td:nth-child(5),
    .gcp-desk-table th:nth-child(7), .gcp-desk-table td:nth-child(7) { display: none; }
    .member-card__head, .mod-thread__head { flex-direction: column; }
    .ticket-number strong { font-size: 30px; }
}

/* ---------- Launch build v3: phones */
@media screen and (max-width: 900px) {
    .account-card { padding: 0 22px 22px; }
    .account-card .form-heading { padding: 22px 0 0; }
    .account-card .captcha-grid { grid-template-columns: 1fr; }
    .notify-form__row { flex-direction: column; }
    .news-card { padding: 20px; }
    .news-card--lead h2 { font-size: 26px; }
    .news-filters .news-rss { margin-left: 0; }
    .dispatch-head { flex-direction: column; align-items: flex-start; }
    .play-toolbar { justify-content: flex-start; }
}

/* Wide wiki tables scroll sideways on phones instead of being cut off by main's overflow. */
@media screen and (max-width: 900px) {
    .wiki-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ================================================================ Light mode: phones
   The colour tokens and surfaces are in desktop.css. Text spans the full width here, so the hero veil is even. */
@media screen and (max-width: 900px) {
    .light-mode {
        --lm-veil: linear-gradient(rgba(210, 230, 248, 0.94), rgba(216, 234, 250, 0.88));
    }
}
