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

:root {
    --restart-overlay-offset: 120px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #210e56;
    padding: 30px 16px 60px;
    min-height: 100vh;
    color: #210e56;
}

#site-footer {
    margin-top: 30px;
    text-align: center;
    color: #e0dbff;
    font-size: 14px;
    letter-spacing: 0.03em;
}

.footer-in-overlay {
    color: #fff;
    opacity: 0.95;
}

.inactive-container {
    visibility: hidden;
    pointer-events: none;
}

#hero-logo {
    text-align: center;
    margin-bottom: 20px;
}

#hero-logo img {
    width: clamp(110px, 30vw, 220px);
    max-width: 60vw;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    background: white;
    padding: clamp(20px, 4vw, 32px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#start-screen,
#game-area {
    max-width: 760px;
    margin: 0 auto;
    padding-left: 3px;
    padding-right: 3px;
}

.canvas-wrapper {
    position: relative;
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

#duck {
    position: absolute;
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 10;
    left: 0;
    top: 0;
}

.hidden {
    display: none !important;
}

#gameCanvas {
    border: 3px solid #210e56;
    border-radius: 8px;
    background: #e3f2fd;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    width: 100%;
    height: auto;
}

#score {
    font-size: 24px;
    font-weight: bold;
    color: #210e56;
    margin: 15px 0;
}

#highScore {
    font-size: 18px;
    color: #210e56;
    margin: 10px 0;
}

#restart-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(33, 14, 86, 0) 0,
            rgba(33, 14, 86, 0) calc(var(--restart-overlay-offset, 0px)),
            rgba(33, 14, 86, 0.85) calc(var(--restart-overlay-offset, 0px)),
            rgba(33, 14, 86, 0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: calc(var(--restart-overlay-offset, 0px) + 40px) 16px 40px;
    z-index: 1000;
}

#restart {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 3px solid #210e56;
    width: min(90vw, 420px);
    max-width: 420px;
    text-align: center;
}

#restart p {
    font-size: 32px;
    font-weight: bold;
    color: #210e56;
    margin-bottom: 20px;
}

#restart .restart-subtitle {
    font-size: 18px;
    font-weight: normal;
    color: #210e56;
    margin-bottom: 20px;
    margin-top: -10px;
}

#restart button {
    background: #210e56;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: background 0.3s;
}

#restart button:hover {
    background: #1a0b42;
}

#restart a {
    display: block;
    margin-top: 15px;
    color: #210e56;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

#restart a:hover {
    color: #1a0b42;
    text-decoration: underline;
}

/* Global button styles */
.play-button {
    background: #210e56;
    color: white !important;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: background 0.3s;
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    text-decoration: none;
}

.play-button:hover {
    background: #1a0b42;
}

/* Start screen styles */
#start-screen {
    padding: 20px;
    text-align: center;
    z-index: 100;
}

#start-screen h1 {
    font-size: 48px;
    color: #210e56;
    margin-bottom: 15px;
}

#start-screen p {
    font-size: 18px;
    color: #210e56;
    margin-bottom: 30px;
}

#start-screen .web-button {
    display: block;
    background: white;
    color: #210e56;
    border: 2px solid #210e56;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    margin: 10px auto;
    transition: all 0.3s;
    max-width: 300px;
}

#start-screen .web-button:hover {
    background: #210e56;
    color: white;
}

@media (max-width: 850px) {
    #game-container {
        padding: 20px 15px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 15px 12px 40px;
    }

    #hero-logo img {
        width: clamp(95px, 36vw, 150px);
    }

    #restart-overlay {
        padding-left: 12px;
        padding-right: 12px;
    }

    #game-container {
        border-radius: 16px;
    }

    #restart {
        padding: 20px;
        width: 100%;
        max-width: 360px;
    }
}
