/*
Theme Name: Emulator
Theme URI: https://robautomates.com/emulator/
Author: Rob Automates
Description: Child theme for the Rob Automates SNES emulator library.
Template: theme
Version: 1.0.0
Text Domain: emulator
*/

body.post-type-archive-roms,
body.single-roms {
    background: #080a0d;
    color: #f6f8fb;
}

body.emulator-archive-page {
    min-height: 100vh;
}

html:has(body.single-roms),
body.single-roms {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.emulator-hero {
    padding: 130px 0 64px;
    background: linear-gradient(135deg, rgba(6, 9, 14, .94), rgba(24, 31, 42, .88));
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.emulator-hero--archive {
    padding-bottom: 42px;
}

.emulator-hero h1,
.emulator-hero .lead {
    color: #fff;
}

.emulator-hero .lead {
    max-width: 680px;
    color: rgba(255, 255, 255, .72);
}

.emulator-archive {
    padding-top: 38px;
    padding-bottom: 72px;
}

.emulator-archive__toolbar {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 0 auto 28px;
}

.emulator-rom-search {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    color: #111820;
    background: #fff;
    border: 2px solid rgba(83, 183, 255, .72);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    font-size: 17px;
    font-weight: 700;
    outline: none;
}

.emulator-rom-search:focus {
    border-color: #53b7ff;
    box-shadow: 0 0 0 4px rgba(83, 183, 255, .2), 0 10px 30px rgba(0, 0, 0, .28);
}

.emulator-rom-search::placeholder {
    color: rgba(17, 24, 32, .58);
}

.emulator-rom-results {
    position: relative;
    min-height: 180px;
    transition: opacity .16s ease;
}

.emulator-rom-results.is-loading {
    opacity: .72;
}

.emulator-rom-results.is-loading::after {
    content: "Loading...";
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    background: rgba(0, 0, 0, .72);
    border-radius: 8px;
}

.rom-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 0 0 30px;
}

.rom-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.rom-card:hover,
.rom-card:focus-within {
    color: #fff;
    text-decoration: none;
    transform: translateY(-3px);
    border-color: #53b7ff;
    background: rgba(255, 255, 255, .085);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
}

.rom-card__preview,
.rom-card__title,
.rom-card__favorite {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.rom-card__preview {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
}

.rom-card__preview::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: rgba(0, 0, 0, .48);
    transition: opacity .16s ease;
}

.rom-card__image {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    padding: 8px;
    background: #07090d;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.rom-card__image img {
    width: auto;
    height: auto;
    max-width: min(76%, 160px);
    max-height: 150px;
    object-fit: contain;
}

.rom-card__favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    color: #fff;
    background: rgba(5, 6, 8, .76);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}

.rom-card__favorite::before {
    content: "\2606";
    font-size: 24px;
    line-height: 1;
}

.rom-card__favorite.is-favorite {
    color: #ffd45f;
    border-color: rgba(255, 212, 95, .7);
    background: rgba(26, 20, 6, .86);
}

.rom-card__favorite.is-favorite::before {
    content: "\2605";
}

.rom-card__favorite:disabled {
    cursor: wait;
    opacity: .62;
}

.rom-card__title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 11px 12px 12px;
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, rgba(16, 24, 32, .96), rgba(8, 10, 13, .98));
    font-size: 15px;
    font-weight: 800;
    line-height: 1.22;
    text-align: center;
    text-decoration: none;
}

.rom-card__title span {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.rom-card__title:hover,
.rom-card__title:focus {
    color: #9ddcff;
    background: linear-gradient(180deg, rgba(20, 36, 50, .98), rgba(10, 16, 22, .98));
    text-decoration: none;
    outline: none;
}

.rom-card__play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 46px;
    padding: 0 24px;
    border: 1px solid rgba(83, 183, 255, .86);
    border-radius: 999px;
    color: #071018;
    background: #53b7ff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: translate(-50%, -46%) scale(.96);
    transition: opacity .16s ease, transform .16s ease;
}

.rom-card:hover .rom-card__preview::after,
.rom-card:focus-within .rom-card__preview::after,
.rom-card:hover .rom-card__play,
.rom-card:focus-within .rom-card__play {
    opacity: 1;
}

.rom-card:hover .rom-card__play,
.rom-card:focus-within .rom-card__play {
    transform: translate(-50%, -50%) scale(1);
}

.rom-card__placeholder {
    padding: 14px;
    color: rgba(255, 255, 255, .72);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.emulator-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: max-content;
    margin: 30px auto 0;
    padding: 8px;
    background: rgba(5, 8, 12, .72);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.emulator-pagination__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 40px;
    padding: 0 14px;
    color: #fff;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.emulator-pagination__button:hover,
.emulator-pagination__button:focus,
.emulator-pagination__button.is-active {
    color: #071018;
    background: #53b7ff;
    border-color: rgba(83, 183, 255, .86);
    outline: none;
}

.emulator-pagination__button:hover,
.emulator-pagination__button:focus {
    transform: translateY(-1px);
}

.emulator-pagination__button.is-active {
    box-shadow: 0 0 0 3px rgba(83, 183, 255, .24), inset 0 -2px 0 rgba(0, 0, 0, .12);
}

@media (max-width: 1199px) {
    .rom-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .emulator-archive {
        padding-top: 24px;
    }

    .emulator-pagination {
        gap: 7px;
        width: 100%;
        max-width: 100%;
        margin-top: 22px;
        padding: 7px;
    }

    .emulator-pagination__button {
        flex: 1 0 40px;
        min-width: 40px;
        min-height: 38px;
        padding: 0 10px;
        font-size: 14px;
    }

    .rom-card__image {
        padding: 6px;
    }

    .rom-card__image img {
        max-width: min(74%, 118px);
        max-height: 106px;
    }

    .rom-card__preview::after {
        opacity: .18;
        background: linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .38));
    }

    .rom-card__favorite {
        top: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
        border-color: rgba(255, 255, 255, .28);
        background: rgba(5, 6, 8, .64);
        box-shadow: 0 5px 12px rgba(0, 0, 0, .24);
    }

    .rom-card__favorite::before {
        font-size: 18px;
    }

    .rom-card__play {
        min-width: 68px;
        min-height: 30px;
        padding: 0 13px;
        font-size: 12px;
        box-shadow: 0 7px 18px rgba(0, 0, 0, .28);
        opacity: .94;
        transform: translate(-50%, -50%) scale(1);
    }

    .rom-card__title {
        min-height: 46px;
        padding: 8px 8px 9px;
        font-size: 13px;
        line-height: 1.18;
    }
}

@media (pointer: coarse) and (max-width: 950px) {
    .rom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (pointer: coarse) {
    .rom-card__preview::after,
    .rom-card__play {
        opacity: 1;
    }

    .rom-card__play {
        transform: translate(-50%, -50%) scale(1);
    }
}

.rom-meta {
    color: rgba(255, 255, 255, .68);
}

.rom-player {
    position: relative;
    margin: 35px 0;
    background: #050608;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    overflow: hidden;
}

.rom-player__screen {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 360px;
}

.emulator-screen-stick {
    display: none;
}

.emulator-screen-stick__knob {
    display: none;
}

.emulator-fullscreen-overlay {
    display: none;
}

.emulator-n64-requirement {
    position: absolute;
    inset: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, .86);
}

.emulator-n64-requirement[hidden] {
    display: none;
}

.emulator-n64-requirement__panel {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-width: 360px;
}

.emulator-n64-requirement__title {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

.emulator-n64-requirement__text {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.emulator-n64-requirement__button {
    min-height: 38px;
    padding: 0 18px;
    color: #071018;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
}

.emulator-n64-requirement__button[hidden] {
    display: none;
}

.emulator-landscape-overlay {
    display: none;
}

.rom-player__screen > div,
.rom-player__screen canvas,
.rom-player__screen iframe {
    width: 100% !important;
    height: 100% !important;
}

.rom-notice {
    margin: 35px 0;
    padding: 24px;
    color: #fff;
    background: rgba(83, 183, 255, .12);
    border: 1px solid rgba(83, 183, 255, .35);
    border-radius: 8px;
}

.rom-content {
    color: rgba(255, 255, 255, .82);
}

.emulator-player-page {
    min-height: 100vh;
    overflow: hidden;
    background: #080a0d;
}

.emulator-player-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 56px;
    padding: 10px 18px;
    color: #fff;
    background: rgba(8, 10, 13, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.emulator-player-header a {
    color: #fff;
    text-decoration: none;
}

.emulator-player-header__brand {
    font-weight: 700;
}

.emulator-player-header__title {
    overflow: hidden;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emulator-player-header__nav {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 14px;
}

.emulator-player-main {
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 12px 12px 28px;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .emulator-player-main {
        height: 100dvh;
    }
}

:fullscreen .emulator-player-main,
:-webkit-full-screen .emulator-player-main {
    height: 100vh;
}

.emulator-player-copyright {
    color: rgba(255, 255, 255, .48);
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    padding-top: 6px;
}

.emulator-player-page .rom-player {
    margin-top: 0;
}

.emulator-player-page--game-boy .rom-player {
    justify-self: center;
    width: min(100%, 560px);
    max-width: min(54vw, 560px);
}

.emulator-player-page--game-boy .rom-player__screen {
    aspect-ratio: 10 / 9;
    min-height: 0;
}

.emulator-player-page--snes .rom-player,
.emulator-player-page--sega-genesis .rom-player {
    justify-self: center;
    width: min(100%, 620px);
    max-width: min(50vw, 620px);
}

.emulator-player-page--snes .rom-player__screen,
.emulator-player-page--sega-genesis .rom-player__screen {
    aspect-ratio: 4 / 3;
    min-height: 0;
}

.emulator-player-page--nes .rom-player {
    justify-self: center;
    width: min(100%, 500px);
    max-width: min(44vw, 500px);
}

.emulator-player-page--nes .rom-player__screen {
    aspect-ratio: 4 / 3;
    min-height: 0;
}

.emulator-player-page--game-gear .rom-player {
    justify-self: center;
    width: min(100%, 500px);
    max-width: min(44vw, 500px);
}

.emulator-player-page--game-gear .rom-player__screen {
    aspect-ratio: 10 / 9;
    min-height: 0;
}

.emulator-console {
    display: grid;
    grid-template-columns: minmax(112px, 170px) minmax(0, 1fr) minmax(112px, 170px);
    gap: 12px;
    align-items: center;
    width: 100%;
    height: 100%;
}

.emulator-console.is-controls-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.emulator-console.is-controls-hidden .emulator-left-rail,
.emulator-console.is-controls-hidden .emulator-right-rail {
    display: none;
}

.emulator-player-page--n64 .emulator-console {
    grid-template-columns: minmax(0, 1fr);
}

.emulator-player-page--n64 .emulator-left-rail,
.emulator-player-page--n64 .emulator-right-rail,
.emulator-player-page--n64 .emulator-screen-stick,
.emulator-player-page--n64 .emulator-screen-stick__knob,
.emulator-player-page--n64 .rom-player .emulator-trigger-button--z {
    display: none !important;
}

.emulator-left-rail {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 10px;
    height: 100%;
    min-width: 0;
}

.emulator-center-bar {
    position: relative;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    margin-bottom: 8px;
}

.emulator-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    justify-self: center;
    max-width: 100%;
}

.emulator-user-indicator {
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: rgba(255, 255, 255, .86);
    background: rgba(255, 255, 255, .09);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emulator-user-indicator--login {
    color: #fff;
    background: rgba(210, 42, 42, .88);
    border-color: rgba(255, 121, 121, .75);
}

.emulator-user-indicator span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emulator-user-indicator a {
    color: inherit;
    text-decoration: none;
}

.emulator-user-save {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    color: #fff;
    background: rgba(5, 6, 8, .86);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emulator-user-save:hover,
.emulator-user-save:focus {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .3);
    outline: none;
}

.emulator-user-save:active {
    background: rgba(255, 255, 255, .18);
}

.emulator-console .rom-player {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.emulator-right-rail {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    gap: 10px;
    height: 100%;
    min-width: 0;
}

.emulator-controls {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.emulator-dpad-mode {
    display: inline-flex;
    align-self: end;
    justify-self: start;
    gap: 3px;
    padding: 3px;
    background: rgba(5, 6, 8, .74);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 999px;
}

.emulator-n64-left-mode {
    display: none;
    align-self: end;
    justify-self: start;
    gap: 3px;
    padding: 3px;
    background: rgba(5, 6, 8, .74);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 999px;
}

.emulator-dpad-mode__button {
    min-width: 50px;
    min-height: 26px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, .72);
    background: transparent;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emulator-n64-left-mode__button {
    min-width: 52px;
    min-height: 26px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, .72);
    background: transparent;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emulator-dpad-mode__button.is-active,
.emulator-n64-left-mode__button.is-active {
    color: #fff;
    background: rgba(0, 0, 0, .76);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.emulator-controls--analog {
    display: none;
    justify-self: center;
    width: 124px;
    height: 124px;
    border-radius: 50%;
}

.emulator-n64-sensitivity {
    display: none;
    justify-self: center;
    width: 124px;
    padding: 7px 8px 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: rgba(5, 6, 8, .68);
}

.emulator-player-page--n64 .emulator-console.is-n64-stick-mode .emulator-n64-sensitivity {
    display: block;
}

.emulator-player-page--n64 .emulator-console.is-n64-dpad-mode .emulator-n64-sensitivity {
    display: none;
}

.emulator-n64-sensitivity__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, .78);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.emulator-n64-sensitivity__range {
    display: block;
    width: 100%;
    accent-color: #d7dce5;
}

.emulator-analog__gate {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .12) 0 16%, transparent 17%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .08) 0 48%, rgba(5, 6, 8, .72) 49%);
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .28), inset 0 8px 16px rgba(255, 255, 255, .06);
}

.emulator-analog__gate::before,
.emulator-analog__gate::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: rgba(255, 255, 255, .12);
    transform: translate(-50%, -50%);
}

.emulator-analog__gate::before {
    width: 72%;
    height: 1px;
}

.emulator-analog__gate::after {
    width: 1px;
    height: 72%;
}

.emulator-analog__knob {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .24), 0 8px 20px rgba(0, 0, 0, .28);
    transform: translate(-50%, -50%);
}

.emulator-player-page--n64 .emulator-dpad-mode {
    display: none;
}

.emulator-player-page--n64 .emulator-n64-left-mode {
    display: inline-flex;
}

.emulator-player-page--n64 .emulator-controls--analog {
    display: block;
}

.emulator-player-page--n64 .emulator-console.is-n64-stick-mode .emulator-controls--dpad,
.emulator-player-page--n64 .emulator-console.is-n64-dpad-mode .emulator-controls--analog {
    display: none;
}

.emulator-controls--dpad {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(3, 54px);
    justify-self: center;
    justify-content: center;
    gap: 0;
}

.emulator-dpad-diagonal {
    position: absolute;
    z-index: 2;
    width: 22px;
    height: 22px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

.emulator-dpad-diagonal::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    border-top: 3px solid rgba(255, 255, 255, .88);
    border-left: 3px solid rgba(255, 255, 255, .88);
    transform: translate(-50%, -50%);
}

.emulator-controls--dpad.is-eight-way .emulator-dpad-diagonal {
    opacity: 1;
}

.emulator-dpad-diagonal--up-left {
    left: 42px;
    top: 42px;
}

.emulator-dpad-diagonal--up-left::before {
    transform: translate(-50%, -50%) rotate(0deg);
}

.emulator-dpad-diagonal--up-right {
    right: 42px;
    top: 42px;
}

.emulator-dpad-diagonal--up-right::before {
    transform: translate(-50%, -50%) rotate(90deg);
}

.emulator-dpad-diagonal--down-right {
    right: 42px;
    bottom: 42px;
}

.emulator-dpad-diagonal--down-right::before {
    transform: translate(-50%, -50%) rotate(180deg);
}

.emulator-dpad-diagonal--down-left {
    left: 42px;
    bottom: 42px;
}

.emulator-dpad-diagonal--down-left::before {
    transform: translate(-50%, -50%) rotate(270deg);
}

.emulator-control,
.emulator-shoulder-button,
.emulator-trigger-button,
.emulator-face-button,
.emulator-system-button {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .13);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22);
    transition: none;
}

.emulator-control {
    position: relative;
    min-width: 54px;
    min-height: 54px;
    border-radius: 0;
}

.emulator-control::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
}

.emulator-control--up {
    grid-column: 2;
    border-radius: 9px 9px 0 0;
    border-bottom-color: transparent;
}

.emulator-control--up::before {
    top: 62%;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 17px solid #fff;
}

.emulator-control--left {
    grid-column: 1;
    grid-row: 2;
    border-radius: 9px 0 0 9px;
    border-right-color: transparent;
}

.emulator-control--left::before {
    left: 62%;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-right: 17px solid #fff;
}

.emulator-control--center {
    grid-column: 2;
    grid-row: 2;
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, .18);
}

.emulator-control--right {
    grid-column: 3;
    grid-row: 2;
    border-radius: 0 9px 9px 0;
    border-left-color: transparent;
}

.emulator-control--right::before {
    left: 38%;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #fff;
}

.emulator-control--down {
    grid-column: 2;
    grid-row: 3;
    border-radius: 0 0 9px 9px;
    border-top-color: transparent;
}

.emulator-control--down::before {
    top: 38%;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 17px solid #fff;
}

.emulator-controls--face {
    position: relative;
    width: 178px;
    height: 178px;
    justify-self: center;
}

.emulator-shoulder-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: start;
    min-width: 140px;
    min-height: 40px;
    padding: 0 24px;
    border-radius: 999px 999px 12px 12px;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.emulator-left-rail .emulator-shoulder-button {
    justify-self: center;
}

.emulator-right-rail .emulator-shoulder-button {
    justify-self: center;
}

.emulator-trigger-button {
    display: none;
    align-items: center;
    justify-content: center;
    justify-self: center;
    min-width: 104px;
    min-height: 34px;
    padding: 0 18px;
    border-radius: 12px 12px 999px 999px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.emulator-player-page--n64 .emulator-trigger-button--z {
    display: inline-flex;
    align-self: center;
}

.emulator-player-page--n64 .rom-player .emulator-trigger-button--z {
    position: absolute;
    right: 16px;
    bottom: 36px;
    z-index: 35;
    min-width: 32px;
    min-height: 92px;
    padding: 8px 0;
    border-radius: 999px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0;
    line-height: .82;
    opacity: .46;
}

.emulator-player-page--n64 .rom-player .emulator-trigger-button--z.is-pressed,
.emulator-player-page--n64 .rom-player .emulator-trigger-button--z.is-gamepad-pressed {
    transform: none;
    opacity: .82;
}

.emulator-face-button {
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-weight: 800;
    line-height: 58px;
    text-align: center;
}

.emulator-n64-c-button {
    display: none;
}

.emulator-face-button--x {
    left: 60px;
    top: 0;
}

.emulator-face-button--y {
    left: 12px;
    top: 60px;
}

.emulator-face-button--a {
    right: 12px;
    top: 60px;
}

.emulator-face-button--b {
    left: 60px;
    bottom: 0;
}

.emulator-player-page--two-button .emulator-controls--face {
    width: 132px;
    height: 58px;
}

.emulator-player-page--two-button .emulator-face-button--x,
.emulator-player-page--two-button .emulator-face-button--y {
    display: none;
}

.emulator-player-page--two-button .emulator-face-button--a {
    right: 0;
    top: 0;
}

.emulator-player-page--two-button .emulator-face-button--b {
    left: 0;
    bottom: 0;
}

.emulator-player-page--game-boy .emulator-controls--face {
    width: 148px;
    height: 88px;
}

.emulator-player-page--game-boy .emulator-face-button {
    width: 58px;
    height: 58px;
    line-height: 58px;
}

.emulator-player-page--game-boy .emulator-face-button--a {
    right: 0;
    top: 4px;
}

.emulator-player-page--game-boy .emulator-face-button--b {
    left: 0;
    bottom: 4px;
}

.emulator-player-page--n64 .emulator-controls--face {
    width: 178px;
    height: 184px;
}

.emulator-player-page--n64 .emulator-face-button--x,
.emulator-player-page--n64 .emulator-face-button--y {
    display: none;
}

.emulator-player-page--n64 .emulator-n64-c-button {
    display: block;
    width: 42px;
    height: 42px;
    color: #171000;
    background: #f2c94c;
    border-color: rgba(255, 231, 121, .82);
    box-shadow: inset 0 -4px 0 rgba(83, 54, 0, .26);
    font-size: 10px;
    line-height: 1.05;
}

.emulator-player-page--n64 .emulator-n64-c-button--up {
    left: 68px;
    top: -8px;
}

.emulator-player-page--n64 .emulator-n64-c-button--left {
    left: 22px;
    top: 34px;
}

.emulator-player-page--n64 .emulator-n64-c-button--right {
    right: 22px;
    top: 34px;
}

.emulator-player-page--n64 .emulator-n64-c-button--down {
    left: 68px;
    top: 72px;
}

.emulator-player-page--n64 .emulator-face-button--b {
    left: 22px;
    bottom: 0;
    color: #04140a;
    background: #34c759;
    border-color: rgba(108, 235, 136, .82);
    box-shadow: inset 0 -4px 0 rgba(0, 73, 28, .28);
}

.emulator-player-page--n64 .emulator-face-button--a {
    right: 22px;
    top: auto;
    bottom: 0;
    color: #04101f;
    background: #3aa7ff;
    border-color: rgba(135, 205, 255, .86);
    box-shadow: inset 0 -4px 0 rgba(0, 62, 116, .3);
}

.emulator-player-page--n64 [data-emulator-control="select"] {
    display: none;
}

.emulator-controls--system {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    padding: 0;
    background: transparent;
}

.emulator-system-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.emulator-system-button--fullscreen {
    color: #071018;
    background: #53b7ff;
    border-color: rgba(83, 183, 255, .8);
}

.emulator-system-button:hover,
.emulator-system-button:focus {
    color: #fff;
    text-decoration: none;
}

.emulator-control.is-pressed,
.emulator-control.is-gamepad-pressed,
.emulator-shoulder-button.is-pressed,
.emulator-shoulder-button.is-gamepad-pressed,
.emulator-trigger-button.is-pressed,
.emulator-trigger-button.is-gamepad-pressed,
.emulator-face-button.is-pressed,
.emulator-face-button.is-gamepad-pressed,
.emulator-system-button.is-pressed,
.emulator-system-button.is-gamepad-pressed {
    transform: translateY(2px);
    background: rgba(83, 183, 255, .34);
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, .28);
}

#game .ejs_virtualGamepad_open,
#game .ejs_menu_bar,
#game .ejs_context_menu,
#game .ejs_settings_parent,
#game .ejs_popup_container {
    display: none !important;
}

#game .ejs_virtualGamepad_parent {
    display: none !important;
}

.emulator-player-page--n64 .emulator-console.is-n64-stick-mode #game .ejs_virtualGamepad_parent {
    display: none !important;
}

.emulator-player-page .rom-player__screen {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100vh;
}

.emulator-actions {
    position: relative;
    justify-self: center;
    width: 38px;
}

.emulator-actions__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-height: 34px;
    padding: 0;
    color: #fff;
    list-style: none;
    background: rgba(5, 6, 8, .86);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emulator-actions__toggle:hover,
.emulator-actions__toggle:focus {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .3);
    outline: none;
}

.emulator-actions__toggle::-webkit-details-marker {
    display: none;
}

.emulator-actions__icon,
.emulator-actions__icon::before,
.emulator-actions__icon::after {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.emulator-actions__icon {
    position: relative;
}

.emulator-actions__icon::before,
.emulator-actions__icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.emulator-actions__icon::before {
    top: -5px;
}

.emulator-actions__icon::after {
    top: 5px;
}

.emulator-actions__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    z-index: 30;
    display: grid;
    gap: 6px;
    width: 150px;
    padding: 8px;
    background: rgba(5, 6, 8, .98);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.emulator-actions__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.emulator-actions__item:hover,
.emulator-actions__item:focus {
    color: #fff;
    text-decoration: none;
    background: rgba(83, 183, 255, .28);
}

.emulator-actions__item[aria-pressed="true"] {
    border-color: rgba(83, 183, 255, .65);
}

.emulator-modal[hidden] {
    display: none;
}

.emulator-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, .76);
}

.emulator-modal__dialog {
    width: min(560px, 100%);
    max-height: min(86vh, 620px);
    overflow: auto;
    color: #fff;
    background: rgba(8, 10, 13, .98);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}

.emulator-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.emulator-modal__header h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.emulator-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.emulator-remap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 18px;
}

.emulator-remap-row {
    display: grid;
    gap: 7px;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    font-weight: 700;
}

.emulator-remap-row select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
}

.emulator-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.emulator-modal__button {
    min-height: 38px;
    padding: 0 14px;
    color: #071018;
    background: #53b7ff;
    border: 1px solid rgba(83, 183, 255, .8);
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.emulator-modal__button--secondary {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
}

.emulator-modal__button:disabled {
    cursor: wait;
    opacity: .65;
}

@media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
    .emulator-player-page--n64 .emulator-console.is-n64-stick-mode .emulator-screen-stick {
        position: absolute;
        left: 0;
        top: 42px;
        bottom: 18px;
        z-index: 32;
        display: block;
        width: 54%;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    .emulator-player-page--n64 .emulator-console.is-n64-stick-mode .emulator-screen-stick__knob {
        position: fixed;
        display: block;
        width: 58px;
        height: 58px;
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
        box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .24), 0 8px 24px rgba(0, 0, 0, .24);
        opacity: 0;
        pointer-events: none;
    }

    .emulator-player-page--n64 .emulator-screen-stick:active .emulator-screen-stick__knob {
        opacity: .86;
    }

    .emulator-fullscreen-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 100vh;
        padding: 24px;
        border: 0;
        color: #fff;
        text-align: center;
        background: rgba(0, 0, 0, .94);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .emulator-fullscreen-overlay__panel {
        display: grid;
        justify-items: center;
        gap: 14px;
        max-width: 340px;
    }

    .emulator-fullscreen-overlay__icon {
        position: relative;
        width: 82px;
        height: 50px;
        border: 3px solid rgba(83, 183, 255, .95);
        border-radius: 12px;
        box-shadow: 0 0 26px rgba(83, 183, 255, .22);
    }

    .emulator-fullscreen-overlay__icon::before,
    .emulator-fullscreen-overlay__icon::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        border-color: #fff;
        border-style: solid;
    }

    .emulator-fullscreen-overlay__icon::before {
        left: 9px;
        top: 9px;
        border-width: 3px 0 0 3px;
    }

    .emulator-fullscreen-overlay__icon::after {
        right: 9px;
        bottom: 9px;
        border-width: 0 3px 3px 0;
    }

    .emulator-fullscreen-overlay__title,
    .emulator-fullscreen-overlay__text,
    .emulator-fullscreen-overlay__cta {
        display: block;
    }

    .emulator-fullscreen-overlay__title {
        font-size: 24px;
        font-weight: 800;
        line-height: 1.1;
    }

    .emulator-fullscreen-overlay__text {
        color: rgba(255, 255, 255, .72);
        font-size: 14px;
        line-height: 1.4;
    }

    .emulator-fullscreen-overlay__cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 132px;
        min-height: 42px;
        padding: 0 20px;
        border: 1px solid rgba(83, 183, 255, .78);
        border-radius: 999px;
        color: #071018;
        background: #53b7ff;
        box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
        font-size: 13px;
        font-weight: 800;
        line-height: 1;
    }

    .emulator-fullscreen-overlay[hidden],
    :fullscreen .emulator-fullscreen-overlay,
    :-webkit-full-screen .emulator-fullscreen-overlay {
        display: none;
    }
}

@media (max-width: 900px) and (orientation: portrait), (pointer: coarse) and (orientation: portrait) {
    .emulator-landscape-overlay {
        position: fixed;
        inset: 0;
        z-index: 10001;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        color: #fff;
        text-align: center;
        background: rgba(0, 0, 0, .94);
    }

    .emulator-landscape-overlay__panel {
        display: grid;
        justify-items: center;
        gap: 14px;
        max-width: 320px;
    }

    .emulator-landscape-overlay__icon {
        position: relative;
        width: 74px;
        height: 46px;
        border: 3px solid rgba(255, 255, 255, .9);
        border-radius: 10px;
        transform: rotate(-12deg);
    }

    .emulator-landscape-overlay__icon::after {
        content: "";
        position: absolute;
        right: 7px;
        top: 50%;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .9);
        transform: translateY(-50%);
    }

    .emulator-landscape-overlay__title {
        font-size: 22px;
        font-weight: 800;
        line-height: 1.1;
    }

    .emulator-landscape-overlay__text {
        color: rgba(255, 255, 255, .72);
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 767px) {
    .emulator-hero {
        padding: 92px 0 30px;
    }

    .emulator-hero h1 {
        font-size: 32px;
    }

    .rom-player {
        margin: 20px -12px 24px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .rom-player__screen {
        min-height: 260px;
        max-height: calc(100vh - 245px);
    }

    .single-roms main.container,
    .single-roms .emulator-player-main {
        padding-bottom: 8px;
    }

    .emulator-player-header {
        grid-template-columns: 1fr auto;
        gap: 10px;
        min-height: 50px;
        padding: 8px 12px;
    }

    .emulator-player-header__title {
        display: none;
    }

    .emulator-player-header__nav {
        gap: 10px;
        font-size: 13px;
    }

    .emulator-player-main {
        width: 100%;
        height: 100vh;
        padding: 8px 4px 24px;
    }

    .emulator-player-page .rom-player {
        margin-top: 0;
    }

    .emulator-console {
        grid-template-columns: minmax(122px, 136px) minmax(0, 1fr) minmax(122px, 136px);
        gap: 8px;
        align-items: center;
    }

    .emulator-console.is-controls-hidden {
        grid-template-columns: minmax(0, 1fr);
    }

    .emulator-center-bar {
        min-height: 32px;
        gap: 6px;
        margin-bottom: 6px;
    }

    .emulator-controls--dpad {
        grid-template-columns: repeat(3, 34px);
        grid-template-rows: repeat(3, 34px);
        gap: 0;
    }

    .emulator-controls--analog {
        width: 88px;
        height: 88px;
    }

    .emulator-n64-sensitivity {
        width: 88px;
        padding: 5px 6px 6px;
    }

    .emulator-n64-sensitivity__label {
        margin-bottom: 3px;
        font-size: 8px;
    }

    .emulator-n64-sensitivity__range {
        height: 14px;
    }

    .emulator-analog__knob {
        width: 34px;
        height: 34px;
    }

    .emulator-control {
        min-width: 34px;
        min-height: 34px;
    }

    .emulator-control--up {
        border-radius: 7px 7px 0 0;
    }

    .emulator-control--left {
        border-radius: 7px 0 0 7px;
    }

    .emulator-control--right {
        border-radius: 0 7px 7px 0;
    }

    .emulator-control--down {
        border-radius: 0 0 7px 7px;
    }

    .emulator-controls--face {
        width: 108px;
        height: 108px;
    }

    .emulator-left-rail,
    .emulator-right-rail {
        gap: 7px;
    }

    .emulator-face-button {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 14px;
    }

    .emulator-shoulder-button {
        min-width: 86px;
        min-height: 28px;
        padding: 0 12px;
        border-radius: 999px 999px 9px 9px;
        font-size: 12px;
    }

    .emulator-trigger-button {
        min-width: 76px;
        min-height: 24px;
        padding: 0 10px;
        border-radius: 9px 9px 999px 999px;
        font-size: 11px;
    }

    .emulator-player-page--n64 .rom-player .emulator-trigger-button--z {
        right: 14px;
        bottom: 30px;
        min-width: 26px;
        min-height: 74px;
        padding: 7px 0;
        border-radius: 999px;
        font-size: 9px;
    }

    .emulator-face-button--x {
        left: 37px;
    }

    .emulator-face-button--y {
        left: 4px;
        top: 37px;
    }

    .emulator-face-button--a {
        right: 4px;
        top: 37px;
    }

    .emulator-face-button--b {
        left: 37px;
    }

    .emulator-player-page--two-button .emulator-controls--face {
        width: 82px;
        height: 38px;
    }

    .emulator-player-page--two-button .emulator-face-button--a {
        right: 0;
        top: 0;
    }

    .emulator-player-page--two-button .emulator-face-button--b {
        left: 0;
        bottom: 0;
    }

    .emulator-player-page--game-boy .emulator-controls--face {
        width: 82px;
        height: 54px;
    }

    .emulator-player-page--game-boy .emulator-face-button {
        width: 34px;
        height: 34px;
        line-height: 34px;
        font-size: 12px;
    }

    .emulator-player-page--game-boy .emulator-face-button--a {
        right: 0;
        top: 1px;
    }

    .emulator-player-page--game-boy .emulator-face-button--b {
        left: 0;
        bottom: 1px;
    }

    .emulator-player-page--n64 .emulator-controls--face {
        width: 118px;
        height: 116px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button {
        width: 28px;
        height: 28px;
        font-size: 8px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--up {
        left: 45px;
        top: -5px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--left {
        left: 14px;
        top: 23px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--right {
        right: 14px;
        top: 23px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--down {
        left: 45px;
        top: 49px;
    }

    .emulator-player-page--n64 .emulator-face-button--b {
        left: 10px;
        bottom: 0;
    }

    .emulator-player-page--n64 .emulator-face-button--a {
        right: 10px;
        top: auto;
        bottom: 0;
    }

    .emulator-system-button {
        min-width: 58px;
        min-height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    .emulator-system-button--fullscreen {
        min-width: 82px;
    }

    .emulator-controls--system {
        min-height: 30px;
        gap: 6px;
    }

    .emulator-player-page .rom-player__screen {
        max-height: 100vh;
    }

    .emulator-player-copyright {
        font-size: 10px;
        padding-top: 4px;
    }

    .emulator-dpad-mode {
        gap: 2px;
        padding: 2px;
    }

    .emulator-dpad-mode__button {
        min-width: 42px;
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .emulator-n64-left-mode {
        gap: 2px;
        padding: 2px;
    }

    .emulator-n64-left-mode__button {
        min-width: 42px;
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .emulator-user-indicator {
        max-width: 108px;
        padding: 7px 8px;
        font-size: 11px;
    }

    .emulator-user-actions {
        gap: 6px;
    }

    .emulator-user-save {
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .emulator-actions {
        width: 34px;
    }

    .emulator-actions__toggle {
        width: 34px;
        min-height: 30px;
    }

    .emulator-actions__panel {
        width: 128px;
    }

    .emulator-actions__item {
        min-height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .emulator-player-main {
        padding: 8px 8px 24px;
    }

    .emulator-console {
        grid-template-columns: minmax(122px, 140px) minmax(0, 1fr) minmax(122px, 140px);
        gap: 8px;
    }

    .emulator-player-page--snes .emulator-console,
    .emulator-player-page--sega-genesis .emulator-console,
    .emulator-player-page--game-boy .emulator-console {
        grid-template-columns: minmax(170px, 190px) minmax(0, 1fr) minmax(170px, 190px);
        gap: 10px;
    }

    .emulator-left-rail,
    .emulator-right-rail {
        gap: 7px;
    }

    .emulator-shoulder-button {
        min-width: 104px;
        min-height: 30px;
        padding: 0 14px;
        border-radius: 999px 999px 9px 9px;
        font-size: 12px;
    }

    .emulator-player-page--n64 .emulator-controls--face {
        width: 118px;
        height: 148px;
    }

    .emulator-player-page--n64 .emulator-controls--analog {
        margin-top: -22px;
        margin-bottom: 22px;
    }

    .emulator-player-page--n64 .emulator-console.is-n64-stick-mode .emulator-screen-stick {
        top: 24px;
        bottom: 32px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--up {
        left: 44px;
        top: -5px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--left {
        left: 13px;
        top: 24px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--right {
        right: 13px;
        top: 24px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button--down {
        left: 44px;
        top: 52px;
    }

    .emulator-player-page--n64 .emulator-face-button {
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 14px;
    }

    .emulator-player-page--n64 .emulator-n64-c-button {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 8px;
    }

    .emulator-player-page--n64 .emulator-face-button--b {
        left: 18px;
        bottom: 0;
    }

    .emulator-player-page--n64 .emulator-face-button--a {
        right: 18px;
        top: auto;
        bottom: 0;
    }

    .emulator-player-page--n64 .rom-player .emulator-trigger-button--z {
        right: 14px;
        bottom: 30px;
        width: 28px;
        min-width: 28px;
        height: 86px;
        min-height: 0;
        padding: 7px 0;
        border-radius: 999px;
        font-size: 8px;
        line-height: .78;
    }

    .emulator-player-page--game-boy .rom-player {
        width: min(100%, 360px);
        max-width: 42vw;
    }

    .emulator-player-page--game-boy .rom-player__screen {
        aspect-ratio: 10 / 9;
    }

    .emulator-player-page--game-boy .emulator-controls--face {
        width: 118px;
        height: 72px;
    }

    .emulator-player-page--game-boy .emulator-face-button {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 14px;
    }

    .emulator-player-page--game-boy .emulator-face-button--a {
        right: 0;
        top: 4px;
    }

    .emulator-player-page--game-boy .emulator-face-button--b {
        left: 0;
        bottom: 4px;
    }

    .emulator-player-page--snes .rom-player,
    .emulator-player-page--sega-genesis .rom-player {
        width: min(100%, 390px);
        max-width: 42vw;
    }

    .emulator-player-page--snes .rom-player__screen,
    .emulator-player-page--sega-genesis .rom-player__screen {
        aspect-ratio: 4 / 3;
    }

    .emulator-player-page--nes .rom-player {
        width: min(100%, 340px);
        max-width: 38vw;
    }

    .emulator-player-page--nes .rom-player__screen {
        aspect-ratio: 4 / 3;
    }

    .emulator-player-page--game-gear .rom-player {
        width: min(100%, 320px);
        max-width: 36vw;
    }

    .emulator-player-page--game-gear .rom-player__screen {
        aspect-ratio: 10 / 9;
    }
}
