:root {
    --bg: #ffffff;
    --text: #1d1d1d;
    --menu-bg: #ffffff;
    --border: black;
    --section-bg: #ffffff;
    --contact-bg: #f0f0f0;
    --link: #4285f4;
    --shadow: rgba(0, 0, 0, 0.25);
    --card: #ffffff;
    --accent-600: #4f46e5;
    --accent-400: #7c3aed;
    --muted: #6b7280;
    --radius: 12px;
    --space: 18px;
    --max-width: 420px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --text: #dddddd;
        --menu-bg: #000000;
        --border: black;
        --section-bg: #121212;
        --contact-bg: #1a1a1a;
        --link: #8ab4f8;
        --shadow: rgba(0, 0, 0, 0.1);
        --card: #1a1a1a;
        --accent-600: #4f46e5;
        --accent-400: #7c3aed;
        --muted: #dddddd;
    }
}

* {
    box-sizing: border-box;
}

#click-counter {
    width: 100%;
    max-width: var(--max-width);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--card));
    border-radius: calc(var(--radius) + 4px);
    padding: calc(var(--space) * 1.25);
    box-shadow: 0 6px 18px rgba(34, 38, 49, 0.06);
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: center;
    justify-items: center;
    text-align: center;
    border: 2px solid #000;
}

.click-counter-display {
    font-weight: 700;
    font-size: 3.2rem;
    line-height: 1;
    padding: 20px 28px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(124, 58, 237, 0.08),
        rgba(79, 70, 229, 0.04)
    );
    color: var(--accent-600);
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(34, 38, 49, 0.06);
    user-select: none;
}

.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

button[class^="click-counter-"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: 10px;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.click-counter-increment-button,
.click-counter-decrement-button {
    background: linear-gradient(90deg, var(--accent-400), var(--accent-600));
    color: white;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
    border: none;
}

@media (min-width: 520px) {
    #click-counter {
        gap: 18px;
    }

    .click-counter-display {
        font-size: 3.5rem;
        min-width: 180px;
    }

    button[class^="click-counter-"] {
        min-width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
}

.small {
    font-size: 0.9rem;
    color: var(--muted);
}

.click-counter-display {
    border: solid 10px var(--accent-400);
}

.below-main {
    width: 100%;
    max-width: var(--max-width);
    margin-top: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 18px;
}

.demo-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--section-bg);
    padding-top: 6px;
    padding-bottom: 20px;
}

#click-counter.full-viewport {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    padding: calc(var(--space) * 2);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.full-viewport-parent {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
}
