* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0d0f1a;
    color: #e6e8f0;
    min-height: 100vh;
}

.auth-body {
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #1a2040, #06070d 70%);
}

.auth-card {
    width: 360px;
    padding: 36px 30px;
    border-radius: 18px;
    background: rgba(22, 26, 46, .85);
    border: 1px solid rgba(120, 140, 255, .18);
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 80px rgba(80,110,255,.08);
    backdrop-filter: blur(10px);
    text-align: center;
}

.auth-card h1 {
    font-size: 28px; letter-spacing: 3px; margin-bottom: 6px;
    text-shadow: 0 0 18px rgba(120,150,255,.7);
}
.auth-card h1 span { color: #ff5470; text-shadow: 0 0 18px rgba(255,84,112,.8); }
.auth-card .sub { color: #7e86a8; margin-bottom: 24px; font-size: 14px; letter-spacing: 1px; }

.auth-card input {
    width: 100%; padding: 13px 15px; margin-bottom: 12px;
    border-radius: 10px; border: 1px solid rgba(120,140,255,.22);
    background: #0f1225; color: #e6e8f0; font-size: 15px;
    transition: .2s;
}
.auth-card input:focus {
    outline: none; border-color: #5a7bff;
    box-shadow: 0 0 0 3px rgba(90,123,255,.15);
}

.auth-card button {
    width: 100%; padding: 13px; margin-top: 6px;
    border: none; border-radius: 10px; cursor: pointer;
    font-weight: 700; letter-spacing: 2px; font-size: 14px;
    background: linear-gradient(135deg, #5a7bff, #a24bff);
    color: #fff;
    box-shadow: 0 8px 25px rgba(90,123,255,.35);
    transition: .2s;
}
.auth-card button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(90,123,255,.5); }

.alt { margin-top: 18px; font-size: 13px; color: #7e86a8; }
.alt a { color: #7fa2ff; text-decoration: none; }
.alt a:hover { text-decoration: underline; }

.flash {
    background: rgba(255,84,112,.15); border: 1px solid rgba(255,84,112,.4);
    color: #ff8ba0; padding: 10px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}

.game-body { display: flex; flex-direction: column; align-items: center; padding: 14px; }

.topbar {
    width: 100%; max-width: 980px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 4px 14px;
}
.brand { font-weight: 800; letter-spacing: 3px; color: #8ea3ff; text-shadow: 0 0 15px rgba(120,150,255,.5); }
.user-info { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.user-info .nick { color: #ffd166; font-weight: 700; }
.user-info .stats { color: #7e86a8; }
.user-info .stats b { color: #fff; }
.logout { color: #ff5470; text-decoration: none; font-size: 13px; }
.logout:hover { text-decoration: underline; }

.game-wrap { width: 100%; max-width: 980px; }

.hud { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.side { flex: 1; }
.side.right { text-align: right; }
.pname { font-size: 13px; font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; color: #b8c1e6; }
.hpbar {
    height: 20px; background: #151a30; border-radius: 10px;
    border: 1px solid rgba(120,140,255,.25);
    overflow: hidden; position: relative;
}
.hpfill { height: 100%; width: 100%; border-radius: 10px; transition: width .18s cubic-bezier(.2,.8,.3,1); }
.hpfill.p1 { background: linear-gradient(90deg, #22d3a7, #4ade80); box-shadow: 0 0 12px rgba(74,222,128,.5) inset; }
.hpfill.p2 { background: linear-gradient(90deg, #ff5470, #ff8a5b); box-shadow: 0 0 12px rgba(255,84,112,.5) inset; }
.side.right .hpfill { margin-left: auto; }
.vs { font-weight: 900; font-size: 18px; color: #5a6a9a; letter-spacing: 2px; }

.canvas-box { position: relative; border-radius: 14px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(120,140,255,.15); }

canvas { display: block; width: 100%; height: auto; background: #0a0d18; }

.overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(6,8,16,.82); backdrop-filter: blur(6px);
    gap: 12px; animation: fadeIn .3s ease;
}
.overlay.hidden { display: none; }
.overlay h1 { font-size: 52px; letter-spacing: 6px; }
.overlay h1.win { color: #4ade80; text-shadow: 0 0 40px rgba(74,222,128,.7); }
.overlay h1.lose { color: #ff5470; text-shadow: 0 0 40px rgba(255,84,112,.7); }
.overlay p { color: #9aa3c7; }
.overlay button {
    margin-top: 10px; padding: 13px 30px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #5a7bff, #a24bff); color: #fff;
    font-weight: 700; letter-spacing: 2px; cursor: pointer; font-size: 14px;
    box-shadow: 0 10px 30px rgba(90,123,255,.4);
    transition: .2s;
}
.overlay button:hover { transform: translateY(-2px); }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.controls {
    margin-top: 12px; display: flex; flex-wrap: wrap; gap: 18px;
    justify-content: center; font-size: 13px; color: #8a93b8;
}
kbd {
    display: inline-block; padding: 3px 8px; margin-right: 4px;
    background: #1a2040; border: 1px solid rgba(120,140,255,.3);
    border-bottom-width: 2px; border-radius: 5px; font-size: 11px;
    font-family: inherit; color: #c8d1f5;
}
.hint { color: #ffb648; }