* { box-sizing: border-box; }

body {
    margin: 0;
    background: #03040a;
    font-family: "Orbitron", sans-serif;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

a { color: #8CBF35; }

/* ---------- Game ---------- */

#game-container {
    width: 900px;
    height: 600px;
    background: radial-gradient(circle at center, #0a0f2b, #03040a);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    font-size: 16px;
}

.panel {
    background: rgba(0,0,0,0.4);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

#center-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

#center-overlay h1 {
    font-size: 42px;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.btn {
    margin-top: 20px;
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #8CBF35, #5E8524);
    color: #000;
    box-shadow: 0 0 15px rgba(140,191,53,0.7);
    transition: 0.15s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.btn.secondary {
    background: linear-gradient(135deg, #333, #111);
    color: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
}

/* ---------- Top bar (nav on game/highscore pages) ---------- */

#topbar {
    width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

#topbar .links a {
    margin-left: 16px;
    text-decoration: none;
    font-weight: 700;
}

/* ---------- Auth pages (Login / Registrierung) ---------- */

.auth-card {
    width: 380px;
    background: radial-gradient(circle at center, #131f0a, #03040a);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    padding: 32px 30px;
}

.auth-card h1 {
    font-size: 26px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0;
    text-align: center;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #C9E28F;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2A3A12;
    background: #0A1206;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

.field input:focus {
    outline: none;
    border-color: #8CBF35;
}

.auth-card .btn {
    width: 100%;
    text-align: center;
    margin-top: 6px;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #C9E28F;
}

.error-box {
    background: rgba(255,0,90,0.15);
    border: 1px solid rgba(255,0,90,0.5);
    color: #ff5f9e;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.success-box {
    background: rgba(0,255,170,0.1);
    border: 1px solid rgba(0,255,170,0.5);
    color: #6affc9;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ---------- Highscore page ---------- */

#user-header {
    width: 700px;
    box-sizing: border-box;
    margin: 0 auto 16px;
    padding: 14px 24px;
    background: radial-gradient(circle at center, #0a0f2b, #03040a);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    font-size: 14px;
    text-align: left;
}

#highscore-card {
    width: 700px;
    background: radial-gradient(circle at center, #0a0f2b, #03040a);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    padding: 30px;
}

#highscore-card h1 {
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0;
}

table.scores {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-scroll {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #8CBF35 #0a0f2b;
}

.table-scroll::-webkit-scrollbar {
    width: 10px;
}

.table-scroll::-webkit-scrollbar-track {
    background: #0a0f2b;
    border-radius: 10px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8CBF35, #5E8524);
    border-radius: 10px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #8CBF35;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    background: #0a0f2b;
    z-index: 1;
}

table.scores th, table.scores td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #2A3A12;
}

table.scores th {
    color: #C9E28F;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

table.scores tr.me {
    background: rgba(140,191,53,0.08);
}

table.scores td.rank {
    color: #8CBF35;
    font-weight: 700;
    width: 40px;
}