*{margin:0;padding:0;box-sizing:border-box}
.game-container{display:flex;flex-direction:column;align-items:center;width:100%;max-width:500px;margin:0 auto;font-family:'Segoe UI',system-ui,sans-serif;background:#0f0d1a;min-height:100vh;color:#e2e8f0}
.game-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px;background:linear-gradient(135deg,#1a1740,#0f0d2e);border-bottom:1px solid rgba(99,102,241,.2)}
.game-title{font-size:18px;font-weight:700;color:#a5b4fc}
.header-right{display:flex;gap:14px}
.stat-box{text-align:center}
.stat-label{display:block;font-size:9px;color:#94a3b8;text-transform:uppercase;letter-spacing:1px}
.stat-value{font-size:22px;font-weight:700}
.stat-value.you{color:#4ade80}.stat-value.ai{color:#ef4444}

.canvas-wrapper{flex:1;display:flex;align-items:center;justify-content:center;width:100%;padding:8px}
#gameCanvas{background:#1a1740;border:2px solid rgba(99,102,241,.3);border-radius:8px}

.game-over-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.75);z-index:10;justify-content:center;align-items:center}
.game-over-overlay.active{display:flex}
.game-over-panel{background:linear-gradient(135deg,#1e1b4b,#0a0737);border:1px solid rgba(99,102,241,.3);border-radius:16px;padding:32px 28px;text-align:center;max-width:320px;width:90%}
.game-over-panel h2{font-size:28px;margin-bottom:12px}
.game-over-panel h2.win{color:#4ade80}.game-over-panel h2.lose{color:#ef4444}
.final-score{font-size:20px;font-weight:700;margin-bottom:20px;color:#a5b4fc}
.restart-btn{padding:12px 36px;font-size:16px;font-weight:700;color:#fff;background:#6366f1;border:none;border-radius:10px;cursor:pointer}
.restart-btn:hover{background:#4f46e5}

/* Mobile virtual controls */
.mobile-controls{display:none;width:100%;padding:8px 16px 16px;justify-content:center;gap:40px}
.ctrl-btn{width:56px;height:56px;font-size:22px;color:#a5b4fc;background:#1a1740;border:2px solid rgba(99,102,241,.3);border-radius:50%;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background .1s}
.ctrl-btn:active{background:#4f46e5;color:#fff}
@media (pointer:coarse){.mobile-controls{display:flex}#gameCanvas{touch-action:none}}

@media (orientation:portrait){#gameCanvas{width:min(94vw,400px);height:min(65vw,280px)}}
@media (orientation:landscape){#gameCanvas{width:min(70vh,400px);height:min(45vh,280px)}}
