:root {
    color-scheme: dark;
    font-family: "Leelawadee UI", Tahoma, system-ui, sans-serif;
    background: #101529;
    color: #fff2dd;
    --gold: #f8d69c;
    --muted: #beb8ce;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 16% 17%, #42304e80, transparent 46%),
        radial-gradient(ellipse at 84% 0%, #2d365980, transparent 42%),
        #101529;
}
main { width: min(1100px, 100%); margin: auto; padding: clamp(18px, 4vw, 52px); }
.heading { text-align: center; margin: 10px 0 26px; }
.heading-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 18px);
}
.header-logo {
    display: block;
    flex: 0 0 auto;
    width: clamp(58px, 14vw, 130px);
    height: auto;
}
.heading-title h1 {
    font-size: clamp(19px, 5.65vw, 62px);
    white-space: nowrap;
}
h1 { color: var(--gold); text-shadow: 0 2px 22px #ffc77242; font-size: clamp(32px, 6.5vw, 62px); margin: 0; line-height: 1.2; }
.heading p { color: var(--muted); margin: 10px 0 0; }
.layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.scene, .panel { border: 1px solid #eacc9d32; border-radius: 24px; overflow: hidden; }
.scene {
    position: relative;
    min-height: 620px;
    background: #111a35;
    border-color: #e8b8797d;
    box-shadow: 0 0 0 3px #e4ba6a12, 0 16px 40px #090d235e;
}
canvas { position: absolute; width: 100%; height: 100%; display: block; }
.scene-caption {
    position: absolute; inset: 8px 0 auto; text-align: center; color: #f8d69ce0;
    font-size: 13px; text-shadow: 0 2px 6px #091025;
}
.panel { background: #1b1e35; padding: clamp(16px, 3vw, 26px); }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend, .field-label { font-weight: 700; font-size: 18px; padding: 0; }
small, .meta { color: var(--muted); font-weight: normal; font-size: 12px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.choices label { position: relative; cursor: pointer; }
.choices input { position: absolute; opacity: 0; }
.choices span {
    display: grid; place-items: center; gap: 7px; padding: 10px 2px;
    background: #232741; border: 1px solid #424460; border-radius: 12px; font-size: 13px;
}
.choices input:checked + span { border-color: var(--gold); color: var(--gold); background: #3a3146; }
.choices input:focus-visible + span, button:focus-visible, .text-field:focus-visible { outline: 2px solid #ffe4ae; outline-offset: 3px; }
.choices i {
    width: 28px; height: 22px; display: block; position: relative; margin: 3px 0;
    color: #ee91af;
    background: currentColor; border-radius: 90% 0 90% 0; transform: rotate(-45deg) scale(.76);
}
.choices i::before, .choices i::after {
    content: ""; position: absolute; width: 23px; height: 17px; background: currentColor;
    border-radius: 90% 0 90% 0; opacity: .74;
}
.choices i::before { left: -7px; top: -4px; transform: rotate(-40deg); }
.choices i::after { right: -7px; bottom: -4px; transform: rotate(40deg); }
.choices .marigold { color: #ffbc61; }
.choices .orchid { color: #c1a0fc; }
.field-label { display: block; }
.text-field {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    padding: 10px 12px;
    background: #12172c;
    color: inherit;
    border: 1px solid #51516b;
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
}
textarea.text-field { min-height: 84px; resize: vertical; }
.text-field::placeholder { color: #aaa5be; opacity: 1; }
.meta { display: flex; justify-content: space-between; gap: 6px; margin: 8px 0 18px; }
button {
    width: 100%; min-height: 49px; border: 0; border-radius: 12px; cursor: pointer;
    background: linear-gradient(105deg, #ffe3ae, #edb978);
    color: #30213a; font: inherit; font-weight: 750; font-size: 17px;
}
button:disabled { opacity: .65; cursor: wait; }
button span { margin-left: .3em; }
.status { font-size: 14px; color: var(--gold); overflow-wrap: anywhere; margin-bottom: 0; }
.status:empty { display: none; }
.status.error { color: #ffbabb; }
blockquote {
    white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--gold);
    margin: 10px 0 0; padding-left: 10px; color: var(--muted); font-size: 14px;
}
@media (max-width: 720px) {
    .layout { grid-template-columns: 1fr; gap: 14px; }
    .scene { min-height: 600px; }
    .heading { margin-bottom: 18px; }
}

#river-status { color: var(--muted); font-size: 13px; }
.shared { margin-top: 20px; }
.shared h2 { margin: 0; color: var(--gold); font-size: 20px; }
#recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
#recent:empty { margin: 0; }
#recent li {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #232741;
    padding: 9px 12px;
    border-radius: 9px;
    overflow-wrap: anywhere;
}
#recent small { margin-left: auto; flex-shrink: 0; }
.flower { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.flower.lotus { background: #ee91af; }
.flower.marigold { background: #ffbc61; }
.flower.orchid { background: #c1a0fc; }

.saved-wish { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.choices .white-lotus { color: #fff0ce; }
.flower.white-lotus { background: #fff0ce; }
.choices .jasmine { color: #e7f5c9; }
.flower.jasmine { background: #e7f5c9; }
.choices .rose { color: #f68091; }
.flower.rose { background: #f68091; }
.choices .banana { color: #8bd8a7; }
.flower.banana { background: #8bd8a7; }
.choices .royal { color: #ffd890; }
.flower.royal { background: #ffd890; }
.choices .moonlight { color: #8dddf8; }
.flower.moonlight { background: #8dddf8; }
