@font-face { font-family: 'BlurLight'; src: url(../fonts/blurlight.ttf); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: #0d0d0d;
    color: #c0c0c0;
    font-family: 'BlurLight', monospace;
}

body {
    padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
    overflow-y: auto;
}

.page {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 0 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeUp 0.4s ease both;
}

.back {
    font-size: 12px;
    color: #c0c0c0;
    text-decoration: none;
    opacity: 0.3;
    letter-spacing: 2px;
    transition: opacity 0.2s;
}
.back:hover { opacity: 0.8; }

.scores { display: flex; align-items: center; gap: 16px; }

.score-box { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.score-label { font-size: 10px; opacity: 0.35; letter-spacing: 2px; }
.score-val { font-size: 20px; letter-spacing: 1px; }
.lives-val { font-size: 11px; letter-spacing: 3px; margin-top: 2px; }

.new-btn {
    background: transparent;
    border: 1px solid rgba(200,200,200,0.25);
    color: #c0c0c0;
    font-family: 'BlurLight', monospace;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.55;
}
.new-btn:hover { border-color: rgba(200,200,200,0.7); opacity: 1; }

.canvas-wrap {
    position: relative;
    animation: fadeUp 0.5s ease 0.05s both;
}

#canvas {
    display: block;
    width: 100%;
    touch-action: none;
}

.start-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: rgba(13,13,13,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.4s ease both;
}

.start-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.start-hint {
    font-size: 11px;
    opacity: 0.3;
    letter-spacing: 2px;
}

.level-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,13,13,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.3s ease both;
}

.level-num {
    font-size: 28px;
    letter-spacing: 5px;
    opacity: 0.85;
    animation: fadeUp 0.4s ease both;
}

.plays-count {
    font-size: 11px;
    opacity: 0.22;
    letter-spacing: 2px;
    text-align: center;
    animation: fadeUp 0.5s ease 0.12s both;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,13,13,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.3s ease both;
}

.overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
    width: 100%;
}

.over-title { font-size: 22px; letter-spacing: 3px; }
.over-score { font-size: 32px; letter-spacing: 2px; }

.over-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 220px;
}

.nick-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(200,200,200,0.3);
    color: #c0c0c0;
    font-family: 'BlurLight', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 6px 0;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}
.nick-input:focus { border-color: rgba(200,200,200,0.7); }
.nick-input::placeholder { opacity: 0.3; }

.over-btn {
    background: transparent;
    border: 1px solid rgba(200,200,200,0.3);
    color: #c0c0c0;
    font-family: 'BlurLight', monospace;
    font-size: 13px;
    letter-spacing: 2px;
    padding: 7px 0;
    width: 100%;
    max-width: 220px;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.7;
}
.over-btn:hover { border-color: rgba(200,200,200,0.8); opacity: 1; }
.over-btn.secondary { opacity: 0.35; margin-top: 4px; }
.over-btn.secondary:hover { opacity: 0.7; }
.over-saved { font-size: 13px; opacity: 0.5; letter-spacing: 2px; }

.hint {
    font-size: 11px;
    opacity: 0.2;
    letter-spacing: 2px;
    text-align: center;
    animation: fadeUp 0.5s ease 0.1s both;
}

.leaderboard { display: flex; flex-direction: column; gap: 14px; animation: fadeUp 0.5s ease 0.15s both; }
.lb-title { font-size: 13px; opacity: 0.35; letter-spacing: 3px; }
.lb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lb-loading, .lb-empty { font-size: 13px; opacity: 0.25; letter-spacing: 1px; }
.lb-item { display: flex; align-items: baseline; gap: 10px; font-size: 15px; letter-spacing: 0.5px; animation: fadeUp 0.3s ease both; }
.lb-rank { font-size: 11px; opacity: 0.25; letter-spacing: 1px; width: 20px; flex-shrink: 0; }
.lb-nick { flex: 1; opacity: 0.8; }
.lb-score { font-size: 14px; opacity: 0.55; letter-spacing: 1px; }
