/* Dashboard previews stay at 240x320; expanded windows use the game's native resolution. */
.session-card .preview-screen{width:120px;height:160px;aspect-ratio:3 / 4;margin:0 auto}.session-card .session-preview{min-height:182px;display:flex;align-items:center;justify-content:center}.session-card .open-runtime{left:24px;right:24px;bottom:20px}.session-card .session-preview:hover .open-runtime{opacity:1}
.session-card .preview-screen{width:240px;height:320px;flex-shrink:0}
.session-card .session-preview{min-height:340px;padding:10px;position:relative}
.j2me-player{width:240px;flex-shrink:0;color:#ddd7f5;outline:none;font-family:system-ui,sans-serif}
.j2me-player,.j2me-player *{box-sizing:border-box}
.j2me-player:focus-visible{outline:2px solid #a899ff;outline-offset:5px;border-radius:8px}
.j2me-display{position:relative;width:240px;height:320px;background:#000;overflow:hidden;border-radius:4px}
.j2me-display canvas{display:block;width:240px;height:320px;touch-action:none;image-rendering:pixelated;object-fit:contain}
/* Native PNG dimensions must not change the dashboard card's viewport. */
.session-card:not(.auth-demo) .j2me-player{width:240px;min-width:240px;max-width:240px;flex:none}
.session-card:not(.auth-demo) .j2me-display{width:240px;min-width:240px;max-width:240px;height:320px;min-height:320px;max-height:320px;flex:none;aspect-ratio:3 / 4}
.session-card:not(.auth-demo) .j2me-display canvas{width:240px;height:320px;min-width:240px;max-width:240px;min-height:320px;max-height:320px;object-fit:contain;object-position:center}
.j2me-overlay{position:absolute;inset:0;background:rgba(8,10,20,.88);display:flex;align-items:center;justify-content:center;text-align:center;padding:16px;color:#d5cef2;font-size:13px;line-height:1.6;pointer-events:none}
.j2me-overlay[hidden]{display:none}
.j2me-player button{display:flex;align-items:center;justify-content:center;background:#252539;color:#eee9ff;border:1px solid #42415d;border-radius:5px;font-size:14px;font-weight:600;min-height:24px;cursor:pointer;touch-action:none;user-select:none;padding:0;box-shadow:0 1px 0 #10101e}
.j2me-phone-controls,.j2me-phone-controls *,.tab-actions,.tab-actions *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.j2me-player button:hover{background:#36334f}
.j2me-player button:active,.j2me-player button.pressed{background:#6d57c9;border-color:#b3a1ff;box-shadow:none}
.j2me-phone-controls{display:grid;grid-template-columns:60px 100px 60px;gap:10px;margin:8px 0 6px;align-items:start}
.j2me-idle button[data-key]:disabled{cursor:default;color:#a69dbc;opacity:.7}.j2me-idle button[data-key]:disabled:hover{background:#252539}.j2me-idle .j2me-display .open-runtime{width:216px}
.j2me-side-keys{display:flex;flex-direction:column;justify-content:space-between;height:84px}.j2me-side-keys button{font-size:11px;height:24px}.j2me-side-keys [data-key=ASTERISK],.j2me-side-keys [data-key=POUND]{font-size:17px}.j2me-triangle{display:block;width:10px;height:8px;background:currentColor;clip-path:polygon(50% 0,100% 100%,0 100%)}.j2me-triangle.direction-left{transform:rotate(-90deg)}.j2me-triangle.direction-right{transform:rotate(90deg)}.j2me-triangle.direction-down{transform:rotate(180deg)}
.j2me-dpad{display:grid;grid-template-columns:repeat(3,30px);grid-template-rows:24px 30px 24px;justify-content:center;gap:3px}
.j2me-dpad [data-key=UP]{grid-area:1/2}.j2me-dpad [data-key=LEFT]{grid-area:2/1}.j2me-dpad [data-key=SELECT]{grid-area:2/2;width:30px;height:30px;font-size:10px;background:#413760;border-color:#78649d;border-radius:4px}.j2me-dpad [data-key=RIGHT]{grid-area:2/3}.j2me-dpad [data-key=DOWN]{grid-area:3/2}
.standalone-player{margin:0;background:#12121d;color:#eee9ff;font-family:system-ui,sans-serif;display:flex;justify-content:center;padding:24px}
.standalone-player main{width:280px}.standalone-player a{color:#b4a3ff;font-size:13px;text-decoration:none}.standalone-player h1{font-size:18px}.standalone-player .j2me-player{margin:auto}.player-help{font-size:12px;line-height:1.6;color:#aaa2c4}
.standalone-player main{width:max(280px,var(--player-frame-width,256px));max-width:100%;min-width:0}.standalone-player .j2me-player{width:100%;height:100%;display:flex;flex-direction:column}.standalone-player .j2me-display{width:100%;height:auto;flex:1;min-height:0;aspect-ratio:auto;margin:0}.standalone-player .j2me-display canvas{width:100%;height:100%}.standalone-player .j2me-phone-controls{width:240px;flex-shrink:0;margin:8px auto 6px}
.player-resize-frame{box-sizing:border-box;position:relative;width:256px;height:434px;padding:8px;margin:0 auto;border-radius:8px;background:#1b1b2c;box-shadow:inset 0 0 0 1px #42415d;outline:none}.player-resize-frame:focus-visible{box-shadow:inset 0 0 0 2px #a899ff}.player-resize-edge{position:absolute;display:block;touch-action:none;user-select:none;z-index:3}.player-resize-edge[data-resize=n],.player-resize-edge[data-resize=s]{left:8px;right:8px;height:8px;cursor:ns-resize}.player-resize-edge[data-resize=n]{top:0}.player-resize-edge[data-resize=s]{bottom:0}.player-resize-edge[data-resize=e],.player-resize-edge[data-resize=w]{top:8px;bottom:8px;width:8px;cursor:ew-resize}.player-resize-edge[data-resize=e]{right:0}.player-resize-edge[data-resize=w]{left:0}.player-resize-edge[data-resize=ne],.player-resize-edge[data-resize=nw],.player-resize-edge[data-resize=se],.player-resize-edge[data-resize=sw]{width:8px;height:8px}.player-resize-edge[data-resize=ne]{right:0;top:0;cursor:nesw-resize}.player-resize-edge[data-resize=nw]{left:0;top:0;cursor:nwse-resize}.player-resize-edge[data-resize=se]{right:0;bottom:0;cursor:nwse-resize}.player-resize-edge[data-resize=sw]{left:0;bottom:0;cursor:nesw-resize}
.session-card .preview-screen small{white-space:normal;overflow-wrap:anywhere;max-height:190px;overflow:auto;padding:8px;line-height:1.5}
.session-card .runtime-connected{flex-direction:column;gap:8px}
.session-card{position:relative}.session-card .session-card-head{padding-right:12px}.session-card .session-preview{padding:10px;min-height:340px}.session-card .runtime-connected{min-height:0}
.tab-actions{position:absolute;right:6px;top:74px;display:flex;flex-direction:column;gap:7px;z-index:2}
.tab-actions button,.tab-actions a{width:28px;height:28px;display:grid;place-items:center;border:1px solid #34344d;border-radius:5px;background:#1b1c2c;color:#b9acd9;font:18px system-ui,sans-serif;padding:0;text-decoration:none;cursor:pointer}
.tab-actions .close-runtime{color:#d9a3b2}.tab-actions button:hover,.tab-actions a:hover{background:#3e3254;color:#fff}.tab-actions button:disabled{opacity:.3;cursor:wait}.tab-actions .close-runtime:hover{background:#733c50}
.tab-actions .delete-tab{color:#ff969f}.tab-actions .delete-tab:hover{background:#733c50}
.j2me-readonly .j2me-phone-controls{display:none}.j2me-readonly canvas{pointer-events:none}
.tab-actions svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:360px){.tab-actions{right:2px}.tab-actions button,.tab-actions a{width:20px;height:26px}.tab-actions svg{width:15px;height:15px}}
.tab-action-error{color:#f4b878;font-size:11px;margin:0;padding:8px 12px;overflow-wrap:anywhere}
.session-card .session-card-body{padding:12px;min-height:46px;border-top:1px solid #353550;background:linear-gradient(90deg,#161d30,#252240,#161d30)}.session-card .session-remaining{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;text-align:center}.session-card .session-remaining small{font:600 12px system-ui,sans-serif;color:#c5bddf}.session-card .session-remaining b{margin:0;font:700 20px system-ui,sans-serif;color:#f1eaff;font-variant-numeric:tabular-nums}
.runtime-tab{display:inline-flex;align-items:center;gap:7px;font:600 12px system-ui,sans-serif;color:#c5bddf}.tab-java-icon{display:block;object-fit:contain;flex-shrink:0}.session-card .session-card-head{min-height:48px;padding-top:6px;padding-bottom:6px}.session-card .preview-screen small{font-size:10px}.session-card[data-accept-jar=true] .preview-screen:after{content:'hoặc kéo thả file .jar vào tab';display:block;color:#a59abf;font:10px system-ui,sans-serif;margin-top:8px}.session-card.jar-dragover{border-color:#a995ff;box-shadow:0 0 0 2px #a995ff}.jar-dragover .preview-screen{background:#31264b}.jar-uploading .upload-to-tab{cursor:wait}.tab-action-error.upload-progress{color:#bbaaff;text-align:center}.tab-jar-input[hidden]{display:none!important}
.runtime-error-log{padding:10px 16px;color:#f4b878;font-size:12px}
.runtime-error-log summary{cursor:pointer}
.runtime-error-log pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto;line-height:1.5}
