html[data-theme="night"] {
    --drift-sky: #173d52;
    --drift-sky-warm: #d47f6b;
    --drift-sea: #071f2e;
    --drift-sea-soft: #0e4858;
    --drift-foam: #d9f0e8;
    --drift-ink: #fff5df;
    --drift-muted: #b8d0d2;
    --drift-panel: #f6ecd7;
    --drift-panel-2: #fff8e9;
    --drift-panel-ink: #183448;
    --drift-panel-muted: #6b7f86;
    --drift-accent: #efb86e;
    --drift-accent-strong: #d97a64;
    --drift-line: rgba(255, 255, 255, .18);
    --drift-panel-line: rgba(24, 52, 72, .13);
    --drift-shadow: 0 24px 80px rgba(2, 17, 28, .4);
}

html[data-theme="day"] {
    --drift-sky: #f1d59d;
    --drift-sky-warm: #efb278;
    --drift-sea: #276f80;
    --drift-sea-soft: #62b2b2;
    --drift-foam: #f7fff8;
    --drift-ink: #12394a;
    --drift-muted: #315d67;
    --drift-panel: #fff8e9;
    --drift-panel-2: #fffdf6;
    --drift-panel-ink: #17384a;
    --drift-panel-muted: #6d7f81;
    --drift-accent: #f0b05f;
    --drift-accent-strong: #df7d67;
    --drift-line: rgba(18, 57, 74, .16);
    --drift-panel-line: rgba(24, 52, 72, .12);
    --drift-shadow: 0 24px 80px rgba(22, 66, 77, .2);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body.drift-page {
    margin: 0;
    overflow: hidden;
    background: var(--drift-sea);
    color: var(--drift-ink);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--drift-accent);
    outline-offset: 3px;
}

.drift-icon {
    width: 1.25em;
    height: 1.25em;
    display: block;
    flex: 0 0 auto;
}

.drift-app {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    width: min(1440px, calc(100vw - 32px));
    height: min(900px, calc(100dvh - 32px));
    min-height: 640px;
    margin: 16px auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    box-shadow: var(--drift-shadow);
}

.drift-scene {
    position: relative;
    min-width: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(180deg, var(--drift-sky) 0%, var(--drift-sky-warm) 34%, var(--drift-sea-soft) 62%, var(--drift-sea) 100%);
}

.drift-scene::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: -4%;
    right: -4%;
    bottom: -2%;
    height: 54%;
    opacity: .82;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 500' preserveAspectRatio='none'%3E%3Cpath d='M0 82C170 38 316 40 480 82s318 45 480 0 330-42 640 8v410H0Z' fill='%230b3446' fill-opacity='.24'/%3E%3Cpath d='M0 154c170-48 318-43 482 3s315 48 477 0 331-38 641 14v329H0Z' fill='%23082132' fill-opacity='.32'/%3E%3Cpath d='M0 252c190-51 344-43 506 7s308 49 474 5 331-37 620 6v230H0Z' fill='%23061927' fill-opacity='.48'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
}

.drift-scene::before {
    background-image:
        repeating-linear-gradient(174deg, transparent 0 22px, rgba(227, 247, 241, .12) 23px 24px, transparent 25px 45px),
        linear-gradient(180deg, transparent 0%, rgba(4, 30, 44, .1) 38%, rgba(3, 20, 31, .32) 100%);
}

.drift-scene::after {
    content: "";
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    height: 26%;
    background:
        repeating-linear-gradient(174deg, transparent 0 17px, rgba(229, 248, 243, .18) 18px 19px, transparent 20px 35px),
        linear-gradient(180deg, transparent, rgba(3, 20, 31, .3));
    opacity: .66;
    pointer-events: none;
}

.drift-water {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.drift-bubbles {
    position: absolute;
    z-index: 4;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.drift-bubbles span {
    position: absolute;
    left: var(--x);
    bottom: 4%;
    width: var(--size);
    height: var(--size);
    border: 1px solid rgba(230, 250, 245, .42);
    border-radius: 50%;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .36);
    opacity: 0;
    animation: drift-bubble-rise var(--duration) ease-in var(--delay) infinite;
    will-change: transform, opacity;
}

.drift-sun {
    position: absolute;
    z-index: 1;
    top: 11%;
    right: 12%;
    width: clamp(74px, 9vw, 126px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 235, 186, .72);
    box-shadow: 0 0 90px rgba(255, 210, 142, .54);
    animation: drift-sun-breathe 7s ease-in-out infinite;
    pointer-events: none;
}

html[data-theme="day"] .drift-sun {
    background: rgba(255, 248, 217, .92);
    box-shadow: 0 0 100px rgba(255, 233, 167, .82);
}

.drift-cloud {
    position: absolute;
    z-index: 1;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 245, 226, .2);
    filter: blur(2px);
    pointer-events: none;
}

.drift-cloud-a {
    top: 19%;
    left: 11%;
    width: 190px;
    animation: drift-cloud-a 14s ease-in-out infinite alternate;
}

.drift-cloud-b {
    top: 28%;
    right: 25%;
    width: 130px;
    opacity: .65;
    animation: drift-cloud-b 18s ease-in-out infinite alternate;
}

.drift-topbar {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    right: 0;
    animation: drift-fade-down .7s cubic-bezier(.2, .8, .2, 1) both;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: max(18px, env(safe-area-inset-top)) 26px 0;
}

.drift-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.drift-brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--drift-line);
    border-radius: 50%;
    background: rgba(4, 25, 37, .16);
    backdrop-filter: blur(10px);
}

.drift-brand-mark .drift-icon {
    width: 20px;
    height: 20px;
}

.drift-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 5px 7px 5px 5px;
    border: 1px solid var(--drift-line);
    border-radius: 999px;
    background: rgba(4, 25, 37, .17);
    font-size: 13px;
    backdrop-filter: blur(12px);
}

.drift-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.drift-user > span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drift-login-link {
    min-height: 32px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--drift-accent);
    color: #173447;
    font-weight: 700;
    cursor: pointer;
}

.drift-hero {
    position: absolute;
    z-index: 5;
    top: 14%;
    left: clamp(26px, 5vw, 74px);
    right: 36%;
    animation: drift-hero-in .9s .08s cubic-bezier(.18, .8, .2, 1) both;
    pointer-events: none;
}

.drift-kicker,
.drift-panel-kicker,
.drift-dialog-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
}

.drift-kicker {
    color: var(--drift-muted);
}

.drift-hero h1 {
    margin: 0;
    font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
    font-size: clamp(44px, 6.2vw, 78px);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: .04em;
}

.drift-hero > p:last-child {
    max-width: 520px;
    margin: 16px 0 0;
    color: var(--drift-muted);
    font-size: clamp(14px, 1.3vw, 17px);
    line-height: 1.8;
}

.drift-bottle-stage {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 51%;
    width: clamp(190px, 27vw, 310px);
    aspect-ratio: .78;
    transform: translate(calc(-50% + var(--drift-parallax-x, 0px)), calc(-50% + var(--drift-parallax-y, 0px)));
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
    pointer-events: none;
}


.drift-bottle {
    position: absolute;
    inset: 0;
    animation: drift-bob 5.8s ease-in-out infinite;
    will-change: transform, opacity;
    transform-origin: 50% 72%;
}

.drift-bottle svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 20px 18px rgba(4, 26, 39, .26));
    animation: drift-bottle-sway 7.2s ease-in-out infinite;
    transform-origin: 50% 82%;
}

.drift-splash {
    position: absolute;
    z-index: -1;
    left: 50%;
    bottom: 2%;
    width: 92%;
    height: 34%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
}

.drift-splash i {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 28%;
    height: 36%;
    border: 2px solid rgba(235, 255, 249, .72);
    border-top-color: transparent;
    border-radius: 50%;
    transform: translateX(-50%) scale(.35);
    opacity: 0;
}

.drift-splash i:nth-child(2) {
    width: 48%;
    height: 55%;
}

.drift-splash i:nth-child(3) {
    width: 68%;
    height: 74%;
}

.drift-bottle-stage.is-picking .drift-splash,
.drift-bottle-stage.is-throwing .drift-splash {
    opacity: 1;
}

.drift-bottle-stage.is-picking .drift-splash i,
.drift-bottle-stage.is-throwing .drift-splash i {
    animation: drift-splash-ring .95s ease-out both;
}

.drift-bottle-stage.is-picking .drift-splash i:nth-child(2),
.drift-bottle-stage.is-throwing .drift-splash i:nth-child(2) {
    animation-delay: .12s;
}

.drift-bottle-stage.is-picking .drift-splash i:nth-child(3),
.drift-bottle-stage.is-throwing .drift-splash i:nth-child(3) {
    animation-delay: .24s;
}
.drift-ripple {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 2%;
    height: 24px;
    border: 1px solid rgba(226, 247, 242, .28);
    border-radius: 50%;
    animation: drift-ripple 4.5s ease-out infinite;
}

.drift-ripple-b {
    animation-delay: 2.2s;
}

.drift-bottle-stage.is-picking .drift-bottle {
    animation: drift-pick 1.05s cubic-bezier(.22, .66, .24, 1) both;
}

.drift-bottle-stage.is-throwing .drift-bottle {
    animation: drift-throw 1.25s cubic-bezier(.22, .66, .24, 1) both;
}

.drift-bottle-stage.is-returning .drift-bottle {
    animation: drift-return .95s cubic-bezier(.18, .8, .2, 1) both;
}

.drift-scene.is-splashing::after {
    animation: drift-water-flash 1s ease-out both;
}

.drift-scene-foot {
    position: absolute;
    z-index: 7;
    left: 28px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--drift-muted);
    font-size: 12px;
}

.drift-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9be0c5;
    box-shadow: 0 0 0 4px rgba(155, 224, 197, .14);
    animation: drift-live-pulse 2.2s ease-out infinite;
}

.drift-panel {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 0;
    animation: drift-panel-in .8s .12s cubic-bezier(.18, .8, .2, 1) both;
    padding: 32px 28px max(28px, env(safe-area-inset-bottom));
    background: var(--drift-panel);
    color: var(--drift-panel-ink);
}

.drift-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.drift-panel-kicker,
.drift-dialog-kicker {
    color: var(--drift-accent-strong);
}

.drift-panel-head h2,
.drift-dialog-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 650;
    line-height: 1.2;
}

.drift-icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--drift-panel-line);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.drift-icon-button:hover {
    background: rgba(24, 52, 72, .06);
}

.drift-icon-button:active {
    transform: scale(.96);
}

.drift-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 28px 0;
    padding: 20px 0;
    border-top: 1px solid var(--drift-panel-line);
    border-bottom: 1px solid var(--drift-panel-line);
}

.drift-stat {
    min-width: 0;
    text-align: center;
}

.drift-stat + .drift-stat {
    border-left: 1px solid var(--drift-panel-line);
}

.drift-stat strong {
    display: block;
    margin-bottom: 3px;
    font-size: 28px;
    font-weight: 650;
    line-height: 1;
    transform-origin: 50% 70%;
}

.drift-stat strong.is-changing {
    animation: drift-number-pop .42s cubic-bezier(.18, .82, .2, 1);
}

.drift-stat span {
    display: block;
    overflow: hidden;
    color: var(--drift-panel-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drift-primary-actions {
    display: grid;
    gap: 12px;
}

.drift-primary-actions .drift-button > span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.drift-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}

.drift-button:hover {
    transform: translateY(-1px);
}

.drift-button:active {
    transform: scale(.98);
}

.drift-button:disabled {
    cursor: wait;
    opacity: .62;
    transform: none;
}

.drift-button-primary {
    background: linear-gradient(135deg, #f9d69b, var(--drift-accent));
    color: #173447;
    box-shadow: 0 10px 28px rgba(214, 148, 70, .2);
}

.drift-button-secondary {
    border-color: var(--drift-panel-line);
    background: var(--drift-panel-2);
    color: var(--drift-panel-ink);
}

.drift-button-quiet {
    border-color: var(--drift-panel-line);
    background: transparent;
    color: inherit;
}

.drift-history-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    margin-top: 12px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--drift-panel-line);
    background: transparent;
    color: inherit;
    font-weight: 650;
    cursor: pointer;
}

.drift-history-button > span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.drift-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    margin-top: auto;
    padding-top: 26px;
    color: var(--drift-panel-muted);
    font-size: 12px;
    line-height: 1.65;
}

.drift-note > span {
    color: var(--drift-accent-strong);
}

.drift-note p {
    margin: 0;
}

.drift-credit-guide {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--drift-panel-line);
    background: linear-gradient(150deg, rgba(239, 184, 110, .18), rgba(217, 122, 100, .1));
    color: var(--drift-panel-ink);
}

.drift-credit-guide.is-urgent {
    border-color: rgba(217, 122, 100, .55);
    background: linear-gradient(150deg, rgba(217, 122, 100, .22), rgba(239, 184, 110, .16));
}

.drift-credit-guide-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.drift-credit-guide-icon {
    display: inline-flex;
    color: var(--drift-accent-strong);
}

.drift-credit-guide-icon .drift-icon {
    width: 18px;
    height: 18px;
}

.drift-credit-guide-text {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--drift-panel-muted);
}

.drift-credit-guide-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.drift-credit-link {
    flex: 1 1 auto;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--drift-panel-line);
    background: var(--drift-panel-2);
    color: var(--drift-panel-ink);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.drift-credit-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 17, 28, .12);
}

.drift-credit-link-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--drift-accent) 0%, var(--drift-accent-strong) 100%);
    color: #fff;
}

.drift-dialog {
    width: min(560px, calc(100vw - 28px));
    max-height: min(820px, calc(100dvh - 28px));
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: var(--drift-panel);
    color: var(--drift-panel-ink);
    box-shadow: 0 28px 100px rgba(2, 17, 28, .48);
}

.drift-dialog::backdrop {
    background: rgba(3, 18, 29, .64);
    backdrop-filter: blur(4px);
    animation: drift-backdrop-in .28s ease-out both;
}

.drift-dialog-shell {
    max-height: min(820px, calc(100dvh - 28px));
    overflow-y: auto;
    padding: 26px;
    animation: drift-dialog-in .42s cubic-bezier(.16, .82, .22, 1) both;
}

.drift-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.drift-dialog-head .drift-icon-button {
    color: var(--drift-panel-ink);
}

.drift-compose-form {
    display: grid;
    gap: 14px;
}

.drift-field {
    display: block;
}

.drift-field textarea {
    display: block;
    width: 100%;
    min-height: 220px;
    resize: vertical;
    padding: 18px;
    border: 1px solid var(--drift-panel-line);
    border-radius: 8px;
    background: var(--drift-panel-2);
    color: var(--drift-panel-ink);
    line-height: 1.9;
}

.drift-field textarea::placeholder {
    color: #8a9899;
}

.drift-compose-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 20px;
    color: var(--drift-panel-muted);
    font-size: 12px;
}

[data-compose-error] {
    color: #c65e4e;
}

.drift-submit {
    width: 100%;
}

.drift-creature-result {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 12px 0 20px;
    text-align: center;
    animation: drift-creature-in .55s cubic-bezier(.16, .82, .22, 1) both;
}

.drift-creature-result[hidden] {
    display: none;
}

.drift-creature-result img {
    display: block;
    width: min(230px, 68vw);
    max-height: 230px;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: drop-shadow(0 18px 18px rgba(32, 83, 86, .18));
    animation: drift-creature-float 4.8s ease-in-out infinite;
}

.drift-creature-result p {
    max-width: 330px;
    margin: 16px 0 0;
    color: var(--drift-panel-muted);
    line-height: 1.8;
}

.drift-letter {
    position: relative;
    padding: 24px;
    border: 1px solid rgba(130, 91, 38, .15);
    border-radius: 8px;
    background:
        repeating-linear-gradient(0deg, transparent 0 33px, rgba(151, 111, 52, .12) 34px 35px),
        linear-gradient(145deg, #fffaf0, #f2dfb6);
    color: #2b3e44;
    box-shadow: inset 0 0 40px rgba(135, 93, 34, .06);
}

.drift-letter-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #697778;
    font-size: 13px;
}

.drift-letter-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(63, 107, 111, .12);
}

.drift-letter-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drift-letter p {
    min-height: 110px;
    margin: 0 0 18px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
    font-size: 17px;
    line-height: 2;
}

.drift-letter time {
    display: block;
    color: #788383;
    font-size: 12px;
    text-align: right;
}

.drift-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.drift-result-picked {
    color: var(--drift-panel-muted);
    font-size: 12px;
}

.drift-like-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid rgba(217, 122, 100, .4);
    border-radius: 999px;
    background: #fff6ef;
    color: #c9553f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.drift-like-button .drift-icon {
    width: 16px;
    height: 16px;
}

.drift-like-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #ffece2;
}

.drift-like-button.is-liked,
.drift-like-button:disabled {
    cursor: default;
    border-color: transparent;
    background: linear-gradient(135deg, #f08a6f, #d9553f);
    color: #fff;
}

.drift-like-button.is-liked .drift-icon {
    fill: currentColor;
}

.drift-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.drift-result-actions > * {
    flex: 1;
}

.drift-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--drift-panel-line);
}

.drift-tabs button {
    min-height: 48px;
    padding: 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--drift-panel-muted);
    font-weight: 650;
    cursor: pointer;
}

.drift-tabs button[aria-selected="true"] {
    border-bottom-color: var(--drift-accent-strong);
    color: var(--drift-panel-ink);
}

.drift-history-list {
    min-height: 240px;
}

.drift-record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px 0;
    animation: drift-record-in .42s cubic-bezier(.18, .82, .2, 1) both;
    animation-delay: calc(var(--record-index, 0) * 42ms);
    border-bottom: 1px solid var(--drift-panel-line);
}

.drift-record:last-child {
    border-bottom: 0;
}

.drift-record-main {
    min-width: 0;
}

.drift-record-content {
    display: -webkit-box;
    margin: 0 0 7px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.drift-record-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--drift-panel-muted);
    font-size: 12px;
}

.drift-record-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(24, 52, 72, .07);
}

.drift-record-actions {
    align-self: center;
}

.drift-record-withdraw {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--drift-panel-line);
    border-radius: 7px;
    background: transparent;
    color: var(--drift-panel-muted);
    font-size: 12px;
    cursor: pointer;
}

.drift-empty {
    display: grid;
    place-items: center;
    min-height: 250px;
    padding: 30px;
    color: var(--drift-panel-muted);
    text-align: center;
}

.drift-empty .drift-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    color: var(--drift-accent-strong);
}

.drift-empty p {
    margin: 0;
    line-height: 1.7;
}

[data-history-dialog] .drift-empty .drift-icon {
    animation: drift-spin 1.1s linear infinite;
}

.drift-login-shell {
    padding: 40px 30px 30px;
    text-align: center;
}

.drift-login-art {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(239, 184, 110, .2);
    color: var(--drift-accent-strong);
}

.drift-login-art .drift-icon {
    width: 34px;
    height: 34px;
}

.drift-login-shell h2 {
    margin: 0 0 12px;
    font-size: 25px;
}

.drift-login-shell p {
    margin: 0 auto 24px;
    max-width: 360px;
    color: var(--drift-panel-muted);
    line-height: 1.8;
}

.drift-toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    max-width: min(420px, calc(100vw - 28px));
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(8, 30, 43, .9);
    color: #fff6e5;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 12px 40px rgba(1, 13, 21, .32);
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}

.drift-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.drift-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes drift-bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(10px) rotate(2deg); }
}

@keyframes drift-ripple {
    0% { transform: scale(.66); opacity: 0; }
    28% { opacity: .62; }
    100% { transform: scale(1.2); opacity: 0; }
}

@keyframes drift-pick {
    0% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
    18% { transform: translateY(24px) scale(.94) rotate(-2deg); }
    42% { transform: translateY(7px) scale(1.04) rotate(2deg); }
    100% { transform: translateY(-145px) scale(1.26) rotate(-15deg); opacity: 0; }
}

@keyframes drift-throw {
    0% { transform: translate(38%, 105%) scale(1.34) rotate(34deg); opacity: 0; }
    18% { opacity: 1; }
    52% { transform: translateY(-150px) scale(.7) rotate(-14deg); }
    74% { transform: translateY(-48px) scale(.66) rotate(6deg); }
    88% { transform: translateY(16px) scale(.61) rotate(-3deg); }
    100% { transform: translateY(0) scale(1) rotate(0); }
}

@keyframes drift-spin {
    to { transform: rotate(360deg); }
}

@keyframes drift-bubble-rise {
    0% { opacity: 0; transform: translate3d(0, 20px, 0) scale(.7); }
    14% { opacity: .62; }
    62% { opacity: .44; }
    100% { opacity: 0; transform: translate3d(18px, -62vh, 0) scale(1.18); }
}

@keyframes drift-sun-breathe {
    0%, 100% { transform: scale(1); opacity: .82; }
    50% { transform: scale(1.06); opacity: 1; }
}

@keyframes drift-cloud-a {
    from { transform: translateX(-8px); }
    to { transform: translateX(22px); }
}

@keyframes drift-cloud-b {
    from { transform: translateX(12px); }
    to { transform: translateX(-26px); }
}

@keyframes drift-bottle-sway {
    0%, 100% { transform: rotate(-1.8deg) translateY(0); }
    35% { transform: rotate(1.4deg) translateY(-5px); }
    68% { transform: rotate(-.8deg) translateY(3px); }
}

@keyframes drift-splash-ring {
    0% { opacity: 0; transform: translateX(-50%) scale(.25); }
    24% { opacity: .9; }
    100% { opacity: 0; transform: translateX(-50%) scale(1.28); }
}

@keyframes drift-water-flash {
    0%, 100% { opacity: .66; }
    28% { opacity: .94; }
    58% { opacity: .52; }
}

@keyframes drift-return {
    0% { opacity: 0; transform: translateY(44px) scale(.72) rotate(8deg); }
    64% { opacity: 1; transform: translateY(-8px) scale(1.04) rotate(-2deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes drift-fade-down {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drift-hero-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drift-panel-in {
    from { opacity: 0; transform: translateX(34px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes drift-panel-mobile-in {
    from { opacity: 0; transform: translateY(42px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drift-live-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(155, 224, 197, .14); }
    50% { box-shadow: 0 0 0 8px rgba(155, 224, 197, .03); }
}

@keyframes drift-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drift-dialog-in {
    from { opacity: 0; transform: translateY(24px) scale(.965); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drift-number-pop {
    0% { transform: scale(1); }
    44% { transform: scale(1.28); color: var(--drift-accent-strong); }
    100% { transform: scale(1); }
}

@keyframes drift-record-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drift-creature-in {
    from { opacity: 0; transform: translateY(18px) scale(.88); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drift-creature-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-9px) rotate(1.5deg); }
}

@media (max-width: 1120px) {
    .drift-app {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

    .drift-panel {
        padding-left: 24px;
        padding-right: 24px;
    }

    .drift-hero {
        right: 30%;
    }
}

@media (max-width: 900px) {
    body.drift-page {
        background: var(--drift-sea);
    }

    .drift-app {
        display: block;
        width: 100%;
        height: 100dvh;
        min-height: 560px;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .drift-scene {
        position: absolute;
        inset: 0;
    }

    .drift-topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .drift-hero {
        top: 12%;
        left: 22px;
        right: 22px;
    }

    .drift-hero h1 {
        font-size: clamp(38px, 10vw, 58px);
    }

    .drift-hero > p:last-child {
        max-width: 420px;
        font-size: 14px;
    }

    .drift-bottle-stage {
        top: 43%;
        width: clamp(150px, 34vw, 230px);
    }

    .drift-scene-foot {
        display: none;
    }

    .drift-panel {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        animation-name: drift-panel-mobile-in;
        max-height: 46dvh;
        overflow-y: auto;
        padding: 20px;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 8px;
        box-shadow: 0 18px 60px rgba(3, 18, 29, .3);
    }

    .drift-panel-head h2 {
        font-size: 22px;
    }

    .drift-stats {
        margin: 16px 0;
        padding: 14px 0;
    }

    .drift-stat strong {
        font-size: 23px;
    }

    .drift-primary-actions {
        grid-template-columns: 1fr 1fr;
    }

    .drift-credit-guide:not([hidden]) {
        display: flex;
        flex-direction: column;
    }

    .drift-credit-guide-links {
        order: -1;
        margin-bottom: 12px;
    }

    .drift-note {
        display: none;
    }
}

@media (max-width: 560px) {
    .drift-topbar {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .drift-brand > span:last-child {
        display: none;
    }

    .drift-user > span {
        max-width: 92px;
    }

    .drift-hero {
        top: 11%;
    }

    .drift-hero h1 {
        font-size: 40px;
    }

    .drift-hero > p:last-child {
        margin-top: 10px;
        line-height: 1.65;
    }

    .drift-bottle-stage {
        top: 39%;
        width: 170px;
    }

    .drift-panel {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        max-height: 45dvh;
        padding: 17px;
    }

    .drift-panel-kicker {
        display: none;
    }

    .drift-panel-head h2 {
        font-size: 19px;
    }

    .drift-icon-button {
        width: 38px;
        height: 38px;
    }

    .drift-stats {
        margin: 13px 0;
        padding: 12px 0;
    }

    .drift-stat strong {
        font-size: 20px;
    }

    .drift-primary-actions {
        gap: 10px;
    }

    .drift-button {
        min-height: 48px;
        padding: 10px;
        gap: 8px;
        font-size: 13px;
    }

    .drift-history-button {
        min-height: 48px;
        margin-top: 8px;
    }

    .drift-dialog {
        position: fixed;
        inset: auto 0 0;
        width: 100%;
        max-width: none;
        max-height: 88dvh;
        margin: 0;
        border-radius: 8px 8px 0 0;
    }

    .drift-dialog-shell {
        max-height: 88dvh;
        padding: 22px 18px max(22px, env(safe-area-inset-bottom));
    }

    .drift-field textarea {
        min-height: 170px;
    }

    .drift-result-actions {
        flex-direction: column-reverse;
    }
}

@media (max-height: 700px) and (min-width: 901px) {
    .drift-app {
        min-height: 560px;
    }

    .drift-panel {
        padding-top: 24px;
    }

    .drift-stats {
        margin: 18px 0;
        padding: 15px 0;
    }

    .drift-note {
        padding-top: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .drift-bottle,
    .drift-ripple,
    [data-history-dialog] .drift-empty .drift-icon {
        animation: none;
}

    .drift-bottle svg,
    .drift-bubbles span,
    .drift-sun,
    .drift-cloud,
    .drift-topbar,
    .drift-hero,
    .drift-panel,
    .drift-record,
    .drift-dialog-shell,
    .drift-dialog::backdrop,
    .drift-live-dot {
        animation: none;
    }

    .drift-creature-result,
    .drift-creature-result img {
        animation: none;
}

    .drift-bottle-stage {
        transform: translate(-50%, -50%);
        transition: none;
    }

    .drift-button,
    .drift-icon-button,
    .drift-toast {
        transition: none;
    }
}
