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

body {
    font-family: 'Noto Sans', sans-serif;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ed 100%);
    color: #2d5d3d;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(45, 93, 61, 0.1);
    padding: 30px;
    max-width: 600px;
    width: 100%;
}

/* Header */
header {
    margin-bottom: 30px;
}

.user-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.user-dropdown {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    border: 2px solid #8FCB9B;
    border-radius: 12px;
    background: white;
    color: #2d5d3d;
    font-size: 16px;
    font-family: 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-dropdown:focus {
    outline: none;
    border-color: #6bb77b;
    box-shadow: 0 0 0 3px rgba(143, 203, 155, 0.2);
}

/* Main Timer Section */
main {
    text-align: center;
}

.timer-display {
    font-size: 72px;
    font-weight: 300;
    color: #2d5d3d;
    margin: 30px 0;
    letter-spacing: 4px;
}

.time-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 18px;
    justify-content: center;
    margin-bottom: 36px;
    padding: 10px 0;
    background: linear-gradient(90deg, #e8f5ed 0%, #f0f9f4 100%);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(143, 203, 155, 0.10);
}

.btn-bamboo {
    background: linear-gradient(180deg, #8FCB9B 0%, #7ab88a 100%);
    color: white;
    border: none;
    padding: 18px 0;
    border-radius: 30px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(143, 203, 155, 0.18);
    transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s;
    font-family: 'Noto Sans', sans-serif;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    outline: none;
}

.btn-bamboo:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 8px 24px rgba(143, 203, 155, 0.22);
    background: linear-gradient(180deg, #7ab88a 0%, #8FCB9B 100%);
}

.btn-bamboo:active {
    transform: scale(0.98);
}

.control-buttons {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 36px;
    padding: 10px 0;
    background: linear-gradient(90deg, #e8f5ed 0%, #f0f9f4 100%);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(143, 203, 155, 0.10);
}

.btn-primary {
    background: linear-gradient(90deg, #8FCB9B 0%, #7ab88a 100%);
    color: white;
    border: none;
    padding: 18px 0;
    border-radius: 30px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(143, 203, 155, 0.18);
    transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s;
    font-family: 'Noto Sans', sans-serif;
    letter-spacing: 1px;
    min-width: 140px;
    outline: none;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #7ab88a 0%, #8FCB9B 100%);
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 8px 24px rgba(143, 203, 155, 0.22);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: #8FCB9B;
    border: 2px solid #8FCB9B;
    padding: 16px 0;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(.4,2,.3,1), box-shadow 0.18s;
    font-family: 'Noto Sans', sans-serif;
    min-width: 140px;
    outline: none;
}

.btn-secondary:hover {
    background: #e8f5ed;
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(143, 203, 155, 0.10);
}

.btn-secondary:active {
    transform: scale(0.96);
}

.score-section {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ed 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.score-section h3 {
    color: #2d5d3d;
    margin-bottom: 10px;
}

.score-section p {
    font-size: 18px;
    color: #4a7c5d;
    margin: 5px 0;
}

.achievements-unlocked {
    background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.achievements-unlocked h3 {
    color: #d4a017;
    margin-bottom: 15px;
}

#unlockedList {
    text-align: left;
}

.achievement-item {
    background: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #d4a017;
}

.achievement-item strong {
    color: #2d5d3d;
    display: block;
    margin-bottom: 5px;
}

.achievement-item span {
    color: #6b8e7a;
    font-size: 14px;
}

/* Footer */
footer {
    border-top: 2px solid #e8f5ed;
    padding-top: 20px;
    margin-top: 20px;
}

.sound-section {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sound-section label {
    font-weight: 600;
    color: #2d5d3d;
}

.sound-dropdown {
    padding: 10px 16px;
    border: 2px solid #8FCB9B;
    border-radius: 12px;
    background: white;
    color: #2d5d3d;
    font-size: 16px;
    font-family: 'Noto Sans', sans-serif;
    cursor: pointer;
}

.user-stats {
    text-align: center;
    color: #4a7c5d;
}

.user-stats p {
    margin: 5px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(45, 93, 61, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(45, 93, 61, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #8FCB9B;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #2d5d3d;
    transform: scale(1.1);
}

.modal-content h2 {
    color: #2d5d3d;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #8FCB9B;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Noto Sans', sans-serif;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #6bb77b;
    box-shadow: 0 0 0 3px rgba(143, 203, 155, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e8f5ed;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #6b8e7a;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-family: 'Noto Sans', sans-serif;
}

.tab-btn:hover {
    color: #2d5d3d;
}

.tab-btn.active {
    color: #2d5d3d;
    border-bottom-color: #8FCB9B;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: linear-gradient(90deg, #f0f9f4 0%, #ffffff 100%);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(143, 203, 155, 0.15);
    border-left-color: #8FCB9B;
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    color: #8FCB9B;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.gold {
    color: #FFD700;
}

.leaderboard-rank.silver {
    color: #C0C0C0;
}

.leaderboard-rank.bronze {
    color: #CD7F32;
}

.leaderboard-user {
    flex: 1;
}

.leaderboard-username {
    font-size: 18px;
    font-weight: 600;
    color: #2d5d3d;
    margin-bottom: 4px;
}

.leaderboard-stats {
    font-size: 14px;
    color: #6b8e7a;
}

.leaderboard-score {
    font-size: 20px;
    font-weight: 700;
    color: #8FCB9B;
    min-width: 100px;
    text-align: right;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-card {
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
    border: 2px solid #d4a017;
}

.achievement-card.locked {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    opacity: 0.6;
}

.achievement-card.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.2);
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.achievement-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d5d3d;
    margin-bottom: 6px;
}

.achievement-desc {
    font-size: 13px;
    color: #6b8e7a;
    margin-bottom: 8px;
}

.achievement-date {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .timer-display {
        font-size: 38px;
    }

    .time-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 6px 0;
    }

    .btn-bamboo {
        padding: 12px 0;
        font-size: 16px;
    }

    .control-buttons {
        flex-direction: column;
        gap: 12px;
        padding: 6px 0;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        min-width: unset;
    }

    .user-section {
        flex-direction: column;
    }

    .user-dropdown {
        width: 100%;
    }
    
    #addUserBtn, #leaderboardBtn {
        width: 100%;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 5% auto;
        padding: 20px;
    }
}

@media (max-width: 400px) {
    .timer-display {
        font-size: 36px;
    }

    .time-buttons {
        flex-direction: column;
    }

    .btn-bamboo {
        width: 100%;
    }
}
