/* Wilder Talk. Same family as the portal and the gym button: ink, bone, lime. */
:root {
  --ink: #0b0c09; --ink-2: #141611; --ink-3: #1c1f17; --line: rgba(242, 241, 234, .12);
  --bone: #f2f1ea; --dim: #b9b8ae; --mute: #6f7264; --lime: #b8f523; --bad: #ff8f6b;
  --disp: "Big Shoulders Display", sans-serif; --body: "Barlow", system-ui, sans-serif; --tech: "Chakra Petch", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--bone); font-family: var(--body); font-size: 17px; display: flex; flex-direction: column; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.top { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 12px) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.who { font-family: var(--disp); font-size: 26px; text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.who .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.date { font-family: var(--tech); font-size: 13px; color: var(--mute); letter-spacing: .06em; }

.thread { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
.empty { margin: auto; text-align: center; max-width: 280px; color: var(--mute); display: grid; gap: 8px; }
.empty b { font-family: var(--disp); font-size: 34px; color: var(--bone); text-transform: uppercase; }
.day { align-self: center; font-family: var(--tech); font-size: 12px; color: var(--mute); letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.msg { display: grid; gap: 6px; }
.me { justify-self: end; max-width: 86%; background: var(--ink-3); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; padding: 11px 14px; line-height: 1.4; }
.me .meta { display: block; font-family: var(--tech); font-size: 11px; color: var(--mute); margin-top: 5px; text-align: right; letter-spacing: .04em; }
.dor { justify-self: start; max-width: 90%; padding: 4px 2px 0 14px; border-left: 2px solid var(--lime); line-height: 1.45; color: var(--dim); white-space: pre-wrap; }
.dor.pending { color: var(--mute); font-style: italic; border-color: var(--mute); }
.dor.pending::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
.dor.failed { color: var(--bad); border-color: var(--bad); }
.dor .retry { margin-left: 8px; font-family: var(--tech); font-size: 12px; text-decoration: underline; color: var(--bone); }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.dock { border-top: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 14px) max(16px, env(safe-area-inset-left)); background: linear-gradient(180deg, var(--ink-2), var(--ink)); }
.status { min-height: 20px; text-align: center; font-family: var(--tech); font-size: 13px; color: var(--dim); letter-spacing: .04em; margin-bottom: 8px; }
.status.bad { color: var(--bad); }
.row { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; }
.side { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--dim); }
.side svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.timer { font-family: var(--tech); font-size: 15px; color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }

.mic { justify-self: center; position: relative; width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d4ff5c, var(--lime) 45%, #8fc40f); color: var(--ink); display: grid; place-items: center; box-shadow: 0 12px 40px -10px rgba(184, 245, 35, .55); transition: transform .12s, background .2s; touch-action: manipulation; }
.mic:active { transform: scale(.96); }
.mic svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; grid-area: 1 / 1; }
.mic .ico-stop { display: none; fill: currentColor; stroke: none; }
.mic .ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--lime); opacity: 0; transform: scale(calc(1 + var(--lvl, 0) * .35)); transition: transform .08s; }
.mic .spinner { display: none; grid-area: 1 / 1; width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(11, 12, 9, .25); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body[data-mode="rec"] .mic { background: radial-gradient(circle at 35% 30%, #ffb39b, #ff6b4a 50%, #d84a2a); box-shadow: 0 12px 40px -8px rgba(255, 107, 74, .6); color: #fff; }
body[data-mode="rec"] .mic .ico-mic { display: none; }
body[data-mode="rec"] .mic .ico-stop { display: block; }
body[data-mode="rec"] .mic .ring { opacity: .7; border-color: #ff6b4a; }
body[data-mode="rec"] .timer { color: var(--bone); }
body[data-mode="send"] .mic { pointer-events: none; opacity: .85; }
body[data-mode="send"] .mic svg { display: none; }
body[data-mode="send"] .mic .spinner { display: block; }

.type { display: flex; gap: 8px; margin-bottom: 12px; }
.type input { flex: 1; min-width: 0; background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--bone); font: inherit; }
.type .send { padding: 0 16px; border-radius: 12px; background: var(--bone); color: var(--ink); font-weight: 600; }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 24px; z-index: 10; }
.sheet form { background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 12px; width: 100%; max-width: 340px; }
.sheet input { background: var(--ink-3); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--bone); font: inherit; }
.sheet button { background: var(--lime); color: var(--ink); border-radius: 10px; padding: 12px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .mic .spinner, .dor.pending::after { animation: none; } }
