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

body {
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 95%;
}

.score-container {
    text-align: center;
    margin-bottom: 20px;
}

.clicker {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    cursor: pointer;
    user-select: none;
    overflow: hidden;  
}

.target {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s;
}

.target:active {
    transform: scale(0.9);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.shop {
    margin-top: 20px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.shop h2 {
    text-align: center;
    margin-bottom: 15px;
}

.upgrade {
    background: #f5f5f5;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#catUpgrade {
    background: linear-gradient(45deg, #f5f5f5, #ffe0e0);
    border: 1px solid #eed;
}

#curiosityUpgrade {
    background: linear-gradient(45deg, #f5f5f5, #e0f0ff);
    border: 1px solid #dde;
}

#pointsBoosterUpgrade {
    background: linear-gradient(45deg, #f5f5f5, #e0e0e0);
    border: 1px solid #ddd;
}

#coffeeShopUpgrade {
    background: linear-gradient(45deg, #f5f5f5, #e8d9c0);
    border: 1px solid #ded;
}

#authorEventUpgrade {
    background: linear-gradient(45deg, #f5f5f5, #d9e8c0);
    border: 1px solid #ded;
}

button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #45a049;
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.goal-container {
    margin: 15px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.timer {
    margin-top: 10px;
    font-weight: bold;
}

.username-form {
    margin: 15px 0;
}

.username-form input {
    padding: 8px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.leaderboard-container {
    margin-top: 20px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.leaderboard-container h2 {
    text-align: center;
    margin-bottom: 15px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.leaderboard-table th, .leaderboard-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.leaderboard-table th {
    background-color: #f2f2f2;
}

.leaderboard-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

#leaderboardButton {
    display: none;
}

.hidden {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.bookstore-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 20px auto;
    border-radius: 5px;
    display: block;
}

@media (max-width: 480px) {
    .clicker {
        width: 150px;
        height: 150px;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .upgrade {
        padding: 10px;
    }
}