:root {
    --bg-color: #f0f2f5;
    --text: #1c1e21;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --accent: #f59e0b;
    --pad-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    user-select: none;
}

.container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

header {
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.highlight {
    color: var(--primary);
}

.subtitle {
    color: #6b7280;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.settings-bar {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.label {
    font-weight: 700;
    color: #4b5563;
    font-size: 0.9rem;
}

.duration-options {
    display: flex;
    gap: 0.5rem;
}

.dur-btn {
    background: #f3f4f6;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s;
}

.dur-btn.active {
    background: var(--primary);
    color: white;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.click-pad {
    background: var(--pad-bg);
    height: 300px;
    border-radius: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 900;
    color: #9ca3af;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.05s, background 0.1s;
    position: relative;
    overflow: hidden;
    border: 4px solid transparent;
}

.click-pad:active {
    transform: scale(0.98);
    background: #f9fafb;
}

.click-pad:focus {
    outline: none;
    border-color: var(--primary);
}

.stats-display {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.stat-box {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-box .label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.stat-box .value {
    font-size: 2rem;
    font-weight: 900;
    color: #111827;
}

.stat-box.highlight .value {
    color: var(--primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.final-score {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    margin: 1rem 0;
}

.unit {
    font-size: 1.5rem;
    color: #6b7280;
}

#rank-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #4b5563;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}