/* RetroArch 通用外壳 — 各 play-*.html 共用 */
html.retro-shell-page,
body.retro-shell-page {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  width: 100%;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

body.retro-shell-page .webplayer-container {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  background: #000;
}

body.retro-shell-page .webplayer-preview { display: none !important; }
body.retro-shell-page #canvas_div {
  line-height: 0;
  margin: 0;
  padding: 0;
  background: #000;
  min-height: 0;
}

body.retro-shell-page .webplayer_border {
  margin: 0;
  padding: 0;
  border: none;
}

body.retro-shell-page canvas.webplayer {
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  background: #000;
  max-width: none !important;
  max-height: none !important;
}

/* Emscripten 会清掉 canvas inline 宽高；用变量保住显示尺寸 */
body.retro-shell-page.rs-sized-canvas canvas.webplayer {
  width: var(--rs-canvas-w) !important;
  height: var(--rs-canvas-h) !important;
}

body.retro-shell-page.rs-mobile .webplayer-container {
  flex: 1;
  min-height: 0;
  width: 100%;
}

body.retro-shell-page.rs-mobile #canvas_div {
  flex: 1;
  min-height: 0;
  width: 100%;
}

body.retro-shell-page.rs-mobile canvas.webplayer {
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
}

body.retro-shell-page #loading-tip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ccc;
  font-size: 14px;
  z-index: 200;
  width: min(320px, 86vw);
  padding: 18px 16px 14px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

body.retro-shell-page #loading-tip .rs-load-msg {
  margin-bottom: 12px;
  line-height: 1.45;
  color: #ddd;
}

body.retro-shell-page #loading-tip .rs-load-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

body.retro-shell-page #loading-tip .rs-load-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d8bfd 0%, #5eead4 100%);
  transition: width 0.18s ease;
}

body.retro-shell-page #loading-tip .rs-load-pct {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
  min-height: 16px;
}

/* 延迟启动：外壳先成型，框内显示「开始游戏」 */
body.retro-shell-page.rs-defer-start canvas.webplayer {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.retro-shell-page.rs-defer-start #canvas_div {
  background: #000;
}

#rsStartOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 60;
}

#rsStartOverlay .rs-start-btn {
  background: #e1e1e1;
  border: none;
  border-radius: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #3d3d3d;
  padding: 6px 18px;
  cursor: pointer;
  box-shadow: none;
  text-shadow: 0.5px 0.5px 0 rgba(255, 255, 255, 0.8), -0.5px -0.5px 0 rgba(0, 0, 0, 0.3);
}

#rsStartOverlay .rs-start-btn:hover {
  background: #ececec;
}

#rsStartOverlay .rs-start-btn:active {
  background: #d5d5d5;
}

#retroStubUI { display: none !important; }

/* PC（独立页 + 嵌入）：游戏+工具栏紧凑堆叠，勿用 fixed 底栏 */
html.retro-shell-page.rs-pc-layout,
body.retro-shell-page.rs-pc-layout {
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

html.retro-shell-page.rs-pc-standalone,
body.retro-shell-page.rs-pc-standalone {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 房间氛围底图；!important 抗 libretro 内联 #000 */
  background-color: #6c7a81 !important;
  background-image: url(/img/bgtv.jpg) !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  box-sizing: border-box;
  padding: 24px 16px;
}

html.retro-shell-page.rs-pc-standalone {
  display: block;
  padding: 0;
}

/* 浏览器全屏时仍用纯黑，避免房间底图抢画面 */
body.retro-shell-page.rs-pc-standalone:has(#rsStage:fullscreen),
body.retro-shell-page.rs-pc-standalone:has(#rsStage:-webkit-full-screen),
html.retro-shell-page.rs-pc-standalone:has(#rsStage:fullscreen),
html.retro-shell-page.rs-pc-standalone:has(#rsStage:-webkit-full-screen) {
  background-image: none !important;
  background-color: #000 !important;
}

/* 独立玩页：顶部留白给关闭叉，画面下移，叉不挡内容 */
body.retro-shell-page.rs-standalone:not(.rs-immersive-landscape) #rsStage {
  padding-top: 44px;
  box-sizing: border-box;
}

/* 独立玩页关闭叉：落在顶部留白带内 */
.rs-close-btn {
  position: fixed;
  top: max(4px, env(safe-area-inset-top, 0px));
  right: max(8px, env(safe-area-inset-right, 0px));
  z-index: 400;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.rs-close-btn span {
  display: block;
  margin-top: -2px;
}

.rs-close-btn:hover,
.rs-close-btn:active {
  background: rgba(40, 40, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.45);
}

body.retro-shell-page.rs-embed .rs-close-btn {
  display: none !important;
}

/* 小电视块：画面+工具栏一体居中；全屏时由 :fullscreen 规则接管 */
body.retro-shell-page.rs-pc-standalone.rs-pc-layout #rsStage {
  position: relative;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  background: transparent;
  box-shadow: none;
  /* 固定工具栏槽：折叠只藏按钮，不改总高，电视机不弹 */
  padding-bottom: 152px;
  box-sizing: border-box;
}

/* 工具栏绝对定位在槽内，高度固定，折叠不参与文档流重排 */
body.retro-shell-page.rs-pc-standalone.rs-pc-layout #retroShellBar {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 152px;
  justify-content: flex-start;
}

body.retro-shell-page.rs-pc-standalone.rs-pc-layout #rsStage:fullscreen,
body.retro-shell-page.rs-pc-standalone.rs-pc-layout #rsStage:-webkit-full-screen {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  padding-bottom: 0 !important;
}

body.retro-shell-page.rs-pc-standalone.rs-pc-layout #rsStage:fullscreen #retroShellBar,
body.retro-shell-page.rs-pc-standalone.rs-pc-layout #rsStage:-webkit-full-screen #retroShellBar {
  position: relative !important;
  height: auto;
  left: auto;
  right: auto;
  bottom: auto;
}

/*
 * PC 独立玩页电视机壳（对标 wgame80）：
 * tv.png 2048×1570，灰屏孔约 (268,139) 1514×1134（≈4:3）。
 * padding-% 一律相对宽度 → 任意缩放不错位。
 */
#rsTvBezel.rs-tv-bezel {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  max-width: 100%;
  aspect-ratio: 2048 / 1570;
  box-sizing: border-box;
  margin: 0 auto;
  overflow: visible;
  isolation: isolate;
  /* 底图改挂 ::after，好把阴影夹在「房间底」与「电视机」之间 */
  background: none;
  image-rendering: auto;
  padding: 6.7871% 12.9883% 14.502% 13.0859%;
  flex: 0 0 auto;
}

/* 阴影：背景前、电视机后；整块放在机脚下方 */
#rsTvBezel.rs-tv-bezel::before {
  content: "";
  position: absolute;
  left: 0%;
  right: 0%;
  bottom: -1%;
  height: 9%;
  transform: none;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.6) 45%,
    rgba(0, 0, 0, 0.3) 68%,
    transparent 82%
  );
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* 电视机壳图叠在阴影之上 */
#rsTvBezel.rs-tv-bezel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url(/img/tv.png) center / 100% 100% no-repeat;
  pointer-events: none;
}

#rsTvBezel .rs-tv-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  box-sizing: border-box;
  line-height: 0;
}

#rsTvBezel .rs-tv-screen .webplayer-container,
#rsTvBezel .rs-tv-screen #canvas_div {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
}

/* 全屏 / 手机：去掉电视机壳外观，屏孔铺满 */
body.rs-mobile #rsTvBezel.rs-tv-bezel,
#rsStage:fullscreen #rsTvBezel.rs-tv-bezel,
#rsStage:-webkit-full-screen #rsTvBezel.rs-tv-bezel,
body.rs-immersive-landscape #rsTvBezel.rs-tv-bezel,
body.rs-immersive-portrait #rsTvBezel.rs-tv-bezel,
html.rs-immersive-landscape #rsTvBezel.rs-tv-bezel,
html.rs-immersive-portrait #rsTvBezel.rs-tv-bezel {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.rs-mobile #rsTvBezel.rs-tv-bezel::before,
body.rs-mobile #rsTvBezel.rs-tv-bezel::after,
#rsStage:fullscreen #rsTvBezel.rs-tv-bezel::before,
#rsStage:fullscreen #rsTvBezel.rs-tv-bezel::after,
#rsStage:-webkit-full-screen #rsTvBezel.rs-tv-bezel::before,
#rsStage:-webkit-full-screen #rsTvBezel.rs-tv-bezel::after,
body.rs-immersive-landscape #rsTvBezel.rs-tv-bezel::before,
body.rs-immersive-landscape #rsTvBezel.rs-tv-bezel::after,
body.rs-immersive-portrait #rsTvBezel.rs-tv-bezel::before,
body.rs-immersive-portrait #rsTvBezel.rs-tv-bezel::after,
html.rs-immersive-landscape #rsTvBezel.rs-tv-bezel::before,
html.rs-immersive-landscape #rsTvBezel.rs-tv-bezel::after,
html.rs-immersive-portrait #rsTvBezel.rs-tv-bezel::before,
html.rs-immersive-portrait #rsTvBezel.rs-tv-bezel::after {
  display: none !important;
}

body.rs-mobile #rsTvBezel .rs-tv-screen,
#rsStage:fullscreen #rsTvBezel .rs-tv-screen,
#rsStage:-webkit-full-screen #rsTvBezel .rs-tv-screen {
  width: 100%;
  height: 100%;
}

body.retro-shell-page.rs-pc-layout {
  display: flex;
  flex-direction: column;
}

body.retro-shell-page.rs-pc-layout #rsStage {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  width: 100%;
}

body.retro-shell-page.rs-pc-layout #rsPlayRow {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  width: 100%;
}

body.retro-shell-page.rs-pc-layout .webplayer-container,
body.retro-shell-page.rs-pc-layout #canvas_div {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

body.retro-shell-page.rs-pc-layout #retroShellBar {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  flex-shrink: 0;
  z-index: 130;
}

/* PC 浏览器全屏 #rsStage：铺满并 contain，避免仍按嵌入比例把画布算超高 */
#rsStage:fullscreen,
#rsStage:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  background: #000;
  overflow: hidden !important;
}

#rsStage:fullscreen #rsPlayRow,
#rsStage:-webkit-full-screen #rsPlayRow {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#rsStage:fullscreen .webplayer-container,
#rsStage:fullscreen #canvas_div,
#rsStage:-webkit-full-screen .webplayer-container,
#rsStage:-webkit-full-screen #canvas_div {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

#rsStage:fullscreen #retroShellBar,
#rsStage:-webkit-full-screen #retroShellBar {
  flex: 0 0 auto !important;
}

body.retro-shell-page.rs-pc-layout #touchControls {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#retroShellBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border-top: none;
  box-sizing: border-box;
}

.rs-bar-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 4px 2px;
  box-sizing: border-box;
  background: transparent;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  max-height: 220px;
  overflow: hidden;
}

#retroShellBar.rs-bar-collapsed .rs-bar-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.rs-bar-tab {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 20px;
  margin: 0 0 -1px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: rgba(28, 28, 28, 0.88);
  color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.rs-bar-tab:hover {
  background: rgba(45, 45, 45, 0.95);
}

/* 展开时箭头朝下（收起）；收起后朝上（展开） */
.rs-bar-tab-icon {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #fff;
  transition: transform 0.22s ease;
}

#retroShellBar.rs-bar-collapsed .rs-bar-tab-icon {
  transform: rotate(180deg);
}

.rs-bar-row,
.rs-bar-main,
.rs-bar-sub {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
  min-height: 0;
}

.rs-btn-num {
  font-style: italic;
  font-weight: 300;
  font-size: calc(1em - 1px);
  opacity: 0.78;
  margin-left: 1px;
}

.rs-gamepad-status {
  flex: 1 1 0;
  min-width: 0;
  border-style: dashed;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
}

.rs-gamepad-status.connected {
  border-style: solid;
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

#retroGamepadOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.72);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

#retroGamepadOverlay.open { display: flex; }

.rs-gamepad-panel {
  width: 100%;
  max-width: 420px;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 16px;
  color: #eee;
}

.rs-gamepad-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.rs-shell-version {
  font-size: 12px;
  font-weight: normal;
  color: rgba(255,255,255,0.45);
}

.rs-gamepad-panel-status {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}

.rs-gamepad-panel-status.connected {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.rs-gamepad-help-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
}

.rs-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 4px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  background: rgba(30, 30, 30, 0.82);
  color: #eee;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rs-btn:active,
.rs-btn.rs-active {
  background: rgba(255,255,255,0.22);
}

.rs-btn.rs-primary {
  background: rgba(40, 120, 200, 0.35);
  border-color: rgba(80, 160, 240, 0.45);
}

.rs-btn.rs-active {
  background: rgba(34, 197, 94, 0.28);
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.rs-mobile-only { display: none; }
body.retro-shell-page.rs-mobile .rs-mobile-only { display: inline-block; }

/* 手机竖屏：紧凑布局 = 满宽画面 + 叠层虚拟键 + 底栏（不用 100dvh 撑出大片黑边） */
body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape):not(.rs-embed) {
  height: auto;
  max-height: none;
  min-height: 0;
}

html.retro-shell-page.rs-embed,
body.retro-shell-page.rs-embed.rs-mobile:not(.rs-immersive-landscape):not(.rs-immersive-portrait) {
  height: auto;
  max-height: none;
  min-height: 0;
}

body.retro-shell-page.rs-embed.rs-mobile:not(.rs-immersive-landscape):not(.rs-immersive-portrait) #rsStage {
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape) #rsStage {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape):not(.rs-immersive-portrait) #rsPlayRow {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  position: relative;
  height: auto;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape) .webplayer-container,
body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape) #canvas_div {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape):not(.rs-immersive-portrait) #touchControls {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  flex-shrink: 0;
  height: 140px;
  width: 100%;
  margin-top: 100px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

body.retro-shell-page.rs-mobile:not(.rs-immersive-landscape) #retroShellBar {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  flex-shrink: 0;
  z-index: 130;
  pointer-events: auto;
}

body.retro-shell-page.rs-mobile.has-touch-controls #touchControls {
  position: relative;
}

/* 横屏沉浸：游戏居中，虚拟键绝对定位（JS 按 canvas 边缘计算） */
html.rs-immersive-landscape,
body.retro-shell-page.rs-immersive-landscape {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

html.rs-immersive-landscape body.retro-shell-page.rs-immersive-landscape {
  position: fixed;
  inset: 0;
}

html.rs-immersive-landscape #rsStage {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  transform: none;
}

html.rs-immersive-landscape #rsPlayRow {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: block;
}

html.rs-immersive-landscape body.has-touch-controls #touchControls {
  display: block;
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  z-index: 10;
}

html.rs-immersive-landscape .tc-row {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
}

html.rs-immersive-landscape .tc-dpad,
html.rs-immersive-landscape .tc-mid,
html.rs-immersive-landscape .tc-face {
  pointer-events: auto;
}

html.rs-immersive-landscape .tc-dpad {
  width: 120px;
  height: 120px;
  box-sizing: border-box;
  overflow: visible;
}

html.rs-immersive-landscape .webplayer-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

html.rs-immersive-landscape #canvas_div {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

html.rs-immersive-landscape canvas.webplayer {
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
}

html.rs-immersive-landscape .tc-mid {
  flex-direction: column;
  gap: 10px;
}

html.rs-immersive-landscape .tc-mid .tc-btn {
  width: 48px;
  height: 36px;
  font-size: 11px;
}

html.rs-immersive-landscape .tc-face {
  flex-direction: column;
  gap: 8px;
}

html.rs-immersive-landscape .tc-face .tc-btn {
  width: 44px;
  height: 44px;
}

html.rs-immersive-landscape .tc-face .tc-b {
  margin-bottom: 0;
}

html.rs-immersive-landscape .tc-face-md {
  width: 176px;
  height: 120px;
  flex-direction: row;
}

html.rs-immersive-landscape .tc-face-md .tc-btn {
  width: 48px;
  height: 48px;
  font-size: 14px;
}

html.rs-immersive-landscape .tc-face-md .tc-md-x { left: 0; top: 0; }
html.rs-immersive-landscape .tc-face-md .tc-md-y { left: 64px; top: 0; }
html.rs-immersive-landscape .tc-face-md .tc-md-z { left: 128px; top: 0; }
html.rs-immersive-landscape .tc-face-md .tc-md-a { left: 0; top: 64px; }
html.rs-immersive-landscape .tc-face-md .tc-md-b { left: 64px; top: 64px; }
html.rs-immersive-landscape .tc-face-md .tc-md-c { left: 128px; top: 64px; }

html.rs-immersive-landscape .tc-face-arcade {
  width: 168px;
  height: 116px;
}

html.rs-immersive-landscape .tc-face-arcade .tc-btn {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

html.rs-immersive-landscape .tc-face-arcade .tc-ar-1 { left: 0; top: 0; }
html.rs-immersive-landscape .tc-face-arcade .tc-ar-2 { left: 60px; top: 0; }
html.rs-immersive-landscape .tc-face-arcade .tc-ar-3 { left: 120px; top: 0; }
html.rs-immersive-landscape .tc-face-arcade .tc-ar-4 { left: 0; top: 68px; }
html.rs-immersive-landscape .tc-face-arcade .tc-ar-5 { left: 60px; top: 68px; }
html.rs-immersive-landscape .tc-face-arcade .tc-ar-6 { left: 120px; top: 68px; }

html.rs-immersive-landscape .tc-face-ps {
  width: 120px;
  height: 120px;
}

html.rs-immersive-landscape .tc-face-ps .tc-btn {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

html.rs-immersive-landscape .tc-face-sfc {
  width: 120px;
  height: 120px;
}

html.rs-immersive-landscape .tc-face-sfc .tc-btn {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

html.rs-immersive-landscape #retroShellBar {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  flex-shrink: 0;
  width: 100%;
  padding: 0;
  gap: 0;
  margin-top: auto;
  background: transparent;
  border-top: none;
}

html.rs-immersive-landscape .rs-bar-body {
  padding: 3px 3px 1px;
  gap: 2px;
}

html.rs-immersive-landscape .rs-bar-row,
html.rs-immersive-landscape .rs-bar-main,
html.rs-immersive-landscape .rs-bar-sub {
  flex-wrap: nowrap;
  gap: 2px;
}

html.rs-immersive-landscape .rs-btn {
  padding: 4px 2px;
  font-size: 11px;
  min-width: 0;
  flex: 1 1 0;
}

/* 竖屏全屏沉浸：父页 iframe 铺满，不旋转，保留三段式 */
html.rs-immersive-portrait,
body.retro-shell-page.rs-immersive-portrait {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

html.rs-immersive-portrait body.retro-shell-page.rs-immersive-portrait {
  position: fixed;
  inset: 0;
}

html.rs-immersive-portrait #rsStage {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
  overflow: hidden;
  background: #000;
  box-sizing: border-box;
}

html.rs-immersive-portrait #rsPlayRow {
  flex: 0 0 auto !important;
  min-height: 0;
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

/* 键贴画面：固定间距，勿 margin-top:auto 沉底（横版会拉开大块黑边） */
html.rs-immersive-portrait body.has-touch-controls #touchControls {
  display: block;
  flex: 0 0 auto;
  position: relative;
  width: 100%;
  height: 140px;
  margin-top: 100px;
  z-index: 20;
}

html.rs-immersive-portrait #retroShellBar {
  flex: 0 0 auto;
  position: relative;
  width: 100%;
  z-index: 130;
}

html.rs-immersive-portrait .webplayer-container,
html.rs-immersive-portrait #canvas_div {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

html.rs-immersive-portrait .rs-btn.rs-active {
  background: rgba(255,255,255,0.28);
}

/* 非手机：工具栏在虚拟键上方 */
body.retro-shell-page.has-touch-controls:not(.rs-mobile) #retroShellBar {
  bottom: 140px;
}

#touchControls {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 140px;
  z-index: 100;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-callout: none;
  touch-action: none;
}

#touchControls,
#touchControls * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  touch-callout: none !important;
  -webkit-user-drag: none;
  -webkit-user-modify: read-only;
}

body.retro-shell-page.has-touch-controls #touchControls { display: block; }

.tc-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  padding: 10px 22px 16px;
  box-sizing: border-box;
}

.tc-dpad {
  position: relative;
  width: 120px;
  height: 120px;
  pointer-events: auto;
  flex: 0 0 auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  perspective: 520px;
  perspective-origin: 50% 50%;
}

/* 圆形底盘固定不倾斜，承接十字阴影 */
.tc-dpad-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 0;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.12), inset 0 -2px 4px rgba(0,0,0,0.25);
}

.tc-dpad-rocker {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg);
  transition: transform 0.06s ease-out, filter 0.06s ease-out;
  will-change: transform;
  /* 紧阴影落在圆盘上，避免黑底上散成大坨 */
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.65));
}

.tc-dpad.tc-dpad-active .tc-dpad-rocker {
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.75));
}

.tc-dpad.tc-tilt-up .tc-dpad-rocker {
  filter: drop-shadow(0 4px 2px rgba(0,0,0,0.72));
}

.tc-dpad.tc-tilt-down .tc-dpad-rocker {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.70));
}

.tc-dpad.tc-tilt-left .tc-dpad-rocker {
  filter: drop-shadow(3px 2px 2px rgba(0,0,0,0.72));
}

.tc-dpad.tc-tilt-right .tc-dpad-rocker {
  filter: drop-shadow(-3px 2px 2px rgba(0,0,0,0.72));
}

.tc-dpad-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tc-dpad-cross {
  fill: url(#tcDpadCrossGrad);
  stroke: rgba(255,255,255,0.55);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.tc-dpad-dimple {
  fill: url(#tcDpadDimpleGrad);
}

.tc-dpad-dimple-rim {
  stroke: rgba(255,255,255,0.32);
  stroke-width: 1.3;
}

.tc-dpad-arrow {
  fill: rgba(255,255,255,0.48);
}

.tc-dpad.tc-dpad-active .tc-dpad-cross {
  fill: rgba(255,255,255,0.34);
  stroke: rgba(255,255,255,0.68);
}

.tc-dpad.tc-dpad-active .tc-dpad-base {
  background: rgba(255,255,255,0.16);
}

.tc-btn {
  position: absolute;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  font: bold 13px/1 sans-serif;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  touch-callout: none !important;
  -webkit-user-modify: read-only;
}

.tc-btn:active, .tc-btn.pressed { background: rgba(255,255,255,0.38); }
.tc-mid { display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.tc-mid .tc-btn { position: static; width: 64px; height: 36px; font-size: 11px; }
.tc-face { display: flex; gap: 12px; align-items: flex-end; pointer-events: auto; }
.tc-face .tc-btn { position: static; width: 52px; height: 52px; border-radius: 50%; font-size: 16px; }
.tc-face .tc-b { margin-bottom: 12px; }

.tc-face-md {
  position: relative;
  width: 130px;
  height: 110px;
  flex: 0 0 auto;
  display: block;
}
.tc-face-md .tc-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 12px;
  padding: 0;
  margin: 0;
}
.tc-face-md .tc-md-b { left: 12px; bottom: 0; }
.tc-face-md .tc-md-a { left: 46px; bottom: 0; }
.tc-face-md .tc-md-c { left: 80px; bottom: 0; }
.tc-face-md .tc-md-y { left: 46px; bottom: 36px; }
.tc-face-md .tc-md-x { left: 22px; bottom: 68px; }
.tc-face-md .tc-md-z { left: 70px; bottom: 68px; }

/* 街机六键：整齐 2×3，竖屏略紧、横屏更疏 */
.tc-face-arcade {
  position: relative;
  width: 156px;
  height: 108px;
  flex: 0 0 auto;
  display: block;
}
.tc-face-arcade .tc-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 14px;
  padding: 0;
  margin: 0;
}
.tc-face-arcade .tc-ar-1 { left: 0; top: 0; }
.tc-face-arcade .tc-ar-2 { left: 56px; top: 0; }
.tc-face-arcade .tc-ar-3 { left: 112px; top: 0; }
.tc-face-arcade .tc-ar-4 { left: 0; top: 56px; }
.tc-face-arcade .tc-ar-5 { left: 56px; top: 56px; }
.tc-face-arcade .tc-ar-6 { left: 112px; top: 56px; }

.tc-face-ps {
  position: relative;
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  display: block;
}
.tc-face-ps .tc-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 14px;
  padding: 0;
  margin: 0;
}
.tc-face-ps .tc-ps-y { left: 41px; top: 0; }
.tc-face-ps .tc-ps-x { left: 0; top: 41px; }
.tc-face-ps .tc-ps-b { left: 82px; top: 41px; }
.tc-face-ps .tc-ps-a { left: 41px; top: 82px; }

.tc-face-sfc {
  position: relative;
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  display: block;
}
.tc-face-sfc .tc-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 14px;
  padding: 0;
  margin: 0;
}
.tc-face-sfc .tc-sfc-y { left: 41px; top: 0; }
.tc-face-sfc .tc-sfc-x { left: 0; top: 41px; }
.tc-face-sfc .tc-sfc-b { left: 82px; top: 41px; }
.tc-face-sfc .tc-sfc-a { left: 41px; top: 82px; }

#retroKeymapOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.72);
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

#retroKeymapOverlay.open { display: flex; }

.rs-keymap-panel {
  width: 100%;
  max-width: 320px;
  max-height: 85vh;
  overflow: auto;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 10px 8px;
  color: #eee;
}

.rs-keymap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rs-keymap-row span {
  font-size: 12px;
  line-height: 1.25;
}

.rs-keymap-row button {
  flex-shrink: 0;
  min-width: 64px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
}

.rs-keymap-row button.listening {
  background: rgba(200, 120, 40, 0.45);
  border-color: rgba(255, 180, 80, 0.6);
}

.rs-keymap-foot {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.rs-keymap-foot .rs-btn {
  flex: 1;
  padding: 5px 2px;
  font-size: 11px;
}

/* 画面特效：底部浮层；遮罩可点关闭（透明底不挡看效果） */
#retroShaderOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding-bottom: 28px;
}

#retroShaderOverlay.open { display: flex; }

.rs-shader-drawer {
  position: relative;
  pointer-events: auto;
  width: min(100%, 420px);
  max-height: min(40vh, 300px);
  overflow: auto;
  background: rgba(12, 12, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 8px;
  color: #eee;
  box-sizing: border-box;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rs-shader-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.rs-shader-item {
  padding: 5px 3px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(30, 30, 30, 0.82);
  color: #eee;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rs-shader-item:hover {
  background: rgba(50, 50, 50, 0.9);
}

.rs-shader-item.selected {
  background: rgba(40, 150, 90, 0.85);
  border-color: rgba(80, 200, 130, 0.85);
  font-weight: 600;
}

.rs-shader-loading {
  margin: 4px 0;
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@media (max-width: 520px) {
  .rs-shader-drawer {
    width: 100%;
    max-height: min(36vh, 260px);
    padding: 8px 4px 6px;
  }
  .rs-shader-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
  .rs-shader-item {
    padding: 5px 2px;
    font-size: 10.5px;
  }
}

/* NES 制式抽屉 */
#retroRegionOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
}

#retroRegionOverlay.open { display: flex; }

.rs-region-drawer {
  width: 100%;
  max-width: 420px;
  max-height: 50vh;
  overflow: auto;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px 12px 0 0;
  padding: 14px 14px 18px;
  color: #eee;
  box-sizing: border-box;
}

.rs-region-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rs-region-drawer-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.rs-region-close { flex-shrink: 0; }

.rs-region-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
}

.rs-region-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rs-region-item {
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
}

.rs-region-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.rs-region-item.selected {
  background: rgba(40, 150, 90, 0.55);
  border-color: rgba(80, 200, 130, 0.7);
  font-weight: 600;
}

.rs-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(30, 30, 30, 0.92);
  color: #eee;
  font-size: 13px;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.rs-toast.show { opacity: 1; }

/* 作弊码抽屉：对标特效底部浮层，勿贴死网页底边 */
#retroCheatOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
  padding: 16px 12px 28px;
}

#retroCheatOverlay.open { display: flex; }

.rs-cheat-drawer {
  position: relative;
  pointer-events: auto;
  width: min(100%, 420px);
  max-height: min(56vh, 420px);
  overflow: auto;
  background: rgba(12, 12, 12, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 14px 14px 12px;
  color: #eee;
  box-sizing: border-box;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rs-cheat-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rs-cheat-drawer-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.rs-cheat-close { flex-shrink: 0; }

.rs-cheat-hint,
.rs-cheat-status {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
}

.rs-cheat-status { color: rgba(180, 220, 255, 0.75); }

.rs-cheat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.rs-cheat-search {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #eee;
  font-size: 13px;
  box-sizing: border-box;
}

.rs-cheat-add {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.rs-cheat-input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #eee;
  font-size: 13px;
  box-sizing: border-box;
  width: 100%;
}

.rs-cheat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(36vh, 280px);
  overflow: auto;
  padding-right: 2px;
}

.rs-cheat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.rs-cheat-item.on {
  background: rgba(40, 150, 90, 0.28);
  border-color: rgba(80, 200, 130, 0.55);
}

.rs-cheat-item input {
  margin-top: 3px;
  flex-shrink: 0;
}

.rs-cheat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rs-cheat-desc {
  font-size: 13px;
  line-height: 1.35;
  color: #eee;
}

.rs-cheat-code {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.45);
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
}

.rs-cheat-empty {
  margin: 10px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

@media (max-width: 520px) {
  #retroCheatOverlay {
    padding: 12px 8px 28px;
  }
  .rs-cheat-drawer {
    width: 100%;
    max-height: min(50vh, 360px);
  }
  .rs-cheat-add {
    grid-template-columns: 1fr;
  }
}

/* 街机作弊（对标旧 EJS Cheats 下拉面板） */
#retroArcadeCheatOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
}

#retroArcadeCheatOverlay.open { display: flex; }

.rs-arcade-cheat-panel {
  width: 100%;
  max-width: 420px;
  max-height: 78vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(238, 238, 238, 0.2);
  border-radius: 8px;
  padding: 14px 14px 12px;
  color: #eee;
  box-sizing: border-box;
}

.rs-arcade-cheat-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  column-gap: 8px;
  row-gap: 0;
  max-height: 56vh;
  overflow: auto;
  margin-bottom: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.rs-arcade-cheat-row {
  display: contents;
}

.rs-arcade-cheat-label {
  grid-column: 1;
  display: block;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.25;
  color: #f0f0f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-arcade-cheat-label:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rs-arcade-cheat-select {
  grid-column: 2;
  width: 80px;
  min-width: 80px;
  height: 24px;
  margin: 1px 0;
  padding: 0 20px 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #2a2a2a;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position:
    calc(100% - 11px) calc(50% + 1px),
    calc(100% - 7px) calc(50% + 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  color: #f0f0f0;
  font-size: 11px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  align-self: center;
}

.rs-arcade-cheat-select:hover,
.rs-arcade-cheat-select:focus {
  background-color: #333;
  outline: none;
}

.rs-arcade-cheat-select option {
  background: #2a2a2a;
  color: #f0f0f0;
}

.rs-arcade-cheat-empty {
  grid-column: 1 / -1;
  margin: 12px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.rs-arcade-cheat-foot {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.rs-arcade-cheat-foot .rs-btn {
  min-width: 80px;
}
