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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ── Wrapper ── */
.counter-wrapper {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 3rem 3.5rem;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2.5rem;
}

/* ── Counter Display ── */
.counter-display {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.count {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    transition: color 0.25s ease, transform 0.15s ease;
    display: inline-block;
}

.count.positive { color: #4ade80; }
.count.negative { color: #f87171; }
.count.zero     { color: #94a3b8; }

/* ── Buttons ── */
.button-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 1.8rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    flex: 1;
    justify-content: center;
}

.btn span {
    font-size: 1.3rem;
    line-height: 1;
}

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

.btn-increment {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}

.btn-increment:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 28px rgba(34, 197, 94, 0.5);
}

.btn-decrement {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
}

.btn-decrement:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 28px rgba(239, 68, 68, 0.5);
}

.btn-increment.pending,
.btn-decrement.pending {
    outline: 3px solid #facc15;
    outline-offset: 3px;
    filter: brightness(1.15);
    animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { outline-color: #facc15; }
    50%       { outline-color: #fde047; }
}

.btn-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.7rem 1.5rem;
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.btn-fullscreen:active {
    transform: scale(0.97);
}

/* ── Hint ── */
.hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .counter-wrapper {
        padding: 2rem 1.5rem;
    }
    h1 {
        font-size: 1.5rem;
    }
    .count {
        font-size: 4rem;
    }
    .button-row {
        flex-direction: column;
    }
}
