/*
 * The app's shared stylesheet (#894), loaded by every layout, the guest and
 * onboarding pages included. It holds only the few utility classes the views
 * still use from the days of the Tailwind scaffold, so they keep rendering
 * without a build step. Add here only what a view really uses. The game's own
 * chrome lives in game.css, which only the in-game layout loads (#1178).
 */

.block { display: block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.w-full { width: 100%; }

.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-red-600 { color: #dc2626; }

/* Visually hidden, still read by screen readers. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Every click answered at once (#1178, public/js/pending.js): the button or
   link that was used dims while the next page is on its way, and a thin bar
   slides across the top once the wait is long enough to notice. With Reduce
   motion the bar stands still. */
.is-pending {
    cursor: progress !important;
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.hearth-pending-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10000;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.hearth-pending-bar.is-on { opacity: 1; }
.hearth-pending-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--ember, #c96a2b), var(--gold, #b8862e), transparent);
}
@media (prefers-reduced-motion: no-preference) {
    .hearth-pending-bar::before {
        width: 40%;
        animation: hearth-pending-slide 1.1s ease-in-out infinite;
    }
}
@keyframes hearth-pending-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

/* iOS zooms into any text field under 16px when it gets focus and never
   zooms back out, so the page ends up wider than the screen and scrolls
   sideways (#1184: the chat's message box was 14.5px). Every field reads
   at 16px at least on iOS alone, where the zoom happens; elsewhere the
   fields keep their own sizes. Disabling zoom in the viewport tag would
   also take pinch-zoom from everyone. */
@supports (-webkit-touch-callout: none) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]),
    textarea,
    select {
        font-size: max(16px, 1em) !important;
    }
}
