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

:root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --primary-light: #81C784;
    --danger-color: #f44336;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-radius: 16px;
    --spacing: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    padding: var(--spacing);
}

header {
    text-align: center;
    padding: 24px 0;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 20px 0;
}

/* Counter Container */
.counter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
}

.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.counter-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.counter-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Counter Buttons */
.btn-counter {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-counter:active {
    transform: scale(0.95);
    background: #3a3a3a;
}

.btn-minus {
    color: var(--danger-color);
}

.btn-plus {
    color: var(--primary-color);
}

/* Log Button */
.btn-log {
    width: 100%;
    max-width: 320px;
    height: 80px;
    border-radius: var(--border-radius);
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.btn-log:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.btn-log:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-log-icon {
    font-size: 32px;
    line-height: 1;
}

.btn-log-text {
    line-height: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--primary-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Footer Stats */
footer {
    padding: 24px 0;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-light);
    font-variant-numeric: tabular-nums;
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .counter-number {
        font-size: 64px;
    }

    .btn-counter {
        width: 70px;
        height: 70px;
        font-size: 40px;
    }

    .btn-log {
        height: 70px;
        font-size: 20px;
    }
}

/* Prevent text selection on buttons */
button {
    -webkit-user-select: none;
    user-select: none;
}