/* Gifts (web_gifts.py) and group live sessions (web_groups.py). Loaded only on their pages.
   Tokens from brand/brand.css; no inline styles (CSP style-src 'self'). Phone-first. */

/* ---- forms ---- */
.gift-form fieldset, .live-form fieldset { border: 1px solid var(--line); min-width: 0; }
.gift-form legend, .live-form legend { padding: 0 4px; }
.gift-form legend h2, .live-form legend h2 { margin: 0; }
.gift-form label, .live-form label { margin-top: 12px; }
.gift-form input[type=email], .gift-form input[type=date], .gift-form input[type=time],
.live-form input[type=email], .live-form input[type=number], .live-form input[type=datetime-local],
.live-form input[type=time], .live-form input[type=date] {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; min-height: 44px; }
.gift-kinds, .gift-share, .gift-when { display: grid; gap: 8px; margin: 4px 0 8px; }
label.gift-choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; margin: 0; }
label.gift-choice input { margin-top: 3px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
label.gift-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.gift-check { margin-top: 16px; }
.gift-form [hidden], .gift-date[hidden] { display: none; }
.gift-link-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.gift-link-row input { flex: 1 1 220px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.gift-list { list-style: none; padding: 0; margin: 0; }
.gift-row { border-top: 1px solid var(--line); padding: 10px 0; } .gift-row p { margin: 2px 0; }
.gift-row:first-child { border-top: 0; }

/* ---- the gift page: a card that lifts its lid, then the message ---- */
.gift-stage { max-width: 620px; margin: 0 auto 24px; padding: 8px; text-align: center; overflow: hidden; }
.gift-card { position: relative; margin: 8px auto 20px; border-radius: var(--radius-lg); }
.gift-frame { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 18px 48px -24px rgba(15, 20, 32, .45);
  outline: 2px solid var(--glow); outline-offset: 6px; }
.gift-art { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.gift-body { padding: 20px 20px 24px; }
.gift-eyebrow { color: var(--glow-ink); letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; font-weight: 700; margin: 0; }
.gift-name { font-size: clamp(1.9rem, 7vw, 2.6rem); margin: .15em 0 .2em; overflow-wrap: break-word; }
.gift-what { color: var(--muted); margin: 0 0 12px; overflow-wrap: break-word; }
.gift-message { margin: 16px 0 0; padding: 16px 18px; border-radius: var(--radius); background: var(--glow-soft);
  font-size: 1.1rem; font-style: italic; text-align: left; overflow-wrap: break-word; white-space: pre-line; }
.gift-message p { margin: 0; }
.gift-lid { position: absolute; inset: -6px; z-index: 2; border-radius: var(--radius-lg); background: var(--accent-fill);
  pointer-events: none; transform-origin: top center; overflow: hidden; }
.gift-ribbon { position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; transform: translateX(-50%); background: var(--glow); }
.gift-ribbon::after { content: ""; position: absolute; left: -200px; right: -200px; top: 50%; height: 18px; transform: translateY(-50%); background: var(--glow); }
.gift-card .gift-lid { opacity: 0; visibility: hidden; }
.gift-actions { margin: 8px auto; max-width: 480px; }
.gift-actions form { margin: 12px 0; }
.gift-actions .btn.big, .gift-done .btn.big { width: 100%; max-width: 360px; }
@media (prefers-reduced-motion: no-preference) {
  .gift-card .gift-lid { visibility: visible; animation: gift-lid 1.6s .3s cubic-bezier(.6, 0, .3, 1) forwards; opacity: 1; }
  .gift-card.is-closed .gift-lid { animation: none; opacity: .92; }
  .gift-frame { animation: gift-rise .9s 1.2s ease-out both; }
  .gift-name, .gift-what { animation: gift-fade .8s 1.6s ease-out both; }
  .gift-message { animation: gift-fade 1s 2.1s ease-out both; }
  .gift-actions { animation: gift-fade .8s 2.6s ease-out both; }
}
@keyframes gift-lid { 0% { transform: none; opacity: 1; } 35% { transform: rotate(-2deg) translateY(-6px); }
  100% { transform: translateY(-110%) rotate(-8deg); opacity: 0; visibility: hidden; } }
@keyframes gift-rise { from { transform: scale(.96); } to { transform: none; } }
@keyframes gift-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- live sessions ---- */
.live-hero { display: grid; gap: 12px; }
.live-art { width: 100%; height: auto; border-radius: var(--radius-card); aspect-ratio: 16 / 9; object-fit: cover; max-height: 200px; }
/* 2026-10-13 (Gergo: "huge image"): a modest banner on phones; beside the title on wider screens */
@media (min-width: 720px) {
  .live-hero { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; align-items: center; }
  .live-hero > .notice { grid-column: 1 / -1; }
  .live-art { aspect-ratio: 4 / 3; max-height: none; }
}
.live-when { font-size: 1.1rem; font-weight: 600; margin: 0; }
.live-countdown { font-size: clamp(2rem, 9vw, 3rem); font-variant-numeric: tabular-nums; font-weight: 600; margin: 8px 0; letter-spacing: .02em; }
.live-status { display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .9rem; }
.live-status.is-live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #c0392b; }
@media (prefers-reduced-motion: no-preference) { .live-status.is-live::before { animation: live-pulse 1.6s infinite; } }
@keyframes live-pulse { 50% { opacity: .35; } }
.live-counter { color: var(--muted); font-variant-numeric: tabular-nums; }
.live-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.live-actions > * { flex: 1 1 200px; }
.live-actions form { display: flex; } .live-actions form .btn, .live-actions form button { flex: 1; }
.live-player { margin: 16px 0; padding: 16px; border-radius: var(--radius-card); background: var(--surface-2); }
.live-player progress { width: 100%; height: 8px; }
.live-player .live-time { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.live-note { white-space: pre-line; overflow-wrap: break-word; }
.live-list { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.live-list .card { margin: 0; }
.wall { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.wall li { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); overflow-wrap: break-word; }
.wall .who { font-weight: 600; font-size: .9rem; color: var(--muted); }
.wall .text { margin: 4px 0; white-space: pre-line; }
.wall form { display: inline; }
.wall button.link { min-height: 44px; padding: 8px 0; }
.crisis-box { border: 2px solid var(--glow); }
.crisis-lines { padding-left: 1.2em; } .crisis-lines li { margin: 4px 0; }
.mod-table { width: 100%; border-collapse: collapse; }
.mod-item { border-top: 1px solid var(--line); padding: 10px 0; }
.mod-item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-item .actions form { display: inline; }

@media (max-width: 760px) {
  .gift-form input, .gift-form select, .gift-form textarea, .live-form input, .live-form select, .live-form textarea { font-size: 16px; }
}
.gift-hero { padding: 8px 0 4px; } .gift-hero .lead { margin-top: 0; }
.live-form + .wall, #wall .live-form { margin-bottom: 16px; }

/* lobby chat (live.html, lobby.js) */
.lobby-log { list-style: none; padding: 0; margin: 0 0 12px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.lobby-log li { padding: 6px 10px; border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.lobby-log li.is-pending { opacity: .7; }
.lobby-log .who { font-weight: 600; }
.lobby-clip audio { display: block; width: 100%; max-width: 320px; height: 36px; margin-top: 4px; }
.lobby-row { display: flex; gap: 8px; align-items: flex-end; }
.lobby-row textarea { flex: 1; min-width: 0; }
.lobby-mic.is-recording { background: #d8473b; color: #fff; border-color: #d8473b; }
.host-line { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 14px; } .host-line p { margin: 0 0 2px; }
.host-mark, .host-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; } .host-avatar { display: grid; place-items: center; background: var(--accent-fill); color: var(--accent-text); font-weight: 700; }
