/* Fox brand. Tokens live on :root in shared.css. This file is the character
   and the SMS-night layout (direction E): cream page, chunky Nunito, pressable
   buttons, the fox in the room. */

.brand-magic-cat,
.brand-magic-mark {
    animation: room-bob 3.2s ease-in-out infinite;
}

@keyframes room-bob {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 6px)); }
}

.room-top,
.room-hero,
.room-listen,
.room-rec-idea,
.room-sounds-toggle,
.room-stop-label,
.room-mic-note,
.sent-tuck { display: none; }

body.room-night {
    background: var(--cream);
    background-image: none;
}

body.room-night .room-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
body.room-night .room-wordmark {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--fox);
    line-height: 1;
}
body.room-night .room-for {
    font-size: 13px;
    font-weight: 800;
    color: var(--mute);
}

body.room-night .room-hero {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 2px;
    min-height: 132px;
}
body.room-night .room-hero-img {
    width: 148px;
    height: auto;
    display: block;
    transform-origin: 50% 85%;
    animation: room-idle 2.8s ease-in-out infinite;
    -webkit-user-drag: none;
    user-select: none;
}
@keyframes room-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}
body.room-night .room-bubble {
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 16px 16px 16px 6px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    box-shadow: 0 3px 0 var(--line);
    margin-bottom: 18px;
    max-width: 150px;
}
body.room-night.room-recording .room-bubble,
body.room-night.room-review .room-bubble { display: none; }

body.room-night.room-recording .room-hero-img,
body.room-night.room-listen-live .room-hero-img {
    animation: none;
    transform: scale(calc(1 + var(--room-level, 0) * 0.07)) rotate(calc(var(--room-level, 0) * -3deg));
}

body.room-night .room-listen {
    display: none;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--fox);
    margin: 0;
}
body.room-night.room-recording .room-listen { display: block; }

body.room-night .room-rec-idea {
    display: none;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
body.room-night.room-recording .room-rec-idea { display: block; }
body.room-night .room-rec-idea span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 2px;
}

body.room-night .reminder-idea-card {
    border: 2px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--line);
    padding: 14px 14px 12px;
    animation: room-peek-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes room-peek-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
body.room-night .reminder-idea-kicker {
    color: var(--teal);
    letter-spacing: 0.12em;
    font-size: 11px;
}
body.room-night .reminder-idea-title {
    font-family: Nunito, sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}
body.room-night .reminder-idea-body {
    font-weight: 700;
    color: var(--mute);
}
body.room-night .reminder-idea-starter {
    background: var(--cream);
    border-radius: 14px;
    font-weight: 700;
}
body.room-night .starter-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fox);
    margin-bottom: 3px;
}
body.room-night .room-card-peek {
    position: absolute;
    top: -52px;
    right: 12px;
    width: 96px;
    height: 70px;
    overflow: hidden;
    pointer-events: none;
    animation: room-peek 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.room-night .room-card-peek .room-rig {
    width: 96px;
}
@keyframes room-peek {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
body.room-night.room-recording .reminder-idea-card,
body.room-night.room-review .reminder-idea-card { display: none !important; }

body.room-night .room-sounds-toggle {
    display: block;
    margin: 2px auto 0;
    background: none;
    border: 0;
    color: var(--mute);
    font-weight: 800;
    font-size: 14px;
    padding: 8px 12px;
    min-height: 44px;
}
body.room-night .sound-board-back {
    display: flex;
    background: transparent;
    box-shadow: none;
    border: 0;
    min-height: 36px;
    padding: 0 2px;
    color: var(--mute);
}
body.room-night .sound-board-back-title { display: none; }

body.room-night:not(.room-sounds-open) .sound-board-corner,
body.room-night:not(.room-sounds-open) .sound-board-pads { display: none !important; }

body.room-night:not(.room-sounds-open) .sound-board-stage {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    grid-template-rows: none !important;
    flex: 1 1 auto;
    min-height: 0;
}
body.room-night:not(.room-sounds-open) .sound-board-stage .recorder-panel {
    height: auto !important;
    flex: 0 0 auto;
    margin-top: auto;
    padding-bottom: 0;
}
body.room-night .sound-board-stage .recorder-panel-inner {
    min-height: 64px;
    height: 64px;
    border-radius: 16px !important;
    background: var(--fox) !important;
    background-image: none !important;
    box-shadow: 0 6px 0 var(--room-lip) !important;
    color: #fff;
}
body.room-night .sound-board-stage .recorder-idle-mark {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: none;
}
body.room-night .sound-board-stage .recorder-panel-inner:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--room-lip) !important;
}
body.room-night .recorder-panel.recording-active .recorder-panel-inner,
body.room-night .recorder-panel.counting-down .recorder-panel-inner {
    background: var(--teal) !important;
    box-shadow: 0 6px 0 var(--teal-lip) !important;
    height: auto;
    min-height: 64px;
}
body.room-night .recorder-panel.recording-active .recorder-panel-inner:active {
    box-shadow: 0 2px 0 var(--teal-lip) !important;
}
body.room-night .room-stop-label {
    display: none;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}
body.room-night.room-recording .room-stop-label { display: block; }
body.room-night .recorder-panel.recording-active .timer {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff;
    line-height: 0.95;
}
body.room-night .room-mic-note {
    display: none;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--fox);
    margin: 6px 0 0;
}
body.room-night.room-mic-denied .room-mic-note { display: block; }

/* Pressable lip on the shared buttons, everywhere. */
.btn,
.btn-submit,
.btn-generate,
.welcome-btn,
.byb-ready-btn,
.btn-reminder {
    border-radius: var(--radius-btn);
    font-weight: 800;
    box-shadow: 0 5px 0 var(--room-lip);
    min-height: 48px;
}
.btn:active,
.btn-submit:active,
.btn-generate:active,
.welcome-btn:active,
.byb-ready-btn:active,
.btn-reminder:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--room-lip);
}
.btn-g {
    background: var(--teal);
    box-shadow: 0 5px 0 var(--teal-lip);
    border-radius: var(--radius-btn);
    font-weight: 800;
}
.btn-g:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--teal-lip); }
.btn-s {
    background: var(--cream);
    color: var(--ink);
    border-radius: 14px;
    box-shadow: 0 3px 0 var(--line);
    font-weight: 800;
}
.btn-s:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.card {
    border: 2px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

#library-list .empty,
#members-list .empty,
#playlists-list .empty,
#gs-items:empty {
    background: none;
    padding-top: 78px;
}

.sent-screen { background: var(--cream); }
body.room-sent .sent-screen-inner { padding-top: 8px; }
.sent-mark-img {
    width: min(240px, 70vw);
    height: auto;
    display: block;
    margin: 8px auto 4px;
    animation: room-settle 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes room-settle {
    from { transform: translateY(-18px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.sent-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-align: center;
    line-height: 1;
    margin: 8px 0 0;
    color: var(--ink);
}
.sent-tuck[hidden] { display: none !important; }
.sent-tuck {
    display: block;
    width: fit-content;
    margin: 14px auto 0;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 8px 14px 9px;
    text-align: center;
    box-shadow: 0 3px 0 var(--line);
    transform: rotate(-4deg);
}
.sent-tuck b { display: block; font-size: 14px; font-weight: 800; }
.sent-tuck span { font-size: 11px; font-weight: 700; color: var(--mute); }
.sent-another {
    display: inline-block;
    margin-top: 18px;
    background: none;
    border: 0;
    color: var(--teal);
    font-size: 15px;
    font-weight: 800;
    min-height: 44px;
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea { font-size: 16px; }

/* Phone sign-in. Invisible reCAPTCHA host must stay in the layout;
   display:none makes the check fail on iPhone Safari. */
#tg-recaptcha {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.phone-auth { text-align: left; }
.phone-auth-label {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}
.phone-auth-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 56px;
    margin-bottom: 0.85rem;
    padding: 0 0.9rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-sizing: border-box;
}
.phone-auth-field:focus-within { border-color: #1B2A4A; background: #fff; }
.phone-auth-cc {
    flex: none;
    font-family: 'Nunito', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1B2A4A;
    line-height: 1;
}
.phone-auth-field .phone-auth-input {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.85rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1B2A4A;
}
.phone-auth-field .phone-auth-input:focus { border: none; background: transparent; outline: none; }
.phone-auth-code {
    margin-bottom: 0.85rem;
    letter-spacing: 0.35em;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    min-height: 56px;
    padding-left: 0.85rem;
    color: #1B2A4A;
}
.phone-auth-consent {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #3E4E6C;
    line-height: 1.45;
    text-align: center;
    margin: 0 0 0.9rem;
}
.phone-auth-sim,
.phone-auth-recovery,
.phone-auth-sent,
.phone-auth-legacy-hint,
.phone-auth-sheet-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #3E4E6C;
    line-height: 1.45;
    text-align: center;
    margin: 0 0 0.9rem;
}
.phone-auth-recovery { margin-top: 0.85rem; margin-bottom: 0.35rem; }
.phone-auth-send {
    width: 100%;
    min-height: 56px;
    margin-top: 0.15rem;
    font-size: 1.15rem;
}
.phone-auth-error {
    min-height: 1.2em;
    margin-top: 0.55rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #C0392B;
}
.phone-auth-error:empty { min-height: 0; margin-top: 0; }
.phone-auth-text,
.phone-auth-google {
    display: block;
    width: 100%;
    margin: 0.35rem auto 0;
    padding: 0.45rem 0.5rem;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    min-height: 44px;
}
.phone-auth-google {
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    min-height: 44px;
    margin-top: 0.65rem;
}
.phone-auth-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
}
.phone-auth-row .phone-auth-text { width: auto; margin: 0; }
.phone-auth-legacy {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--line, var(--border));
}
.phone-auth-legacy .phone-auth-input { margin-bottom: 0.65rem; }
.phone-auth-sheet-title {
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.25rem;
}
.phone-auth input[aria-invalid="true"] { border-color: #C0392B; }

/* Me tab: the phone is the account. */
.me-account { text-align: left; }
.me-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--light);
    margin: 0 0 0.4rem;
}
.me-section {
    margin-top: 1.05rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}
.me-phone-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.me-phone-number {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.01em;
}
.me-text-btn {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0;
    color: var(--fox);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}
.me-signout {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
}
.me-quiet {
    margin: 0.2rem 0 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.45;
}
.me-consent {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.45;
}
.me-email {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
}
.me-reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.me-reminder-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
}
.me-reminder-row .me-quiet { margin: 0.1rem 0 0; }
.me-cadence-label {
    margin-top: 0.15rem;
}
.me-cadence {
    margin: 0 0 0.9rem;
}
.me-name-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    background: var(--hover);
    border-radius: 14px;
    cursor: pointer;
    margin-bottom: 0.45rem;
}
.me-name-display span {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
}
.me-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--fox);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}
#contributor-own-setup {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 2px solid var(--border);
}
#contributor-own-setup a {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--fox);
    text-decoration: none;
}
#me-phone-change,
#me-phone-add { margin-top: 0.75rem; }

/* Credits sheet. A bottom sheet, not a card with a heavy Close. */
.credits-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(36, 24, 20, 0.45);
}
.credits-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: min(92vh, 780px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--cream);
    color: var(--ink);
    border-radius: 28px 28px 0 0;
    padding: 0.35rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 28px rgba(36, 24, 20, 0.16);
    text-align: center;
}
.credits-sheet-grab {
    width: 42px;
    height: 5px;
    border-radius: 99px;
    background: var(--line, #E7D7C8);
    margin: 0.35rem auto 0.15rem;
}
.credits-sheet-x {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.credits-sheet-head { padding: 0.15rem 2rem 0; }
.credits-sheet-mark {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.15rem;
}
.credits-sheet h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-align: center;
}
.credits-sheet .credits-balance {
    display: block;
    background: #fff;
    border: 2px solid var(--line, #F0E2D4);
    border-radius: 18px;
    box-shadow: 0 4px 0 #E7D3C4;
    padding: 0.85rem 1rem 0.95rem;
    margin: 0.35rem 0 0.9rem;
}
.credits-sheet .credits-balance-num {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ink);
}
.credits-sheet .credits-balance-lbl {
    margin-top: 0.15rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}
.credits-balance-why,
.credits-sheet-note,
.credits-sheet .credits-history-summary {
    display: block;
    margin: 0.45rem 0 0.85rem;
    max-width: none;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
}
.credits-sheet .credits-history-summary:empty { display: none; }
.credits-sheet .credits-dialog-sub {
    text-align: center;
    margin: 0.2rem 0 0.8rem;
}
.credits-sheet .credits-dialog-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: none;
    padding: 0;
    margin: 0 0 0.85rem;
}
.credits-sheet .credits-tab-buy { width: 100%; }
.credits-sheet .credits-tab {
    min-height: 44px;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}
.credits-sheet .credits-tab.active { color: var(--ink); }
.credits-sheet .credits-packs { gap: 0.45rem; }
.credits-sheet .credits-pack {
    background: #fff;
    border: 2px solid var(--line, #E7D7C8);
    border-radius: 16px;
    box-shadow: 0 3px 0 var(--line, #E7D7C8);
    padding: 0.85rem 0.35rem 0.7rem;
}
.credits-sheet .credits-pack.popular {
    border-color: var(--fox);
    background: #fff;
    box-shadow: 0 3px 0 var(--room-lip, #C42E0E);
}
.credits-sheet .credits-pack .pack-amount { font-size: 1.45rem; color: var(--ink); }
.credits-sheet .credits-pack .pack-price { color: var(--fox); font-size: 1rem; }
.credits-sheet .credits-cost-card {
    background: #fff;
    border-radius: 16px;
    padding: 0.35rem 0.9rem;
    margin-bottom: 0.75rem;
}
.credits-sheet .credits-cost-row { padding: 0.7rem 0; }
.credits-sheet .credits-cost-row-text { font-size: 1rem; font-weight: 800; color: var(--ink); }
.credits-sheet .credits-cost-row-cost {
    color: var(--ink);
    background: var(--hover);
    font-size: 1rem;
}
.credits-sheet .credits-history-list {
    max-height: none;
    overflow: visible;
    border-top: none;
    margin: 0 0 0.5rem;
    text-align: left;
}
.credits-day {
    margin: 0.85rem 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--light);
}
.credits-sheet .credits-entry {
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.4rem;
    align-items: center;
}
.credits-sheet .credits-entry-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.35;
}
.credits-times {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--hover);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 800;
    vertical-align: 1px;
}
.credits-sheet .credits-entry-amount { font-size: 1.05rem; }
.credits-sheet .credits-history-empty,
.credits-sheet .credits-history-loading {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}
.me-account .phone-auth-consent,
.me-account .phone-auth-sim,
.me-account .phone-auth-sent {
    text-align: left;
}
.me-account .phone-auth-error { text-align: left; }
.me-account .btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .brand-magic-cat,
    .brand-magic-mark,
    .room-hero-img,
    .room-card-peek,
    .reminder-idea-card,
    .sent-mark-img {
        animation: none !important;
    }
    body.room-night.room-recording .room-hero-img,
    body.room-night.room-listen-live .room-hero-img {
        transform: none;
    }
}
