:root{--bg: #0f1117;--surface: #1a1d27;--surface2: #252838;--border: #2e3248;--accent: #7c6af7;--accent-hover: #9b8ef9;--text: #e8eaf6;--text-muted: #8b8fa8;--success: #4caf7d;--error: #e05555;--warning: #f0a050;--radius: 8px;--sidebar-w: 320px}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;overflow:hidden}body{background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif;font-size:14px;line-height:1.5}#app{width:100%;height:100%;display:flex;flex-direction:column}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 16px;border-radius:var(--radius);border:none;cursor:pointer;font-size:14px;font-weight:500;transition:opacity .15s,background .15s}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover:not(:disabled){background:var(--accent-hover)}.btn-ghost{background:transparent;color:var(--text-muted);border:1px solid var(--border)}.btn-ghost:hover:not(:disabled){background:var(--surface2);color:var(--text)}.btn-danger{background:var(--error);color:#fff}input,select{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);color:var(--text);padding:8px 12px;font-size:14px;width:100%;outline:none}input:focus,select:focus{border-color:var(--accent)}input::placeholder{color:var(--text-muted)}label{display:block;margin-bottom:4px;color:var(--text-muted);font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:.05em}.form-group{margin-bottom:14px}.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:99px;font-size:12px;font-weight:500}.chip-green{background:#4caf7d33;color:var(--success)}.chip-red{background:#e0555533;color:var(--error)}.chip-yellow{background:#f0a05033;color:var(--warning)}.chip-purple{background:#7c6af733;color:var(--accent)}.dashboard{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden}.dash-topbar{padding:14px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.dash-topbar h1{font-size:18px;font-weight:600}.dash-topbar-actions{display:flex;gap:10px;align-items:center}.dash-body{flex:1;overflow-y:auto;padding:24px}.game-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}.game-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:12px;transition:border-color .15s}.game-card:hover{border-color:var(--accent)}.game-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.game-card-title{font-size:15px;font-weight:600;line-height:1.3;word-break:break-word}.game-card-system{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin-top:2px}.game-card-files{display:flex;flex-direction:column;gap:4px}.file-row{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-muted)}.file-row .dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.file-row .dot.have{background:var(--success)}.file-row .dot.missing{background:var(--border)}.file-row.clickable{cursor:pointer}.file-row.clickable:hover{color:var(--text)}.game-card-actions{display:flex;gap:8px;margin-top:auto}.game-card-actions .btn-play{flex:1;background:var(--accent);color:#fff;padding:8px;border-radius:var(--radius);border:none;cursor:pointer;font-size:13px;font-weight:600;transition:background .15s;display:flex;align-items:center;justify-content:center;gap:6px}.game-card-actions .btn-play:hover{background:var(--accent-hover)}.game-card-actions .btn-play:disabled{opacity:.45;cursor:not-allowed}.add-game-card{background:transparent;border:2px dashed var(--border);border-radius:12px;padding:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;cursor:pointer;min-height:160px;color:var(--text-muted);transition:border-color .15s,color .15s}.add-game-card:hover{border-color:var(--accent);color:var(--accent)}.add-game-card .plus{font-size:28px;line-height:1}.add-game-card span{font-size:13px;font-weight:500}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;color:var(--text-muted);text-align:center;gap:10px}.empty-state h3{font-size:16px;color:var(--text)}.add-game-modal .drop-zone{margin-bottom:8px}.add-game-modal .step{margin-bottom:20px}.add-game-modal .step h4{font-size:13px;font-weight:600;margin-bottom:6px}.add-game-modal .optional-tag{display:inline-block;font-size:10px;font-weight:400;color:var(--text-muted);margin-left:6px;text-transform:uppercase}.auth-page{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bg)}.auth-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:36px;width:360px;max-width:90vw}.auth-card h1{font-size:22px;margin-bottom:6px}.auth-card p{color:var(--text-muted);margin-bottom:24px}.auth-error{color:var(--error);font-size:13px;margin-top:10px;min-height:20px}.loading-page{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}.loading-card{width:100%;max-width:680px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.loading-header{display:flex;align-items:flex-start;gap:16px;padding:20px 24px 16px}.loading-header h2{font-size:16px;margin:0 0 4px}.loading-status-text{color:var(--text-muted);font-size:13px;margin:0}.terminal-box{background:#0d0d0d;margin:0 24px;border-radius:6px;height:280px;overflow-y:auto;font-family:Courier New,monospace;font-size:12px;line-height:1.5;padding:12px;border:1px solid #333;scrollbar-width:thin;scrollbar-color:#444 transparent}.terminal-line{color:#c8c8c8;white-space:pre-wrap;word-break:break-all}.loading-footer{padding:16px 24px;display:flex;align-items:center;gap:16px}.status-bar{flex:1;height:4px;background:var(--surface-2);border-radius:2px;overflow:hidden}.status-bar-fill{height:100%;background:var(--accent);border-radius:2px;transition:width .5s ease}.spinner{width:32px;height:32px;flex-shrink:0;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.upload-page{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;padding:40px 20px;overflow-y:auto}.upload-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:32px;width:500px;max-width:100%}.upload-card h2{font-size:18px;margin-bottom:6px}.upload-card>p{color:var(--text-muted);margin-bottom:24px}.drop-zone{border:2px dashed var(--border);border-radius:var(--radius);padding:24px;text-align:center;cursor:pointer;transition:border-color .2s,background .2s;color:var(--text-muted);margin-bottom:12px}.drop-zone:hover,.drop-zone.drag-over{border-color:var(--accent);background:#7c6af70f}.drop-zone.has-file{border-color:var(--success);color:var(--success)}.upload-progress-wrap{margin-top:10px;background:var(--surface-2);border-radius:4px;height:6px;position:relative;overflow:hidden}.upload-progress-bar{height:100%;background:var(--accent);border-radius:4px;transition:width .15s ease;width:0%}.upload-progress-label{display:block;text-align:center;font-size:11px;color:var(--text-muted);margin-top:4px}.upload-section{margin-bottom:24px}.upload-section h3{font-size:14px;font-weight:600;margin-bottom:8px}.upload-optional{font-size:12px;color:var(--text-muted);margin-bottom:8px}.upload-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:8px}.play-page{width:100%;height:100%;display:flex}.emulator-area{flex:1;min-width:0;position:relative;background:#000;display:flex;align-items:center;justify-content:center}#emulator-container{width:100%;height:100%}#emulator-container canvas{width:100%!important;height:100%!important;object-fit:contain}.ap-sidebar{width:var(--sidebar-w);flex-shrink:0;background:var(--surface);border-left:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}.sidebar-header{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}.sidebar-header h2{font-size:15px;font-weight:600}.sidebar-tabs{display:flex;border-bottom:1px solid var(--border)}.sidebar-tab{flex:1;padding:10px;text-align:center;cursor:pointer;font-size:13px;color:var(--text-muted);border-bottom:2px solid transparent;transition:color .15s}.sidebar-tab.active{color:var(--accent);border-bottom-color:var(--accent)}.sidebar-content{flex:1;overflow-y:auto;padding:14px}.ap-connect-form .form-group{margin-bottom:10px}.ap-status{display:flex;align-items:center;gap:8px;margin-bottom:14px;font-size:13px}.item-log{display:flex;flex-direction:column;gap:6px}.item-entry{background:var(--surface2);border-radius:var(--radius);padding:8px 10px;font-size:12px}.item-entry .item-name{font-weight:600;color:var(--accent)}.item-entry .item-from{color:var(--text-muted)}.chat-log{display:flex;flex-direction:column;gap:4px;font-size:12px;padding-bottom:8px}.chat-msg{padding:4px 6px;border-radius:4px;line-height:1.4;word-break:break-word}.chat-msg.info{color:var(--text-muted)}.chat-msg.item-recv{background:#7c6af71f}.chat-msg.hint{background:#f0a0501a}.admin-page{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden}.admin-topbar{padding:14px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.admin-topbar h1{font-size:18px}.admin-body{flex:1;overflow-y:auto;padding:20px}.user-table{width:100%;border-collapse:collapse}.user-table th,.user-table td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--border)}.user-table th{color:var(--text-muted);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.user-table tr:hover td{background:var(--surface2)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100}.modal{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:28px;width:380px;max-width:90vw}.modal h3{margin-bottom:18px;font-size:16px}.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}.mobile-controls{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:10;-webkit-user-select:none;user-select:none;touch-action:none}.ctrl-btn{position:absolute;pointer-events:all;background:#ffffff26;border:2px solid rgba(255,255,255,.25);border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .1s}.ctrl-btn:active{background:#ffffff59}.ctrl-btn.dpad-up{width:44px;height:44px;bottom:148px;left:56px;border-radius:8px 8px 0 0}.ctrl-btn.dpad-down{width:44px;height:44px;bottom:60px;left:56px;border-radius:0 0 8px 8px}.ctrl-btn.dpad-left{width:44px;height:44px;bottom:104px;left:12px;border-radius:8px 0 0 8px}.ctrl-btn.dpad-right{width:44px;height:44px;bottom:104px;left:100px;border-radius:0 8px 8px 0}.ctrl-btn.btn-a{width:52px;height:52px;bottom:90px;right:20px;background:#dc323259}.ctrl-btn.btn-b{width:52px;height:52px;bottom:150px;right:80px;background:#dcdc3240}.ctrl-btn.btn-x{width:44px;height:44px;bottom:210px;right:28px;background:#3264dc4d}.ctrl-btn.btn-y{width:44px;height:44px;bottom:150px;right:138px;background:#32b43240}.ctrl-btn.btn-start{width:52px;height:28px;bottom:40px;left:50%;transform:translate(10px);border-radius:14px;font-size:11px}.ctrl-btn.btn-select{width:52px;height:28px;bottom:40px;left:50%;transform:translate(-62px);border-radius:14px;font-size:11px}.ctrl-btn.btn-l{width:64px;height:28px;bottom:auto;top:8px;left:8px;border-radius:14px;font-size:13px}.ctrl-btn.btn-r{width:64px;height:28px;bottom:auto;top:8px;right:8px;border-radius:14px;font-size:13px}@media (max-width: 768px){.play-page{flex-direction:column}.ap-sidebar{width:100%;height:220px;border-left:none;border-top:1px solid var(--border)}:root{--sidebar-w: 100%}.ctrl-btn.btn-start{transform:translate(8px)}.ctrl-btn.btn-select{transform:translate(-60px)}}
