/* ==========================================================================
   BOTSEBITA JAVA EMULATOR v1.3 — Frutiger Aero · dark orange
   Glass panels, gel buttons, bokeh bubbles, light rays, soft gloss.
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg0: #0c0502;
  --bg1: #1a0a03;
  --bg2: #2e1305;
  --orange: #ff7a14;
  --orange-hi: #ffa43c;
  --orange-lo: #d9560a;
  --ember: #a63a06;
  --amber: #ffd08a;
  --cream: #fff1df;
  --text: #fff0e0;
  --muted: #d3a57c;
  --dim: #a67a58;
  --aqua: #62e8d2;
  --green: #5be0a4;
  --red: #ff6a5e;
  --glass-top: rgba(255, 178, 100, .20);
  --glass-bot: rgba(140, 52, 10, .22);
  --glass-line: rgba(255, 200, 140, .34);
  --glass-line-soft: rgba(255, 200, 140, .16);
  --gloss: rgba(255, 255, 255, .34);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  font-family: "Segoe UI", "Frutiger", "Frutiger Linotype", "Myriad Pro", "Trebuchet MS", "Lucida Grande", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--text); }
html { overflow-x: hidden; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 85% -8%, rgba(255, 122, 20, .55) 0, rgba(255, 122, 20, 0) 62%),
    radial-gradient(ellipse 60% 45% at 8% 105%, rgba(255, 94, 10, .42) 0, rgba(255, 94, 10, 0) 65%),
    radial-gradient(ellipse 90% 60% at 50% 120%, rgba(255, 170, 60, .22) 0, rgba(255, 170, 60, 0) 70%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg1) 38%, var(--bg0) 100%);
  background-attachment: fixed;
}
/* light rays */
body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 90vh; overflow: hidden; pointer-events: none; z-index: 0;
  background: conic-gradient(from 200deg at 82% -10%, transparent 0 8%, rgba(255, 190, 110, .13) 11%, transparent 15%, rgba(255, 160, 70, .10) 20%, transparent 25%, rgba(255, 200, 130, .08) 30%, transparent 36%);
  mix-blend-mode: screen;
}
/* bokeh bubbles */
.aero-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aero-bg i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55) 0, rgba(255, 220, 170, .18) 18%, rgba(255, 140, 40, .10) 55%, rgba(255, 120, 20, .02) 75%);
  border: 1px solid rgba(255, 215, 170, .28);
  box-shadow: inset 0 -8px 18px rgba(255, 120, 30, .18), 0 0 30px rgba(255, 120, 30, .12);
  animation: bubble-float 14s ease-in-out infinite;
}
.aero-bg i:nth-child(1) { width: 190px; height: 190px; left: -50px; top: 14%; animation-duration: 17s; }
.aero-bg i:nth-child(2) { width: 90px; height: 90px; left: 21%; top: 72%; animation-delay: -4s; }
.aero-bg i:nth-child(3) { width: 140px; height: 140px; right: 6%; top: 52%; animation-duration: 19s; animation-delay: -7s; }
.aero-bg i:nth-child(4) { width: 54px; height: 54px; right: 24%; top: 12%; animation-delay: -2s; }
.aero-bg i:nth-child(5) { width: 70px; height: 70px; left: 46%; top: 88%; animation-delay: -9s; }
.aero-bg i:nth-child(6) { width: 34px; height: 34px; left: 8%; top: 56%; animation-delay: -5s; }
.aero-bg i:nth-child(7) { width: 110px; height: 110px; right: -30px; top: 84%; animation-duration: 21s; }
@keyframes bubble-float { 0%, 100% { transform: translate3d(0, 0, 0) } 50% { transform: translate3d(14px, -26px, 0) } }

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.6); }
a { color: inherit; }
[hidden] { display: none !important; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- glass mixin (applied to every panel) ---------- */
.sidebar, .info-card, .device-column, .dropzone, .search-box, .privacy-note, .tool-chip,
.runtime-badge, .settings-dialog, .help-dialog, .toast {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--gloss), inset 0 -18px 34px rgba(255, 110, 20, .07), 0 10px 30px rgba(0, 0, 0, .4);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

/* ---------- top bar ---------- */
.topbar {
  height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(255, 160, 80, .30) 0%, rgba(150, 56, 10, .34) 49%, rgba(70, 24, 4, .52) 50%, rgba(36, 12, 3, .62) 100%);
  border-bottom: 1px solid rgba(255, 190, 120, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 28px rgba(0, 0, 0, .5);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; min-width: 270px; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; filter: drop-shadow(0 4px 10px rgba(255, 110, 10, .55)); }
.brand-copy { display: flex; flex-direction: column; gap: 4px; }
.brand-copy strong { letter-spacing: .07em; font-size: 14px; text-shadow: 0 1px 0 #5a1d02, 0 0 14px rgba(255, 140, 40, .55); }
.brand-copy small { font-size: 10px; letter-spacing: .16em; color: var(--amber); opacity: .85; }
.top-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- gel buttons ---------- */
.btn {
  position: relative; border: 1px solid var(--glass-line); border-radius: 12px; padding: 10px 15px;
  color: var(--cream); font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, rgba(255, 190, 120, .30) 0%, rgba(160, 62, 12, .34) 50%, rgba(80, 26, 4, .52) 51%, rgba(120, 44, 8, .45) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 12px rgba(0, 0, 0, .4);
  text-shadow: 0 1px 1px rgba(60, 16, 0, .8);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn::after { content: ""; position: absolute; left: 6%; right: 6%; top: 2px; height: 46%; border-radius: 10px 10px 40% 40%; background: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, .04)); pointer-events: none; }
.btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.15); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px rgba(255, 120, 20, .35); }
.btn:not(:disabled):active { transform: translateY(1px); filter: brightness(.95); }
.btn.primary {
  border-color: #ffd199; color: #fff;
  background: linear-gradient(180deg, #ffbe66 0%, #ff8f24 49%, #e4600a 50%, #ff8d2a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 6px rgba(130, 40, 0, .45), 0 6px 20px rgba(255, 110, 10, .45);
}
.btn.danger-outline { color: #ffb4a8; border-color: rgba(255, 130, 110, .5); background: linear-gradient(180deg, rgba(255, 110, 90, .28), rgba(120, 20, 10, .45)); font-size: 19px; padding: 10px 14px; }
.btn.icon-btn { width: 40px; height: 40px; padding: 0; font-size: 19px; border-radius: 50%; }
.btn.full { width: 100%; }

.runtime-badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; color: var(--amber); font-size: 10px; white-space: nowrap; }
.runtime-badge i, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-hi); box-shadow: 0 0 10px var(--orange); display: inline-block; }
.runtime-badge.ready { color: #c5f5df; border-color: rgba(110, 230, 180, .45); }
.runtime-badge.ready i, .live-dot { background: var(--green); box-shadow: 0 0 10px rgba(91, 224, 164, .85), inset 0 1px 1px rgba(255, 255, 255, .7); }
.runtime-badge.busy i { background: var(--orange-hi); box-shadow: 0 0 10px var(--orange); }

/* ---------- layout ---------- */
.workspace { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: calc(100vh - 84px); }
.sidebar { margin: 16px 0 16px 16px; border-radius: var(--radius); padding: 24px 18px 17px; display: flex; flex-direction: column; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 18px; }
.eyebrow { font-size: 9px; letter-spacing: .17em; color: var(--amber); opacity: .8; font-weight: 800; }
.section-head h2 { font-size: 18px; margin: 5px 0 0; letter-spacing: -.02em; text-shadow: 0 1px 0 #5a1d02; }
.count-pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; border: 1px solid #ffd199; background: linear-gradient(180deg, #ffbe66, #e4600a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); text-shadow: 0 1px 1px #7a2a00; }
.search-box { height: 40px; border-radius: 999px; display: flex; gap: 9px; align-items: center; padding: 0 15px; color: var(--muted); margin-bottom: 13px; }
.search-box span { font-size: 22px; line-height: 1; }
.search-box input { width: 100%; background: transparent; border: 0; color: var(--text); outline: none; font-size: 12px; }
.search-box input::placeholder { color: var(--dim); }
.dropzone { width: 100%; border-style: dashed; border-color: rgba(255, 200, 140, .5); border-radius: 16px; min-height: 117px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; margin: 0 0 22px; transition: .16s; color: var(--text); }
.dropzone:hover, .dropzone.dragover { border-color: var(--amber); background: linear-gradient(180deg, rgba(255, 170, 90, .34), rgba(180, 70, 12, .3)); }
.upload-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; font-size: 21px; border-radius: 50%; background: linear-gradient(180deg, #ffbe66, #e4600a); border: 1px solid #ffd199; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 12px rgba(255, 110, 10, .4); }
.dropzone strong { font-size: 12px; }
.dropzone small { font-size: 10px; color: var(--muted); text-align: center; padding: 0 9px; }
.library-subhead { display: flex; align-items: center; justify-content: space-between; color: var(--amber); opacity: .8; font-size: 9px; font-weight: 800; letter-spacing: .15em; margin: 0 2px 9px; }
.text-btn { border: 0; background: none; color: var(--muted); font-size: 10px; padding: 3px; }
.text-btn:hover { color: #fff; text-decoration: underline; }
.game-library { display: flex; flex-direction: column; gap: 7px; min-height: 40px; margin-bottom: 18px; }
.game-item { position: relative; border: 1px solid var(--glass-line-soft); background: linear-gradient(180deg, rgba(255, 170, 90, .14), rgba(120, 40, 8, .2)); border-radius: 14px; padding: 9px; display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; min-width: 0; transition: .15s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.game-item:hover { border-color: var(--glass-line); background: linear-gradient(180deg, rgba(255, 170, 90, .28), rgba(150, 56, 10, .3)); }
.game-item.selected { border-color: #ffd199; background: linear-gradient(180deg, rgba(255, 180, 100, .42), rgba(220, 90, 14, .36)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 18px rgba(255, 120, 20, .35); }
.mini-cover { width: 42px; height: 48px; flex: 0 0 42px; border-radius: 10px; background: radial-gradient(ellipse at 50% 15%, #ffb04d, #d9560a 60%, #6a2204); display: grid; place-items: center; color: #fff6e8; font-size: 10px; font-weight: 900; line-height: 1.1; text-align: center; border: 1px solid #ffd199; overflow: hidden; text-shadow: 0 1px 2px #5a1d02; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.mini-cover.jad { background: radial-gradient(ellipse at 50% 15%, #d8b27a, #8a5a2a 70%, #3a2210); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.game-item-copy { min-width: 0; flex: 1; }
.game-item-copy strong { display: block; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.game-item-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.game-item .item-arrow { color: var(--amber); font-size: 19px; }
.empty-library { padding: 20px 10px; text-align: center; color: var(--muted); }
.empty-library > span { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--glass-line); border-radius: 50%; background: linear-gradient(180deg, rgba(255, 170, 90, .25), rgba(120, 40, 8, .25)); margin: 0 auto 10px; font-size: 19px; color: var(--amber); box-shadow: inset 0 1px 0 var(--gloss); }
.empty-library strong { display: block; font-size: 11px; color: var(--cream); }
.empty-library p { font-size: 10px; line-height: 1.6; margin: 6px 0 0; }
.sidebar-footer { margin-top: auto; padding-top: 22px; }
.privacy-note { display: flex; gap: 9px; padding: 11px; border-radius: 14px; color: var(--amber); }
.privacy-note > span { font-size: 15px; }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.credits { font-size: 8px; letter-spacing: .12em; color: var(--dim); margin: 16px 4px 0; }

.main-panel { min-width: 0; padding: 24px clamp(18px, 3vw, 44px) 18px; }
.player-header { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.player-header h1 { margin: 6px 0 4px; font-size: 28px; letter-spacing: -.03em; font-weight: 700; text-shadow: 0 2px 0 #5a1d02, 0 0 26px rgba(255, 130, 30, .5); }
.player-header p { margin: 0; font-size: 12px; color: var(--muted); }
.player-actions { display: flex; gap: 8px; }
.player-actions .btn { padding: 12px 16px; }

.play-area { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(300px, 350px); gap: clamp(18px, 3vw, 40px); align-items: start; max-width: 1320px; margin: 0 auto; }
.device-column { min-width: 0; border-radius: 22px; padding: 17px 12px 14px; min-height: 735px; display: flex; flex-direction: column; align-items: center; position: relative; overflow: hidden; }
.device-column::before { content: ""; position: absolute; left: 0; right: 0; top: -34%; height: 70%; border-radius: 50%; background: radial-gradient(ellipse at 50% 100%, rgba(255, 220, 170, .22), transparent 70%); pointer-events: none; }
.device-column::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, rgba(255, 120, 20, .22) 0, transparent 58%); }
.device-caption { position: relative; z-index: 1; width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--amber); font-weight: 800; font-size: 8px; letter-spacing: .13em; padding: 0 4px 16px; opacity: .85; }
.device-caption > span:first-child { display: flex; align-items: center; gap: 7px; }

/* ---------- the phone ---------- */
.phone-wrap { position: relative; z-index: 1; display: flex; justify-content: center; max-width: 100%; padding: 0 8px 20px; }
.phone {
  --ph-body: linear-gradient(115deg, #7a4a28 0%, #1a0d06 7%, #3e2210 15%, #0b0502 27%, #26130a 50%, #0b0502 86%, #8c5530 100%);
  --ph-edge: #c88a55; --ph-hi: #ffd9b0; --ph-glow: rgba(255, 120, 20, .25);
  --ph-text: #f6c898; --ph-num: #ffe6c8; --ph-sub: #d8a878;
  --ph-key: linear-gradient(180deg, #9a6a44 0%, #3a1e0e 50%, #140a04 51%, #2a150a 100%);
  --ph-key-line: #5a3418;
  --ph-pad: linear-gradient(140deg, #4a2a14, #0d0602);
  --ph-dkey: linear-gradient(180deg, #8a5a38, #2a150a 52%, #140a04 53%, #22110a);
  --ph-dkey-line: #6a4020;
  --ph-frame: linear-gradient(120deg, #9a6a44, #1c0e06 16%, #080402 70%, #8a5a38);
  --ph-frame-line: #c88a55;
  width: 280px; max-width: 100%; min-height: 670px; border-radius: 34px; position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 11px 13px 10px;
  background: var(--ph-body);
  border: 1px solid var(--ph-edge);
  box-shadow: 0 34px 60px rgba(0, 0, 0, .75), 0 0 46px var(--ph-glow), inset 1px 1px 1px var(--ph-hi), inset -2px -2px 3px #050201;
}
.phone::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 38%; pointer-events: none; border-radius: 34px 34px 60% 60% / 34px 34px 22% 22%; background: linear-gradient(180deg, rgba(255, 230, 200, .20), rgba(255, 230, 200, 0)); }
.phone-top { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 2px 9px 9px; position: relative; gap: 8px; }
.camera-lens { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; border: 2px solid #5a3a22; background: radial-gradient(circle at 35% 30%, #6aa9ff 0, #0a1220 55%); box-shadow: 0 0 0 1px #1c0e06; }
.speaker { display: flex; gap: 3px; align-items: center; }
.speaker i { width: 3px; height: 11px; border-radius: 3px; background: linear-gradient(#0b0502, #8a5a38, #0b0502); box-shadow: 0 0 0 1px #1c0e06; }
.phone-brand { font-size: 9px; font-weight: 700; letter-spacing: .01em; color: var(--ph-text); text-shadow: 0 1px 1px #000, 0 0 8px rgba(255, 140, 40, .45); white-space: nowrap; }
.phone-screen-frame { padding: 7px; border-radius: 10px; background: var(--ph-frame); border: 1px solid #050201; box-shadow: inset 0 0 0 1px var(--ph-frame-line), 0 3px 6px rgba(0, 0, 0, .7), 0 0 20px rgba(255, 130, 30, .2); }
.phone-screen-frame.screen-frameless { padding: 1px; border-radius: 3px; }
.phone-screen { width: 100%; aspect-ratio: 3/4; position: relative; overflow: hidden; background: #120803; border: 1px solid #050201; display: flex; flex-direction: column; isolation: isolate; border-radius: 3px; }
.phone-screen::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 34%; pointer-events: none; z-index: 12; background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0)); }
.screen-status { position: absolute; inset: 0 0 auto; height: 17px; z-index: 4; display: flex; justify-content: space-between; align-items: center; padding: 0 7px; background: linear-gradient(180deg, rgba(255, 150, 60, .45), rgba(60, 20, 4, .8)); color: #fff4e6; font-size: 8px; font-weight: 700; letter-spacing: .03em; border-bottom: 1px solid rgba(255, 210, 160, .4); }
.screen-status b { font-size: 7px; color: var(--amber); }
.screen-content { position: absolute; inset: 17px 0 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background: radial-gradient(ellipse at 50% 12%, #ff9a3a 0, #c4460a 28%, #4a1a05 62%, #1a0a03 100%); }
.screen-content::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 22% 78%, rgba(255, 255, 255, .22) 0 9px, transparent 10px), radial-gradient(circle at 80% 62%, rgba(255, 255, 255, .16) 0 14px, transparent 15px), radial-gradient(circle at 66% 90%, rgba(255, 255, 255, .20) 0 6px, transparent 7px); }
.wallpaper-orbit { position: absolute; width: 170px; height: 190px; top: -25px; left: -15px; transform: rotate(-26deg); border: 18px solid rgba(255, 210, 150, .14); border-radius: 50%; box-shadow: 0 0 0 10px rgba(255, 170, 80, .08), 0 0 0 22px rgba(255, 150, 60, .05); }
.wallpaper-orbit span { position: absolute; width: 110px; height: 10px; background: linear-gradient(90deg, transparent, rgba(255, 243, 223, .8), rgba(255, 176, 80, .8), transparent); transform: rotate(-28deg); top: 34px; left: 4px; filter: drop-shadow(0 0 6px #ffb050); opacity: .75; }
.wallpaper-orbit i { position: absolute; right: -30px; bottom: 20px; width: 110px; height: 7px; background: #ffe0a8; transform: rotate(-35deg); box-shadow: 0 0 12px rgba(255, 224, 168, .6); opacity: .0; }
.boot-brand { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin: 4px 0 24px; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.mini-b { width: 34px; height: 34px; border-radius: 10px; filter: drop-shadow(0 4px 10px rgba(255, 120, 10, .7)); }
.boot-brand strong { font-size: 13px; letter-spacing: .08em; margin-top: 8px; }
.boot-brand small { color: var(--amber); font-size: 7px; letter-spacing: .2em; margin-top: 3px; }
.screen-menu { z-index: 2; width: 86%; border: 1px solid rgba(255, 210, 160, .45); border-radius: 8px; background: rgba(30, 10, 2, .55); backdrop-filter: blur(4px); padding: 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.menu-row { display: flex; align-items: center; gap: 7px; padding: 6px; color: #ffe2c2; font-size: 8px; border-radius: 5px; white-space: nowrap; overflow: hidden; }
.menu-row span:last-child { text-overflow: ellipsis; overflow: hidden; }
.menu-row.active { background: linear-gradient(180deg, #ffb457, #e4600a); color: #fff; text-shadow: 0 1px 1px #7a2a00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.screen-softkeys { z-index: 2; position: absolute; bottom: 5px; left: 6px; right: 6px; display: flex; justify-content: space-between; font-size: 7px; color: #ffe2c2; }
.game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; z-index: 6; }
.phone-screen.playing .screen-status { display: none; }
.screen-message { position: absolute; z-index: 10; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(120, 44, 6, .96), rgba(24, 8, 2, .98)); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 15px; color: var(--cream); gap: 9px; }
.screen-message strong { font-size: 11px; }
.screen-message p { font-size: 8px; line-height: 1.7; color: #f0c9a0; margin: 0; }
.screen-message .spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 210, 160, .25); border-top-color: var(--orange-hi); animation: spin 1s linear infinite; }
.screen-message.error strong { color: #ffb4a8; }
.screen-message .btn { padding: 7px 12px; font-size: 9px; margin-top: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.phone-controls { padding: 9px 3px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; position: relative; }
.soft-row { display: flex; justify-content: space-between; align-items: center; padding: 0 9px; }
.phone-key { border: 1px solid #1a0b04; background: var(--ph-key); box-shadow: 0 2px 3px rgba(0, 0, 0, .8), inset 0 1px 1px rgba(255, 220, 180, .45); color: var(--ph-text); display: grid; place-items: center; }
.phone-key:active, .phone-key.pressed, .dpad-key:active, .dpad-key.pressed, .number-key:active, .number-key.pressed { background: linear-gradient(180deg, #ffbe66, #e4600a); color: #fff; box-shadow: 0 0 0 1px #ffd199, 0 0 14px rgba(255, 130, 30, .8); }
.phone-key.soft { width: 50px; height: 18px; border-radius: 9px; font-size: 7px; }
.phone-key.menu-key { width: 28px; height: 22px; border-radius: 8px; font-size: 12px; }
.nav-row { display: flex; justify-content: space-between; align-items: center; padding: 0 0 3px; }
.phone-key.call-key, .phone-key.end-key { width: 24px; height: 26px; border-radius: 12px; font-size: 8px; color: #8be8b3; }
.phone-key.end-key { color: #ff9a8c; }
.dpad { width: 116px; height: 103px; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; padding: 4px; border-radius: 18px; background: var(--ph-pad); box-shadow: inset 0 1px 2px rgba(255, 210, 160, .35), 0 3px 6px rgba(0, 0, 0, .7); }
.dpad-key { border: 1px solid var(--ph-dkey-line); border-radius: 8px; background: var(--ph-dkey); color: var(--ph-text); font-size: 11px; box-shadow: inset 0 1px 1px rgba(255, 220, 180, .4), 0 1px 2px rgba(0, 0, 0, .8); }
.dpad-key.up { grid-column: 2; grid-row: 1; }
.dpad-key.left { grid-column: 1; grid-row: 2; }
.dpad-key.fire { grid-column: 2; grid-row: 2; border-radius: 50%; font-size: 8px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #ffbe66, #ff8f24 49%, #d9560a 50%, #ff8d2a); border: 2px solid #ffd199; text-shadow: 0 1px 1px #7a2a00; }
.dpad-key.right { grid-column: 3; grid-row: 2; }
.dpad-key.down { grid-column: 2; grid-row: 3; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 5px; }
.number-key { height: 26px; border: 1px solid var(--ph-key-line); border-radius: 13px; background: var(--ph-key); box-shadow: 0 2px 2px rgba(0, 0, 0, .8), inset 0 1px 1px rgba(255, 220, 180, .45); display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--ph-num); padding: 0 5px; }
.number-key b { font-size: 11px; font-weight: 650; }
.number-key small { font-size: 5px; color: var(--ph-sub); letter-spacing: .02em; }
.symbol-key b { font-size: 14px; }
.phone-bottom { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ph-text); font-size: 9px; letter-spacing: .22em; font-weight: 700; padding: 5px 0 0; text-shadow: 0 0 8px rgba(255, 140, 40, .55); }
.bottom-mark { width: 16px; height: 16px; }
.device-shadow { position: absolute; z-index: -1; bottom: 4px; left: calc(50% - 140px); width: 280px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(14px); }
.device-tools { position: relative; z-index: 2; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; width: 100%; margin-top: auto; padding: 5px 0 0; }
.tool-chip { font-size: 9px; color: var(--cream); border-radius: 999px; padding: 8px 12px; }
.tool-chip:hover { border-color: #ffd199; background: linear-gradient(180deg, rgba(255, 190, 120, .4), rgba(200, 80, 12, .35)); }
.phone.keypad-hidden .keypad { display: none; }
.phone.keypad-hidden { min-height: 590px; }

/* ---------- right column cards ---------- */
.right-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.info-card { position: relative; border-radius: 18px; padding: 16px; overflow: hidden; }
.info-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 38px; background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)); pointer-events: none; }
.card-heading { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--amber); font-weight: 800; font-size: 9px; letter-spacing: .13em; margin-bottom: 14px; }
.tiny-status, .engine-state { font-size: 8px; color: #ffe2b8; border: 1px solid rgba(255, 200, 140, .5); background: linear-gradient(180deg, rgba(255, 170, 80, .35), rgba(150, 60, 10, .4)); padding: 4px 8px; border-radius: 999px; letter-spacing: .06em; }
.tiny-status.loaded, .engine-state.ready { color: #c9f7e1; border-color: rgba(110, 230, 180, .55); background: linear-gradient(180deg, rgba(91, 224, 164, .3), rgba(20, 90, 60, .4)); }
.selected-game-info { display: flex; gap: 13px; align-items: center; }
.game-cover { width: 68px; height: 82px; border-radius: 12px; flex: 0 0 68px; background: radial-gradient(ellipse at 50% 12%, #ffb04d, #d9560a 55%, #5a1d02); border: 1px solid #ffd199; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 18px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 120, 20, .35); display: grid; place-items: center; text-align: center; color: #fff1de; overflow: hidden; }
.game-cover span { font-size: 12px; letter-spacing: .08em; line-height: 1.45; text-shadow: 0 1px 2px #5a1d02; }
.game-cover b { font-size: 24px; color: #fff; text-shadow: 0 0 13px #ffb050; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-cover.jad { background: radial-gradient(ellipse at 50% 12%, #d8b27a, #8a5a2a 70%, #3a2210); }
.game-details { min-width: 0; flex: 1; }
.game-details h3 { font-size: 15px; letter-spacing: -.02em; margin: 0 0 5px; overflow-wrap: anywhere; }
.game-details p { font-size: 10px; line-height: 1.55; color: var(--muted); margin: 0 0 9px; }
.meta-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.meta-pills span { font-size: 8px; color: var(--amber); border: 1px solid var(--glass-line); background: rgba(255, 150, 60, .14); padding: 4px 8px; border-radius: 999px; }
.metadata-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; border-top: 1px solid var(--glass-line-soft); margin-top: 16px; padding-top: 13px; }
.metadata-grid div { min-width: 0; }
.metadata-grid small { display: block; font-size: 8px; color: var(--dim); letter-spacing: .12em; margin-bottom: 5px; }
.metadata-grid strong { display: block; font-size: 10px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-buttons { display: flex; gap: 8px; margin-top: 14px; }
.card-buttons .full { flex: 1; }
.control-card .card-heading { margin-bottom: 10px; }
.mini-select { font-size: 9px; color: var(--cream); border: 1px solid var(--glass-line); border-radius: 999px; background: linear-gradient(180deg, rgba(255, 170, 80, .3), rgba(120, 44, 8, .4)); padding: 5px 10px; }
.control-mode-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: rgba(20, 7, 1, .55); border: 1px solid var(--glass-line-soft); padding: 4px; border-radius: 999px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6); }
.mode-option { border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 7px 4px; border-radius: 999px; }
.mode-option.active { color: white; background: linear-gradient(180deg, #ffbe66, #ff8f24 49%, #e4600a 50%, #ff8d2a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 8px rgba(255, 110, 10, .5); text-shadow: 0 1px 1px #7a2a00; }
.control-summary { display: flex; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--glass-line-soft); }
.control-symbol { height: 36px; width: 36px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 170, 80, .4), rgba(120, 44, 8, .45)); border: 1px solid var(--glass-line); color: var(--amber); font-size: 18px; flex: 0 0 36px; box-shadow: inset 0 1px 0 var(--gloss); }
.control-summary strong { display: block; font-size: 11px; }
.control-summary p { font-size: 9px; color: var(--muted); line-height: 1.5; margin: 4px 0 0; }
.keymap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 5px; padding: 14px 0; }
.keymap-grid span { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; min-width: 0; }
.keymap-grid kbd { min-width: 44px; text-align: center; font-family: inherit; font-size: 8px; font-weight: 800; color: var(--cream); background: linear-gradient(180deg, rgba(255, 190, 120, .3), rgba(80, 26, 4, .5)); border: 1px solid var(--glass-line); border-bottom-width: 2px; border-radius: 7px; padding: 5px 5px; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.keymap-grid small { font-size: 8px; color: var(--dim); }
.gamepad-status { border-top: 1px solid var(--glass-line-soft); padding: 12px 0 0; display: flex; align-items: center; gap: 9px; }
.gamepad-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--glass-line); background: linear-gradient(180deg, rgba(255, 170, 80, .3), rgba(120, 44, 8, .4)); border-radius: 50%; color: var(--amber); font-size: 17px; }
.gamepad-status strong { font-size: 10px; display: block; }
.gamepad-status small { display: block; font-size: 8px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.gamepad-led { width: 8px; height: 8px; border-radius: 50%; background: #6a4a38; margin-left: auto; flex: 0 0 8px; }
.gamepad-led.on { background: var(--green); box-shadow: 0 0 10px rgba(91, 224, 164, .9); }
.engine-card p { position: relative; font-size: 10px; line-height: 1.7; color: var(--muted); margin: 0 0 13px; }
.external-engine { display: block; text-align: center; color: var(--amber); text-decoration: none; font-size: 10px; margin-top: 12px; }
.external-engine:hover { color: #fff; text-decoration: underline; }
.bottom-status { display: flex; justify-content: space-between; gap: 15px; margin: 17px 1px 0; padding: 12px 2px 0; border-top: 1px solid var(--glass-line-soft); color: var(--dim); font-size: 8px; letter-spacing: .1em; }
.bottom-status > span:first-child { display: flex; align-items: center; gap: 7px; }
.bottom-status .live-dot { width: 6px; height: 6px; }

/* ---------- dialogs & toasts ---------- */
.settings-dialog, .help-dialog { border-radius: 22px; color: var(--text); padding: 0; width: min(600px, 95vw); max-width: 96vw; max-height: 92vh; overflow: auto; box-shadow: 0 30px 100px rgba(0, 0, 0, .8), inset 0 1px 0 var(--gloss); background: linear-gradient(180deg, rgba(120, 48, 10, .94), rgba(34, 12, 3, .96)); }
.settings-dialog::backdrop, .help-dialog::backdrop { background: rgba(10, 3, 0, .72); backdrop-filter: blur(8px); }
.settings-dialog form { margin: 0; }
.dialog-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--glass-line); background: linear-gradient(180deg, rgba(255, 180, 100, .28), rgba(120, 44, 8, .3)); position: sticky; top: 0; z-index: 2; }
.dialog-head h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 20px; padding: 16px 0; border-bottom: 1px solid var(--glass-line-soft); }
.setting-row > span { display: flex; flex-direction: column; gap: 5px; }
.setting-row strong { font-size: 12px; }
.setting-row small { font-size: 10px; color: var(--muted); }
.setting-row select { min-width: 180px; max-width: 50%; background: rgba(20, 7, 1, .7); color: var(--cream); border: 1px solid var(--glass-line); border-radius: 10px; padding: 8px; font-size: 10px; }
.setting-row input[type=checkbox] { width: 18px; height: 18px; accent-color: #ff8a1f; }
.dialog-actions { display: flex; justify-content: flex-end; padding: 18px 20px; }
.help-list { padding: 18px 28px 18px 43px; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.help-list li { padding-left: 3px; }
.help-list strong { display: block; font-size: 12px; margin-bottom: 4px; }
.help-list span { display: block; font-size: 11px; line-height: 1.7; color: var(--muted); }
.help-footer { margin: 0 20px 20px; padding: 12px; border: 1px solid var(--glass-line); background: rgba(255, 150, 60, .12); border-radius: 12px; font-size: 10px; color: var(--amber); line-height: 1.6; }
.toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { max-width: min(360px, 90vw); border-radius: 14px; padding: 12px 15px; color: var(--cream); font-size: 11px; line-height: 1.6; animation: toast-in .18s ease-out; background: linear-gradient(180deg, rgba(150, 60, 12, .94), rgba(50, 18, 4, .96)); }
.toast.warn { border-color: #ffc46a; }
.toast.error { border-color: #ff7d6c; }
.toast.success { border-color: #6fe3b4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.controls-large .dpad-key { font-size: 15px; }
.controls-large .number-key { height: 30px; }
.controls-compact .dpad { width: 100px; height: 88px; }
.controls-compact .number-key { height: 22px; }
.hide-dpad .dpad { opacity: .3; pointer-events: none; }
.hide-keypad .keypad { display: none; }


/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .main-panel { padding-left: 20px; padding-right: 20px; }
  .play-area { grid-template-columns: minmax(290px, 1fr) minmax(280px, 320px); gap: 16px; }
  .player-header h1 { font-size: 24px; }
  .player-actions { flex-wrap: wrap; justify-content: flex-end; }
  .runtime-badge { display: none; }
  .device-column { min-height: 710px; }
}
@media (max-width: 940px) {
  .topbar { padding: 12px 16px; height: auto; min-height: 78px; flex-wrap: wrap; }
  .brand { min-width: 0; }
  .brand-copy strong { font-size: 11px; }
  .top-actions { gap: 6px; }
  .top-actions .btn { font-size: 10px; padding: 9px 11px; }
  .top-actions .icon-btn { width: 36px; height: 36px; }
  .workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .play-area { grid-template-columns: 1fr; }
  .device-column { min-height: 0; padding-bottom: 15px; }
  .phone-wrap { padding-bottom: 12px; }
  .phone { min-height: 650px; }
  .right-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .current-game-card, .engine-card { grid-column: 1/-1; }
  .player-header { align-items: flex-start; }
  .bottom-status { flex-wrap: wrap; }
  .bottom-status span:last-child { width: 100%; }
}
@media (max-width: 680px) {
  .topbar { position: relative; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 10px; letter-spacing: .04em; }
  .brand-copy small { font-size: 8px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-actions .secondary { display: none; }
  .top-actions .runtime-badge { display: flex; font-size: 9px; margin-right: auto; }
  .workspace { display: flex; flex-direction: column; }
  .sidebar { margin: 12px 12px 0; padding: 15px 14px 12px; }
  .section-head { margin-bottom: 12px; }
  .section-head h2 { font-size: 15px; }
  .dropzone { min-height: 76px; margin-bottom: 13px; }
  .dropzone small { font-size: 9px; }
  .library-subhead { margin-bottom: 7px; }
  .game-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 190px; overflow: auto; }
  .game-item { padding: 7px; gap: 7px; }
  .mini-cover { height: 42px; width: 34px; flex-basis: 34px; }
  .game-item-copy strong { font-size: 10px; }
  .game-item-copy small { font-size: 8px; }
  .game-item .item-arrow { display: none; }
  .empty-library { grid-column: 1/-1; padding: 14px 10px; }
  .empty-library > span { display: none; }
  .sidebar-footer { padding-top: 11px; }
  .privacy-note { padding: 8px; }
  .privacy-note p { font-size: 9px; }
  .credits { display: none; }
  .main-panel { padding: 18px 12px 13px; }
  .player-header { display: block; margin-bottom: 13px; }
  .player-header h1 { font-size: 22px; }
  .player-header p { font-size: 10px; }
  .player-actions { justify-content: stretch; margin-top: 13px; }
  .player-actions .btn { flex: 1; padding: 11px 8px; font-size: 10px; }
  .device-column { border-radius: 18px; padding: 12px 7px; overflow: visible; }
  .device-caption { font-size: 7px; padding-bottom: 12px; }
  .phone-wrap { padding-left: 0; padding-right: 0; }
  .phone { width: 270px; min-height: 640px; }
  .device-tools { gap: 5px; }
  .tool-chip { font-size: 8px; padding: 7px 9px; }
  .right-panel { display: flex; }
  .info-card { padding: 13px; }
  .bottom-status { line-height: 1.7; font-size: 7px; }
  .setting-row { margin: 0 14px; gap: 10px; }
  .setting-row select { min-width: 135px; font-size: 9px; }
  .toast-region { bottom: 10px; right: 10px; left: 10px; }
  .toast { max-width: none; }
}
@media (max-width: 380px) {
  .brand-copy strong { font-size: 9px; }
  .top-actions .primary { font-size: 9px; }
  .phone { width: 252px; min-height: 620px; padding-left: 11px; padding-right: 11px; }
  .dpad { width: 105px; height: 94px; }
  .number-key { height: 24px; }
  .keypad { gap: 4px; }
  .metadata-grid { gap: 4px; }
  .metadata-grid strong { font-size: 9px; }
  .selected-game-info { gap: 9px; }
  .game-cover { width: 58px; flex-basis: 58px; height: 75px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* ==========================================================================
   v1.3 — colores del teléfono · rendimiento · pantalla completa con marco
   ========================================================================== */

/* ---------- colores (Sonycs Eriksson ww995) ---------- */
.phone[data-color="silver"] {
  --ph-body: linear-gradient(115deg, #ffffff 0%, #b9bec5 7%, #eceef1 15%, #9aa0a8 27%, #d6d9de 50%, #9aa0a8 86%, #f6f7f9 100%);
  --ph-edge: #f1f3f5; --ph-hi: #ffffff; --ph-glow: rgba(210, 222, 245, .28);
  --ph-text: #30343b; --ph-num: #1d2025; --ph-sub: #4b5058;
  --ph-key: linear-gradient(180deg, #f5f6f8 0%, #b7bcc3 50%, #8e949c 51%, #c6cad0 100%);
  --ph-key-line: #6c7179;
  --ph-pad: linear-gradient(140deg, #d3d7dc, #7d838b);
  --ph-dkey: linear-gradient(180deg, #f7f8fa, #bbc0c7 52%, #9198a1 53%, #cbcfd5);
  --ph-dkey-line: #70757d;
  --ph-frame: linear-gradient(120deg, #eceef1, #2a2c30 16%, #0b0c0d 70%, #c9ccd1);
  --ph-frame-line: #f4f5f7;
}
.phone[data-color="red"] {
  --ph-body: linear-gradient(115deg, #ff9d93 0%, #a3140f 7%, #e6382d 15%, #7a0a07 27%, #cf241b 50%, #7a0a07 86%, #ffa194 100%);
  --ph-edge: #ffb7ad; --ph-hi: #ffd6d0; --ph-glow: rgba(255, 70, 50, .32);
  --ph-text: #ffe1dc; --ph-num: #fff0ed; --ph-sub: #ffb8ae;
  --ph-key: linear-gradient(180deg, #e0564b 0%, #6a120d 50%, #2f0604 51%, #4a0b08 100%);
  --ph-key-line: #3a0805;
  --ph-pad: linear-gradient(140deg, #8a1812, #2a0504);
  --ph-dkey: linear-gradient(180deg, #d84a40, #53100b 52%, #280504 53%, #3c0a07);
  --ph-dkey-line: #a82a20;
  --ph-frame: linear-gradient(120deg, #ff9d93, #3a0806 16%, #0c0202 70%, #e6382d);
  --ph-frame-line: #ff9a8c;
}
.color-swatches { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 6px 0 2px; color: var(--amber); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); box-shadow: 0 2px 5px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .6); }
.swatch[data-color="black"]  { background: radial-gradient(circle at 35% 28%, #8a5a38 0, #1a0d06 55%, #050201 100%); }
.swatch[data-color="silver"] { background: radial-gradient(circle at 35% 28%, #ffffff 0, #c3c7cd 55%, #8d939b 100%); }
.swatch[data-color="red"]    { background: radial-gradient(circle at 35% 28%, #ff9d93 0, #d4281e 55%, #7a0a07 100%); }
.swatch.active { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- rendimiento mientras corre un juego ----------
   El motor Java corre en el hilo principal del navegador: cada efecto de vidrio
   (backdrop-filter), burbuja animada o mezcla que se repinta le roba tiempo al juego
   y al audio. Mientras hay un juego en marcha se apagan. */
body.playing { background-attachment: scroll; }
body.playing::before, body.playing .aero-bg { display: none; }
body.playing .aero-bg i, body.playing .live-dot { animation: none; }
body.playing .sidebar, body.playing .info-card, body.playing .device-column, body.playing .dropzone,
body.playing .search-box, body.playing .privacy-note, body.playing .tool-chip, body.playing .runtime-badge,
body.playing .topbar, body.playing .toast {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.playing .device-column::before, body.playing .device-column::after { display: none; }
body.playing .phone { box-shadow: 0 18px 30px rgba(0, 0, 0, .7), inset 1px 1px 1px var(--ph-hi), inset -2px -2px 3px #050201; }
body.playing .phone-screen::after { display: none; }
body.playing .phone-screen-frame { box-shadow: inset 0 0 0 1px var(--ph-frame-line); }
.game-frame { contain: strict; }

/* ---------- pantalla completa con marco de teléfono ---------- */
.stage-bar { display: none; }
.phone-wrap.stage-fs {
  position: fixed; inset: 0; z-index: 200; width: 100vw; height: 100vh; height: 100dvh; max-width: none;
  padding: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 80% -5%, rgba(255, 122, 20, .45) 0, transparent 62%),
    radial-gradient(ellipse 60% 45% at 10% 110%, rgba(255, 94, 10, .34) 0, transparent 65%),
    linear-gradient(180deg, #2e1305, #0c0502);
}
.phone-wrap.stage-fs .device-shadow { display: none; }
.phone-wrap.stage-fs .phone {
  flex: none; width: 280px; max-width: none; min-height: 670px;
  transform: scale(var(--stage-scale, 1)); transform-origin: center center;
  box-shadow: 0 0 40px var(--ph-glow), inset 1px 1px 1px var(--ph-hi), inset -2px -2px 3px #050201;
}
/* en pantalla completa siempre se ve el teclado y el D-pad completos */
.phone-wrap.stage-fs .phone .keypad { display: grid; }
.phone-wrap.stage-fs .phone.hide-dpad .dpad { opacity: 1; pointer-events: auto; }
.phone-wrap.stage-fs .phone.hide-keypad .keypad { display: grid; }
.phone-wrap.stage-fs .phone.keypad-hidden { min-height: 670px; }
/* móvil horizontal: pantalla a la izquierda, teclas a la derecha (sigue siendo un solo teléfono) */
.phone-wrap.stage-fs.stage-land .phone {
  display: grid; grid-template-columns: 254px 250px; grid-template-rows: auto 1fr; column-gap: 14px;
  width: auto; min-height: 0; padding: 11px 16px 10px 13px;
}
.stage-land .phone-top { grid-column: 1; grid-row: 1; }
.stage-land .phone-screen-frame { grid-column: 1; grid-row: 2; align-self: start; }
.stage-land .phone-controls { grid-column: 2; grid-row: 1 / 3; padding-top: 4px; }

body.stage-on { overflow: hidden; }
/* un padre con backdrop-filter atraparía al contenedor fijo: se apaga mientras dura el modo */
body.stage-on .device-column { backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
body.stage-on .device-column::before, body.stage-on .device-column::after { display: none; }
body.stage-on .topbar { position: static; }

.phone-wrap.stage-fs .stage-bar {
  display: flex; gap: 6px; position: absolute; z-index: 5;
  top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px);
}
.stage-bar .btn { padding: 7px 11px; font-size: 10px; background: rgba(20, 8, 2, .72); border: 1px solid rgba(255, 200, 140, .5); color: var(--cream); border-radius: 999px; opacity: .6; }
.stage-bar .btn:hover, .stage-bar .btn:focus-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) { .aero-bg i { animation: none; } }
