
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    background: linear-gradient(135deg, #87CEEB 0%, #E0F6FF 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* Game Page Styles */
.game-area {
    position: relative;
    width: 90vw; /* Default to 90% of viewport width */
    max-width: 1000px;
    height: 54vw; /* 5:3 aspect ratio based on width */
    max-height: 600px;
    background: url('background.jpg') no-repeat center/cover;
    margin: 2vh auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 4px solid #FFD700;
    touch-action: manipulation; /* Improve touch responsiveness */
}

.sun {
    position: absolute;
    cursor: pointer;
    font-size: clamp(24px, 5vw, 32px); /* Scale between 24px and 32px */
    transition: transform 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    z-index: 2;
}

.sun:hover, .sun:active {
    transform: scale(1.2);
}

.distraction {
    position: absolute;
    font-size: clamp(36px, 7vw, 48px); /* Scale between 36px and 48px */
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
}

.hidden {
    display: none;
}

#timer {
    font-size: clamp(20px, 4vw, 28px); /* Scale between 20px and 28px */
    margin: 2vh auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5em 1em;
    border-radius: 25px;
    width: fit-content;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Username Form Styles */
.username-form {
    text-align: center;
    margin: 10vh auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 5vw;
    border-radius: 15px;
    width: 90vw;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.username-form label {
    font-size: clamp(18px, 5vw, 24px); /* Scale between 18px and 24px */
    color: #444;
    display: block;
    margin-bottom: 1em;
}

.username-form input[type="text"] {
    padding: 2vw;
    margin: 2vw 0;
    border: 2px solid #FFD700;
    border-radius: 5px;
    font-size: clamp(14px, 4vw, 16px);
    width: 100%;
    max-width: 200px;
}

.username-form input[type="submit"] {
    padding: 2vw 5vw;
    background: #FFD700;
    border: none;
    border-radius: 5px;
    color: #333;
    font-size: clamp(14px, 4vw, 16px);
    cursor: pointer;
    transition: background 0.3s ease;
}

.username-form input[type="submit"]:hover,
.username-form input[type="submit"]:active {
    background: #FFA500;
}

/* Leaderboard Styles */
h1 {
    text-align: center;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 5vw 0;
    font-size: clamp(32px, 10vw, 48px);
}

table {
    margin: 5vw auto;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90vw;
    max-width: 600px;
}

th, td {
    padding: 2vw 3vw;
    text-align: center;
    font-size: clamp(12px, 3vw, 16px);
}

th {
    background: #FFD700;
    color: #333;
    font-weight: bold;
}

td {
    border-bottom: 1px solid #eee;
}

tr:nth-child(even) {
    background: #f8f8f8;
}

tr:hover {
    background: #f0f0f0;
}

.play-again {
    text-align: center;
    margin: 5vw 0;
}

.play-again a {
    display: inline-block;
    padding: 2vw 5vw;
    background: #FFD700;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-size: clamp(14px, 4vw, 18px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.play-again a:hover,
.play-again a:active {
    background: #FFA500;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Media Query for Small Screens */
@media (max-width: 600px) {
    .game-area {
        border-width: 2px; /* Thinner border on small screens */
    }
    .username-form {
        padding: 3vw;
    }
}