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

:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

.container {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 0.5rem);
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.header {
    margin-bottom: 2rem;
}

h1 {
    color: hsl(var(--foreground));
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.timer-section {
    margin-bottom: 2rem;
}

.timer-display {
    font-size: 3rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    padding: 1.5rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    letter-spacing: 0.05em;
}

.counter-section {
    margin-bottom: 2rem;
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.counter-label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-reset-counter {
    background: transparent;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 0.5);
    padding: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-reset-counter:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border-color: hsl(var(--border));
}

.btn-reset-counter:active {
    transform: scale(0.95);
}

.btn-reset-counter:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn-reset-counter svg {
    width: 14px;
    height: 14px;
}

.counter-display {
    font-size: 4rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    padding: 1.5rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buttons-section {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid hsl(var(--border));
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-add {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.btn-add:hover {
    background: hsl(var(--primary) / 0.9);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-add:active {
    transform: scale(0.95);
}

.btn-add:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn-subtract {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-color: hsl(var(--destructive));
}

.btn-subtract:hover {
    background: hsl(var(--destructive) / 0.9);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-subtract:active {
    transform: scale(0.95);
}

.btn-subtract:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

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

.btn-icon {
    line-height: 1;
    user-select: none;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-control {
    padding: 0.875rem 1.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-control .btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-control .btn-text {
    white-space: nowrap;
}

.btn-control:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

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

.btn-control:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
    background: hsl(var(--secondary) / 0.8);
}

.captures-section {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.captures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.captures-label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-clear-captures {
    background: transparent;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 0.5);
    padding: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-clear-captures:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border-color: hsl(var(--border));
}

.btn-clear-captures:active {
    transform: scale(0.95);
}

.captures-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--muted) / 0.3);
    padding: 0.5rem;
}

.captures-list::-webkit-scrollbar {
    width: 6px;
}

.captures-list::-webkit-scrollbar-track {
    background: transparent;
}

.captures-list::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
}

.captures-list::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.3);
}

.captures-empty {
    text-align: center;
    padding: 1.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.capture-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 0.75);
    transition: all 0.2s ease;
    animation: capture-appear 0.3s ease-out;
}

.capture-item:last-child {
    margin-bottom: 0;
}

.capture-item:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--border));
}

@keyframes capture-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.capture-type {
    font-weight: 600;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    white-space: nowrap;
}

.capture-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.capture-datetime {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
}

.capture-time {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.footer-signature {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    text-align: center;
}

.signature-link {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.signature-link:hover {
    color: hsl(var(--foreground));
}

.signature-brand {
    font-weight: 600;
    color: hsl(var(--primary));
    transition: color 0.2s ease;
}

.signature-link:hover .signature-brand {
    color: hsl(var(--primary) / 0.8);
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .timer-section {
        margin-bottom: 1.5rem;
    }
    
    .timer-display {
        font-size: 2.25rem;
        padding: 1.25rem;
    }
    
    .counter-section {
        margin-bottom: 1.5rem;
    }
    
    .btn-reset-counter {
        width: 32px;
        height: 32px;
        padding: 0.5rem;
    }
    
    .btn-reset-counter svg {
        width: 16px;
        height: 16px;
    }
    
    .counter-display {
        font-size: 3.5rem;
        padding: 1.25rem;
        min-height: 110px;
    }
    
    .buttons-section {
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .btn {
        width: 120px;
        height: 120px;
        font-size: 3.5rem;
    }
    
    .control-buttons {
        gap: 0.75rem;
    }
    
    .btn-control {
        padding: 1rem 1.75rem;
        font-size: 1rem;
        min-height: 48px;
        flex: 1;
        min-width: 100px;
    }
    
    .footer-signature {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .signature-link {
        font-size: 0.7rem;
    }
    
    .captures-section {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .captures-list {
        max-height: 150px;
    }
    
    .capture-item {
        padding: 0.625rem;
        flex-wrap: wrap;
    }
    
    .capture-type {
        font-size: 0.8rem;
    }
    
    .capture-details {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .capture-datetime {
        font-size: 0.7rem;
    }
    
    .capture-time {
        font-size: 0.8rem;
    }
}

