.iw-pond {
    --iw-ink: #f6e6e0;
    --iw-muted: #c6b3ba;
    --iw-brass: #eec7af;
    --iw-border: rgba(225, 181, 180, .26);
    --iw-base: #1c1620;
    --iw-title-font: var(--iw-serif, "Shippori Mincho", "Noto Serif CJK SC", serif);
    --iw-reading-font: var(--iw-serif, "Noto Serif CJK SC", serif);
    --iw-ui-font: var(--iw-round, "Zen Maru Gothic", system-ui, sans-serif);
    width: min(calc(100% - clamp(1.5rem, 8.9vw, 10rem)), 84rem);
    margin-inline: auto;
    padding-block: clamp(1.5rem, 5vh, 4.1rem) clamp(1.4rem, 5vh, 4.2rem);
    color: var(--iw-ink);
    font-family: var(--iw-ui-font, "Zen Maru Gothic", system-ui, sans-serif);
}

.iw-pond [hidden] { display: none !important; }

.iw-pond-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.iw-pond-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0 0 clamp(1.05rem, 3.2vh, 2.15rem);
}

.iw-pond-reading {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 0 0 .38rem;
    color: var(--iw-brass);
    font-family: "Inori Mincho", var(--iw-title-font);
    font-size: .85rem;
    letter-spacing: .26em;
}

.iw-pond-reading::before {
    content: '';
    width: 1.8rem;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(236, 192, 164, .81));
}

.iw-pond #iw-pond-title {
    margin: 0;
    color: var(--iw-ink);
    font-family: var(--iw-title-font, "Shippori Mincho", "Songti SC", "Noto Serif CJK SC", serif);
    font-size: clamp(2.4rem, 7vw, 4.85rem);
    font-weight: 500;
    letter-spacing: .065em;
    line-height: 1.09;
}

.iw-pond-intro {
    margin: 0 0 .24rem;
    color: var(--iw-muted);
    font-family: var(--iw-reading-font, "LXGW WenKai", "Kaiti SC", serif);
    font-size: clamp(1.035rem, 1.55vw, 1.25rem);
    line-height: 1.65;
    text-align: end;
}

.iw-pond-frame {
    position: relative;
    overflow: clip;
    border: 1px solid var(--iw-border);
    border-radius: clamp(14px, 1.65vw, 24px);
    background: var(--iw-base);
    box-shadow: 0 26px 60px rgba(5, 0, 10, .26);
}

.iw-pond-scene {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: clamp(24rem, 56svh, 39rem);
    background:
        radial-gradient(ellipse at 55% 45%, #74576b48, #35243b18 36%, transparent 72%),
        linear-gradient(180deg, #292435 0%, #1a2632 52%, #192b32 74%, #182228 100%);
    border-block-end: 1px solid var(--iw-border);
    touch-action: pan-y;
}

.iw-pond-art, .iw-pond-shade, .iw-pond-water, .iw-pond-shore {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.iw-pond-art {
    display: block;
    filter: var(--iw-pond-grade, none);
    transition: filter 1.35s cubic-bezier(.24, .59, .23, 1);
}

.iw-pond-art.iw-pond-day-art {
    filter: saturate(.87);
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(.24, .59, .23, 1);
}

.iw-pond-day-art.is-ready { opacity: var(--iw-pond-day-mix, 0); }

.iw-pond-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--iw-pond-art-position, 50% 22%);
}

.iw-pond-shade {
    pointer-events: none;
    background:
        linear-gradient(0deg, #15122258 0%, transparent 25%),
        linear-gradient(90deg, #201a2d24, transparent 22%, transparent 83%, #271b3017);
}

.iw-pond-shade::before,
.iw-pond-shade::after {
    position: absolute;
    inset: 0;
    content: '';
    transition: opacity 1.4s cubic-bezier(.22, .68, .3, 1);
}

.iw-pond-shade::before {
    background:
        radial-gradient(ellipse at 48% 18%, rgba(111, 137, 186, .2), transparent 65%),
        linear-gradient(180deg, rgba(21, 26, 53, .25), rgba(13, 23, 45, .72) 82%);
    opacity: var(--iw-pond-night, 0);
}

.iw-pond-shade::after {
    background:
        radial-gradient(ellipse at 54% 39%, rgba(255, 223, 182, .28), transparent 66%),
        linear-gradient(180deg, rgba(187, 150, 161, .1), rgba(187, 146, 119, .08) 78%, transparent);
    opacity: var(--iw-pond-day, .24);
}

.iw-pond-scene-tools {
    position: absolute;
    z-index: 4;
    inset-block-start: clamp(.58rem, 2.1vw, 1.12rem);
    inset-inline-end: clamp(.58rem, 2.1vw, 1.12rem);
    display: flex;
    gap: .28rem;
    padding: .15rem;
    border: 1px solid rgba(240, 201, 192, .25);
    border-radius: 12px;
    background: #251d2ce8;
    color: #fbede6;
    box-shadow: 0 5px 22px #1b14245c;
}

.iw-pond-light-control { position: relative; }

.iw-pond-light-control::after {
    position: absolute;
    inset-block-start: calc(50% - 3px);
    inset-inline-end: 9px;
    width: 6px;
    height: 6px;
    border-inline-end: 1px solid #f4c9b8;
    border-block-end: 1px solid #f4c9b8;
    transform: rotate(45deg);
    pointer-events: none;
    content: '';
}

.iw-pond-light, .iw-pond-touch {
    appearance: none;
    min-height: 44px;
    min-width: 44px;
    padding-inline: .66rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .74rem;
    letter-spacing: .025em;
    cursor: pointer;
    touch-action: manipulation;
}

.iw-pond-light { padding-inline-end: 1.4rem; }
.iw-pond-light option { background: #322638; color: #fae7de; }
.iw-pond-light:hover, .iw-pond-touch:not(:disabled):hover { background: #74536d58; }
.iw-pond-touch:disabled { cursor: default; opacity: .54; }
.iw-pond-light:focus-visible { outline: 2px solid #ffdbb7; outline-offset: -2px; }

.iw-pond-water { display: block; pointer-events: none; }
.iw-pond-shore { pointer-events: none; }

.iw-pond-scene::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 22% 26%, rgba(239, 210, 191, .28), transparent 63%),
        radial-gradient(ellipse at 70% 43%, rgba(197, 163, 190, .18), transparent 59%);
    opacity: var(--iw-pond-dawn, 0);
    transition: opacity 1.4s cubic-bezier(.22, .68, .3, 1);
    content: '';
}

.iw-pond-date {
    position: absolute;
    inset-block-end: clamp(.6rem, 2.6vw, 1.4rem);
    inset-inline-start: clamp(.65rem, 2.6vw, 1.5rem);
    min-height: 1.95rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .18rem .7rem;
    border: 1px solid rgba(227, 195, 191, .2);
    border-radius: 100px;
    color: #f6e9e2;
    background: rgba(30, 22, 35, .77);
    font-size: .75rem;
    letter-spacing: .035em;
    line-height: 1.2;
    pointer-events: none;
}

.iw-pond-date::before {
    content: '';
    width: .33rem;
    height: .33rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #ffe3be;
    box-shadow: 0 0 .6rem #ffccb288;
}

.iw-pond-scene.is-archived .iw-pond-date::before {
    background: transparent;
    outline: 1px solid var(--iw-brass);
    box-shadow: none;
}

.iw-pond-position {
    position: absolute;
    z-index: 1;
    touch-action: manipulation;
    left: var(--iw-pond-x);
    top: var(--iw-pond-y);
    transform: translate(-50%, -50%);
    appearance: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffdcc4;
    pointer-events: auto;
    cursor: pointer;
}

.iw-pond-position::before,
.iw-pond-position::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: opacity .23s ease, scale .23s ease, border-color .23s ease;
}

.iw-pond-position::before {
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 1px solid #f5d0b9be;
    opacity: 0;
}

.iw-pond-position::after {
    width: 3px;
    height: 3px;
    background: #f9e6d9;
    opacity: 0;
}

.iw-pond-position[data-state="empty"]::before,
.iw-pond-position[data-state="empty"]::after { opacity: .85; }

.iw-pond-position[data-state="empty"]::before {
    background: #382b35a3;
    box-shadow: 0 0 18px #facbb346;
}

.iw-pond-position.is-mine::after {
    opacity: .92;
    background: #ffd9b9;
    box-shadow: 0 0 7px #fed1aa;
}

.iw-pond-position:hover::before,
.iw-pond-position.is-selected::before,
.iw-pond-position:focus-visible::before {
    opacity: 1;
    scale: 1.34;
    border-color: #ffdfc7;
    box-shadow: 0 0 0 3px #241c2880, 0 0 19px #fce2c056;
}

.iw-pond-position.is-selected { z-index: 3; }
.iw-pond-position:focus-visible { z-index: 4; }

.iw-pond-ripple {
    position: absolute;
    inset: var(--iw-pond-y) auto auto var(--iw-pond-x);
    width: 64px;
    height: 23px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 220, 191, .58);
    border-radius: 50%;
    box-shadow: inset 0 0 15px rgba(255, 204, 166, .22), 0 0 12px rgba(255, 218, 193, .19);
    pointer-events: none;
    animation: iw-pond-ripple 1.55s cubic-bezier(.2, .48, .43, 1) both;
}

.iw-pond-ripple::before {
    position: absolute;
    inset: 3px 7px;
    border: 1px solid rgba(255, 223, 206, .31);
    border-radius: inherit;
    content: '';
}

.iw-pond-ripple[data-kind="visitor"] { border-color: #fce1c6d6; }
.iw-pond-ripple[data-kind="plant"] { border-color: #ffe5cfc3; }

@keyframes iw-pond-ripple {
    0% { transform: translate(-50%, -50%) scale(.17); opacity: .88; }
    32% { opacity: .58; }
    100% { transform: translate(-50%, -50%) scale(2.29); opacity: 0; }
}

.iw-pond-deck {
    display: grid;
    grid-template-columns: minmax(18rem, 1.04fr) minmax(17rem, 1fr);
    background:
        radial-gradient(ellipse at top left, #613b4926, transparent 64%),
        linear-gradient(135deg, #291f2b 0%, #211a25 65%, #221a25 100%);
}

.iw-pond-care {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    box-sizing: border-box;
    padding: clamp(.85rem, 2vw, 1.35rem) clamp(.85rem, 2.6vw, 1.9rem);
    border-right: 1px solid rgba(233, 191, 195, .13);
}

.iw-pond-note { min-width: 0; }

.iw-pond-note-title {
    margin: 0 0 .23rem;
    color: var(--iw-ink);
    font-family: var(--iw-reading-font, "LXGW WenKai", "Kaiti SC", serif);
    font-size: clamp(1.045rem, 1.55vw, 1.22rem);
    line-height: 1.35;
    letter-spacing: .055em;
}

.iw-pond-note-text {
    margin: 0;
    color: var(--iw-muted);
    min-height: 2.75em;
    font-size: .81rem;
    line-height: 1.5;
}

.iw-pond-buttons {
    display: flex;
    align-items: center;
    gap: .42rem;
    flex: 0 0 auto;
}

.iw-pond-buttons button, .iw-pond-live, .iw-pond-scene-submit, .iw-pond-visitors-actions button {
    touch-action: manipulation;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: .44rem .68rem;
    box-sizing: border-box;
    border: 1px solid rgba(231, 192, 183, .25);
    border-radius: 10px;
    background: #322735;
    color: var(--iw-ink);
    font: inherit;
    font-size: .83rem;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .22s ease, border-color .22s ease;
}

.iw-pond-buttons .iw-pond-plant, .iw-pond .iw-pond-scene-submit {
    color: #2d1c2b;
    border-color: #f3c8ba;
    background: #e6b8ad;
    font-weight: 600;
}

.iw-pond .iw-pond-scene-submit {
    position: absolute;
    z-index: 5;
    inset-inline-end: .65rem;
    inset-block-end: .55rem;
    display: none;
    box-shadow: 0 5px 24px #1b121f66;
}

.iw-pond-buttons .iw-pond-plant:not(:disabled):hover { background: #f3cbbf; }
.iw-pond-buttons button:not(:disabled):hover,
.iw-pond-live:hover, .iw-pond-visitors-actions button:not(:disabled):hover { border-color: #ddafb1; }
.iw-pond-buttons button:disabled, .iw-pond-visitors-actions button:disabled { opacity: .54; cursor: default; }

.iw-pond-history {
    padding: .52rem clamp(.85rem, 2.6vw, 1.9rem) .55rem;
}

.iw-pond-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    min-height: 44px;
}

.iw-pond-history-head label {
    color: var(--iw-ink);
    font-family: var(--iw-reading-font, "LXGW WenKai", "Kaiti SC", serif);
    font-size: 1rem;
    white-space: nowrap;
}

.iw-pond-time {
    margin-inline-start: auto;
    color: var(--iw-muted);
    font-size: .745rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.iw-pond-live {
    padding-inline: .58rem;
    font-size: .75rem;
    background: transparent;
}

.iw-pond-history input[type="range"] {
    appearance: none;
    display: block;
    width: 100%;
    height: 44px;
    margin-block: -.45rem -.42rem;
    margin-inline: 0;
    background: transparent;
    cursor: pointer;
}

.iw-pond-history input:disabled { cursor: default; opacity: .55; }

.iw-pond-history input::-webkit-slider-runnable-track {
    box-sizing: border-box;
    height: 3px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #b37786, #e7b99b var(--iw-pond-fraction, 100%), #594351 var(--iw-pond-fraction, 100%));
}

.iw-pond-history input::-moz-range-track {
    box-sizing: border-box;
    height: 3px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #b37786, #e7b99b var(--iw-pond-fraction, 100%), #594351 var(--iw-pond-fraction, 100%));
}

.iw-pond-history input::-webkit-slider-thumb {
    appearance: none;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    margin-top: -5.5px;
    border: 1px solid #fff0da;
    border-radius: 50%;
    background: #e8bbac;
    box-shadow: 0 0 0 3px #e6afa935;
}

.iw-pond-history input::-moz-range-thumb {
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    border: 1px solid #fff0da;
    border-radius: 50%;
    background: #e8bbac;
    box-shadow: 0 0 0 3px #e6afa935;
}

.iw-pond-history-ticks {
    display: flex;
    justify-content: space-between;
    color: #c9aeb5;
    font-size: .68rem;
    letter-spacing: .045em;
}

.iw-pond-visitors {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem .9rem;
    padding: .56rem clamp(.85rem, 2.6vw, 1.9rem);
    border-block-start: 1px solid #e9bfc325;
    background: linear-gradient(105deg, #342738, #28202d 69%, #261f2b);
}

.iw-pond-visitors-copy {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .16rem .8rem;
    min-width: 0;
}

.iw-pond-visitors-title {
    margin: 0;
    color: #f4d9cd;
    font-family: var(--iw-reading-font);
    font-size: .95rem;
    line-height: 1.5;
    white-space: nowrap;
}

.iw-pond-visitors-count {
    margin: 0;
    color: var(--iw-muted);
    font-size: .76rem;
    line-height: 1.45;
}

.iw-pond-visitors-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .38rem;
}

.iw-pond-visitors-actions button {
    font-size: .75rem;
    padding-inline: .61rem;
}

.iw-pond-visitors-actions .iw-pond-view-wave {
    background: transparent;
    border-color: transparent;
}

.iw-pond button:focus-visible,
.iw-pond input:focus-visible {
    outline: 2px solid #ffdbb7;
    outline-offset: 2px;
}

.iw-pond-announcement {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 63rem) {
    .iw-pond-care { flex-wrap: wrap; }
    .iw-pond-note-text { min-height: 1.5em; }
}

@media (max-width: 46rem) {
    .iw-pond {
        width: calc(100% - 1.5rem);
        padding-block: clamp(1rem, 4vh, 2.2rem) 1.5rem;
    }
    .iw-pond-deck { grid-template-columns: 1fr; }
    .iw-pond-care {
        align-items: center;
        border-right: 0;
        border-block-end: 1px solid #e9bfc320;
    }
    .iw-pond-history { padding-block-end: .7rem; }
    .iw-pond .iw-pond-scene-submit { display: inline-flex; }
    .iw-pond-scene.has-plant-choice + .iw-pond-deck .iw-pond-plant { display: none; }
    .iw-pond-visitors { align-items: flex-start; flex-wrap: wrap; }
    .iw-pond-visitors-actions { margin-inline-start: auto; }
}

@media (max-width: 42.5rem) and (orientation: portrait) {
    .iw-pond-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .64rem;
    }
    .iw-pond-intro { text-align: start; }
    .iw-pond-scene { height: clamp(23rem, 50svh, 34rem); }
    .iw-pond-art img { object-position: var(--iw-pond-art-position-mobile, 51% 51%); }
    .iw-pond-care { gap: .62rem .65rem; }
}

@media (max-height: 31rem) and (orientation: landscape) {
    .iw-pond { padding-block: .65rem 1.2rem; }
    .iw-pond-heading { margin-block-end: .65rem; }
    .iw-pond-reading { margin-block-end: .22rem; font-size: .7rem; }
    .iw-pond #iw-pond-title { font-size: clamp(1.9rem, 6vw, 3rem); }
    .iw-pond-intro { font-size: .95rem; }
    .iw-pond-scene { height: clamp(17rem, 76svh, 23rem); }
    .iw-pond-deck { grid-template-columns: minmax(14.6rem, 1fr) 1fr; }
    .iw-pond-care { border-right: 1px solid #e9bfc320; border-block-end: 0; }
    .iw-pond .iw-pond-scene-submit { display: inline-flex; }
    .iw-pond-scene.has-plant-choice + .iw-pond-deck .iw-pond-plant { display: none; }
}

@media (max-height: 31rem) and (max-width: 34rem) and (orientation: landscape) {
    .iw-pond-deck { grid-template-columns: 1fr; }
    .iw-pond-care { border-right: 0; border-block-end: 1px solid #e9bfc320; }
}

@media (prefers-reduced-motion: reduce) {
    .iw-pond *, .iw-pond *::before, .iw-pond *::after { transition-duration: 0s !important; }
    .iw-pond-ripple { animation: none; }
    .iw-pond-ripple.is-resting { transform: translate(-50%, -50%) scale(.78); opacity: .68; }
}
