:root {
    color-scheme: dark;
    --bg-0: #0b0d12;
    --bg-1: #121722;
    --bg-2: #1a2130;
    --panel: rgba(24, 31, 46, 0.88);
    --border: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --text-muted: #9aa7c0;
    --accent: #ff6b9d;
    --accent-soft: rgba(255, 107, 157, 0.16);
    --success: #5eead4;
    --warning: #fbbf24;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 18px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --game-min-h: 540px;
    --game-h: min(80vh, 720px);
    --app-pad: 1rem;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: clip;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    background:
        radial-gradient(circle at top left, rgba(255, 107, 157, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(94, 234, 212, 0.12), transparent 28%),
        linear-gradient(180deg, var(--bg-0), #07080c 100%);
    color: var(--text);
}

button {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    max-width: 100%;
}

.app-header,
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(7, 8, 12, 0.72);
}

.app-footer {
    border-bottom: 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #c084fc);
    color: #140812;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow);
}

.brand-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.brand-subtitle {
    margin: 0.125rem 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-nav__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-nav__group--game {
    padding-right: 0.75rem;
    border-right: 1px solid var(--border);
}

.app-nav__group--auth {
    gap: 0.5rem;
}

.btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #f472b6);
    color: #1a0812;
    font-weight: 700;
}

.app-main {
    display: grid;
    grid-template-columns: minmax(240px, 280px) 1fr;
    gap: 1rem;
    padding: var(--app-pad);
    min-width: 0;
}

.sidebar {
    display: grid;
    gap: 1rem;
    align-content: start;
    min-width: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0 0 0.875rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.stat-list {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.stat-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.stat-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.stat-list dt,
.stat-list dd {
    margin: 0;
}

.stat-list dt {
    color: var(--text-muted);
}

.save-slots {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.panel-hint {
    margin: -0.25rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.save-slot {
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.save-slot:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

.save-slot--selected {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.save-slot__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.save-slot__label {
    font-weight: 600;
    color: var(--text);
}

.save-slot__meta {
    font-size: 0.8rem;
    text-align: right;
}

.save-slot__actions {
    display: flex;
    gap: 0.375rem;
}

.btn-sm {
    padding: 0.35rem 0.625rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
}

.session-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.app-header--logged-in .session-bar:not([hidden]) {
    display: flex;
}

.session-bar strong {
    color: var(--text);
}

.app-header--logged-in {
    flex-wrap: wrap;
}

.app-header--logged-in .brand {
    flex: 1 1 auto;
}

.app-header--logged-in .app-nav {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.game-stage {
    min-height: var(--game-min-h);
    min-width: 0;
}

.game-root {
    display: grid;
    grid-template-rows: 1fr;
    width: 100%;
    min-height: var(--game-min-h);
    height: var(--game-h);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
        var(--bg-1);
    box-shadow: var(--shadow);
    position: relative;
}

.game-loading,
.game-error {
    grid-row: 1;
    grid-column: 1;
    z-index: 2;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--game-min-h);
    height: 100%;
    padding: 2rem;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
        var(--bg-1);
}

.game-loading__spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(255, 107, 157, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.25rem;
}

.game-error h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.game-loading p,
.game-error p {
    margin: 0 auto;
    max-width: 42rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.game-frame {
    grid-row: 1;
    grid-column: 1;
    z-index: 1;
    display: block;
    width: 100%;
    min-height: var(--game-min-h);
    height: 100%;
    border: 0;
    background: #0f1420;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
}

.game-error code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.85rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding:
        max(1rem, var(--safe-top))
        max(1rem, var(--safe-right))
        max(1rem, var(--safe-bottom))
        max(1rem, var(--safe-left));
    background: rgba(4, 6, 10, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overscroll-behavior: contain;
}

.modal {
    width: min(100%, 420px);
    max-height: min(92vh, 92dvh, 720px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(165deg, rgba(255, 107, 157, 0.08), transparent 42%),
        rgba(18, 23, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0.75rem;
}

.auth-modal__brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.brand-mark--sm {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.auth-modal__intro {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.auth-modal__intro h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.auth-modal__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.45;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin: 0 1.25rem;
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    border-radius: 0;
}

.auth-tab {
    flex: 1;
    border: 0;
    border-radius: 0;
    padding: 0.75rem 0.5rem;
    margin-bottom: -1px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.auth-tab:hover {
    color: var(--text);
}

.auth-tab--active {
    color: var(--accent);
    font-weight: 700;
    border-bottom-color: var(--accent);
    background: transparent;
    box-shadow: none;
}

.auth-panel {
    padding: 1rem 1.25rem 1.25rem;
}

.auth-form {
    display: grid;
}

.auth-form--login {
    gap: 0.875rem;
    max-width: 100%;
}

.auth-form--register {
    gap: 1rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.auth-form--register .field-hint {
    margin-top: -0.125rem;
    padding-left: 0.125rem;
    color: rgba(154, 167, 192, 0.85);
}

.auth-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

.form-field {
    display: grid;
    gap: 0.375rem;
}

.form-field--invalid .input-wrap input {
    border-color: rgba(248, 113, 113, 0.55);
}

.form-field--invalid .input-wrap input:focus {
    outline-color: rgba(248, 113, 113, 0.35);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    display: flex;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-wrap--password input {
    padding-right: 2.75rem;
}

.input-wrap input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: rgba(255, 107, 157, 0.45);
    background: rgba(0, 0, 0, 0.38);
}

.input-wrap input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.input-wrap input::placeholder {
    color: rgba(154, 167, 192, 0.55);
}

.field-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.field-error {
    margin: 0;
    color: #fca5a5;
    font-size: 0.8125rem;
}

.btn-password-toggle {
    position: absolute;
    right: 0.375rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-password-toggle .icon-eye-off {
    display: none;
}

.btn-password-toggle.is-visible .icon-eye {
    display: none;
}

.btn-password-toggle.is-visible .icon-eye-off {
    display: block;
}

.btn-password-toggle:hover,
.btn-password-toggle:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.form-error-summary {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fecaca;
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-form__row {
    display: flex;
    align-items: center;
}

.auth-form__row--between {
    justify-content: flex-end;
    margin-top: -0.25rem;
}

.auth-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    text-decoration: none;
}

.auth-link:hover:not(:disabled),
.auth-link:focus-visible:not(:disabled) {
    text-decoration: underline;
    outline: none;
}

.auth-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-link--inline {
    font-weight: 600;
}

.auth-form__footer {
    margin: 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    cursor: pointer;
}

.form-checkbox input {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.auth-success {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem 1.25rem 2.25rem;
    text-align: center;
}

.auth-success__icon {
    color: var(--success);
}

.auth-success h3 {
    margin: 0;
    font-size: 1.125rem;
}

.auth-success p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn--loading {
    position: relative;
    opacity: 0.85;
    cursor: wait;
}

.btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.panel--status-feed {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.status-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 9.5rem;
    overflow-y: auto;
    display: grid;
    gap: 0.375rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.status-feed::-webkit-scrollbar {
    width: 6px;
}

.status-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.status-feed__item {
    padding: 0.5rem 0.625rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
    animation: status-feed-in 0.25s ease;
}

.status-feed__item--orgasm {
    border-color: rgba(255, 107, 157, 0.35);
    color: var(--text);
    background: rgba(255, 107, 157, 0.08);
}

.status-feed__item--warning {
    border-color: rgba(251, 191, 36, 0.35);
    color: var(--text);
    background: rgba(251, 191, 36, 0.06);
}

.status-feed__item--success {
    border-color: rgba(94, 234, 212, 0.3);
}

.status-feed-empty {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.status-feed:not(:empty) + .status-feed-empty {
    display: none;
}

@keyframes status-feed-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.toast--orgasm {
    border-color: rgba(255, 107, 157, 0.45);
    background: rgba(255, 107, 157, 0.1);
}

.toast-stack {
    position: fixed;
    right: max(1rem, var(--safe-right));
    bottom: max(1rem, var(--safe-bottom));
    left: auto;
    z-index: 110;
    display: grid;
    gap: 0.5rem;
    max-width: min(360px, calc(100vw - 2rem - var(--safe-left) - var(--safe-right)));
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    animation: toast-in 0.2s ease;
}

.toast--success {
    border-color: rgba(94, 234, 212, 0.35);
}

.toast--error {
    border-color: rgba(248, 113, 113, 0.45);
}

.toast--warning {
    border-color: rgba(251, 191, 36, 0.45);
}

.toast--hide {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.status-pill::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--warning);
}

.status-pill--ready::before {
    background: var(--success);
}

.panel--cheats {
    padding-top: 0.75rem;
}

.panel--locked {
    opacity: 0.92;
}

.panel--locked .cheats-toggle {
    color: var(--text-muted);
}

.panel--locked .cheats-toggle[aria-disabled="true"] {
    cursor: default;
}

.panel--locked .cheats-body .cheat-toggle:has(input:disabled),
.panel--locked .cheats-body .btn:disabled {
    opacity: 0.55;
}

.cheats-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cheats-toggle__icon {
    width: 0.65rem;
    height: 0.65rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cheats-toggle[aria-expanded="true"] .cheats-toggle__icon {
    transform: rotate(-135deg);
}

.cheats-body {
    margin-top: 0.875rem;
}

.cheats-actions {
    display: grid;
    gap: 0.625rem;
}

.cheats-section-label {
    margin: 0.75rem 0 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cheats-section-label:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.cheat-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    line-height: 1.4;
    font-size: 0.9rem;
}

.cheat-toggle input {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.cheat-toggle:has(input:disabled) {
    opacity: 0.55;
    cursor: not-allowed;
}

.breast-op-sizes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.breast-op-size[aria-pressed="true"] {
    border-color: var(--accent, #c45cff);
    color: var(--accent, #c45cff);
}

@media (max-width: 900px) {
    :root {
        --game-min-h: clamp(280px, 52dvh, 480px);
        --game-h: clamp(320px, calc(100dvh - 12rem), 640px);
        --app-pad: 0.75rem;
    }

    .app-main {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .sidebar {
        order: 2;
    }

    .game-stage {
        order: 1;
    }

    .app-header,
    .app-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .app-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .app-nav__group {
        width: 100%;
    }

    .app-nav__group--game {
        padding-right: 0;
        border-right: 0;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .app-nav__group--auth {
        justify-content: stretch;
    }

    .app-nav__group--auth .btn {
        flex: 1 1 0;
    }

    .session-bar {
        order: 2;
        width: 100%;
    }

    .app-header--logged-in .app-nav {
        order: 3;
    }

    body.modal-open {
        position: fixed;
        width: 100%;
        inset: 0;
        touch-action: none;
    }

    .modal-backdrop {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal {
        margin-block: auto;
        max-height: calc(100dvh - 1.5rem - var(--safe-top) - var(--safe-bottom));
    }

    .auth-modal {
        max-height: calc(100dvh - 1.5rem - var(--safe-top) - var(--safe-bottom));
    }

    .auth-tabs {
        margin-inline: 1rem;
    }

    .auth-panel {
        padding-inline: 1rem;
    }

    .breast-op-sizes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toast-stack {
        left: max(0.75rem, var(--safe-left));
        right: max(0.75rem, var(--safe-right));
        max-width: none;
    }
}

@media (max-width: 480px) {
    :root {
        --game-min-h: clamp(240px, 45dvh, 380px);
        --game-h: clamp(280px, calc(100dvh - 10.5rem), 520px);
        --app-pad: 0.625rem;
    }

    .app-header,
    .app-footer {
        padding-inline: 0.875rem;
    }

    .brand-mark {
        width: 2.5rem;
        height: 2.5rem;
    }

    .app-nav__group .btn {
        justify-content: center;
        padding-inline: 0.75rem;
    }

    .panel {
        padding: 0.875rem;
    }

    .auth-modal__header {
        padding-inline: 1rem;
    }

    .auth-modal__intro h2 {
        font-size: 1rem;
    }

    .game-loading,
    .game-error {
        padding: 1.25rem;
    }
}
