* {
    box-sizing: border-box;
}

html,
body {
    background-color: #0f0f0f;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    height: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.start-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    padding: 20px;
    overflow: auto;
}

.start-overlay.hidden {
    display: none;
}

.start-card {
    width: min(520px, 100%);
    background: rgba(18, 18, 18, 0.94);
    border: 2px solid #8ACE00;
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.start-card h2 {
    margin: 0 0 12px;
    font-size: 32px;
    letter-spacing: 1px;
}

.start-card p {
    margin: 8px 0;
    font-size: 18px;
}

#startGameBtn {
    margin-top: 16px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: #8ACE00;
    color: #111;
    font-size: 19px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
}

#startGameBtn:hover {
    filter: brightness(1.05);
}

.bg-marquee {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background-color: #0f0f0f;
}

.bg-row {
    height: clamp(26px, 3.2vh, 44px);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.bg-track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    font-family: "Courier New", monospace;
    font-size: clamp(20px, 2.4vw, 34px);
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(138, 206, 0, 0.17);
    animation: marqueeLeft 110s linear infinite;
}

.bg-row.reverse .bg-track {
    animation-name: marqueeRight;
}

.bg-track > span {
    padding-right: 2rem;
}

.page-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
}

@keyframes marqueeLeft {
    from {
        transform: translateX(0%);
    }
    to {
        transform: translateX(-50%);
    }
}

@keyframes marqueeRight {
    from {
        transform: translateX(-50%);
    }
    to {
        transform: translateX(0%);
    }
}

.header h1 {
    margin: 20px 0;
    font-size: 40px;
    letter-spacing: 2px;
}


canvas {
    background-color: #8ACE00;
    border: 3px solid white;
    display: block;
    margin: 10px auto;
    width: min(800px, calc(100vw - 24px), calc(100vh - 190px));
    height: auto;
    aspect-ratio: 1 / 1;
    box-shadow: 0 0 20px #aaff00;
}

#tocke, #cas {
    font-weight: bold;
    font-size: 20px;
}

.page-content > div {
    margin: 0;
}

.page-content > div + div {
    margin-top: 10px;
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 20px;
}

@media (max-height: 760px) {
    .start-card h2 {
        font-size: 28px;
    }

    .start-card p {
        font-size: 16px;
    }
}
