body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-sizing: border-box;
}

h1 {
    color: #6a0dad;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: 700;
}

.warning-box {
    background-color: #ffe0b2; /* Light orange/amber */
    color: #e65100; /* Darker orange text */
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #ffb74d; /* Border to match */
    font-weight: bold;
    font-size: 0.95em;
    text-align: center;
}

.warning-box p {
    margin: 0;
    line-height: 1.4;
    color: inherit; /* Inherit color from parent */
}

p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #555;
}

textarea {
    width: calc(100% - 20px);
    padding: 15px;
    margin-bottom: 25px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #6a0dad;
    outline: none;
}

button {
    background-color: #6a0dad;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(106, 0, 173, 0.2);
}

button:hover {
    background-color: #52009d;
    transform: translateY(-2px);
}

button:active {
    background-color: #40007b;
    transform: translateY(0);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.result-box {
    margin-top: 30px;
    padding: 25px;
    border: 2px dashed #6a0dad;
    border-radius: 10px;
    background-color: #f9f0ff;
    text-align: left;
    transition: all 0.5s ease-in-out;
}

.result-box h2 {
    color: #6a0dad;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.result-box p {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 0;
}

.hidden {
    display: none;
}

#loadingAnimation {
    width: 150px;
    height: 150px;
    margin: 20px auto;
}

/* New styles for "broken limit" effect */
.result-box.broken-limit {
    background-color: #ffe0e0; /* Lighter red tint */
    border: 3px solid #ff0000; /* Bright red border */
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); /* Red glow */
    animation: pulseRed 1s infinite alternate; /* Pulsing effect */
}

@keyframes pulseRed {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

/* Optional: Add a subtle shake to the H1 */
.shaking-h1 {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    color: #ff0000; /* Make H1 red */
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Styles for Mode Selection */
.mode-selection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mode-selection p {
    font-size: 1em;
    margin-bottom: 15px;
    color: #777;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mode-button {
    background-color: #e0e0e0;
    color: #333;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: none;
}

.mode-button:hover {
    background-color: #d0d0d0;
    transform: translateY(-1px);
}

.mode-button.active {
    background-color: #6a0dad;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(106, 0, 173, 0.3);
}

.mode-button.active:hover {
    background-color: #52009d;
    transform: translateY(-1px);
}

/* New styles for Leaderboard */
#leaderboard-container {
    margin-top: 40px;
    padding: 25px;
    background-color: #f5f5f5;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

#leaderboard-container h2 {
    color: #6a0dad;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
    color: #333;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item .rank {
    font-weight: bold;
    color: #6a0dad;
    width: 40px;
    text-align: left;
    flex-shrink: 0;
}

.leaderboard-item .player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.leaderboard-item .player-name {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-item .cringe-score {
    font-weight: bold;
    color: #e65100; /* Orange for score */
    width: 80px; /* Fixed width for scores */
    text-align: right;
    flex-shrink: 0;
}

.leaderboard-item.current-player {
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #aaddff; /* Subtle border */
    font-weight: bold;
    box-shadow: 0 0 8px rgba(106, 0, 173, 0.1);
}

.leaderboard-item.current-player .cringe-score {
    color: #6a0dad; /* Purple for current player's score */
}