/* activity-core.css — shared styles for interactive activities */

/* =========================================================
   1. Shared variables
   ========================================================= */

.activity {
    --activity-border: var(--border, #e6e6e6);
    --activity-surface: var(--bg, #fff);
    --activity-text: var(--fg, #111);
    --activity-muted: var(--muted, #666);
    --activity-link: var(--link, #0a58ca);

    --activity-radius: 14px;
    --activity-control-radius: 8px;
    --activity-touch-target: 44px;
    --activity-gap: 10px;

    --activity-focus-width: 3px;
    --activity-focus-offset: 3px;

    width: 100%;
    margin: 24px 0;
    padding: clamp(14px, 3vw, 24px);

    color: var(--activity-text);
    background: var(--activity-surface);

    border: 1px solid var(--activity-border);
    border-radius: var(--activity-radius);
}


/* =========================================================
   2. Header
   ========================================================= */

.activity__header {
    margin: 0 0 16px;
}

.activity__title {
    margin: 0 0 6px;

    font-size: clamp(1.25rem, 4vw, 1.75rem);
    line-height: 1.2;
}

.activity__instructions {
    margin: 0;
    color: var(--activity-muted);
}


/* =========================================================
   3. Body
   ========================================================= */

.activity__body {
    display: flex;
    justify-content: center;

    width: 100%;
    min-width: 0;

    overflow: hidden;
}


/* =========================================================
   4. Footer and controls
   ========================================================= */

.activity__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--activity-gap);

    margin-top: 16px;
}

.activity__controls {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: var(--activity-gap);
}

.activity__button {
    min-height: var(--activity-touch-target);
    padding: 8px 14px;

    color: var(--activity-text);
    background: var(--activity-surface);

    border: 1px solid var(--activity-border);
    border-radius: var(--activity-control-radius);

    font: inherit;
    font-weight: 650;
    line-height: 1.2;

    cursor: pointer;

    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.activity__button:hover {
    border-color: currentColor;
}

.activity__button:active {
    transform: translateY(1px);
}

.activity__button:focus-visible {
    outline:
        var(--activity-focus-width)
        solid
        var(--activity-link);

    outline-offset: var(--activity-focus-offset);
}

.activity__button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.activity__status {
    flex: 1 1 100%;

    margin: 0;
    min-height: 1.5em;

    color: var(--activity-muted);
}


/* =========================================================
   5. Orientation notice
   ========================================================= */

.activity__orientation-note {
    display: none;

    margin: 0 0 12px;
    padding: 10px 12px;

    color: var(--activity-text);
    background: #fff4cc;

    border: 1px solid #ddc66c;
    border-radius: var(--activity-control-radius);
}

.activity__orientation-message {
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.activity.needs-landscape .activity__orientation-note {
    display: block;
}

.activity.is-orientation-blocked .activity__body,
.activity.is-orientation-blocked .activity__footer {
    opacity: 0.45;
}

.activity.is-orientation-blocked .activity__body {
    pointer-events: none;
}


/* =========================================================
   6. Generic states
   ========================================================= */

.activity.is-moving {
    cursor: wait;
}

.activity-list-item {
    list-style: none;
}

.activity-error {
    padding: 12px;

    color: #7d0016;
    background: #fff0f2;

    border: 1px solid #b00020;
    border-radius: 8px;
}


/* =========================================================
   7. Responsive
   ========================================================= */

@media (max-width: 700px) {
    .activity {
        margin: 16px 0;
        padding: 12px;
    }

    .activity__header {
        margin-bottom: 12px;
    }

    .activity__footer {
        margin-top: 12px;
    }

    .activity__controls {
        width: 100%;
    }

    .activity__button {
        flex: 1 1 140px;
    }
}

@media (max-width: 420px) {
    .activity {
        border-radius: 10px;
    }

    .activity__button {
        flex-basis: 100%;
    }
}


/* =========================================================
   8. Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .activity *,
    .activity *::before,
    .activity *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}