/* ---- Tonight on a phone: the stack first, the mood as a strip, the rest in a sheet (tonight.js) ---- */

.mood-tune-count:empty { display: none; }
.mood-sheet:not([open]) { display: none; }

@media (max-width: 760px) {
    /* The card waiting behind the top one is tilted a little past the edge; never let it widen the page. */
    main { overflow-x: clip; }

    /* The mood note shrinks to one row of chips above the stack. */
    .mood-panel.sheet { order: 1; display: flex; align-items: center; gap: 8px; min-height: 0; margin: 0 0 4px; padding: 0; color: var(--paper); background: none; box-shadow: none; }
    .mood-panel > .section-label { display: none; }
    .mood-presets { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 2px 28px 2px 0; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
    .mood-presets::-webkit-scrollbar { display: none; }
    .mood-presets button { flex: none; min-height: 44px; padding: 0 15px; border-color: #46443f; border-radius: 22px; color: #e4dfcf; background: rgba(242, 238, 223, .04); scroll-snap-align: start; white-space: nowrap; }
    .mood-presets button:hover { border-color: var(--red); }
    .mood-presets button[aria-pressed="true"] { border-color: var(--red); color: var(--paper); background: var(--red); }

    .mobile-mood-toggle { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 44px; margin: 0; padding: 0 14px 0 12px; border: 1px solid #8d8b84; border-radius: 22px; color: var(--paper); background: var(--night); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
    .mobile-mood-toggle[aria-expanded="true"] { border-color: var(--red); }
    .mobile-mood-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
    .mood-tune-mark { color: var(--red); font: 400 16px/1 "Yu Mincho", "MS Mincho", serif; letter-spacing: 0; }
    .mood-tune-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; color: var(--paper); background: var(--red); font-size: 10px; letter-spacing: 0; }
    .mood-panel.mobile-open .mobile-mood-toggle::after { content: none; }

    .deck-column { margin-top: 10px; }

    /* "Did you watch…?" waits under the cards (tonight.js moves it there). */
    .deck-column > .watch-checkin { margin: 26px 0 0; }
}

/* ---- The sheet ---- */
.mood-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: min(88svh, 760px); margin: 0; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border: 0; border-top: 3px solid var(--red); color: var(--ink); background-color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(18,18,18,.055) 28px); box-shadow: 0 -14px 40px rgba(0, 0, 0, .5); }
.mood-sheet::backdrop { background: rgba(8, 8, 8, .66); animation: mood-sheet-dim .3s ease-out; }
@keyframes mood-sheet-dim { from { opacity: 0; } }
.mood-sheet-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 0 -20px; padding: 20px 20px 12px; border-bottom: 1px solid #c9c4b4; background: var(--paper); touch-action: none; cursor: grab; }
.mood-sheet-grip { position: absolute; top: 8px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: #bdb8a8; }
.mood-sheet-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--paper); background: var(--red); font: 400 19px/1 "Yu Mincho", "MS Mincho", serif; }
.mood-sheet-head b { font: italic 400 21px/1.1 Georgia, serif; letter-spacing: -.02em; }
.mood-sheet-done { min-height: 44px; padding: 0 18px; border: 0; color: var(--paper); background: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.mood-sheet-done:hover { background: var(--red); }
.mood-sheet-done:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.mood-sheet .mood-panel-body { display: block; }
.mood-sheet h2 { margin: 18px 0 0; font: 400 27px/1.05 Georgia, serif; letter-spacing: -.035em; }
.mood-sheet .mood-panel-body > p { margin: 8px 0 6px; color: #6f6b62; font: italic 14px/1.5 Georgia, serif; }
.mood-sheet .mood-control { margin: 22px 0; }
.mood-sheet .mood-control > div { font-size: 13px; }
.mood-sheet .mood-control strong { font-size: 11px; }
/* Thumb-sized handles: the desktop dot is too small for a finger. */
.mood-sheet input[type='range'] { height: 28px; margin-top: 6px; background: linear-gradient(#aaa697, #aaa697) center / 100% 2px no-repeat; touch-action: pan-y; }
.mood-sheet input[type='range']::-webkit-slider-thumb { width: 26px; height: 26px; border-width: 3px; }
.mood-sheet input[type='range']::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid var(--paper); border-radius: 50%; background: var(--red); box-shadow: 0 0 0 1px var(--ink); }
.mood-sheet .mood-selects select { font-size: 16px; }
.mood-sheet .mood-avoid button { min-height: 44px; }
.mood-sheet #refreshDeck { position: sticky; bottom: 0; z-index: 1; min-height: 52px; margin-top: 18px; box-shadow: 0 -10px 18px rgba(242, 238, 223, .92); }
.mood-sheet .learn-card small { font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
    .mood-sheet::backdrop { animation: none; }
}
