/* Deepwater Creek's own screens (Stage D1): the invitation, Updating and Entering screens share one look. */
:root { --dw-forest: #0d2a20; --dw-forest-deep: #062017; --dw-cream: #f3e8cc; --dw-cream-soft: #d9cfb3; --dw-gold: #d6bd83; --dw-brand: #003322; }
.dw-booting #menu { visibility: hidden; }
.dw-screen {
    position: fixed; inset: 0; z-index: 20; box-sizing: border-box; display: grid; place-items: center; margin: 0;
    padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow-y: auto; color: var(--dw-cream); font: 16px system-ui, sans-serif;
    background: radial-gradient(ellipse at 50% 120%, #1d4a3780, transparent 60%), linear-gradient(170deg, var(--dw-forest), var(--dw-forest-deep));
}
.dw-screen::after {
    /* A low creek of light along the bottom. */
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; pointer-events: none;
    background: linear-gradient(transparent, #2c5a4826); clip-path: polygon(0 40%, 18% 30%, 36% 42%, 55% 28%, 74% 40%, 100% 26%, 100% 100%, 0 100%);
}
.dw-screen-card { position: relative; z-index: 1; width: min(100%, 820px); text-align: center; }
/* The heading and subtitle keep one line where the screen allows: CSS gives a size that scales with the width, and
   screens.mjs (fitLine) measures the real rendered text and shrinks it to fit, down to a readable minimum; only below
   that does it wrap, in balanced lines. The progress, stage and message lines keep their own narrower widths. */
.dw-screen-title { margin: 0; font: clamp(1.15rem, 5.6vw, 3.1rem)/1.1 Georgia, 'Times New Roman', serif; letter-spacing: .01em; text-shadow: 0 3px 18px #00140d; text-wrap: balance; }
.dw-creek-line { display: block; width: min(240px, 60vw); height: 12px; margin: 14px auto 12px; }
.dw-creek-line path { fill: none; stroke: var(--dw-gold); stroke-width: 1.5; stroke-linecap: round; opacity: .7; }
.dw-screen-subtitle { margin: 0 auto 26px; color: var(--dw-cream-soft); font: italic clamp(.9rem, 2.4vw, 1.15rem)/1.5 Georgia, serif; text-wrap: balance; }
.dw-progress { position: relative; height: 8px; margin: 0 auto; max-width: 420px; border-radius: 6px; background: #f3e8cc1f; border: 1px solid #d6bd8355; overflow: hidden; }
.dw-progress span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #c7ad72, var(--dw-cream)); transition: width .25s ease-out; }
/* Work with no measurable size: a gentle travelling glow, labelled as such in the stage text. */
.dw-progress.dw-indeterminate span { width: 32%; animation: dw-drift 1.6s ease-in-out infinite alternate; }
@keyframes dw-drift { from { left: 0; } to { left: 68%; } }
.dw-screen-stage { min-height: 1.4em; margin: 14px 0 0; font-size: .95rem; color: var(--dw-cream); font-variant-numeric: tabular-nums; }
.dw-screen-message { min-height: 3em; margin: 22px auto 0; max-width: 28em; color: #c9c2a6; font: italic .98rem/1.5 Georgia, serif; transition: opacity .6s; }
.dw-screen-message.dw-fading { opacity: 0; }
.dw-screen.dw-error .dw-progress span { background: #b98a5b; }
.dw-screen-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.dw-screen button, .dw-update-banner button {
    box-sizing: border-box; min-height: 44px; padding: 10px 18px; font: inherit; color: var(--dw-cream); cursor: pointer;
    background: #1c3d30; border: 1px solid var(--dw-gold); border-radius: 8px;
}
.dw-screen button:focus-visible, .dw-update-banner button:focus-visible { outline: 2px solid #f0cf83; outline-offset: 2px; }
.dw-sign-out { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(64px, calc(env(safe-area-inset-bottom) + 52px)); background: transparent !important; border-color: #c9b47d80 !important; font-size: .9rem !important; min-height: 40px !important; }
.dw-update-banner {
    position: fixed; z-index: 30; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; box-sizing: border-box;
    width: max-content; max-width: calc(100% - 32px); padding: 8px 10px 8px 14px; border-radius: 10px;
    background: #0d2a20f2; border: 1px solid #d6bd83aa; color: var(--dw-cream); font: 14px system-ui, sans-serif; box-shadow: 0 6px 22px #0008;
}
.dw-update-banner button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
    .dw-progress span, .dw-screen-message { transition: none; }
    .dw-progress.dw-indeterminate span { animation: none; left: 34%; }
}
