:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #8B4513;
    --secondary-color: #2c2c2c;
    --merit-color: #ffd700;
}

[data-theme="light"] {
    --bg-color: #f5f5f7;
    --text-color: #333333;
    --accent-color: #8B4513;
    --secondary-color: #ffffff;
    --merit-color: #d4af37;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.merit-counter {
    font-size: 1.5rem;
    background: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.wooden-fish-container {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

#wooden-fish {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    transition: transform 0.05s ease-out;
}

#wooden-fish.active {
    transform: scale(0.95);
}

/* Floating Merit Text Animation */
.merit-text {
    position: absolute;
    color: var(--merit-color);
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    white-space: nowrap;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-150%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-250%) scale(1);
    }
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 15px;
    width: 100%;
    justify-content: space-around;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 34px;
    display: flex;
    align-items: center;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    width: 60px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.label-text {
    margin-left: 70px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

footer {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: auto;
}

@media (max-width: 600px) {
    .wooden-fish-container {
        width: 200px;
        height: 200px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
}
