/* ============================================================
   Pocket GBA — design system
   Dark, refined, handheld-console inspired.
   Palette: graphite surfaces + warm off-white text + one accent
   (cartridge amber). No gradients on full-screen, no neon glow,
   no decorative blobs. Every element earns its place.
   ============================================================ */

:root {
    /* surfaces */
    --bg:        #0E1113;
    --bg-2:      #121619;
    --surface:   #171C20;
    --surface-2: #1D242A;
    --surface-3: #252E35;
    --line:      #2A343B;
    --line-soft: #222B31;

    /* text */
    --text:      #F4F1EA;   /* warm white */
    --text-2:    #A9B2B7;
    --text-3:    #6D787E;

    /* accent — cartridge amber */
    --accent:      #F0A24B;
    --accent-soft: rgba(240, 162, 75, 0.14);
    --accent-ink:  #221604;
    --accent-press:#D8892F;

    /* status */
    --danger:      #E5484D;
    --danger-soft: rgba(229, 72, 77, 0.12);
    --success:     #5CB87A;

    /* geometry */
    --radius:    14px;
    --radius-lg: 20px;
    --radius-sm: 10px;

    /* type */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
            "Noto Sans Thai", "Sarabun", Roboto, Helvetica, Arial, sans-serif;

    /* spacing scale */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

    --tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

body { min-height: 100dvh; }

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

input, select {
    font-family: inherit;
    font-size: 16px; /* prevents iOS zoom on focus */
    color: inherit;
}

[hidden] { display: none !important; }

::selection { background: var(--accent-soft); }

/* ---------- app shell ---------- */

.app {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.view {
    flex: 1;
    padding: 0 var(--sp-5) calc(var(--tabbar-h) + var(--sp-6));
}

/* ---------- header ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: calc(env(safe-area-inset-top, 0px) + var(--sp-4)) var(--sp-5) var(--sp-3);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.wordmark-logo {
    width: 30px; height: 30px;
    flex: none;
}

.wordmark-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.wordmark-text em {
    font-style: normal;
    color: var(--accent);
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: var(--sp-2);
}

.icon-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: var(--text-2);
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- hero (continue playing) ---------- */

.hero {
    margin: var(--sp-2) 0 var(--sp-6);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    overflow: hidden;
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-4);
    align-items: center;
}

.hero-art {
    width: 84px; height: 84px;
    border-radius: var(--radius);
    flex: none;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hero-body { min-width: 0; flex: 1; }

.hero-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

.hero-title {
    font-size: 19px;
    font-weight: 700;
    margin: 2px 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-sub {
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-play {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 999px;
    transition: transform 0.12s ease, background 0.15s ease;
}
.hero-play:active { transform: scale(0.96); background: var(--accent-press); }
.hero-play svg { width: 16px; height: 16px; }

/* ---------- section labels ---------- */

.section-head {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    margin: var(--sp-6) 0 var(--sp-3);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

.section-note {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
}

/* ---------- search + sort ---------- */

.toolbar {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}

.search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0 12px;
    height: 42px;
}
.search svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    min-width: 0;
}
.search input::placeholder { color: var(--text-3); }

.sort-select {
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0 10px;
    color: var(--text-2);
    font-size: 14px;
    outline: none;
    flex: none;
    max-width: 42%;
    text-overflow: ellipsis;
}

/* ---------- game grid ---------- */

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}

@media (min-width: 480px) {
    .game-grid { grid-template-columns: repeat(3, 1fr); }
}

.game-tile {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.12s ease, border-color 0.15s ease;
    text-align: left;
    width: 100%;
}
.game-tile:active { transform: scale(0.97); }
.game-tile:hover { border-color: var(--line); }

.tile-art {
    aspect-ratio: 1 / 0.86;
    display: grid;
    place-items: center;
    position: relative;
    font-size: 44px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.tile-badge {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(10, 12, 14, 0.55);
    color: var(--success);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tile-body {
    padding: 10px 12px 12px;
    min-width: 0;
}

.tile-title {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-height: 2.6em;
}

.tile-sub {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-dot { color: var(--text-3); }

.tile-actions {
    display: flex;
    border-top: 1px solid var(--line-soft);
}

.tile-btn {
    flex: 1;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.tile-btn:hover { background: var(--surface-2); color: var(--text); }
.tile-btn.primary { color: var(--accent); }
.tile-btn.danger { color: var(--danger); }
.tile-btn + .tile-btn { border-left: 1px solid var(--line-soft); }
.tile-btn svg { width: 15px; height: 15px; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 650;
    transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-press); }

.btn-ghost {
    background: var(--surface-2);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-block { width: 100%; }

.btn-small {
    height: 38px;
    padding: 0 14px;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
}

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-label { opacity: 0.6; }

.spinner {
    width: 17px; height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner.dark { border-color: rgba(0, 0, 0, 0.2); border-top-color: currentColor; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chips / pills ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-2);
}
.chip.ok  { color: var(--success); background: rgba(92, 184, 122, 0.12); }
.chip.warn{ color: var(--accent); background: var(--accent-soft); }
.chip.err { color: var(--danger); background: var(--danger-soft); }

/* ---------- empty state ---------- */

.empty {
    text-align: center;
    padding: var(--sp-10) var(--sp-5);
}

.empty-art {
    width: 96px; height: 96px;
    margin: 0 auto var(--sp-5);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    display: grid;
    place-items: center;
    color: var(--text-3);
}
.empty-art svg { width: 40px; height: 40px; }

.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-desc  { font-size: 14px; color: var(--text-2); white-space: pre-line; max-width: 300px; margin: 0 auto; }
.empty .btn  { margin-top: var(--sp-5); }

/* ---------- tab bar ---------- */

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--bg-2) 92%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line-soft);
    display: flex;
    max-width: 560px;
    margin: 0 auto;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
    position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); }
.tab .tab-dot {
    position: absolute;
    top: 8px;
    right: calc(50% - 18px);
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    display: none;
}
.tab .tab-dot.on { display: block; }

/* ---------- player ---------- */

.player {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.player-top {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--sp-4) 10px;
}

.player-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.player-status {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.player-status .pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
}
.player-status.saving .pulse {
    background: var(--accent);
    animation: pulse 1s ease infinite;
}
.player-status.error { color: var(--danger); }
.player-status.error .pulse { background: var(--danger); }

@keyframes pulse { 50% { opacity: 0.35; } }

.player-exit {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
}
.player-exit:active { background: var(--surface-3); }

.player-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 var(--sp-3) calc(env(safe-area-inset-bottom, 0px) + var(--sp-3));
}

/* EmulatorJS mounts here */
.game-host {
    flex: 1;
    min-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-2);
    position: relative;
}

.game-host .ejs_parent {
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius);
}

.player-note {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-3);
    padding: 10px var(--sp-3) 0;
    line-height: 1.6;
}

.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    background: var(--bg-2);
    z-index: 5;
    border-radius: var(--radius);
}

.player-loading .spinner {
    width: 28px; height: 28px;
    border-color: var(--surface-3);
    border-top-color: var(--accent);
}

.player-loading-text { font-size: 14px; color: var(--text-2); }
.player-loading-sub { font-size: 12px; color: var(--text-3); max-width: 260px; text-align: center; }

/* ---------- saves view ---------- */

.stat-row {
    display: flex;
    gap: var(--sp-3);
    margin: var(--sp-3) 0 var(--sp-5);
}

.stat-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: var(--sp-4);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
}

.stat-value {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.45;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    margin-bottom: var(--sp-6);
}

.save-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.save-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    margin: var(--sp-4) 0 var(--sp-2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-row {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.save-thumb {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    flex: none;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--text-3);
}
.save-thumb img { width: 100%; height: 100%; object-fit: cover; }
.save-thumb svg { width: 20px; height: 20px; }

.save-info { flex: 1; min-width: 0; }
.save-name {
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.save-meta {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.save-actions { display: flex; gap: 6px; flex: none; }

.mini-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 650;
    color: var(--text-2);
}
.mini-btn:hover { background: var(--surface-3); color: var(--text); }
.mini-btn.accent { color: var(--accent); }
.mini-btn.danger { color: var(--danger); }

/* ---------- settings ---------- */

.settings-group {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--sp-5);
}

.settings-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 14px var(--sp-4);
    width: 100%;
    text-align: left;
    min-height: 52px;
}
.settings-row + .settings-row { border-top: 1px solid var(--line-soft); }
.settings-row:hover { background: var(--surface-2); }

.settings-row .row-label { font-size: 15px; font-weight: 550; }
.settings-row .row-value {
    margin-left: auto;
    font-size: 13.5px;
    color: var(--text-3);
    text-align: right;
    max-width: 55%;
    word-break: break-word;
}
.settings-row .row-desc {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--text-3);
    max-width: 58%;
    line-height: 1.45;
    text-align: right;
}
.settings-row.danger .row-label { color: var(--danger); }

.lang-toggle {
    margin-left: auto;
    display: flex;
    background: var(--surface-2);
    border-radius: 999px;
    padding: 3px;
}
.lang-toggle button {
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-3);
}
.lang-toggle button.on {
    background: var(--accent);
    color: var(--accent-ink);
}

.meter {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
    margin-top: 8px;
}
.meter > div {
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s ease;
}

.note-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: var(--sp-4);
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
    white-space: pre-line;
    margin-bottom: var(--sp-5);
}

/* ---------- sheets & dialogs ---------- */

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 8, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fade 0.18s ease;
}

@keyframes fade { from { opacity: 0; } }

.sheet {
    width: 100%;
    max-width: 560px;
    background: var(--bg-2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--sp-5) var(--sp-5) calc(env(safe-area-inset-bottom, 0px) + var(--sp-5));
    animation: slideUp 0.22s ease;
    max-height: 86dvh;
    overflow-y: auto;
}

@keyframes slideUp { from { transform: translateY(24px); opacity: 0.6; } }

@media (min-width: 560px) {
    .scrim { align-items: center; }
    .sheet {
        border-radius: var(--radius-lg);
        padding-bottom: var(--sp-5);
    }
}

.sheet-grip {
    width: 36px; height: 4px;
    border-radius: 999px;
    background: var(--surface-3);
    margin: -6px auto var(--sp-4);
}

.sheet-title {
    font-size: 18px;
    font-weight: 750;
    margin-bottom: var(--sp-2);
}

.sheet-body {
    font-size: 14.5px;
    color: var(--text-2);
    line-height: 1.65;
    white-space: pre-line;
    margin-bottom: var(--sp-5);
}

.sheet-actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.sheet-actions .btn { width: 100%; }

.checkbox-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    margin-bottom: var(--sp-4);
    cursor: pointer;
}
.checkbox-row input {
    margin-top: 3px;
    width: 18px; height: 18px;
    accent-color: var(--accent);
    flex: none;
}
.checkbox-row .cb-label { font-size: 14px; font-weight: 600; }
.checkbox-row .cb-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }

/* ---------- toasts ---------- */

.toast-host {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--tabbar-h) + var(--sp-4));
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    padding: 0 var(--sp-5);
}

.toast {
    pointer-events: auto;
    max-width: 420px;
    width: fit-content;
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 550;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    animation: toastIn 0.22s ease;
    line-height: 1.5;
    text-align: center;
}
.toast.err  { background: #3A2124; border-color: #5A2C31; }
.toast.ok   { background: #1D2E24; border-color: #2C4736; }

@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

.toast.out { transition: opacity 0.25s ease, transform 0.25s ease; opacity: 0; transform: translateY(8px); }

/* ---------- misc ---------- */

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.divider { height: 1px; background: var(--line-soft); margin: var(--sp-5) 0; }

.mono {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
}

.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }

/* file input trick */
.file-input { display: none; }

/* focus visibility for keyboard users */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* landscape phone player: give the game more room */
@media (orientation: landscape) and (max-height: 500px) {
    .player-top {
        padding-top: max(env(safe-area-inset-top, 0px), 8px);
        padding-bottom: 6px;
    }
    .player-note { display: none; }
}
