* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #e8ecff;
    -webkit-user-select: none;
    user-select: none;
}

#app {
    width: 100%;
    height: 100%;
}

/* ---------- Game shell ---------- */

.game-shell {
    position: relative;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
    cursor: crosshair;
    overflow: hidden;
}

.game-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- HUD ---------- */

.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 26px;
    pointer-events: none;
    font-size: 13px;
    letter-spacing: 3px;
    color: #8a91c7;
    text-shadow: 0 0 12px rgba(74, 158, 255, 0.6);
}

.hud-item span {
    margin-left: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #e8ecff;
    letter-spacing: 1px;
}

.hud-center {
    text-align: center;
}

.lives {
    display: inline-flex;
    gap: 6px;
    margin-left: 10px;
    vertical-align: middle;
}

.lives i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #ff6b6b 55%, #c73e3e);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

.muted-flag {
    margin-right: 14px;
    font-weight: 700;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

/* ---------- Active power-up chips ---------- */

.effects {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    pointer-events: none;
}

.effect {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    border: 1px solid currentColor;
    background: rgba(10, 10, 26, 0.7);
}

.effect.multi {
    color: #ff6b6b;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.6);
}

.effect.rapid {
    color: #4ecdc4;
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.6);
}

.effect.shield {
    color: #ffe66d;
    box-shadow: 0 0 12px rgba(255, 230, 109, 0.6);
}

.effect.freeze {
    color: #95e1d3;
    box-shadow: 0 0 12px rgba(149, 225, 211, 0.6);
}

/* ---------- Overlays ---------- */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    pointer-events: none;
    text-align: center;
}

.title {
    font-size: clamp(40px, 9vw, 88px);
    font-weight: 900;
    letter-spacing: 14px;
    line-height: 0.95;
    color: #e8ecff;
    text-shadow:
        0 0 18px rgba(74, 158, 255, 0.9),
        0 0 60px rgba(74, 158, 255, 0.55);
}

.title span {
    display: block;
    background: linear-gradient(90deg, #ff6b6b, #ffe66d, #4ecdc4, #4a9eff, #95e1d3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.banner {
    font-size: clamp(32px, 6vw, 60px);
    font-weight: 900;
    letter-spacing: 10px;
    color: #4ecdc4;
    text-shadow: 0 0 24px rgba(78, 205, 196, 0.8);
    animation: bannerPop 0.35s ease-out;
}

.banner.gameover {
    color: #ff6b6b;
    text-shadow: 0 0 24px rgba(255, 107, 107, 0.8);
}

@keyframes bannerPop {
    from { opacity: 0; transform: scale(1.6); }
    to   { opacity: 1; transform: scale(1); }
}

.finalscore {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
}

.newhigh {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 5px;
    color: #ffe66d;
    text-shadow: 0 0 18px rgba(255, 230, 109, 0.9);
}

.hint {
    font-size: 15px;
    letter-spacing: 5px;
    color: #4a9eff;
    text-shadow: 0 0 14px rgba(74, 158, 255, 0.8);
}

.subhint {
    font-size: 12px;
    letter-spacing: 3px;
    color: #8a91c7;
}

.spikes-note {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff6b6b;
    text-shadow: 0 0 14px rgba(255, 107, 107, 0.8);
}

.pulse {
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ---------- Leaderboard & name entry ---------- */

.leaderboard {
    border-collapse: collapse;
    font-size: 15px;
    letter-spacing: 2px;
}

.leaderboard td {
    padding: 3px 14px;
    text-align: left;
}

.leaderboard td:last-child {
    text-align: right;
    font-weight: 700;
}

.leaderboard tr.me td {
    color: #ffe66d;
    text-shadow: 0 0 12px rgba(255, 230, 109, 0.8);
}

.name-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.name-entry input {
    width: 220px;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    color: #e8ecff;
    background: rgba(14, 17, 48, 0.9);
    border: 1px solid #4a9eff;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 0 14px rgba(74, 158, 255, 0.4);
}

.name-entry button {
    padding: 8px 26px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #0a0a1a;
    background: #4ecdc4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(78, 205, 196, 0.6);
}

.name-entry button:hover {
    background: #6fe0d8;
}

/* ---------- Boot / loading screen ---------- */

.boot {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.boot-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 10px;
    text-shadow: 0 0 18px rgba(74, 158, 255, 0.9);
}

.boot-title span {
    display: block;
    text-align: center;
    background: linear-gradient(90deg, #ff6b6b, #ffe66d, #4ecdc4, #4a9eff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.loading-progress {
    width: 8rem;
    height: 8rem;
}

.loading-progress circle {
    fill: none;
    stroke: #1d2352;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #4a9eff;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    font-size: 14px;
    letter-spacing: 4px;
    color: #8a91c7;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "LOADING");
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    background: #2a0b1e;
    color: #ffb3cd;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.5);
    display: none;
    left: 0;
    padding: 0.6rem 2.5rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10;
    font-size: 14px;
}

#blazor-error-ui .reload {
    color: #4a9eff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
