/* RetroPlay — estilos dos joysticks touch por plataforma */

.rp-controls {
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.rp-region {
  position: absolute;
  pointer-events: none;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.rp-region > * {
  pointer-events: auto;
}

.rp-shoulders-left {
  top: 8px;
  left: 8px;
  flex-direction: column;
  align-items: flex-start;
}

.rp-shoulders-right {
  top: 8px;
  right: 8px;
  flex-direction: column;
  align-items: flex-end;
}

.rp-left {
  left: 12px;
  bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 48vw;
  justify-content: flex-start;
}

.rp-right {
  right: 12px;
  bottom: 28px;
  width: 160px;
  height: 160px;
  position: absolute;
}

.rp-right-bottom {
  right: 18px;
  bottom: 12px;
}

.rp-c-pad {
  right: 12px;
  bottom: 175px;
  width: 110px;
  height: 110px;
  position: absolute;
}

.rp-center {
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  gap: 14px;
}

/* Botões genéricos */
.rp-btn {
  appearance: none;
  border: 0;
  margin: 0;
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.rp-btn.is-active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.38);
}

.rp-btn.pill {
  border-radius: 999px;
  min-width: 72px;
  min-height: 28px;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.45);
}

.rp-shoulders-left .rp-btn,
.rp-shoulders-right .rp-btn {
  border-radius: 10px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  padding: 0;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.rp-btn.shoulder-2 {
  opacity: 0.9;
  /* mantém o mesmo quadrado do ombro L/R */
}

/* Face buttons diamond (SNES / PS / NDS) */
.rp-right .face-y { position: absolute; left: 50%; top: 0; transform: translateX(-50%); }
.rp-right .face-x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.rp-right .face-b { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.rp-right .face-a { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); }

.rp-right .face-y.is-active,
.rp-right .face-x.is-active,
.rp-right .face-b.is-active,
.rp-right .face-a.is-active {
  transform: translateX(-50%) scale(0.94);
}
.rp-right .face-x.is-active,
.rp-right .face-b.is-active {
  transform: translateY(-50%) scale(0.94);
}

/* D-Pad */
.rp-dpad {
  position: relative;
  width: 128px;
  height: 128px;
}

.rp-dpad-btn {
  appearance: none;
  border: 0;
  position: absolute;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  touch-action: none;
}

.rp-dpad-btn.up { left: 43px; top: 0; }
.rp-dpad-btn.down { left: 43px; bottom: 0; }
.rp-dpad-btn.left { left: 0; top: 43px; }
.rp-dpad-btn.right { right: 0; top: 43px; }
.rp-dpad-btn.is-active { background: rgba(255, 255, 255, 0.4); }

.rp-dpad-center {
  position: absolute;
  left: 43px;
  top: 43px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  pointer-events: none;
}

/* Stick analógico */
.rp-stick {
  width: 120px;
  height: 120px;
  touch-action: none;
}

.rp-stick-base {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  position: relative;
}

.rp-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transform: translate(0, 0);
  will-change: transform;
}

.rp-stick.is-active .rp-stick-knob {
  background: rgba(255, 255, 255, 0.5);
}

/* ===== Temas por console ===== */

.theme-snes .face-y { background: #3b82f6; }
.theme-snes .face-x { background: #3b82f6; }
.theme-snes .face-b { background: #ef4444; }
.theme-snes .face-a { background: #ef4444; }
.theme-snes .rp-shoulders-left .rp-btn,
.theme-snes .rp-shoulders-right .rp-btn {
  background: #64748b;
}

.theme-megadrive .rp-right {
  width: 180px;
  height: 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: end;
}
.theme-megadrive .rp-right .rp-btn {
  position: static;
  transform: none;
}
.theme-megadrive .md-a { background: #2563eb; }
.theme-megadrive .md-b { background: #2563eb; }
.theme-megadrive .md-c { background: #2563eb; }
.theme-megadrive .md-x,
.theme-megadrive .md-y,
.theme-megadrive .md-z {
  min-width: 40px;
  min-height: 40px;
  font-size: 12px;
  background: #64748b;
}

.theme-psx .ps-tri { position: absolute; left: 50%; top: 0; transform: translateX(-50%); color: #22c55e; box-shadow: inset 0 0 0 2px #22c55e; background: rgba(34,197,94,.15); }
.theme-psx .ps-cir { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: #ef4444; box-shadow: inset 0 0 0 2px #ef4444; background: rgba(239,68,68,.15); }
.theme-psx .ps-crs { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); color: #60a5fa; box-shadow: inset 0 0 0 2px #60a5fa; background: rgba(96,165,250,.15); }
.theme-psx .ps-sqr { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: #e879f9; box-shadow: inset 0 0 0 2px #e879f9; background: rgba(232,121,249,.15); }
.theme-psx .ps-tri.is-active { transform: translateX(-50%) scale(0.94); }
.theme-psx .ps-crs.is-active { transform: translateX(-50%) scale(0.94); }
.theme-psx .ps-cir.is-active,
.theme-psx .ps-sqr.is-active { transform: translateY(-50%) scale(0.94); }

.theme-psp .ps-tri,
.theme-psp .ps-cir,
.theme-psp .ps-crs,
.theme-psp .ps-sqr {
  /* herda PS */
}
.theme-psp .ps-tri { position: absolute; left: 50%; top: 0; transform: translateX(-50%); color: #22c55e; box-shadow: inset 0 0 0 2px #22c55e; background: rgba(34,197,94,.15); }
.theme-psp .ps-cir { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: #ef4444; box-shadow: inset 0 0 0 2px #ef4444; background: rgba(239,68,68,.15); }
.theme-psp .ps-crs { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); color: #60a5fa; box-shadow: inset 0 0 0 2px #60a5fa; background: rgba(96,165,250,.15); }
.theme-psp .ps-sqr { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: #e879f9; box-shadow: inset 0 0 0 2px #e879f9; background: rgba(232,121,249,.15); }
.theme-psp .ps-tri.is-active,
.theme-psp .ps-crs.is-active { transform: translateX(-50%) scale(0.94); }
.theme-psp .ps-cir.is-active,
.theme-psp .ps-sqr.is-active { transform: translateY(-50%) scale(0.94); }
.theme-psp .rp-left { bottom: 24px; }

.theme-n64 .n64-a { position: absolute; right: 8px; bottom: 18px; background: #ef4444; min-width: 58px; min-height: 58px; }
.theme-n64 .n64-b { position: absolute; right: 70px; bottom: 55px; background: #22c55e; }
.theme-n64 .rp-c-pad .c-btn {
  position: absolute;
  min-width: 40px;
  min-height: 40px;
  font-size: 11px;
  background: rgba(250, 204, 21, 0.35);
  color: #fde68a;
}
.theme-n64 .rp-c-pad [data-id="c-up"] { left: 50%; top: 0; transform: translateX(-50%); }
.theme-n64 .rp-c-pad [data-id="c-down"] { left: 50%; bottom: 0; transform: translateX(-50%); }
.theme-n64 .rp-c-pad [data-id="c-left"] { left: 0; top: 50%; transform: translateY(-50%); }
.theme-n64 .rp-c-pad [data-id="c-right"] { right: 0; top: 50%; transform: translateY(-50%); }
.theme-n64 .n64-z { background: #64748b; }

.theme-gba .gba-a { position: absolute; right: 8px; bottom: 40px; background: #a78bfa; }
.theme-gba .gba-b { position: absolute; right: 70px; bottom: 18px; background: #a78bfa; }

.theme-nes .nes-a,
.theme-gb .gb-a { position: absolute; right: 10px; bottom: 36px; background: #ef4444; }
.theme-nes .nes-b,
.theme-gb .gb-b { position: absolute; right: 70px; bottom: 20px; background: #ef4444; }

.theme-nds .face-y { background: #64748b; }
.theme-nds .face-x { background: #64748b; }
.theme-nds .face-b { background: #64748b; }
.theme-nds .face-a { background: #64748b; }

.theme-arcade .rp-right {
  width: 180px;
  height: 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.theme-arcade .arc {
  position: static;
  background: rgba(248, 113, 113, 0.45);
}

/* Desktop: sem opacidade forçada no container — o slider de alfa controla os botões. */
@media (hover: hover) and (pointer: fine) {
  .rp-controls:not(.is-editing) .rp-hud-item {
    opacity: calc(var(--rp-controls-opacity, 1) * 0.72);
  }
  .rp-controls:hover:not(.is-editing) .rp-hud-item,
  .rp-controls:focus-within:not(.is-editing) .rp-hud-item {
    opacity: var(--rp-controls-opacity, 1);
  }
}

@media (max-width: 640px) {
  .rp-dpad { width: 118px; height: 118px; }
  .rp-right { width: 148px; height: 148px; }
  .rp-btn { min-width: 48px; min-height: 48px; }
  .rp-stick { width: 108px; height: 108px; }
}

/* Landscape mobile — prioridade Android / Android PC touch */
@media (orientation: landscape) and (max-height: 500px) {
  .rp-left { bottom: 8px; left: 8px; }
  .rp-right { bottom: 8px; right: 8px; width: 130px; height: 130px; }
  .rp-center { bottom: 6px; }
  .rp-shoulders-left,
  .rp-shoulders-right { top: 4px; }
}

/* Mobile ergonomics: reserve room for browser/system gesture edges. */
.rp-controls { --edge: max(22px, env(safe-area-inset-left)); --floor: max(44px, calc(env(safe-area-inset-bottom) + 28px)); user-select: none; }
.rp-left { left: var(--edge); bottom: var(--floor); flex-wrap: nowrap; gap: 16px; max-width: none; }
.rp-right { right: max(22px, env(safe-area-inset-right)); bottom: var(--floor); }
.rp-center { bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px)); }
.rp-center .rp-btn { min-height: 36px; }
.rp-shoulders-left { left: var(--edge); top: max(16px, env(safe-area-inset-top)); }
.rp-shoulders-right { right: max(22px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); }
.rp-c-pad { right: max(26px, env(safe-area-inset-right)); bottom: calc(var(--floor) + 146px); }
.rp-right-bottom { right: 200px; bottom: var(--floor); }
.rp-btn { backdrop-filter: none; }
.rp-btn:focus-visible,.rp-dpad-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.rp-stick { flex: 0 0 auto; }
.rp-dpad { flex: 0 0 auto; }
/* Nintendo diamond: X top, Y left, A right, B bottom. */
.rp-right .face-x { left: 50%; right: auto; top: 0; bottom: auto; transform: translateX(-50%); }
.rp-right .face-y { left: 0; right: auto; top: 50%; bottom: auto; transform: translateY(-50%); }
.rp-right .face-a { left: auto; right: 0; top: 50%; bottom: auto; transform: translateY(-50%); }
.rp-right .face-b { left: 50%; right: auto; top: auto; bottom: 0; transform: translateX(-50%); }
.rp-right .face-x.is-active,.rp-right .face-b.is-active { transform: translateX(-50%) scale(.94); }
.rp-right .face-y.is-active,.rp-right .face-a.is-active { transform: translateY(-50%) scale(.94); }
.theme-snes .face-x { background:#315aaa; }.theme-snes .face-y { background:#288351; }
.theme-snes .face-a { background:#ae3c44; }.theme-snes .face-b { background:#b59936; }
.theme-n64 .n64-a { background:#315eaa; }.theme-n64 .n64-b { background:#27834a; }
.theme-n64 .rp-c-pad .c-btn { min-width:44px;min-height:44px;background:#9a822c;color:#fff2a3;font-size:18px; }
.theme-gb .gb-a,.theme-gb .gb-b { background:#873857; }
.theme-megadrive .md-x { grid-area:1/1; }.theme-megadrive .md-y { grid-area:1/2; }.theme-megadrive .md-z { grid-area:1/3; }
.theme-megadrive .md-a { grid-area:2/1; }.theme-megadrive .md-b { grid-area:2/2; }.theme-megadrive .md-c { grid-area:2/3; }
.theme-megadrive .md-a,.theme-megadrive .md-b,.theme-megadrive .md-c { background:#434650; }
.theme-psp .rp-left { bottom:var(--floor); }
@media (orientation:landscape) and (max-height:500px) {
  .rp-controls { --floor:max(34px,calc(env(safe-area-inset-bottom) + 22px)); }
  .rp-left { bottom:var(--floor);left:var(--edge);gap:12px; }
  .rp-right { bottom:var(--floor);right:max(22px,env(safe-area-inset-right));width:130px;height:130px; }
  .rp-center { bottom:max(12px,env(safe-area-inset-bottom)); }
  .rp-shoulders-left,.rp-shoulders-right { top:max(12px,env(safe-area-inset-top)); }
  .rp-stick { width:104px;height:104px; }
  .rp-dpad { width:110px;height:110px; }
  .rp-dpad-btn { width:36px;height:36px; }
  .rp-dpad-btn.up,.rp-dpad-btn.down { left:37px; }
  .rp-dpad-btn.left,.rp-dpad-btn.right { top:37px; }
  .rp-dpad-center { left:37px;top:37px;width:36px;height:36px; }
  .rp-c-pad { bottom:calc(var(--floor) + 126px);width:100px;height:100px; }
  .theme-n64 .rp-right { width:130px;height:108px; }
  .theme-n64 .n64-a { right:0;bottom:0; }
  .theme-n64 .n64-b { right:62px;bottom:38px; }
  .theme-psx .rp-right-bottom { right:164px; }
  .theme-megadrive .rp-right,.theme-arcade .rp-right { width:174px;height:112px; }
}
@media (orientation:landscape) and (max-height:350px) {
  .rp-c-pad { bottom:calc(var(--floor) + 92px); }
  .theme-n64 .rp-shoulders-right { right:150px; }
}

/* ===== HUD editor + escala (cresce do centro / âncora da região) ===== */
.rp-controls {
  --rp-hud-scale: 1;
}

/* Após flatten os itens saem de .rp-region — precisam de pointer-events próprios. */
.rp-controls > .rp-hud-item,
.rp-region > * {
  pointer-events: auto;
}

/* Antes de editar: escala a região inteira a partir da âncora (não empurra para fora). */
.rp-controls:not(.rp-is-flat) .rp-left {
  transform: scale(var(--rp-hud-scale));
  transform-origin: left bottom;
}
.rp-controls:not(.rp-is-flat) .rp-right,
.rp-controls:not(.rp-is-flat) .rp-c-pad,
.rp-controls:not(.rp-is-flat) .rp-right-bottom {
  transform: scale(var(--rp-hud-scale));
  transform-origin: right bottom;
}
.rp-controls:not(.rp-is-flat) .rp-center {
  transform: scale(var(--rp-hud-scale)) translateX(-50%);
  transform-origin: center bottom;
}
.rp-controls:not(.rp-is-flat) .rp-shoulders-left {
  transform: scale(var(--rp-hud-scale));
  transform-origin: left top;
}
.rp-controls:not(.rp-is-flat) .rp-shoulders-right {
  transform: scale(var(--rp-hud-scale));
  transform-origin: right top;
}

/* Depois de editar: cada item escala do próprio centro. */
.rp-controls.rp-is-flat .rp-hud-item {
  transform: scale(var(--rp-item-scale, var(--rp-hud-scale, 1)));
  transform-origin: center center;
}
.rp-controls.rp-is-flat .rp-hud-item.is-active {
  transform: scale(calc(var(--rp-item-scale, var(--rp-hud-scale, 1)) * 0.94));
}
.rp-controls.rp-measuring .rp-region,
.rp-controls.rp-measuring .rp-hud-item {
  transform: none !important;
}

.rp-controls.is-editing {
  background: rgba(0, 0, 0, 0.22);
  z-index: 13500;
  pointer-events: auto;
  touch-action: none;
}
.rp-controls.is-editing .rp-hud-item {
  outline: 2px dashed rgba(156, 187, 223, 0.9);
  outline-offset: 2px;
  cursor: grab;
  touch-action: none;
  z-index: 5;
}
.rp-controls.is-editing .rp-hud-item.is-dragging {
  outline-color: #9cbbdf;
  cursor: grabbing;
  z-index: 30;
  opacity: 0.95;
}
.rp-controls.is-editing .rp-hud-item[data-hud-kind="container"] {
  outline-style: solid;
  outline-color: rgba(74, 222, 128, 0.95);
}

/* Menu: setinha na borda + painel CENTRAL (não corta botões) */
.rp-hud-shell {
  position: absolute;
  inset: 0;
  z-index: 13000;
  pointer-events: none;
  font-family: system-ui, sans-serif;
}
.rp-hud-toggle,
.rp-hud-drawer,
.rp-hud-backdrop {
  pointer-events: auto;
}
.rp-hud-toggle {
  appearance: none;
  position: absolute;
  left: max(4px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 56px;
  border: 1px solid #536076;
  border-radius: 0 10px 10px 0;
  background: #111722e8;
  color: #edf1f7;
  font: 700 18px/1 system-ui;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.rp-hud-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}
.rp-hud-backdrop[hidden] {
  display: none !important;
}
.rp-hud-drawer {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  flex-direction: column;
  gap: 8px;
  width: min(300px, 86vw);
  max-height: min(78vh, 520px);
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #536076;
  background: #0c1018f7;
  color: #edf1f7;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.rp-hud-shell.is-open .rp-hud-drawer {
  display: flex;
}
.rp-hud-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 700 13px system-ui;
}
.rp-hud-drawer-head span {
  font-size: 12px;
  color: #9cbbdf;
}
.rp-hud-action,
.rp-hud-actions button {
  appearance: none;
  border: 1px solid #536076;
  border-radius: 8px;
  min-height: 36px;
  background: #1a2230;
  color: #edf1f7;
  font: 700 12px system-ui;
  cursor: pointer;
}
.rp-hud-action.is-active {
  border-color: #9cbbdf;
  color: #9cbbdf;
  background: #243044;
}
.rp-hud-scale-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 12px system-ui;
  color: #a5afbf;
}
.rp-hud-scale-label b {
  color: #9cbbdf;
  font-weight: 700;
}
.rp-hud-scale-label input {
  width: 100%;
  accent-color: #9cbbdf;
}
.rp-hud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.rp-hud-actions #rpHudSave {
  background: #9cbbdf;
  color: #111722;
  border-color: #9cbbdf;
}
.rp-hud-hint {
  margin: 0;
  font: 11px/1.35 system-ui;
  color: #a5afbf;
}

/* Escala uniforme — nunca esticar formato */
.rp-controls > .rp-hud-item.rp-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
}
.rp-controls.rp-is-flat .rp-hud-item.rp-btn:not(.pill) {
  /* mantém proporção do CSS; scale só via transform */
  max-width: none;
}

body.orientation-blocked .rp-hud-shell,
body:not(.game-started) .rp-hud-shell {
  visibility: hidden;
  pointer-events: none;
}

/* Esconde indicador "Fast-Forward" nativo do EmulatorJS */
.ejs_tg,
.ejs_text_ff,
div[class*="ejs"][class*="fast"],
div[class*="ejs"][class*="Fast"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
/* Editing receives touch input directly; toolbar stays outside control alpha. */
.rp-controls { --rp-controls-opacity: 1; }
.rp-controls:not(.is-editing) .rp-hud-item { opacity: var(--rp-controls-opacity); }
.rp-controls.is-editing { pointer-events: auto; touch-action: none; }
.rp-controls.is-editing .rp-hud-item { opacity: 1; user-select: none; -webkit-user-select: none; }
.rp-hud-finish {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  right: auto;
  top: max(54px, env(safe-area-inset-top));
  transform: translateX(-50%);
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #9cbbdf;
  border-radius: 10px;
  background: #172334ed;
  color: #fff;
  font: 600 12px system-ui;
  z-index: 2;
}
.rp-hud-finish[hidden], .rp-quick-shell [hidden] { display: none !important; }
.rp-quick-shell {
  position: absolute;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  font: 11px system-ui;
  color: #edf1f7;
  --rp-ad-top: 6px;
  --rp-ad-half: min(150px, 20vw);
  --rp-util-top: max(6px, calc(env(safe-area-inset-top) + var(--rp-ad-top)));
}
/* À direita do banner central — longe do ombro R */
.rp-quick-actions {
  position: absolute;
  top: var(--rp-util-top);
  left: calc(50% + var(--rp-ad-half) + 8px);
  right: auto;
  transform: none;
  display: flex;
  flex-direction: row;
  gap: 4px;
}
.rp-quick-actions button {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(156, 187, 223, 0.22);
  border-radius: 7px;
  background: rgba(17, 23, 34, 0.35);
  color: #fff;
  opacity: 0.32;
  padding: 5px;
  transition: opacity .15s ease, background .15s ease;
}
.rp-quick-actions button:hover,
.rp-quick-actions button:focus-visible,
.rp-quick-actions button:active { opacity: 0.85; background: rgba(17, 23, 34, 0.72); }
.rp-quick-actions button:disabled { opacity: .18; }
.rp-quick-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rp-quick-notice {
  position: absolute;
  top: calc(var(--rp-util-top) + 34px);
  left: calc(50% + var(--rp-ad-half) + 8px);
  right: auto;
  transform: none;
  max-width: min(220px, 40%);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.88);
  font-size: 11px;
  text-align: left;
}
.rp-quick-confirm {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, 82%);
  padding: 16px;
  border: 1px solid #536076;
  border-radius: 12px;
  background: #111722fa;
}
.rp-quick-confirm button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #536076;
  background: #243044;
  color: #fff;
  font: inherit;
}
body:not(.game-started) .rp-quick-shell,
body.orientation-blocked .rp-quick-shell,
.rp-controls.is-editing ~ .rp-quick-shell { visibility: hidden; pointer-events: none; }

/* Shell acima só para o botão "Finalizar"; o restante fica invisível e sem toque. */
.rp-hud-shell.is-hud-editing {
  z-index: 13600;
}
.rp-hud-shell.is-hud-editing .rp-hud-toggle,
.rp-hud-shell.is-hud-editing .rp-hud-drawer,
.rp-hud-shell.is-hud-editing .rp-hud-backdrop {
  visibility: hidden;
  pointer-events: none;
}
