:root {
  --blue: #1769ff;
  --blue-bright: #4a8bff;
  --cyan: #43d6ff;
  --ink: #0a0b0f;
  --panel: #15171d;
  --silver: #c7cbd2;
  --mist: #edf0f4;
  --muted: #757c87;
  --mono: "Courier New", "Microsoft YaHei", monospace;
  --sans: "Arial Narrow", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.page-width { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.grain { position: fixed; z-index: 1000; inset: 0; pointer-events: none; opacity: .055; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.87' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }

.site-header, .game-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-orbit { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border: 3px solid var(--blue); border-radius: 50%; transform: skew(-8deg); box-shadow: inset 0 0 0 3px white, 0 0 0 1px #aeb3bd; }
.brand-orbit::after { content: ""; position: absolute; left: -7px; right: -7px; height: 7px; background: var(--blue); transform: rotate(-12deg); box-shadow: 0 0 0 2px white; }
.brand-orbit i { z-index: 1; color: white; padding: 3px; background: var(--blue); font: normal 900 16px/1 var(--mono); }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font: 900 18px/.9 var(--mono); letter-spacing: -1px; }
.brand-copy strong b { color: var(--blue); }
.brand-copy small { margin-top: 7px; color: #6f7580; font: 700 7px/1 var(--mono); letter-spacing: 2.4px; }
.system-status { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid #bec2c9; border-radius: 2px; color: #666d77; font: 700 9px/1 var(--mono); letter-spacing: 1px; }
.system-status span { width: 7px; height: 7px; background: #4fb56f; border-radius: 50%; box-shadow: 0 0 8px #4fb56f; }
.system-status b { margin-left: 8px; color: var(--blue); }

.home-page { min-height: 100vh; background-color: #e6e8ec; background-image: linear-gradient(rgba(28,38,58,.04) 1px, transparent 1px), linear-gradient(90deg,rgba(28,38,58,.04) 1px,transparent 1px), radial-gradient(circle at 12% 45%,rgba(23,105,255,.09),transparent 31%); background-size: 32px 32px,32px 32px,auto; }
.home-main { min-height: calc(100vh - 168px); display: grid; grid-template-columns: .86fr 1.14fr; align-items: center; gap: 76px; padding: 42px 0 64px; }
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 25px; color: var(--blue); font: 800 10px/1 var(--mono); letter-spacing: 2px; }
.kicker span { font-size: 8px; text-shadow: 0 0 8px var(--blue); }
.hero-copy h1 { margin: 0; font: 900 clamp(50px,6vw,82px)/.98 var(--sans); letter-spacing: -5px; }
.hero-copy h1 em { color: var(--blue); font-style: normal; text-shadow: 4px 4px 0 #bcc2cc; }
.intro { max-width: 480px; margin: 30px 0 27px; color: #5e6570; font-size: 15px; line-height: 1.9; }
.feature-row { display: grid; grid-template-columns: repeat(2,max-content); gap: 10px 22px; color: #4d535d; font: 700 10px/1 var(--mono); }
.feature-row span { display: flex; align-items: center; gap: 8px; }
.feature-row b { color: var(--blue); font-size: 8px; }

.console-card { position: relative; color: #e8eaf0; background: linear-gradient(145deg,#24262d,#0e0f13 63%); border: 1px solid #454952; border-radius: 54px 54px 14px 14px; box-shadow: 0 36px 55px rgba(17,23,35,.32), inset 0 2px 1px #5a5d65, inset 0 -5px 0 #07080a; }
.console-ridge { min-height: 60px; display: flex; align-items: center; padding: 0 36px; border-bottom: 1px solid #41444b; font: 800 9px/1 var(--mono); letter-spacing: 1px; }
.console-ridge span { color: var(--blue-bright); font-size: 13px; }
.console-ridge > i { flex: 1; height: 1px; margin: 0 18px; background: linear-gradient(90deg,#363941,transparent); }
.console-ridge b { color: #777c85; font-size: 8px; }
.console-face { padding: 18px 25px 12px; }
.slot-label { display: flex; justify-content: space-between; margin: 0 20px 8px; color: #6e737c; font: 700 7px/1 var(--mono); letter-spacing: 1.7px; }
.slot-label small { font: inherit; }
.cartridge-slot { position: relative; padding: 34px 30px 28px; background: #181a20; border: 1px solid #4d5058; border-radius: 22px 22px 7px 7px; box-shadow: inset 0 8px 16px #08090b, 0 1px 0 #4d5057; }
.slot-mouth { position: absolute; top: 12px; left: 12%; right: 12%; height: 8px; border-radius: 50%; background: #050609; box-shadow: 0 2px 0 #353840; }
.selection-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.selection-head p { margin: 0 0 5px; color: var(--blue-bright); font: 700 7px/1 var(--mono); letter-spacing: 2px; }
.selection-head h2 { margin: 0; color: white; font-size: 22px; }
.selection-head > span { color: #727782; font: 700 8px/1 var(--mono); }
.rom-library { display: grid; gap: 9px; max-height: 215px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--blue) #25272d; }
.game-card { width: 100%; display: grid; grid-template-columns: 64px 1fr 25px; align-items: center; gap: 14px; padding: 11px; text-align: left; color: #b5bac4; background: #22242a; border: 1px solid #41444c; border-radius: 4px; cursor: pointer; transition: .18s ease; }
.game-card:hover, .game-card.selected { color: white; border-color: var(--blue); background: #282c35; box-shadow: inset 3px 0 var(--blue), 0 5px 15px rgba(0,0,0,.2); }
.cart-mini { position: relative; height: 57px; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#272a31,#0d0e12); border: 2px solid #5b5e65; border-radius: 3px 3px 9px 9px; box-shadow: inset 0 -5px #090a0d; }
.cart-mini::before { content: ""; position: absolute; top: 6px; width: 36px; height: 6px; border-top: 2px solid var(--blue); border-bottom: 1px solid #555a64; }
.cart-mini b { color: var(--blue-bright); font: 900 21px/1 var(--sans); }
.cart-mini i { position: absolute; right: 4px; bottom: 6px; color: #6d727b; font: normal 700 7px/1 var(--mono); }
.game-meta { min-width: 0; display: flex; flex-direction: column; }
.game-meta small { color: #747a84; font: 700 7px/1 var(--mono); letter-spacing: 1.4px; }
.game-meta strong { overflow: hidden; margin: 6px 0 8px; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.game-meta em { color: #777d87; font: normal 7px/1 var(--mono); }
.game-card.selected .game-meta em { color: #6fc58b; }
.card-tick { width: 22px; height: 22px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 50%; opacity: 0; transform: scale(.6); transition: .18s; }
.game-card.selected .card-tick { opacity: 1; transform: scale(1); }
.library-status { margin: 10px 0 0; color: #626872; font: 7px/1.5 var(--mono); text-align: center; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #696e77; font: 700 8px/1 var(--mono); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: #34373e; }
.upload-zone { min-height: 72px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: #111318; border: 1px dashed #4b505a; border-radius: 5px; cursor: pointer; transition: .18s; }
.upload-zone:hover, .upload-zone.dragging { border-color: var(--blue); background: #151b28; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-plus { width: 39px; height: 39px; display: grid; place-items: center; color: var(--blue-bright); border: 1px solid #3d527a; border-radius: 50%; font-size: 22px; }
.upload-zone > span:nth-child(3) { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-zone strong { color: #d3d6dc; font-size: 11px; }
.upload-zone small { color: #626975; font: 7px/1 var(--mono); }
.upload-zone > b { padding: 8px 9px; color: #9ea5af; border: 1px solid #414650; border-radius: 2px; font: 700 8px/1 var(--mono); }
.selected-file { min-height: 72px; display: grid; grid-template-columns: 44px 1fr 27px; align-items: center; gap: 12px; padding: 12px 14px; background: #151b28; border: 1px solid var(--blue); border-radius: 5px; }
.file-chip { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 3px; font: 900 12px/1 var(--mono); }
.selected-file > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.selected-file strong { overflow: hidden; color: white; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.selected-file small { color: #7e8794; font: 7px/1 var(--mono); }
.selected-file button { color: #7e8490; background: none; border: 0; font-size: 22px; cursor: pointer; }
.start-button { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding: 0 17px 0 20px; color: white; background: linear-gradient(90deg,#0b54db,#2378ff); border: 1px solid #5590ff; border-radius: 4px; box-shadow: 0 4px 0 #082f7d, 0 7px 20px rgba(23,105,255,.24); cursor: pointer; transition: .18s; }
.start-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 #082f7d,0 11px 24px rgba(23,105,255,.3); }
.start-button:disabled { filter: grayscale(1); opacity: .4; cursor: not-allowed; box-shadow: none; }
.start-button > span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.start-button small { color: #a9c8ff; font: 700 7px/1 var(--mono); letter-spacing: 1.5px; }
.start-button strong { font-size: 15px; }
.start-button i { width: 32px; height: 32px; display: grid; place-items: center; padding-left: 3px; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; font-style: normal; }
.privacy-note { margin: 13px 0 0; color: #626872; font: 7px/1.4 var(--mono); text-align: center; }
.privacy-note span { color: var(--blue-bright); }
.console-bottom { min-height: 47px; display: flex; align-items: center; gap: 8px; padding: 0 30px; color: #5c616a; font: 700 6px/1 var(--mono); letter-spacing: 1px; }
.console-bottom i { width: 22px; height: 10px; margin-right: 10px; background: #050609; border: 1px solid #363941; border-radius: 8px 8px 2px 2px; }
.console-bottom b { margin-left: auto; color: #737984; }
.home-footer, .game-footer { min-height: 76px; display: flex; align-items: center; justify-content: space-between; color: #727782; border-top: 1px solid #cbd0d7; font: 700 8px/1 var(--mono); letter-spacing: .6px; }
.home-footer p { margin: 0; }
.home-footer p:first-child span { margin-right: 8px; padding: 5px 6px; color: white; background: var(--blue); }

.play-page { min-height: 100vh; color: #e8ebf1; background: #07080b radial-gradient(circle at 50% 14%,#1b2333 0,transparent 40%); }
.game-header { border-bottom: 1px solid #22252b; }
.brand-light .brand-copy strong { color: white; }
.brand-light .brand-orbit { box-shadow: inset 0 0 0 3px #090a0d,0 0 0 1px #3f444d; }
.now-playing { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.now-playing span { color: var(--blue-bright); font: 700 7px/1 var(--mono); letter-spacing: 2px; }
.now-playing strong { max-width: 440px; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.change-game { color: #8a909a; font: 700 9px/1 var(--mono); }
.change-game:hover { color: white; }
.change-game b { margin-left: 6px; color: var(--blue-bright); }
.play-main { padding: 42px 0 70px; }
.machine { max-width: 1000px; margin: auto; padding: 18px 22px 0; background: linear-gradient(145deg,#292c32,#111217); border: 1px solid #4c5058; border-radius: 19px 19px 7px 7px; box-shadow: 0 35px 80px #000, inset 0 2px #5e626a, inset 0 -5px #07080a; }
.machine-top { min-height: 30px; display: flex; align-items: flex-start; justify-content: space-between; color: #747a84; font: 700 7px/1 var(--mono); letter-spacing: 1.6px; }
.machine-top div { display: flex; align-items: center; gap: 7px; }
.machine-top i { width: 6px; height: 6px; background: #54b876; border-radius: 50%; box-shadow: 0 0 7px #54b876; }
.machine-top .error i { background: #ff4b55; box-shadow: 0 0 7px #ff4b55; }
.screen-bezel { position: relative; width: min(100%,860px); margin: 0 auto; padding: 24px; background: #050609; border: 2px solid #3f4248; border-radius: 32px 32px 8px 8px; box-shadow: inset 0 0 0 5px #0f1115,inset 0 0 35px #000,0 2px #62656c; }
.screen-corner { position: absolute; z-index: 1; width: 35px; height: 35px; border-top: 2px solid var(--blue); }
.corner-a { top: 10px; left: 18px; border-left: 2px solid var(--blue); }
.corner-b { top: 10px; right: 18px; border-right: 2px solid var(--blue); }
.game-screen { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: #020203; border-radius: 3px; box-shadow: 0 0 0 1px #2c3037; }
#game { width: 100%; height: 100%; }
#game.ejs_parent { width: 100% !important; height: 100% !important; }
#game > div:not(.ejs_virtualGamepad_open) { width: 100%; height: 100%; }
#game > .ejs_virtualGamepad_open { width: 24px !important; height: 24px !important; }
.mobile-controller { display: none; }
.mobile-start-hint { display: none; }
.boot-screen { position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #aeb6c3; background: #030407; transition: opacity .35s,visibility .35s; }
.boot-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-ring { position: relative; width: 86px; height: 86px; display: grid; place-items: center; color: white; border: 3px solid var(--blue); border-radius: 50%; box-shadow: 0 0 25px rgba(23,105,255,.25),inset 0 0 25px rgba(23,105,255,.15); }
.boot-ring::after { content: ""; position: absolute; width: 112px; height: 8px; background: var(--blue); transform: rotate(-12deg); box-shadow: 0 0 12px rgba(23,105,255,.7); }
.boot-ring b { z-index: 1; padding: 4px; background: #030407; font: 900 30px/1 var(--mono); }
.boot-ring i { position: absolute; z-index: 2; right: -10px; bottom: 13px; padding: 3px 4px; color: #030407; background: white; font: normal 900 7px/1 var(--mono); }
.boot-screen p { margin: 24px 0 14px; font: 700 8px/1.6 var(--mono); letter-spacing: 1px; text-align: center; }
.load-track { width: 190px; height: 3px; overflow: hidden; background: #1d2027; }
.load-track i { display: block; width: 45%; height: 100%; background: var(--blue); animation: loading 1.1s steps(10) infinite; }
.boot-screen.error { color: #ff727a; }
.boot-screen.error .load-track, .boot-screen.error .boot-ring { display: none; }
.boot-screen.error a { display: inline-block; margin-top: 13px; padding: 8px 10px; color: white; border: 1px solid #ff5962; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(230%); } }
.machine-panel { min-height: 96px; display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 24px; max-width: 860px; margin: auto; }
.power-block { display: flex; align-items: center; gap: 8px; color: #7a808a; font: 700 7px/1 var(--mono); }
.power-block span { display: flex; align-items: center; gap: 6px; }
.power-block i { width: 7px; height: 7px; display: inline-block; background: var(--blue); border-radius: 50%; box-shadow: 0 0 8px var(--blue); }
.power-block b { padding: 4px 5px; color: white; background: #252830; }
.game-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.game-info small { color: #656b75; font: 700 7px/1 var(--mono); letter-spacing: 1.4px; }
.game-info strong { overflow: hidden; color: #d6dae1; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.fullscreen-button { padding: 11px 13px; color: #c5cad2; background: #292c33; border: 1px solid #4d515a; border-radius: 3px; font: 700 8px/1 var(--mono); cursor: pointer; }
.fullscreen-button:hover { color: white; border-color: var(--blue); }
.fullscreen-button span { margin-right: 7px; color: var(--blue-bright); }
.control-guide { margin: 0 -22px; min-height: 82px; display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 20px; padding: 13px 24px; background: #0d0f13; border-top: 1px solid #363940; }
.guide-title { display: grid; grid-template-columns: 40px 1fr; gap: 0 10px; }
.guide-title > span { grid-row: 1/3; width: 40px; height: 35px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 12px 12px 5px 5px; font: 900 9px/1 var(--mono); }
.guide-title strong { color: #afb4bd; font: 800 9px/1 var(--mono); }
.guide-title small { color: #5d626b; font: 7px/1.3 var(--mono); }
.key-map { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.key-map span { color: #696f79; font: 700 7px/1 var(--mono); }
kbd { display: inline-grid; min-width: 25px; height: 24px; place-items: center; margin-right: 4px; padding: 0 5px; color: #e0e3e8; background: #25282e; border: 1px solid #4a4e56; border-bottom-width: 3px; border-radius: 3px; font: 700 7px/1 var(--mono); }
.play-notes { max-width: 1000px; display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 48px auto 0; background: #252830; border: 1px solid #252830; }
.play-notes article { min-height: 112px; display: grid; grid-template-columns: 33px 1fr; gap: 12px; padding: 21px; background: #0d0f13; }
.play-notes article > span { color: var(--blue-bright); font: 700 8px/1 var(--mono); }
.play-notes h2 { margin: 0 0 9px; font-size: 13px; }
.play-notes p { margin: 0; color: #686e78; font-size: 9px; line-height: 1.65; }
.game-footer { border-color: #22252b; color: #484d56; }
.gamepad-strip { margin: 0 -22px; min-height: 68px; display: grid; grid-template-columns: 1fr 1px 1fr auto; align-items: center; gap: 18px; padding: 10px 24px; background: #15171c; border-top: 1px solid #363940; }
.pad-slot { min-width: 0; display: grid; grid-template-columns: 36px 1fr 8px; align-items: center; gap: 10px; }
.pad-slot > i { width: 36px; height: 30px; display: grid; place-items: center; color: #777d87; background: #0b0c0f; border: 1px solid #42464e; border-radius: 10px 10px 5px 5px; font: normal 800 9px/1 var(--mono); }
.pad-slot > span { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pad-slot strong { color: #aeb4bd; font: 800 9px/1 var(--mono); }
.pad-slot small { overflow: hidden; color: #626872; font: 7px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.pad-slot > b { width: 7px; height: 7px; border-radius: 50%; background: #4a4e56; }
.pad-slot.connected > i { color: white; border-color: var(--blue); }
.pad-slot.connected > b { background: #54b876; box-shadow: 0 0 7px #54b876; }
.pad-divider { width: 1px; height: 34px; background: #343840; }
.gamepad-strip > p { margin: 0; color: #626872; font: 7px/1.55 var(--mono); text-align: right; }
.gamepad-strip > p span { color: #9299a4; }
.remote-play { min-height: 92px; margin: 0 -22px; padding: 14px 24px; display: grid; grid-template-columns: minmax(260px,1fr) auto auto; align-items: center; gap: 20px; color: #e2e6ed; background: #0b101b; border-top: 1px solid #273b60; }
.remote-play-copy p { margin: 0 0 6px; color: var(--blue-bright); font: 800 8px/1 var(--mono); letter-spacing: 1.5px; }
.remote-play-copy h2 { margin: 0 0 7px; font-size: 15px; }
.remote-play-copy small { color: #69717e; font: 7px/1.45 var(--mono); }
.remote-room { min-width: 305px; display: flex; align-items: center; gap: 12px; }
.remote-room[hidden] { display: none; }
.remote-qr { display: grid; justify-items: center; gap: 4px; }
.remote-qr > div { width: 66px; height: 66px; display: grid; place-items: center; padding: 3px; color: #111; background: white; }
.remote-qr svg { width: 100%; height: 100%; }
.remote-qr small { color: #69717e; font: 6px/1 var(--mono); }
.remote-room-info { display: grid; gap: 6px; }
.remote-room-info > span { color: #69717e; font: 7px/1 var(--mono); }
.remote-room-info strong { color: #73a7ff; font: 900 23px/1 var(--mono); letter-spacing: 4px; }
.remote-room button, .remote-create { color: #dce6f7; background: #18243a; border: 1px solid #3b5683; border-radius: 3px; font: 800 8px/1 var(--mono); cursor: pointer; }
.remote-room button { padding: 6px 8px; }
.remote-create { min-width: 142px; min-height: 40px; padding: 0 13px; }
.remote-create:hover { border-color: var(--blue); }
.remote-create:disabled { opacity: .5; }

.controller-page { min-height: 100dvh; color: #e8ebf1; background: #07080b radial-gradient(circle at 50% 35%,#1b2333,transparent 60%); overscroll-behavior: none; }
.controller-page.controller-active { overflow: hidden; touch-action: none; user-select: none; }
.controller-header { width: min(920px,calc(100% - 32px)); min-height: 84px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #252932; }
.player-two-badge { padding: 9px 12px; color: white; background: var(--blue); border-radius: 3px; font: 900 9px/1 var(--mono); }
.controller-main { width: min(920px,calc(100% - 32px)); min-height: calc(100dvh - 84px); margin: auto; display: grid; place-items: center; }
.controller-connect { width: min(470px,100%); padding: 30px; background: #15171d; border: 1px solid #414650; border-radius: 8px; box-shadow: 0 25px 60px #000; }
.controller-connect > p { margin: 0 0 10px; color: var(--blue-bright); font: 800 9px/1 var(--mono); letter-spacing: 2px; }
.controller-connect h1 { margin: 0 0 24px; font-size: 30px; }
.controller-connect label { display: block; margin-bottom: 9px; color: #7b828e; font-size: 11px; }
.room-code-entry { display: grid; grid-template-columns: 1fr 92px; gap: 9px; }
.room-code-entry input { min-width: 0; height: 52px; padding: 0 14px; color: #73a7ff; background: #07080b; border: 1px solid #4c5260; border-radius: 3px; outline: 0; font: 900 22px/1 var(--mono); letter-spacing: 6px; }
.room-code-entry input:focus { border-color: var(--blue); }
.room-code-entry button { color: white; background: var(--blue); border: 0; border-radius: 3px; font-weight: 900; }
.controller-connect small { display: block; margin-top: 13px; color: #69717e; font-size: 10px; line-height: 1.5; }
.remote-controller { width: 100%; }
.remote-controller-top { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; color: #aeb4bd; background: #15171d; border: 1px solid #414650; border-radius: 5px; font: 800 9px/1 var(--mono); }
.remote-controller-top > div { display: flex; align-items: center; gap: 9px; }
.connection-light { width: 8px; height: 8px; background: #54b876; border-radius: 50%; box-shadow: 0 0 8px #54b876; }
.remote-pad-layout { min-height: 350px; display: grid; grid-template-columns: 1fr 130px 1.2fr; align-items: center; gap: 20px; padding: 24px 3%; touch-action: none; }
.remote-pad-layout button { touch-action: none; color: #bdc3cd; background: #24272d; border: 1px solid #4b4e55; box-shadow: 0 4px 0 #050608; outline: none; }
.remote-dpad { width: 170px; height: 170px; display: grid; grid-template: repeat(3,1fr)/repeat(3,1fr); justify-self: center; }
.remote-dpad button { pointer-events: none; font-size: 14px; }
.remote-dpad button:nth-child(1) { grid-area: 1/2; }.remote-dpad button:nth-child(2) { grid-area: 2/1; }.remote-dpad i { grid-area: 2/2; z-index: 2; background: #15171b; border-radius: 5px; }.remote-dpad button:nth-child(4) { grid-area: 2/3; }.remote-dpad button:nth-child(5) { grid-area: 3/2; }
.remote-dpad button.pressed, .remote-middle button.pressed, .remote-six button.pressed { color: white; background: #0b55d6; box-shadow: 0 1px 0 #030407; transform: translateY(3px); }
.remote-middle { display: flex; flex-direction: column; gap: 28px; }
.remote-middle button { min-height: 28px; border-radius: 20px; font: 800 8px/1 var(--mono); }
.remote-six { display: grid; grid-template-columns: repeat(3,64px); grid-template-rows: repeat(2,64px); justify-content: center; gap: 9px; transform: rotate(-8deg); }
.remote-six button { border-radius: 50%; color: white; font: 900 17px/1 var(--mono); }
.remote-six button:nth-child(-n+3) { width: 50px; height: 50px; place-self: end center; color: #aeb4bd; }
.remote-controller > p { margin: 0; color: #5f6671; text-align: center; font: 8px/1.5 var(--mono); }

@media (max-width: 920px) {
  .home-main { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy { text-align: center; }
  .intro { margin-inline: auto; }
  .feature-row { justify-content: center; }
  .console-card { width: min(650px,100%); margin: auto; }
  .home-footer { margin-top: 50px; }
  .control-guide { grid-template-columns: 1fr; }
  .guide-title { width: fit-content; margin: auto; }
  .key-map { justify-content: center; }
}

@media (max-width: 650px), (hover: none) and (pointer: coarse) {
  .page-width { width: min(100% - 24px,1180px); }
  .site-header, .game-header { min-height: 74px; }
  .system-status, .now-playing { display: none; }
  .brand-orbit { width: 42px; height: 42px; }
  .home-main { padding-top: 32px; }
  .hero-copy h1 { font-size: 48px; letter-spacing: -3px; }
  .intro { font-size: 13px; }
  .feature-row { grid-template-columns: repeat(2,1fr); }
  .feature-row span { justify-content: center; }
  .console-card { border-radius: 34px 34px 10px 10px; }
  .console-ridge { min-height: 50px; padding: 0 22px; }
  .console-face { padding: 12px 10px 8px; }
  .slot-label { margin-inline: 10px; }
  .cartridge-slot { padding: 30px 14px 23px; border-radius: 17px 17px 6px 6px; }
  .upload-zone { grid-template-columns: 38px 1fr; }
  .upload-zone > b { display: none; }
  .console-bottom { padding: 0 17px; }
  .console-bottom span, .console-bottom i { display: none; }
  .home-footer { min-height: 90px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 14px; line-height: 1.5; }
  .play-main { padding-top: 18px; }
  .machine { width: calc(100% + 12px); margin-left: -6px; padding: 10px 8px 0; border-radius: 11px; }
  .machine-top { padding-inline: 6px; }
  .screen-bezel { padding: 10px; border-radius: 18px 18px 6px 6px; }
  .screen-corner { display: none; }
  #game .ejs_virtualGamepad_parent,
  #game .ejs_virtualGamepad_open,
  #game .ejs_start_button { display: none !important; }
  .mobile-start-hint { position: absolute; z-index: 30; left: 50%; bottom: 15px; display: block; padding: 8px 12px; transform: translateX(-50%); color: #dce7ff; background: rgba(11,59,146,.88); border: 1px solid var(--blue-bright); border-radius: 3px; font: 800 8px/1 var(--mono); letter-spacing: .7px; pointer-events: none; }
  .mobile-start-hint.hidden { display: none; }
  .mobile-controller { min-height: 174px; display: grid; grid-template-columns: 1fr 68px 1.15fr; align-items: center; gap: 5px; margin: 10px -2px 4px; padding: 13px 4px 11px; overflow: hidden; background: linear-gradient(145deg,#1c1f25,#0a0b0e); border: 1px solid #3b3e46; border-radius: 10px 10px 22px 22px; box-shadow: inset 0 1px #4b4e55,inset 0 -5px #050608; touch-action: none; user-select: none; -webkit-user-select: none; }
  .mobile-controller button { touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
  .md-dpad { position: relative; width: 122px; height: 122px; display: grid; grid-template: repeat(3,1fr)/repeat(3,1fr); justify-self: center; filter: drop-shadow(0 6px 3px rgba(0,0,0,.45)); touch-action: none; }
  .md-dpad::before, .md-dpad::after { content: ""; position: absolute; z-index: 0; background: #24272d; border: 1px solid #4b4e55; box-shadow: inset 0 -4px #101115; }
  .md-dpad::before { left: 40px; width: 42px; height: 122px; border-radius: 7px; }
  .md-dpad::after { top: 40px; width: 122px; height: 42px; border-radius: 7px; }
  .md-dpad button { position: relative; z-index: 2; display: grid; place-items: center; padding: 0; color: #737985; background: transparent; border: 0; font-size: 10px; }
  .md-dpad button span { transition: transform .08s,color .08s; }
  .md-dpad button.pressed { color: var(--blue-bright); }
  .md-dpad button.pressed span { transform: translateY(2px) scale(.9); }
  .dpad-up { grid-area: 1/2; }
  .dpad-left { grid-area: 2/1; }
  .dpad-right { grid-area: 2/3; }
  .dpad-down { grid-area: 3/2; }
  .md-dpad > i { z-index: 3; grid-area: 2/2; width: 22px; height: 22px; place-self: center; background: radial-gradient(circle,#17191e 0 34%,#2d3037 36% 64%,#15171b 66%); border-radius: 50%; pointer-events: none; }
  .md-system-buttons { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 21px; }
  .md-system-buttons button { position: relative; width: 48px; height: 18px; padding: 0; color: #8b919b; background: #17191d; border: 1px solid #4a4d54; border-radius: 14px; box-shadow: inset 0 -3px #08090b,0 3px 3px rgba(0,0,0,.45); transform: rotate(-7deg); }
  .md-system-buttons button span { position: absolute; left: 50%; top: 23px; transform: translateX(-50%); font: 700 6px/1 var(--mono); letter-spacing: .5px; }
  .md-system-buttons button.pressed { transform: rotate(-7deg) translateY(2px); background: #0c397e; border-color: var(--blue); }
  .md-six-buttons { display: grid; grid-template-columns: repeat(3,40px); grid-template-rows: repeat(2,40px); justify-content: center; align-content: center; gap: 4px 4px; transform: rotate(-8deg); }
  .md-six-buttons button { width: 40px; height: 40px; padding: 0; color: #e6e9ef; background: radial-gradient(circle at 38% 30%,#42464f,#1b1d22 68%); border: 1px solid #5b5f68; border-radius: 50%; box-shadow: inset 0 -5px #0b0c0f,0 4px 4px rgba(0,0,0,.5); font-family: var(--mono); }
  .md-six-buttons button:nth-child(-n+3) { width: 32px; height: 32px; align-self: end; justify-self: center; color: #aeb4bd; background: radial-gradient(circle at 38% 30%,#333740,#15171b 68%); }
  .md-six-buttons strong { font-size: 14px; }
  .md-six-buttons small { font: 800 9px/1 var(--mono); }
  .md-six-buttons button.pressed { transform: translateY(3px); color: white; background: radial-gradient(circle at 45% 42%,#3883ff,#0a45a8 70%); border-color: #79a9ff; box-shadow: inset 0 -2px #06245a,0 1px 2px #000; }
  .machine-panel { min-height: 72px; grid-template-columns: 82px 1fr auto; gap: 10px; padding-inline: 4px; }
  .power-block b { display: none; }
  .fullscreen-button { width: 38px; padding: 10px 0; font-size: 0; }
  .fullscreen-button span { margin: 0; font-size: 13px; }
  .control-guide { margin-inline: -8px; padding: 13px 9px; }
  .key-map { display: none; }
  .gamepad-strip { margin-inline: -8px; grid-template-columns: 1fr 1fr; gap: 10px; padding: 9px 12px; }
  .pad-divider, .gamepad-strip > p { display: none; }
  .pad-slot { grid-template-columns: 31px 1fr 7px; gap: 7px; }
  .pad-slot > i { width: 31px; }
  .remote-play { margin-inline: -8px; padding: 13px 12px; grid-template-columns: 1fr auto; gap: 12px; }
  .remote-room { grid-column: 1/3; grid-row: 2; min-width: 0; justify-content: center; }
  .remote-play-copy h2 { font-size: 13px; }
  .play-notes { grid-template-columns: 1fr; margin-top: 28px; }
  .play-notes article { min-height: 86px; }
  .game-footer { min-height: 70px; }
  .game-footer span:last-child { display: none; }
}

@media (max-width: 430px) {
  .hero-copy h1 { font-size: 42px; }
  .game-card { grid-template-columns: 54px 1fr 22px; gap: 10px; }
  .cart-mini { height: 51px; }
  .game-meta strong { font-size: 14px; }
  .selection-head h2 { font-size: 19px; }
  .console-bottom { justify-content: flex-end; }
}

@media (orientation: landscape) and (max-height: 560px) and (hover: none) {
  .game-header, .play-notes, .game-footer, .machine-top, .machine-panel, .control-guide, .gamepad-strip, .remote-play { display: none; }
  .play-main, .page-width { width: 100%; padding: 0; }
  .machine { width: 100%; height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) min(43vw,370px); align-items: stretch; gap: 5px; margin: 0; padding: 5px; border: 0; border-radius: 0; }
  .screen-bezel { width: 100%; height: 100%; max-width: none; padding: 0; border: 0; border-radius: 0; }
  .game-screen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .mobile-controller { min-height: 0; height: 100%; margin: 0; border-radius: 8px 0 0 8px; }
}

@media (max-width: 650px) {
  .controller-header { min-height: 70px; }
  .controller-main { min-height: calc(100dvh - 70px); }
  .controller-connect { padding: 22px 18px; }
  .remote-pad-layout { min-height: 430px; grid-template-columns: 125px 52px 1fr; gap: 5px; padding-inline: 0; }
  .remote-dpad { width: 122px; height: 122px; }
  .remote-middle { gap: 32px; }
  .remote-middle button { width: 50px; padding: 0; font-size: 6px; }
  .remote-six { grid-template-columns: repeat(3,48px); grid-template-rows: repeat(2,48px); gap: 5px; }
  .remote-six button { font-size: 13px; }
  .remote-six button:nth-child(-n+3) { width: 38px; height: 38px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .controller-page .controller-header { display: none; }
  .controller-page .controller-main { width: 100%; min-height: 100dvh; }
  .controller-page .remote-controller { height: 100dvh; display: grid; grid-template-rows: 34px 1fr; padding: max(5px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .controller-page .remote-controller-top { width: min(320px,40vw); min-height: 28px; margin: auto; font-size: 7px; }
  .controller-page .remote-pad-layout { width: min(900px,100%); min-height: 0; height: 100%; grid-template-columns: 1fr 130px 1.2fr; padding: 5px 4%; }
  .controller-page .remote-dpad { width: min(44vh,165px); height: min(44vh,165px); }
  .controller-page .remote-six { grid-template-columns: repeat(3,min(17vh,62px)); grid-template-rows: repeat(2,min(17vh,62px)); }
  .controller-page .remote-six button { width: min(17vh,62px); height: min(17vh,62px); }
  .controller-page .remote-six button:nth-child(-n+3) { width: min(13vh,47px); height: min(13vh,47px); }
  .controller-page .remote-controller > p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
