:root {
    color-scheme: light;
    --bg: #fff8f2;
    --ink: #2d2730;
    --muted: #786f78;
    --line: #eadbd2;
    --panel: #ffffff;
    --coral: #f06f61;
    --coral-dark: #cc5147;
    --teal: #2b9d96;
    --mint: #ddf4ee;
    --lavender: #ece5ff;
    --sun: #ffd166;
    --shadow: 0 16px 40px rgba(87, 57, 42, .12);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 209, 102, .22), transparent 28rem),
        linear-gradient(180deg, #fff4ef 0%, #f7fbf9 52%, #fff8f2 100%);
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    display: block;
}

.login-shell,
.app-shell {
    width: min(100%, 480px);
    margin: 0 auto;
}

.login-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.login-panel {
    width: 100%;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(234, 219, 210, .9);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px 22px;
}

.login-mascot {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 28px;
    margin: 0 auto 18px;
    box-shadow: 0 12px 28px rgba(240, 111, 97, .24);
}

.kicker {
    margin: 0 0 5px;
    color: var(--teal);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: 2rem;
    line-height: 1.05;
}

h2 {
    margin-bottom: 0;
    font-size: 1.22rem;
    line-height: 1.15;
}

.stack,
.compose,
.mood-box {
    display: grid;
    gap: 12px;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
}

input,
select,
textarea {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    color: var(--ink);
    padding: 13px 14px;
    outline: 0;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(43, 157, 150, .14);
}

.primary,
.ghost,
.icon-button,
.quick-action,
.action-row button,
.segmented button,
.keyboard button,
.ttt-board button,
.sheet button {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 800;
}

.primary {
    background: var(--coral);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 10px 22px rgba(240, 111, 97, .24);
}

.primary:active {
    transform: translateY(1px);
}

.ghost {
    background: var(--mint);
    color: #18736e;
    padding: 10px 14px;
}

.hint {
    color: var(--muted);
    font-size: .88rem;
}

.app-shell {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 14px calc(94px + env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.55rem;
}

.icon-button {
    width: 46px;
    height: 46px;
    background: var(--panel);
    color: var(--coral-dark);
    border: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(87, 57, 42, .08);
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.quick-action {
    position: relative;
    display: grid;
    gap: 5px;
    place-items: center;
    min-height: 84px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(234, 219, 210, .9);
    color: var(--ink);
    box-shadow: 0 8px 20px rgba(87, 57, 42, .08);
}

.quick-action span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--lavender);
    color: #6453ad;
    font-size: 1.1rem;
}

.quick-action strong {
    font-size: .82rem;
}

.screen {
    display: none;
}

.screen.active {
    display: grid;
    gap: 16px;
}

#chat.screen.active {
    min-height: calc(100dvh - 188px - env(safe-area-inset-bottom));
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.hero-band {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    align-items: center;
    width: 100%;
    min-height: 124px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(236, 229, 255, .95), rgba(221, 244, 238, .95));
    border: 1px solid rgba(255, 255, 255, .82);
    color: var(--ink);
    text-align: left;
    box-shadow: 0 10px 26px rgba(87, 57, 42, .08);
}

.hero-band img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 24px;
    background: rgba(255, 255, 255, .56);
}

.hero-band h2 {
    font-size: 1.42rem;
    margin-bottom: 6px;
}

.hero-band p:last-child {
    margin-bottom: 0;
    color: #51495a;
    line-height: 1.35;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.relationship-counter {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 78px;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    text-align: left;
    box-shadow: 0 8px 18px rgba(87, 57, 42, .06);
}

.relationship-counter span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 900;
}

.relationship-counter strong {
    font-size: 1.06rem;
    line-height: 1.25;
}

.list {
    display: grid;
    gap: 10px;
}

.item {
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px;
    box-shadow: 0 8px 18px rgba(87, 57, 42, .06);
}

.item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.item strong {
    display: block;
    margin-bottom: 4px;
}

.meta {
    color: var(--muted);
    font-size: .84rem;
}

.countdown-line {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    color: var(--coral-dark);
    font-size: .9rem;
    font-weight: 900;
}

.calendar-widget {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--line);
}

.calendar-nav,
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: center;
    text-align: center;
}

.calendar-nav {
    grid-template-columns: 48px 1fr 48px;
}

.calendar-nav strong {
    font-size: 1rem;
}

.calendar-weekdays {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 900;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day-cell {
    position: relative;
    min-height: 48px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0e5dc;
    color: var(--ink);
    font-weight: 800;
}

.day-cell.other-month {
    opacity: .38;
}

.day-cell.today {
    border-color: var(--teal);
    box-shadow: inset 0 0 0 2px rgba(43, 157, 150, .18);
}

.day-cell.selected {
    background: var(--mint);
}

.day-number {
    position: absolute;
    top: 7px;
    left: 8px;
    font-size: .8rem;
}

.day-dots {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 7px;
    display: flex;
    justify-content: center;
    gap: 3px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7a6f78;
}

.dot.rhea {
    background: #ff5aa5;
}

.dot.andre {
    background: #1f1b22;
}

.dot.system {
    background: linear-gradient(90deg, #ff5aa5 0 48%, #1f1b22 52% 100%);
}

.day-details {
    display: grid;
    gap: 8px;
}

.delete-button {
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffe7e1;
    color: var(--coral-dark);
    font-weight: 900;
}

.compose {
    background: rgba(255, 255, 255, .86);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    overflow: hidden;
}

.collapsible-panel {
    display: grid;
    gap: 12px;
}

.date-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.date-grid label {
    min-width: 0;
    overflow: hidden;
}

.date-grid input[type="date"] {
    min-width: 0;
    padding-left: 9px;
    padding-right: 7px;
    font-size: .9rem;
}

.compose.compact {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.checkline,
.upload-line {
    display: flex;
    gap: 9px;
    align-items: center;
    color: var(--muted);
    font-weight: 700;
}

.checkline input {
    width: 20px;
    height: 20px;
}

.emoji-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    max-height: 236px;
    overflow-y: auto;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
}

.emoji-row button {
    aspect-ratio: 1;
    min-height: 40px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--line);
    font-size: 1.28rem;
}

.emoji-row button.active {
    background: var(--sun);
    border-color: #e6ae2f;
}

#moodRange,
#moodChart,
#moodStats {
    display: none;
}

.segmented {
    display: flex;
    padding: 3px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
}

.segmented button {
    min-height: 34px;
    padding: 0 10px;
    background: transparent;
    color: var(--muted);
    font-size: .84rem;
}

.segmented button.active {
    background: var(--teal);
    color: white;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mood-chart {
    min-height: 260px;
    padding: 16px 12px 10px;
    border-radius: 20px;
    background: #151120;
    border: 1px solid #39304c;
    color: #eee7ff;
    overflow: hidden;
}

.mood-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.mood-chart-title {
    fill: #a899c1;
    font-size: 15px;
    font-weight: 700;
}

.mood-axis-emoji {
    font-size: 15px;
}

.mood-axis-label {
    fill: #74658e;
    font-size: 11px;
}

.mood-line-rhea,
.mood-line-andre {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mood-line-rhea,
.mood-dot-rhea {
    stroke: #ff5aa5;
}

.mood-line-andre,
.mood-dot-andre {
    stroke: #4a8cff;
}

.mood-dot-rhea,
.mood-dot-andre {
    fill: #151120;
    stroke-width: 3;
}

.mood-area-andre {
    fill: url(#moodBlueFade);
}

.mood-legend {
    font-size: 12px;
    font-weight: 800;
}

.mood-comments {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.mood-comment {
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(221, 244, 238, .62);
    color: var(--ink);
    font-size: .9rem;
}

.mood-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
}

.mood-comment-form input {
    min-height: 42px;
    padding: 10px 12px;
}

.mood-comment-form button {
    min-height: 42px;
    padding: 10px 12px;
}

.stat {
    min-height: 68px;
    padding: 10px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.stat strong {
    display: block;
    font-size: 1.35rem;
}

.reaction-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.reaction-row button,
.reaction {
    min-height: 32px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--lavender);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 12px;
}

.message {
    width: min(86%, 340px);
    padding: 10px 12px;
    border-radius: 18px;
    background: white;
    border: 1px solid var(--line);
}

.message.mine {
    align-self: flex-end;
    background: #e9faf4;
    border-color: #c8ebe4;
}

.message img,
.wish-card img,
.miss-photo {
    width: 100%;
    border-radius: 12px;
    margin-top: 8px;
}

.chat-compose {
    position: sticky;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 4;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hangman-last {
    display: grid;
    gap: 8px;
}

.file-pill {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--lavender);
    font-size: 1.35rem;
    font-weight: 900;
}

.file-pill input {
    display: none;
}

.wheel-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 350px;
}

.wheel-wrap::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid var(--ink);
    filter: drop-shadow(0 4px 4px rgba(45, 39, 48, .18));
}

#wheelCanvas {
    width: min(100%, 320px);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: drop-shadow(0 18px 28px rgba(87, 57, 42, .18));
}

.spin-button {
    position: absolute;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--teal);
}

.result-line {
    min-height: 32px;
    text-align: center;
    font-weight: 900;
    font-size: 1.15rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
}

.chip button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffe7e1;
    color: var(--coral-dark);
}

.add-chip {
    color: var(--ink);
    cursor: pointer;
}

.watch-picks {
    display: grid;
    gap: 8px;
}

.pet-head {
    display: grid;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fff, var(--mint));
    border: 1px solid var(--line);
}

.lumo-progress {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .82);
}

.lumo-progress span {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 900;
}

.lumo-progress div {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee8e2;
}

.lumo-progress i {
    display: block;
    width: var(--value, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--coral), #ffc8d8, var(--teal));
    transition: width .3s ease;
}

.lumo-stage {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    min-height: 300px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: radial-gradient(circle at 50% 18%, #fff, #fff7f1 58%, #f2fbf7);
    touch-action: none;
    user-select: none;
}

.lumo-stage img,
.lumo-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lumo-egg-base {
    z-index: 1;
}

.lumo-scarf-layer {
    z-index: 2;
}

.lumo-dirt-canvas {
    z-index: 3;
}

.lumo-video-canvas {
    z-index: 5;
}

.lumo-stage.video-playing .lumo-egg-base,
.lumo-stage.video-playing .lumo-scarf-layer,
.lumo-stage.video-playing .lumo-dirt-canvas {
    visibility: hidden;
}

.lumo-tools {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.lumo-tools button {
    display: grid;
    gap: 6px;
    justify-items: center;
    min-height: 74px;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    color: var(--ink);
    font-weight: 900;
    font-size: .72rem;
    touch-action: none;
}

.lumo-tools img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    pointer-events: none;
}

.lumo-tool-ghost {
    position: fixed;
    z-index: 60;
    width: 64px;
    height: 64px;
    object-fit: contain;
    pointer-events: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 8px 16px rgba(45, 39, 48, .22));
}

.hidden-egg-card {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 111, 145, .36);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
    text-align: left;
    box-shadow: 0 10px 24px rgba(255, 111, 145, .14);
}

.hidden-egg-card img {
    width: 74px;
    height: 74px;
    object-fit: contain;
}

.hidden-egg-card span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}

.pet-stats {
    display: grid;
    gap: 10px;
}

.bar {
    display: grid;
    gap: 5px;
}

.bar span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}

.bar div {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee8e2;
}

.bar i {
    display: block;
    height: 100%;
    width: var(--value);
    background: linear-gradient(90deg, var(--coral), var(--teal));
}

.temperature-bar div {
    position: relative;
    overflow: visible;
    background: linear-gradient(90deg, #2f80ed 0%, #27c46b 50%, #f05a4f 100%);
}

.temperature-bar i {
    position: absolute;
    top: -4px;
    left: clamp(0%, var(--value), 100%);
    width: 5px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(45, 39, 48, .28);
    box-shadow: 0 3px 8px rgba(45, 39, 48, .22);
    transform: translateX(-50%);
}

.action-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.action-row button {
    background: white;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: .82rem;
}

.hatch-button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--coral), #ff9f7e);
    color: #fff;
    text-align: left;
    box-shadow: 0 14px 30px rgba(240, 111, 97, .34);
    animation: hatch-pulse 1.6s ease-in-out infinite;
}

.hatch-emoji {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(45, 39, 48, .25));
    animation: hatch-wiggle 1.1s ease-in-out infinite;
}

.hatch-text {
    display: grid;
    gap: 2px;
}

.hatch-text strong {
    font-size: 1.02rem;
    font-weight: 900;
}

.hatch-text small {
    font-size: .8rem;
    opacity: .92;
    font-weight: 700;
}

@keyframes hatch-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 14px 30px rgba(240, 111, 97, .34); }
    50% { transform: scale(1.02); box-shadow: 0 18px 38px rgba(240, 111, 97, .46); }
}

@keyframes hatch-wiggle {
    0%, 100% { transform: rotate(-9deg); }
    50% { transform: rotate(9deg); }
}

.baby-tray {
    display: grid;
    gap: 8px;
}

.baby-tool-grid,
.baby-tool-context {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.baby-tray .tool {
    display: grid;
    gap: 5px;
    justify-items: center;
    align-content: center;
    min-height: 78px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    color: var(--ink);
    font-weight: 800;
    font-size: .74rem;
    text-align: center;
    touch-action: none;
}

.baby-tray .tool img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    pointer-events: none;
}

.baby-tray .tool .emoji {
    font-size: 1.7rem;
    line-height: 1;
}

.baby-tray .tool[data-egg-tool] {
    border-color: rgba(43, 157, 150, .35);
    background: linear-gradient(180deg, #fff, #f3fbf8);
}

.baby-tray .tool[data-food-toggle] {
    border-color: rgba(240, 111, 97, .5);
    background: linear-gradient(135deg, #fff, #fff1ec);
}

.food-choice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px dashed rgba(240, 111, 97, .5);
    border-radius: 16px;
    background: #fff7f4;
}

.baby-tool-context {
    padding-top: 2px;
}

.baby-tool-context .tool {
    border-color: rgba(240, 111, 97, .45);
    background: linear-gradient(180deg, #fff, #fff3f0);
}

.bar.low span {
    color: var(--coral);
}

.wish-grid {
    display: grid;
    gap: 12px;
}

.wish-owner-title {
    margin: 2px 0 -2px;
    color: var(--muted);
    font-weight: 900;
}

.wish-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}

.wish-card a {
    color: var(--teal);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.watch-grid,
.watch-results {
    display: grid;
    gap: 12px;
}

.watch-card,
.watch-result {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(87, 57, 42, .06);
}

.watch-result {
    grid-template-columns: 84px minmax(0, 1fr);
}

.poster-wrap {
    width: 112px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: var(--lavender);
}

.poster-wrap.small {
    width: 84px;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 8px;
    color: #6b5f7b;
    font-size: .8rem;
    font-weight: 900;
    text-align: center;
}

.flames {
    display: inline-block;
    margin: 8px 0;
    letter-spacing: 0;
    line-height: 1;
}

.priority-1 {
    font-size: .9rem;
}

.priority-2 {
    font-size: 1rem;
}

.priority-3 {
    font-size: 1.12rem;
}

.priority-4 {
    font-size: 1.24rem;
}

.priority-5 {
    font-size: 1.38rem;
    filter: drop-shadow(0 4px 8px rgba(240, 111, 97, .25));
}

.watch-details {
    margin-top: 6px;
}

.watch-details summary {
    color: var(--teal);
    font-weight: 900;
    cursor: pointer;
}

.watch-details p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.game-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .86);
}

.word-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    margin-bottom: 0;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 0;
}

.letter-slot {
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-height: 38px;
    line-height: 1;
}

.letter-slot.blank {
    border-bottom: 3px solid var(--ink);
    color: transparent;
}

.letter-slot.space {
    border-bottom: 0;
}

.letter-slot.hyphen {
    color: var(--ink);
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.keyboard button {
    min-height: 38px;
    background: var(--lavender);
    color: #4c4185;
}

.keyboard button:disabled {
    opacity: .38;
}

.hangman-stage {
    display: grid;
    place-items: center;
    min-height: 150px;
    border-radius: 16px;
    background: #fff;
    border: 1px dashed var(--line);
}

.hangman-drawing {
    position: relative;
    width: 150px;
    height: 132px;
}

.hangman-drawing span {
    position: absolute;
    display: block;
    background: var(--ink);
}

.hangman-drawing .base {
    left: 18px;
    bottom: 8px;
    width: 96px;
    height: 5px;
}

.hangman-drawing .pole {
    left: 36px;
    bottom: 8px;
    width: 5px;
    height: 112px;
}

.hangman-drawing .beam {
    left: 36px;
    top: 10px;
    width: 70px;
    height: 5px;
}

.hangman-drawing .rope {
    left: 103px;
    top: 10px;
    width: 4px;
    height: 20px;
}

.hangman-drawing .head {
    left: 90px;
    top: 29px;
    width: 30px;
    height: 30px;
    border: 4px solid var(--coral);
    border-radius: 50%;
    background: transparent;
}

.hangman-drawing .body {
    left: 103px;
    top: 58px;
    width: 4px;
    height: 38px;
    background: var(--coral);
}

.hangman-drawing .arm-left,
.hangman-drawing .arm-right,
.hangman-drawing .leg-left,
.hangman-drawing .leg-right {
    width: 4px;
    height: 34px;
    background: var(--coral);
    transform-origin: top center;
}

.hangman-drawing .arm-left {
    left: 103px;
    top: 64px;
    transform: rotate(45deg);
}

.hangman-drawing .arm-right {
    left: 103px;
    top: 64px;
    transform: rotate(-45deg);
}

.hangman-drawing .leg-left {
    left: 103px;
    top: 92px;
    transform: rotate(35deg);
}

.hangman-drawing .leg-right {
    left: 103px;
    top: 92px;
    transform: rotate(-35deg);
}

.ttt-board button:disabled {
    opacity: .7;
}

.ttt-board {
    width: min(100%, 318px);
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 auto;
}

.ttt-board button {
    aspect-ratio: 1;
    background: white;
    border: 1px solid var(--line);
    font-size: 2rem;
}

.miss-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffe7e1, #ece5ff);
}

.miss-button {
    min-height: 112px;
    border-radius: 22px;
    background: var(--coral);
    color: white;
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 16px 28px rgba(240, 111, 97, .25);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 10;
    width: min(100%, 480px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .93);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.bottom-nav button {
    position: relative;
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 54px;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
}

.has-new::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e53935;
    box-shadow: 0 0 0 2px #fff;
}

.bottom-nav span {
    font-size: .67rem;
    font-weight: 800;
}

.bottom-nav button.active {
    background: var(--mint);
    color: var(--teal);
}

.sheet {
    position: fixed;
    left: 50%;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 12;
    width: min(92%, 440px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.settings-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--line);
}

.toggle-list {
    display: grid;
    gap: 10px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
}

.toggle-row span {
    font-weight: 800;
}

.switch {
    position: relative;
    width: 54px;
    height: 32px;
    flex: 0 0 auto;
}

.switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.switch i {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d9d2dc;
    transition: .18s ease;
}

.switch i::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(45, 39, 48, .18);
    transition: .18s ease;
}

.switch input:checked + i {
    background: var(--teal);
}

.switch input:checked + i::after {
    transform: translateX(22px);
}

.sheet button {
    position: relative;
    background: #fff8f2;
    color: var(--ink);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 20;
    width: min(90%, 420px);
    transform: translateX(-50%);
    padding: 12px 14px;
    border-radius: 14px;
    background: #2d2730;
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
}

[hidden] {
    display: none !important;
}

@media (min-width: 760px) {
    .app-shell,
    .login-shell,
    .bottom-nav {
        width: min(100%, 720px);
    }

    .app-shell {
        padding-left: 22px;
        padding-right: 22px;
    }

    .screen.active {
        gap: 18px;
    }

    .wish-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
