/* Kazoo Web. Big, labelled controls first: many Kazoo people are older or young. */
:root {
  --yellow: #ffc729;
  --bg: #141208;
  --card: #221e10;
  --fg: #f6f1e1;
  --muted: #b3aa8c;
  --line: #3a3420;
  --green: #4cc26f;
  --red: #ff6b5f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  min-height: 100dvh;
}

h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 24px 0 8px; font-size: 20px; }
p { margin: 0 0 12px; }
a { color: var(--yellow); }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.lead { font-size: 20px; }
.error { color: var(--red); min-height: 1.2em; }
.center { display: grid; place-items: center; min-height: 80dvh; }
.center-text { text-align: center; margin-top: 20px; }

.screen { display: flex; flex-direction: column; gap: 12px; padding-top: 6vh; }
.screen > * { margin: 0; }
.logo { width: 72px; height: 72px; border-radius: 18px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

button {
  font: inherit;
  font-weight: 650;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: #000;
  cursor: pointer;
  width: 100%;
}
button:disabled { opacity: 0.45; cursor: default; }
button.secondary { background: transparent; color: var(--yellow); border: 2px solid var(--yellow); }
button.link { background: none; color: var(--muted); min-height: 44px; font-weight: 500; text-decoration: underline; }
button.icon { width: 48px; min-height: 48px; padding: 0; background: var(--card); color: var(--fg); font-size: 24px; border-radius: 14px; }
button.provider { display: flex; align-items: center; justify-content: center; gap: 8px; }
button.apple { background: #fff; color: #000; }
button.google { background: #fff; color: #1f1f1f; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

input.big, select.big {
  font: inherit;
  font-size: 20px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--fg);
}
input.code { font: 600 28px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.25em; text-align: center; text-transform: uppercase; }
.bigcode { font: 700 44px/1.1 ui-monospace, Menlo, monospace; letter-spacing: 0.2em; color: var(--yellow); text-align: center; margin: 12px 0; }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bar h1 { flex: 1; margin: 0; }
.mini { width: 40px; height: 40px; border-radius: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }
.card.warn { border-color: var(--yellow); }
.card.note { font-size: 16px; }
.card button + button { margin-top: 8px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; width: 64px; height: 38px; border-radius: 19px; background: var(--line); position: relative; transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(26px); }
.switch input:focus-visible + i { outline: 3px solid var(--yellow); outline-offset: 2px; }

.friends { list-style: none; margin: 0 0 16px; padding: 0; }
.friend {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 4px;
  background: none; color: var(--fg); border-radius: 0; border-bottom: 1px solid var(--line);
  font-weight: 400; text-align: left;
}
.friend:hover { background: var(--card); }
.friend .name { flex: 1; font-weight: 600; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends .empty { padding: 16px 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.dot.on { background: var(--green); }

.row { display: flex; gap: 10px; }
.row button { flex: 1; }

/* ---------------------------------------------------------------- talk */
.talk { display: flex; flex-direction: column; min-height: calc(100dvh - 44px); }
.who { flex: 1; min-width: 0; }
.who h1 { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.who .dot { display: inline-block; vertical-align: middle; }

.history { list-style: none; margin: 0; padding: 0 0 12px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg .signal, .msg .play {
  display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 52px;
  padding: 0 18px; border-radius: 18px; background: var(--card); color: var(--fg);
  border: 2px solid var(--line); font-weight: 600; font-size: 18px;
}
.msg.mine .signal, .msg.mine .play { background: #3a3218; border-color: #3a3218; }
/* Unplayed messages stay bright until heard, like the apps. */
.msg.unplayed .play { background: var(--yellow); color: #000; border-color: var(--yellow); }
.msg .meta { padding: 0 6px; }

.talkbar {
  position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
}
.talkbar .status { margin: 0; min-height: 1.4em; text-align: center; color: var(--muted); font-size: 16px; }
.talkbtn {
  min-height: 120px; font-size: 26px; border-radius: 28px;
  user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none;
}
.talkbtn.on { background: var(--red); color: #fff; }

.sheet { position: fixed; inset: 0; background: rgb(0 0 0 / 0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheetbox {
  width: 100%; max-width: 520px; background: var(--bg); border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; max-height: 85dvh; overflow: auto;
}
.grid { display: grid; gap: 8px; }
.grid.words { grid-template-columns: 1fr 1fr; }
.grid.emoji { grid-template-columns: repeat(6, 1fr); }
.grid.emoji button { font-size: 26px; padding: 0; }
.grid button { min-height: 52px; font-size: 17px; }

/* ---------------------------------------------------------------- live */
.live-btn { width: auto; min-height: 48px; padding: 0 16px; font-size: 16px; }
.live { display: flex; flex-direction: column; gap: 16px; padding-top: 4vh; }
.live h1 { font-size: 34px; margin: 0; }
.livestatus { font-size: 26px; font-weight: 700; text-align: center; min-height: 1.3em; margin: 8px 0; }
.live .talkbtn { min-height: 160px; }
.live .switch.card { margin: 0; }
/* A message that came in during the call: it waits in the conversation. */
.livenotice { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--yellow); font-weight: 600; }
.livenotice[hidden] { display: none; }
button.hangup, button.decline { background: var(--red); color: #fff; }
button.join { background: var(--green); color: #000; }
/* A channel's open Live room, under the header: tap anywhere on it to join. */
.roombar { display: flex; align-items: center; gap: 8px; min-height: 52px; margin: 0 0 8px; padding: 0 16px;
  background: var(--card); border: 2px solid var(--green); color: var(--fg); font-size: 17px; text-align: left; }
.roombar b { margin-left: auto; color: var(--green); }
.roombar[hidden] { display: none; }
.livedot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); flex: none; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .livedot { animation: none; } }
.ringbox h1 { font-size: 30px; margin: 0; }
.ringbox .row button { min-height: 72px; font-size: 22px; }

.tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.tab { min-height: 40px; width: auto; padding: 0 14px; font-size: 15px; background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.tab.on { background: var(--fg); color: var(--bg); }
.row.three button { font-size: 16px; padding: 0 8px; }
.msg .row { gap: 8px; margin-top: 6px; }
.small-btn { min-height: 44px; width: auto; padding: 0 14px; font-size: 16px; }
button.danger { color: var(--red); }

.filterchip { min-height: 44px; width: auto; align-self: center; padding: 0 16px; font-size: 16px; background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.filterchip.on { background: var(--yellow); color: #000; }
.filterrow { display: flex; gap: 8px; align-items: stretch; }
.filterrow button:first-child { flex: 1; text-align: left; min-height: 64px; line-height: 1.3; }
.filterrow .icon { width: 64px; min-height: 64px; }
