/* Page-specific styles. */
body[data-page="/entertainment/snes/"] {
    color-scheme: light;
    --canvas: #f4f5f0;
    --paper: #fff;
    --ink: #20251f;
    --muted: #737b72;
    --line: #e5e9e1;
    --green: #367251;
    --green-dark: #254c37;
    --green-pale: #eaf2e9;
    --orange: #bd7848;
    --error: #a54838;
    --shadow: 0 16px 48px rgb(33 48 36 / 5%);
    font-family: "Segoe UI", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body[data-page="/entertainment/snes/"] { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); }
:where(body[data-page="/entertainment/snes/"]) select { font: inherit; }
:where(body[data-page="/entertainment/snes/"]) select:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 24%); outline-offset: 2px; }
:where(body[data-page="/entertainment/snes/"]) .app-shell { width: min(960px, calc(100% - 48px)); margin: 0 auto; }
:where(body[data-page="/entertainment/snes/"]) .topbar { display: flex; align-items: center; justify-content: space-between; height: 72px; border-bottom: 1px solid #e4e8df; }
:where(body[data-page="/entertainment/snes/"]) .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16.33333px; font-weight: 800; letter-spacing: -.6px; text-decoration: none; }
:where(body[data-page="/entertainment/snes/"]) .brand-mark { display: flex; align-items: end; gap: 2px; width: 21px; height: 21px; padding: 4px; border-radius: 7px; background: var(--green); }
:where(body[data-page="/entertainment/snes/"]) .brand-mark span { width: 3px; border-radius: 2px; background: #fff; }
:where(body[data-page="/entertainment/snes/"]) .brand-mark span:nth-child(1) { height: 6px; }
:where(body[data-page="/entertainment/snes/"]) .brand-mark span:nth-child(2) { height: 11px; }
:where(body[data-page="/entertainment/snes/"]) .brand-mark span:nth-child(3) { height: 8px; }
:where(body[data-page="/entertainment/snes/"]) .local-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fafbf8; color: #5e685f; font-size: 12.33333px; font-weight: 600; }
:where(body[data-page="/entertainment/snes/"]) .local-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); }
:where(body[data-page="/entertainment/snes/"]) .hero { max-width: 720px; padding: 48px 0 28px; }
:where(body[data-page="/entertainment/snes/"]) .eyebrow { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body[data-page="/entertainment/snes/"]) .section-label { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body[data-page="/entertainment/snes/"]) .hero h1 { margin: 12px 0; font-size: clamp(39.33333px, calc(5vw + 1.33333px), 56.33333px); line-height: 1.08; letter-spacing: -2.5px; }
:where(body[data-page="/entertainment/snes/"]) .hero h1 span { color: var(--green); }
:where(body[data-page="/entertainment/snes/"]) .section-label { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.2px; }
:where(body[data-page="/entertainment/snes/"]) .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -13px 0 17px; }
:where(body[data-page="/entertainment/snes/"]) .mode-note { color: #778076; font-size: 11.33333px; line-height: 1.5; }
:where(body[data-page="/entertainment/snes/"]) .upload-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
:where(body[data-page="/entertainment/snes/"]) .upload-copy { display: flex; align-items: flex-start; gap: 14px; }
:where(body[data-page="/entertainment/snes/"]) .step-number { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--green-pale); color: var(--green); font-size: 12.33333px; font-weight: 700; }:where(body[data-page="/entertainment/snes/"]) .file-picker { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; }:where(body[data-page="/entertainment/snes/"]) .file-picker input{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:where(body[data-page="/entertainment/snes/"]) .upload-icon { font-size: 20.33333px; line-height: 1; }
:where(body[data-page="/entertainment/snes/"]) .file-status { grid-column: 1 / -1; margin: -3px 0 0 46px; color: var(--muted); font-size: 12.33333px; }
:where(body[data-page="/entertainment/snes/"]) .file-details { grid-column: 1 / -1; display: grid; gap: 4px; margin: 0 0 0 46px; padding-top: 12px; border-top: 1px solid #edf0ea; color: #717970; font-size: 12.33333px; }
:where(body[data-page="/entertainment/snes/"]) .tool-card { margin-top: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
:where(body[data-page="/entertainment/snes/"]) .card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
:where(body[data-page="/entertainment/snes/"]) .card-index { color: #869087; font-size: 10.33333px; font-weight: 700; letter-spacing: 1px; }
:where(body[data-page="/entertainment/snes/"]) .card-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #f8eee7; color: var(--orange); font-size: 17.33333px; }
:where(body[data-page="/entertainment/snes/"]) .tool-card h2 { margin: 13px 0 16px; font-size: 21.33333px; letter-spacing: -.7px; }
:where(body[data-page="/entertainment/snes/"]) .settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 270px); align-items: end; gap: 14px; }
:where(body[data-page="/entertainment/snes/"]) .field { display: grid; align-content: start; gap: 6px; min-width: 0; color: #525d53; font-size: 11.33333px; font-weight: 600; }
:where(body[data-page="/entertainment/snes/"]) .field select { width: 100%; min-height: 42px; padding: 9px 32px 9px 11px; border: 1px solid #e4e9e2; border-radius: 8px; background: #fbfcfa; color: var(--ink); font-size: 13.33333px; font-weight: 400; }
:where(body[data-page="/entertainment/snes/"]) .field select:focus-visible { border-color: var(--green-border-strong); }:where(body[data-page="/entertainment/snes/"]) .primary-button { display: inline-flex; align-items: center; justify-content: center; }:where(body[data-page="/entertainment/snes/"]) .secondary-button { display: inline-flex; align-items: center; justify-content: center; }:where(body[data-page="/entertainment/snes/"]) .primary-button{ width: 100%; }
:where(body[data-page="/entertainment/snes/"]) .hint { margin: 10px 0 0; color: #929990; font-size: 11.33333px; line-height: 1.55; }
:where(body[data-page="/entertainment/snes/"]) .action-status { min-height: 16px; margin: 10px 0 0; color: var(--green); font-size: 12.33333px; line-height: 1.5; }
:where(body[data-page="/entertainment/snes/"]) .action-status.is-error { color: var(--error); }
:where(body[data-page="/entertainment/snes/"]) .player-host { overflow: hidden; width: min(100%, 1200px); height: auto; min-height: 300px; aspect-ratio: 1.9 / 1; margin: 17px auto 0; border-radius: 11px; background: #141914; }
:where(body[data-page="/entertainment/snes/"]) .controls-note { color: #667267; font-size: 11.33333px; }
:where(body[data-page="/entertainment/snes/"]) .phone-hint { color: #667267; font-size: 11.33333px; }
:where(body[data-page="/entertainment/snes/"]) .control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 7px; }
:where(body[data-page="/entertainment/snes/"]) .controls-note { margin: 9px 0 0; }
:where(body[data-page="/entertainment/snes/"]) .phone-hint { display: block; }
:where(body[data-page="/entertainment/snes/"]) .save-actions { display: flex; flex-wrap: wrap; gap: 9px; }
:where(body[data-page="/entertainment/snes/"]) .processing-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; padding: 12px; border-radius: 9px; background: #f7f8f5; }
:where(body[data-page="/entertainment/snes/"]) .processing-note p { margin: 0; color: #778076; font-size: 11.33333px; line-height: 1.6; }
:where(body[data-page="/entertainment/snes/"]) .privacy-note { margin-top: 18px; padding: 16px 18px; border: 1px solid #e5e9e1; border-radius: 12px; background: #fafbf8; }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog { width: min(560px, calc(100% - 28px)); max-width: none; max-height: min(82vh, 720px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgb(20 34 24 / 24%); }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog::backdrop { background: rgb(25 37 28 / 48%); backdrop-filter: blur(2px); }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog-content { padding: 22px; }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog-header h2 { margin: 6px 0 0; color: #354439; font-size: 20.33333px; }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog ol { display: grid; gap: 8px; margin: 0; padding-left: 21px; color: #58645a; font-size: 13.33333px; line-height: 1.6; }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog--error h2 { color: var(--error); }
:where(body[data-page="/entertainment/snes/"]) .utility-dialog--error #error-dialog-message { margin: 0; color: #59635a; font-size: 14.33333px; line-height: 1.65; }:where(body[data-page="/entertainment/snes/"]) .dialog-close { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; }
:where(body[data-page="/entertainment/snes/"]) .footer { display: flex; justify-content: space-between; gap: 15px; padding: 24px 0 30px; color: #929890; font-size: 11.33333px; }
@media (prefers-reduced-motion: reduce) {
body[data-page="/entertainment/snes/"] * { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; animation-iteration-count: 1; }
}
@media (prefers-reduced-motion: reduce) {
body[data-page="/entertainment/snes/"] *::before { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; animation-iteration-count: 1; }
}
@media (prefers-reduced-motion: reduce) {
body[data-page="/entertainment/snes/"] *::after { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; animation-iteration-count: 1; }
}
:where(body[data-page="/entertainment/snes/"]) .tool-brand-header {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    gap: 0 .75rem;
    height: auto;
    min-height: 72px;
    padding-block: .45rem;
}
:where(body[data-page="/entertainment/snes/"]) .tool-brand-tagline {
    flex: 0 0 100%;
    order: 10;
    width: 100%;
    margin: .15rem 0 0;
    color: #68756b;
    font-size: 0.78333rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.4;
    text-transform: uppercase;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs {
    display: block;
    width: 100%;
    margin: 0 0 clamp(12px, 1.7vw, 20px);
    color: #68756b;
    font: inherit;
    font-size: 0.88333rem;
    line-height: 1.5;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs li + li::before {
    content: "/";
    margin-right: .35rem;
    color: #9aa59b;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs ol a {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    padding: .28rem .78rem;
    border: 1px solid var(--green-border);
    border-radius: 999px;
    background: var(--green-pale);
    box-shadow: 0 1px 2px rgb(37 76 55 / 8%);
    color: var(--green-dark);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs ol a:hover {
    border-color: var(--green);
    background: var(--green-pale-hover);
    color: var(--green-deep);
}
:where(body[data-page="/entertainment/snes/"]) .tool-brand-tagline {
    box-sizing: border-box;
}
:where(body[data-page="/entertainment/snes/"]) .tool-breadcrumbs {
    box-sizing: border-box;
}


:where(body[data-page="/entertainment/snes/"]) .player-host {
    position: relative;
    isolation: isolate;
}
:where(body[data-page="/entertainment/snes/"]) .player-host > .player-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #141914;
}
:where(body[data-page="/entertainment/snes/"]) .fullscreen-toggle {
    position: absolute;
    z-index: 5;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
:where(body[data-page="/entertainment/snes/"]) .fullscreen-toggle-icon {
    font-size: 19px;
    line-height: 1;
}
:where(body[data-page="/entertainment/snes/"]) .player-host:fullscreen,
:where(body[data-page="/entertainment/snes/"]) .player-host:-webkit-full-screen,
:where(body[data-page="/entertainment/snes/"]) .player-host.is-expanded {
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
    background: #101310;
}
:where(body[data-page="/entertainment/snes/"]) .player-host:fullscreen .player-frame,
:where(body[data-page="/entertainment/snes/"]) .player-host:-webkit-full-screen .player-frame,
:where(body[data-page="/entertainment/snes/"]) .player-host.is-expanded .player-frame {
    width: 100%;
    height: 100%;
}
:where(body[data-page="/entertainment/snes/"]).snes-expanded-mode {
    overflow: hidden;
}
:where(body[data-page="/entertainment/snes/"]) .keyboard-diagram {
    display: none;
}
body.has-touch-input[data-page="/entertainment/snes/"] .player-caption .controls-help {
    display: none !important;
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    :where(body[data-page="/entertainment/snes/"]) .keyboard-diagram {
        display: block;
        width: min(100%, 850px);
        margin: 20px auto 2px;
        color: var(--muted, #68746a);
        text-align: center;
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-diagram figcaption {
        margin-bottom: 9px;
        color: var(--green-dark, #254c37);
        font-size: 12px;
        font-weight: 750;
        letter-spacing: .04em;
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-illustration {
        display: block;
        width: 100%;
        height: auto;
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 18px;
        padding-top: 9px;
        color: var(--muted, #68746a);
        font-size: 11px;
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend > span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        background: var(--green, #367251);
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend-dot--button {
        background: var(--green-dark, #254c37);
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend-dot--trigger {
        background: var(--green-mid, #326344);
    }
    :where(body[data-page="/entertainment/snes/"]) .keyboard-legend-dot--system {
        background: var(--green-bright, #6a9bce);
    }
}


/* Keyboard illustration */
:where(body[data-page="/entertainment/snes/"]) .keyboard-case { fill: #f1f4ef; stroke: #d8e0d6; stroke-width: 2; }
:where(body[data-page="/entertainment/snes/"]) .key-shadow { fill: #cbd4ca; }
:where(body[data-page="/entertainment/snes/"]) .key-face { fill: #fff; stroke: #d3dbd2; stroke-width: 1.5; }
:where(body[data-page="/entertainment/snes/"]) .key-label { fill: #344238; font: 700 13px "Segoe UI", Arial, sans-serif; text-anchor: middle; dominant-baseline: middle; }
:where(body[data-page="/entertainment/snes/"]) .key-secondary { fill: #627064; font: 600 8px "Segoe UI", Arial, sans-serif; text-anchor: end; dominant-baseline: middle; }
:where(body[data-page="/entertainment/snes/"]) .key--move .key-face { fill: var(--green, #367251); stroke: var(--green-dark, #254c37); }:where(body[data-page="/entertainment/snes/"]) .key--button .key-face{ fill: var(--green-dark, #254c37); stroke: var(--green-dark, #254c37); }
:where(body[data-page="/entertainment/snes/"]) .key--trigger .key-face { fill: var(--green-mid, #326344); stroke: var(--green-mid, #326344); }
:where(body[data-page="/entertainment/snes/"]) .key--system .key-face { fill: var(--green-bright, #6a9bce); stroke: var(--green-bright, #6a9bce); }:where(body[data-page="/entertainment/snes/"]) .key--move .key-label, :where(body[data-page="/entertainment/snes/"]) .key--trigger .key-label, :where(body[data-page="/entertainment/snes/"]) .key--system .key-label, :where(body[data-page="/entertainment/snes/"]) .key--move .key-secondary, :where(body[data-page="/entertainment/snes/"]) .key--trigger .key-secondary, :where(body[data-page="/entertainment/snes/"]) .key--system .key-secondary{ fill: #fff; }:where(body[data-page="/entertainment/snes/"]) .key--button .key-label, :where(body[data-page="/entertainment/snes/"]) .key--button .key-secondary{ fill: #fff; }


/* Touch controls follow the Sega layout: D-pad left, SNES controls right. */
body.has-touch-input[data-page="/entertainment/snes/"] .player-host:not(.controls-overlay) {
    min-height: 0;
    aspect-ratio: 1.9 / 1;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-controls[hidden] {
    display: none !important;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-controls {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 7px;
    width: min(920px, calc(100vw - 32px));
    min-width: 0;
    margin-inline: auto;
    padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px));
    border: 1px solid #29342b;
    border-top: 0;
    border-radius: 0 0 11px 11px;
    background: #18211a;
    color: #f3f5ef;
    box-sizing: border-box;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-controls-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 34px;
    color: #d3dbd1;
    font-size: 12px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-controls-toolbar select {
    width: 160px;
    min-width: 0;
    min-height: 36px;
    padding: 4px 24px 4px 7px;
    border: 1px solid #465349;
    border-radius: 7px;
    background: #222e25;
    color: #fff;
    font: inherit;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-system-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-controller {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 920px;
    min-height: 122px;
    margin: 0;
    padding-inline: 10px;
    box-sizing: border-box;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad {
    display: grid;
    grid-template-columns: repeat(3, minmax(38px, 44px));
    grid-template-rows: repeat(3, 42px);
    justify-content: start;
    align-items: center;
    justify-self: start;
    gap: 2px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-game-button {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid #718071;
    background: #334335;
    color: #fff;
    font: 700 17px/1 "Segoe UI", Arial, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-game-button:active,
body.has-touch-input[data-page="/entertainment/snes/"] .touch-game-button.is-pressed {
    border-color: #e2f1bd;
    background: #66834d;
    transform: scale(0.96);
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-center {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background: #29362c;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-up {
    grid-column: 2;
    grid-row: 1;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-left {
    grid-column: 1;
    grid-row: 2;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-center {
    grid-column: 2;
    grid-row: 2;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-right {
    grid-column: 3;
    grid-row: 2;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-dpad-down {
    grid-column: 2;
    grid-row: 3;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-actions {
    display: grid;
    justify-self: end;
    justify-items: center;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-face-buttons {
    display: grid;
    grid-template-columns: repeat(2, 44px);
    column-gap: 6px;
    row-gap: 14px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-face-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-face-button span {
    display: block;
    text-align: center;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-system-button {
    min-width: 58px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .game-card > .touch-controls {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-inline: 0;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay:not([hidden]) {
    display: block;
    overflow: hidden;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay > .touch-controls {
    position: absolute;
    right: 8px;
    bottom: env(safe-area-inset-bottom, 0px);
    left: 8px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0 0 42px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controller {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 0;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-dpad {
    width: max-content;
    justify-self: start;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-actions {
    justify-self: end;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controls-toolbar {
    position: absolute;
    right: auto;
    bottom: 0;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 16px);
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateX(-50%);
    pointer-events: none;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controls-toolbar label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controls-toolbar select {
    width: 120px;
    min-height: 34px;
    padding: 3px 22px 3px 6px;
    border-color: rgb(255 255 255 / 55%);
    background: rgb(20 27 22 / 58%);
    pointer-events: auto;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-game-button {
    border-color: rgb(224 236 220 / 72%);
    background: rgb(51 67 53 / 62%);
    box-shadow: none;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-system-buttons {
    pointer-events: auto;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls:fullscreen:not(.controls-overlay),
body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls:-webkit-full-screen:not(.controls-overlay),
body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.is-expanded:not(.controls-overlay) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
}

body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls:fullscreen:not(.controls-overlay) > .player-frame,
body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls:-webkit-full-screen:not(.controls-overlay) > .player-frame,
body.has-touch-input[data-page="/entertainment/snes/"] .player-host.has-touch-controls.is-expanded:not(.controls-overlay) > .player-frame {
    position: relative;
    inset: auto;
    align-self: center;
    justify-self: center;
    width: auto;
    height: min(100%, 52.63vw);
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1.9 / 1;
    transform: none;
    border-radius: 0;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .game-card > .touch-controls {
    width: min(1288px, calc(100vw - 32px));
    max-width: none;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-controller {
    width: 100%;
    max-width: none;
    padding-inline: clamp(12px, 1.5vw, 20px);
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-dpad {
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(3, 50px);
    gap: 3px;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-game-button {
    min-width: 50px;
    min-height: 50px;
    font-size: 19px;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-face-buttons {
    grid-template-columns: repeat(2, 52px);
    column-gap: 10px;
    row-gap: 20px;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-face-button {
    width: 52px;
    min-width: 52px;
    height: 52px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-controls-toolbar label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-controls-toolbar select {
    width: 120px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-system-buttons {
    gap: 16px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-system-button {
    min-width: 52px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-controller {
    grid-template-columns: minmax(120px, 0.8fr) minmax(132px, 1fr);
    gap: 4px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-dpad {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-game-button {
    min-width: 40px;
    min-height: 40px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-face-buttons {
    grid-template-columns: repeat(2, 40px);
    column-gap: 4px;
    row-gap: 8px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-face-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay > .touch-controls {
    padding-bottom: 52px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controls-toolbar {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-controls-toolbar select {
    width: 112px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay .touch-system-buttons {
    gap: 10px;
    margin-top: 8px;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls:fullscreen:not(.controls-overlay) > .touch-controls,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls:-webkit-full-screen:not(.controls-overlay) > .touch-controls,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.is-expanded:not(.controls-overlay) > .touch-controls {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(1288px, calc(100vw - 32px));
    max-width: none;
    justify-self: center;
    margin: 0;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay:fullscreen .touch-dpad,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay:-webkit-full-screen .touch-dpad,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay.is-expanded .touch-dpad {
    transform: translate(64px, -72px);
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay:fullscreen .touch-actions,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay:-webkit-full-screen .touch-actions,
body.has-touch-tablet[data-page="/entertainment/snes/"] .player-host.has-touch-controls.controls-overlay.is-expanded .touch-actions {
    transform: translate(-64px, -72px);
}

/* SNES uses a four-button diamond and a separate pair of shoulder triggers. */
body.has-touch-input[data-page="/entertainment/snes/"] .touch-controller {
    min-height: 158px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-touch-actions {
    grid-template-rows: auto auto;
    gap: 2px;
    justify-self: end;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-shoulders {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 30px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .touch-shoulder-button {
    width: 46px;
    min-width: 46px;
    height: 30px;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-face-buttons {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 0;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-face-y {
    grid-column: 1;
    grid-row: 2;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-face-x {
    grid-column: 2;
    grid-row: 1;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-face-b {
    grid-column: 2;
    grid-row: 3;
}

body.has-touch-input[data-page="/entertainment/snes/"] .snes-face-a {
    grid-column: 3;
    grid-row: 2;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-controller {
    min-height: 198px;
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .snes-face-buttons {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(3, 52px);
}

body.has-touch-tablet[data-page="/entertainment/snes/"] .touch-shoulder-button {
    width: 52px;
    min-width: 52px;
    height: 34px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-controller {
    min-height: 132px;
}

body.has-touch-phone[data-page="/entertainment/snes/"] .snes-face-buttons {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
}

body.has-touch-phone[data-page="/entertainment/snes/"] .touch-shoulder-button {
    width: 40px;
    min-width: 40px;
    height: 27px;
}

