.ph-wrap{display:grid;grid-template-columns:minmax(300px,380px) 1fr;gap:28px;align-items:start;padding-bottom:10px}
.ph{background:linear-gradient(160deg,#5a6c86,#2b3647 60%,#1d2532);border-radius:40px 40px 54px 54px;padding:22px 18px 26px;box-shadow:0 24px 60px rgba(0,0,0,.55),inset 0 2px 0 rgba(255,255,255,.25),inset 0 -6px 0 rgba(0,0,0,.35);touch-action:manipulation;user-select:none;-webkit-user-select:none}
.ph-ear{width:70px;height:8px;margin:0 auto 14px;border-radius:6px;background:repeating-linear-gradient(90deg,#11161e 0 4px,#3a475a 4px 7px)}
.ph-screen{background:#4a5a3a;border-radius:14px;padding:10px;box-shadow:inset 0 0 0 3px #1a1f15}
.ph-screen canvas{display:block;width:100%;height:auto;border-radius:4px;image-rendering:pixelated;touch-action:none;background:#9bbc0f}
.ph-sk{display:flex;justify-content:space-between;font:700 13px "Courier New",monospace;color:#cfe08a;padding:6px 4px 0;min-height:18px}
.ph-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin:16px 0 12px}
.ph-soft{height:44px;border-radius:22px;border:0;background:linear-gradient(#cfd6e2,#8e99ab);color:#2b3647;font-size:14px;cursor:pointer}
.ph-dpad{display:grid;grid-template-columns:44px 52px 44px;grid-template-rows:40px 44px 40px;gap:2px;background:#11161e;border-radius:50%;padding:6px}
.ph-dpad button{border:0;background:#c6ceda;color:#2b3647;cursor:pointer;font-size:14px;border-radius:10px}
.ph-dpad [data-k=up]{grid-column:2;grid-row:1}.ph-dpad [data-k=left]{grid-column:1;grid-row:2}.ph-dpad .ok{grid-column:2;grid-row:2;font-weight:800;background:#e8ecf2}.ph-dpad [data-k=right]{grid-column:3;grid-row:2}.ph-dpad [data-k=down]{grid-column:2;grid-row:3}
.ph-keys{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ph-keys button{min-height:52px;border:0;border-radius:18px 18px 22px 22px;background:linear-gradient(#e9edf3,#b7c0ce);color:#1d2532;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05;box-shadow:0 3px 0 #11161e}
.ph-keys button:active,.ph-dpad button:active,.ph-soft:active{transform:translateY(2px);box-shadow:none}
.ph-keys b{font:800 20px var(--sans)}.ph-keys small{font:600 10px var(--sans);letter-spacing:.06em;text-transform:uppercase;color:#4b5668}
.ph-end{display:block;margin:14px auto 0;width:96px;height:36px;border-radius:18px;border:0;background:#c0392b;color:#fff;font-weight:800;cursor:pointer}
.ph-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.ph-tab{border:1px solid var(--line);background:var(--bg-3);color:var(--ink);border-radius:999px;padding:10px 16px;min-height:44px;font:700 15px var(--sans);cursor:pointer}
.ph-tab.on{background:var(--gold);color:#16051a;border-color:var(--gold)}
.ph-help h2{margin-top:0}
.ph-presets{display:flex;flex-direction:column;gap:6px;max-width:420px}
.ph-pre{text-align:left;border:1px solid var(--line);background:var(--bg-3);color:var(--ink);border-radius:10px;padding:10px 12px;min-height:44px;cursor:pointer}
@media (max-width:760px){.ph-wrap{grid-template-columns:1fr}.ph{max-width:360px;margin:0 auto}}
#ph-share[hidden]{display:none}
