body {
    margin: 0;
    background: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Nunito', sans-serif;
    color: #fff;
    overflow: hidden;
}

.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 98vh;
}

.page-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2em, 5vw, 3.5em);
    color: #fff;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    margin-top: 0;
    text-align: center;
}

.game-container {
    position: relative;
    border: 5px solid #1a1a1a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(160deg, #87CEEB, #a2dffb, #bde5fc);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

canvas {
    display: block;
    /* This makes the canvas see-through */
    background: transparent;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(26, 26, 26, 0.85);
    padding: 20px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.2);
    width: 80%;
    box-sizing: border-box;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-family: 'Fredoka One', cursive;
    font-size: 2.8em;
    color: #ffcc00;
    text-shadow: 3px 3px 0 #E63946;
}

.screen p {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 20px;
}

.restart-hint {
    font-size: 0.9em !important;
    color: #ccc;
    margin-top: -10px !important;
}

#startButton {
    padding: 15px 40px;
    font-size: 22px;
    cursor: pointer;
    border: none;
    background: linear-gradient(to bottom, #56ab2f, #a8e063);
    color: white;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-bottom: 5px solid #3a7d1a;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#startButton:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

#startButton:active {
    transform: translateY(2px) scale(1.05);
    border-bottom-width: 3px;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#score-container {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.ad-placeholder {
    width: 160px;
    height: 700px;
    background-color: #1f2d38;
    border: 2px dashed #445;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-size: 16px;
    border-radius: 8px;
    margin: 0 20px;
}
/* PASTE ALL OF THIS AT THE END OF YOUR CSS FILE */

/* --- Modal Styles --- */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: linear-gradient(to bottom, #4a4e69, #22223b);
    color: #f2e9e4;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1001;
    width: 90%;
    max-width: 500px;
    border: 2px solid #9a8c98;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    pointer-events: none;
}

.modal h2 {
    font-family: 'Fredoka One', cursive;
    color: #ffca3a;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal a {
    color: #ffca3a;
    font-weight: bold;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #9a8c98;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover {
    color: #fff;
}
/* --- Top Left Vertical Links --- */
.side-links {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column; /* stack links vertically */
    gap: 10px;              /* spacing between links */
    z-index: 1100;          /* make sure they sit above game & ads */
}

.side-links a {
    color: #fff;            /* white links */
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.side-links a:hover {
    color: #ffca3a;         /* gold highlight on hover */
    text-decoration: underline;
}
