body {
    margin: 0;
    padding: 0;
    background-color: #e6f7ff; /* Light blue background */
    overflow: hidden; /* Prevent scrollbars */
}

#pen {
    position: absolute;
    width: 120px;
    height: 900px;
    background-image: url('pen.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    left: 50%;
    transform: translateX(-50%);
    top: -900px; /* Starting position moved further up to be off-screen */
}

#container {
    position: relative;
    width: 100%;
    height: 100vh;
    cursor: pointer; /* Change cursor to indicate clickable area */
}

#horizontal-bar {
    position: absolute;
    width: 80%;
    height: 20px;
    background-color: #555;
    top: 85%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#score-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px 15px;
    border-radius: 10px;
    z-index: 10;
}

#result-message {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: bold;
    color: #333;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px 25px;
    border-radius: 15px;
    display: none;
    z-index: 10;
    text-align: center;
    white-space: nowrap;
    max-width: 90%;
}

#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 20;
    text-align: center;
    width: 80%;
    max-width: 500px;
}

#instructions h2 {
    color: #333;
    margin-top: 0;
}

#instructions p {
    color: #555;
    font-size: 18px;
    margin: 10px 0;
    text-align: left;
}

#start-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#start-button:hover {
    background-color: #45a049;
}

#sound-control {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

#volume-controls {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
}

#sound-control:hover #volume-controls {
    display: block;
}

.volume-control {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.volume-control label {
    margin-right: 10px;
    font-weight: bold;
    color: #333;
}

.volume-control input {
    width: 100px;
}

#toggle-sound {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

#toggle-sound:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

#round-display {
    display: none; /* Hide the round display */
}

#final-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 20;
    text-align: center;
    width: 80%;
    max-width: 500px;
}

#final-score h2 {
    color: #333;
    margin-top: 0;
    font-size: 32px;
}

#total-score {
    color: #333;
    font-size: 28px;
    font-weight: bold;
    margin: 20px 0;
}

#restart-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#restart-button:hover {
    background-color: #45a049;
}

#restart-control {
    position: absolute;
    top: 20px;
    left: 80px;
    z-index: 10;
}

#quick-restart-button {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

#quick-restart-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

#help-control {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

#help-button {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

#help-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.text-left {
    text-align: left;
    width: 100%;
    padding: 0 20px;
}

#difficulty-control {
    position: absolute;
    top: 20px;
    left: 220px;
    z-index: 10;
}

#difficulty-selector {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#difficulty-selector:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

#score-board-control {
    position: absolute;
    bottom: 20px;
    right: 80px;
    z-index: 10;
}

#score-board-button {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

#score-board-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

#score-board {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 30;
    text-align: center;
    width: 80%;
    max-width: 500px;
}

#high-scores-list {
    margin: 20px 0;
    text-align: left;
}

#high-scores-list h3 {
    color: #333;
    margin: 15px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #4caf50;
}

#high-scores-list .score-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
}

#high-scores-list .score-entry:nth-child(even) {
    background-color: rgba(230, 230, 230, 0.5);
}

#high-scores-list .score-entry .rank {
    font-weight: bold;
    width: 30px;
}

#high-scores-list .score-entry .player {
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#high-scores-list .score-entry .score {
    font-weight: bold;
    margin-left: 10px;
}

#close-score-board {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#close-score-board:hover {
    background-color: #d32f2f;
}

#username-input {
    display: none; /* Hide the username input section */
}

#player-name {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
    width: 200px;
}

#save-score-button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px 5px;
    transition: background-color 0.3s;
}

#save-score-button:hover {
    background-color: #0b7dda;
}