:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(20, 30, 48, 0.8);
    --border-color: #1e293b;
    --text-color: #f8fafc;
    --accent-color: #00f2fe;
    --danger: #ff0844;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at center, #1a253c 0%, #0b0f19 100%);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.game-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-box, .stats-box {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.panel-box h3 {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

canvas {
    background: #050505;
    border-radius: 8px;
}

#game-canvas {
    border: 3px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2); /* shadowBlur yerine CSS shadow */
}

.main-panel {
    position: relative;
    display: flex;
}

.stat-item {
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}
.stat-item span {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    letter-spacing: 1px;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 10;
    backdrop-filter: blur(5px);
}
.overlay.hidden { display: none; }

.overlay h2 {
    color: var(--danger);
    font-size: 2rem;
    margin-bottom: 5px;
}

.final-score-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
}
#final-score { font-weight: bold; color: var(--accent-color); }

.leaderboard-container {
    width: 80%;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.leaderboard-container h3 {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}
#leaderboard-list {
    list-style: none;
    font-size: 0.85rem;
}
#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
#leaderboard-list li.highlight {
    color: var(--accent-color);
    font-weight: bold;
    background: rgba(0, 242, 254, 0.1);
}

.action-btn {
    padding: 12px 25px;
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 114, 255, 0.4);
    transition: transform 0.1s;
}
.action-btn:active {
    transform: scale(0.95);
}

#player-name-input {
    width: 80%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}

@media (max-width: 600px) {
    .game-layout { flex-direction: column; gap: 10px; }
    .side-panel { flex-direction: row; justify-content: center; width: 100%; gap: 10px; }
    .stats-box { display: flex; flex-direction: row; gap: 10px; padding: 5px 10px; width: 100%; justify-content: space-between; }
    .stat-item { margin-bottom: 0; padding: 5px 10px; flex: 1; }
    .stat-value { font-size: 1.1rem; }
    #game-canvas { width: 250px; height: 500px; }
    .panel-box h3 { display: none; }
    #next-canvas { width: 80px; height: 80px; }
}