/* The cheer bubble (cheer.js). Bottom-right on every device; compact until tapped. Big tap targets, safe areas, reduced motion. */
#cheer { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 45; display: flex; flex-direction: column; align-items: flex-end; font-family: var(--body); }
body.has-cheer main { padding-bottom: 96px; }
.ch-card { width: min(340px, calc(100vw - 24px)); background: linear-gradient(160deg, #1c7a50, #0f4a31); border: 2px solid var(--em); border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 4px #1fbf6f33, 0 8px 32px #000c, 0 0 28px #1fbf6f55; transition: width .2s ease; }
.ch-panel, .ch-tray { display: none; }
.ch-panel { padding: 12px 14px 8px; max-height: min(52vh, 420px); overflow-y: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid #1fbf6f88; }
.ch-ph b, .ch-sum { color: var(--white); } .ch-sub { opacity: .85; }
.ch-ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ch-ph b { font-size: 1.3rem; }
.ch-sub { display: block; font-size: .8rem; font-weight: 400; opacity: .7; letter-spacing: 0; text-transform: none; }
.ch-links { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.ch-links a { color: var(--mint); text-decoration: underline; min-height: 36px; display: inline-flex; align-items: center; }
.ch-links button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #0f2e21; color: var(--white); font: inherit; cursor: pointer; }
.ch-sum { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--mute); font-size: .9rem; margin-bottom: 6px; }
.ch-sum:empty { display: none; }
.ch-list { list-style: none; display: grid; gap: 8px; }
.ch-list li { background: #0a1a13; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.ch-list li b { font-weight: 600; } .ch-list li span { color: var(--mute); font-size: .78rem; margin-left: 8px; }
.ch-list li p { margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .95rem; }
.ch-list .ch-none { color: var(--mute); text-align: center; }
.ch-name { margin-top: 10px; } .ch-name input { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #0a1a13; color: var(--white); font: inherit; font-size: 16px; }
.ch-msg { min-height: 0; font-size: .9rem; color: var(--mint); padding-top: 6px; } .ch-msg:empty { display: none; } .ch-msg.err { color: #ff8f7a; }
.ch-tray { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; border-bottom: 1px solid #1fbf6f88; }
.ch-rx { width: 64px; min-height: 64px; border-radius: 14px; border: 1px solid var(--line); background: #0a1a13; color: var(--mute); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ch-rx .ch-e { font-size: 1.7rem; line-height: 1; } .ch-rx small { font-size: .68rem; }
.ch-rx:active { transform: scale(.94); } .ch-rx.on { border-color: var(--em); background: #0f2e21; color: var(--mint); }
.ch-bar { display: flex; align-items: center; gap: 6px; padding: 8px; }
.ch-min { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; background: none; color: var(--white); font: inherit; font-size: 1.1rem; cursor: pointer; }
.ch-bar input { flex: 1; min-width: 0; height: 48px; border-radius: 99px; padding: 0 12px 0 16px; border: 1px solid var(--line); background: #0a1a13; color: var(--white); font: inherit; font-size: 16px; }
.ch-bar input:focus, .ch-name input:focus { outline: 2px solid var(--em); outline-offset: 1px; }
.ch-post { display: none; height: 48px; padding: 0 16px; border-radius: 99px; border: 0; background: var(--em); color: #03170d; font: inherit; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.ch-post.show { display: inline-block; }
.ch-big, .ch-bubble { position: relative; width: 56px; height: 56px; flex: none; border-radius: 50%; border: 2px solid var(--mint); background: linear-gradient(160deg, #22a066, #136b45); color: var(--white); box-shadow: 0 0 0 4px #1fbf6f33, 0 0 22px #1fbf6f88; display: flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; font-size: 1.7rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.ch-big:active, .ch-bubble:active { transform: scale(.95); }
.ch-big em, .ch-bubble em { position: absolute; top: -5px; right: -5px; min-width: 22px; padding: 1px 6px; border-radius: 99px; background: var(--em); color: #03170d; font-style: normal; font-size: .75rem; font-weight: 600; text-align: center; }
.ch-bubble { display: none; }
.ch-mine { font-size: 1.7rem; line-height: 1; }

#cheer.mode-panel .ch-card, #cheer.mode-tray .ch-card { width: min(400px, calc(100vw - 24px)); }
#cheer.mode-panel .ch-panel { display: block; } #cheer.mode-panel .ch-post.show { display: inline-block; }
#cheer.mode-tray .ch-tray { display: flex; }
#cheer.mode-min .ch-card { display: none; } #cheer.mode-min .ch-bubble { display: flex; }

@media (max-width: 520px) {
    .ch-card { width: min(310px, calc(100vw - 24px)); }
    #cheer.mode-panel, #cheer.mode-tray { left: 8px; right: 8px; align-items: stretch; }
    #cheer.mode-panel .ch-card, #cheer.mode-tray .ch-card { width: auto; }
    .ch-rx { width: calc(20% - 6px); min-width: 56px; }
}
@media (min-width: 700px) { .ch-card { width: 360px; } #cheer.mode-panel .ch-card, #cheer.mode-tray .ch-card { width: 420px; } .ch-panel { max-height: min(56vh, 480px); } }
@media (max-width: 360px) { .ch-card { width: auto; } .ch-bar input { display: none; } .ch-min { display: none; } }
@media (prefers-reduced-motion: reduce) { .ch-card { transition: none; } .ch-rx:active, .ch-big:active, .ch-bubble:active { transform: none; } }

/* the Cheer wall page list */
.social { max-width: 760px; margin: 0 auto; padding: 8px 4vw 30px; }
.soclist { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.soclist li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.soclist li b { font-weight: 600; } .socwhen { color: var(--mute); font-size: .8rem; margin-left: 8px; }
.soclist p { margin-top: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.soclist .socnone { color: var(--mute); text-align: center; }
