/* Tee Sniper Chat. The Tee Groups look (Tailwind emerald and slate, white rounded cards, system fonts) by hand: no
   framework, no web fonts, nothing loaded from anywhere else. */
:root {
  --emerald-50: #ecfdf5; --emerald-100: #d1fae5; --emerald-200: #a7f3d0; --emerald-500: #10b981; --emerald-600: #059669;
  --emerald-700: #047857; --emerald-800: #065f46; --brand: #15803d; --ts-green: #0e7c3a;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
  --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --red-50: #fef2f2; --red-600: #dc2626; --red-700: #b91c1c; --amber-100: #fef3c7; --amber-800: #92400e;
  --radius: 14px; --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 1px 3px rgb(15 23 42 / .08);
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--slate-50); color: var(--slate-900); }
body { min-height: 100dvh; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--emerald-500); outline-offset: 2px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: rgb(255 255 255 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--slate-200); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.brand img { border-radius: 9px; flex: none; }
.wordmark { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.wordmark b { color: var(--brand); font-weight: 800; }
.topbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--slate-700); font-weight: 600; font-size: .95rem; }
.icon-btn:hover { background: var(--slate-100); }
#install { color: var(--emerald-700); }

/* layout */
.view { width: 100%; max-width: 680px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); flex: 1; display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
.muted { color: var(--slate-500); margin: 0; }
.small { font-size: .875rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.section-head h2 { font-size: 1rem; color: var(--slate-600); font-weight: 600; }

/* hero */
.hero { text-align: center; padding: 28px 20px 20px; }
.hero img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 6px 18px rgb(21 128 61 / .25); }
.hero h1 { margin-top: 16px; }
.hero p { margin: 8px auto 0; max-width: 30ch; }
.points { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.points li { display: flex; gap: 10px; align-items: flex-start; color: var(--slate-700); }
.points svg { color: var(--emerald-600); flex: none; margin-top: 1px; }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; color: var(--slate-700); }
.input { display: block; width: 100%; height: 48px; margin-top: 6px; padding: 0 14px; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; font-size: 1rem; }
.input:focus { border-color: var(--emerald-600); outline: 3px solid var(--emerald-100); }
.code-input { text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--slate-200); background: #fff; font-weight: 600; color: var(--slate-800); text-decoration: none; }
.btn:hover { background: var(--slate-50); }
.btn.primary { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }
.btn.primary:hover { background: var(--emerald-700); }
.btn.danger { color: var(--red-700); border-color: #fecaca; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.error { color: var(--red-700); background: var(--red-50); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin: 0; }
.error:empty { display: none; }
.note { color: var(--emerald-800); background: var(--emerald-50); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin: 0; }

/* group list */
.groups { display: grid; gap: 12px; }
.group { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border: 1px solid var(--slate-200);
  border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.group:hover { border-color: var(--emerald-200); }
.group-mark { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--emerald-100); color: var(--emerald-800); font-weight: 800; }
.group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.group-name { display: block; font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--emerald-700); background: var(--emerald-50); border-radius: 99px; padding: 3px 10px; }
.here::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); box-shadow: 0 0 0 3px rgb(16 185 129 / .25); }
.chev { color: var(--slate-400); }
.empty { text-align: center; padding: 28px 20px; }
.empty svg { width: 40px; height: 40px; color: var(--slate-300); }

/* room */
.room { gap: 14px; padding-bottom: 0; }
.room-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; }
.notice { font-size: .9rem; color: var(--slate-600); min-height: 1.4em; margin: 0; text-align: center; }
.notice.warn { color: var(--amber-800); background: var(--amber-100); border-radius: 8px; padding: 6px 10px; }
.people { list-style: none; margin: 0; padding: 4px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 18px 10px; }
.person { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.person button { border: 0; background: none; padding: 0; display: contents; }
.avatar { position: relative; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--emerald-100);
  color: var(--emerald-800); font-weight: 800; font-size: 1.35rem; box-shadow: 0 0 0 3px #fff, 0 0 0 3px transparent; transition: box-shadow .12s ease; }
.person.listener .avatar { background: var(--slate-100); color: var(--slate-500); }
.person.talking .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--emerald-500), 0 0 0 12px rgb(16 185 129 / .22); }
.mic-badge { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; border: 1px solid var(--slate-200); color: var(--slate-500); }
.mic-badge svg { width: 15px; height: 15px; }
.mic-badge.on { background: var(--emerald-600); border-color: var(--emerald-600); color: #fff; }
.mic-badge.forced { background: var(--red-50); border-color: #fecaca; color: var(--red-700); }
.person-name { font-weight: 600; font-size: .92rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-tag { font-size: .72rem; font-weight: 700; color: var(--emerald-700); text-transform: uppercase; letter-spacing: .04em; min-height: 1em; }
.pop { position: absolute; top: -12px; left: 50%; font-size: 1.8rem; transform: translate(-50%, 0); animation: pop 2.4s ease-out forwards; pointer-events: none; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px) scale(1); } }

.dock { position: sticky; bottom: 0; margin: auto -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgb(255 255 255 / .96);
  border-top: 1px solid var(--slate-200); display: grid; gap: 12px; backdrop-filter: blur(8px); }
.reactions { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.react { width: 40px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--slate-100); font-size: 1.3rem; }
.react:hover { background: var(--emerald-50); }
.dock-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.mode { display: grid; gap: 2px; border: 1px solid var(--slate-200); border-radius: 12px; padding: 3px; background: var(--slate-50); justify-self: start; }
.mode button { border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; font-size: .82rem; font-weight: 600; color: var(--slate-600); white-space: nowrap; }
.mode button[aria-checked="true"] { background: #fff; color: var(--emerald-800); box-shadow: var(--shadow); }
.talk { width: 96px; height: 96px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--slate-800); color: #fff;
  box-shadow: 0 6px 16px rgb(15 23 42 / .25); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .08s, background .12s; }
.talk svg { width: 38px; height: 38px; }
.talk.join { background: var(--emerald-600); }
.talk.live { background: var(--emerald-600); box-shadow: 0 0 0 8px rgb(16 185 129 / .25), 0 6px 16px rgb(5 150 105 / .35); }
.talk:active { transform: scale(.97); }
.talk:disabled { opacity: .6; }
.talk-label { text-align: center; font-weight: 700; font-size: .92rem; margin-top: -4px; color: var(--slate-700); }
.leave { justify-self: end; color: var(--red-700); border-color: #fecaca; height: 44px; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; justify-items: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(15 23 42 / .4); }
.sheet-panel { position: relative; width: 100%; max-width: 520px; background: #fff; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgb(15 23 42 / .18); max-height: 85dvh; overflow: auto; animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }
.sheet-panel h2 { margin-bottom: 4px; }
.menu { display: grid; gap: 8px; margin-top: 14px; }
.menu .btn { justify-content: flex-start; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--emerald-50);
  border: 1px dashed var(--emerald-200); font-weight: 800; font-size: 1.45rem; letter-spacing: .08em; color: var(--emerald-800); font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: var(--slate-900); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: .92rem; box-shadow: 0 8px 20px rgb(15 23 42 / .3); max-width: calc(100% - 32px); }

@media (min-width: 720px) {
  .view { padding-top: 28px; }
  .people { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .avatar { width: 84px; height: 84px; font-size: 1.55rem; }
  .dock { margin: auto 0 16px; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { .avatar, .talk { transition: none; } .pop, .sheet-panel { animation: none; } }
.center { text-align: center; }
.mt { margin-top: 14px; }
.group-mark.big { width: 72px; height: 72px; margin: 0 auto; font-size: 1.6rem; border-radius: 18px; }
#lockmark { display: inline-flex; gap: 4px; align-items: center; }
#lockmark svg { width: 16px; height: 16px; }

/* room bar chips, quiet please */
.room-status .row { gap: 6px; }
.chip { height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--slate-200); background: #fff; font-weight: 700; font-size: .85rem; color: var(--slate-700); }
.chip[aria-pressed="true"] { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.chip:disabled { opacity: .5; }
.quiet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fef3c7; border: 2px solid #f59e0b; color: #78350f; font-size: 1.05rem; }
.quiet .btn { height: 40px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--emerald-600); flex: none; }

/* Live Golf: a big one-thumb button, high contrast for sunlight, red while live */
.talk { position: relative; }
.talk-ring { position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; opacity: 0; }
.talk.big { width: 132px; height: 132px; }
.talk.big svg { width: 50px; height: 50px; }
.golf .talk:not(.join):not(.live) { background: var(--slate-900); }
.golf .talk.live { background: #dc2626; box-shadow: 0 0 0 8px rgb(220 38 38 / .28), 0 8px 20px rgb(220 38 38 / .4); }
.golf .talk.live .talk-ring { opacity: 1; background: conic-gradient(#dc2626 calc(var(--left, 1) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 64%, #000 65%); mask: radial-gradient(circle, transparent 64%, #000 65%); }
.golf .talk-label { font-size: 1.05rem; color: var(--slate-900); }
.talk-label.live { color: #b91c1c; font-weight: 800; }
.golf .dock-main { grid-template-columns: 1fr auto 1fr; }
.golf .mode button { padding: 10px 14px; font-size: .95rem; }
.person.live .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #dc2626; }
.person.live.talking .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #dc2626, 0 0 0 13px rgb(220 38 38 / .25); }
.golf .person.live .mic-badge.on { background: #dc2626; border-color: #dc2626; }
.golf .person-tag { color: var(--slate-700); }
.golf .person.live .person-tag { color: #b91c1c; }

/* sharing */
.share-link { padding: 12px 14px; border-radius: 12px; background: var(--slate-50); border: 1px solid var(--slate-200); font-weight: 700; color: var(--emerald-800); word-break: break-all; }
.share-row { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.share-row canvas { width: 132px; height: 132px; border-radius: 10px; border: 1px solid var(--slate-200); image-rendering: pixelated; flex: none; }
.share-row .code-box { font-size: 1.2rem; padding: 10px 12px; }
.room-status { flex-wrap: nowrap; }
.room-status .here { white-space: nowrap; flex: none; }
.room-status .row { flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.chip { white-space: nowrap; padding: 0 10px; flex: none; }
@media (max-width: 380px) { .chip { padding: 0 8px; font-size: .8rem; } .room-status .here { padding: 3px 8px; } }

/* Tee Groups: sign in, groups, friends, invites */
.btn.tg { text-decoration: none; }
.tg-connect { display: grid; gap: 4px; text-decoration: none; color: inherit; border-color: var(--emerald-200); background: var(--emerald-50); }
a.group { text-decoration: none; color: inherit; }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-color: var(--emerald-200); background: var(--emerald-50); }
.friends { display: grid; gap: 6px; max-height: 45dvh; overflow: auto; }
.friend { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--slate-200); border-radius: 12px; font-weight: 400; }
.friend input { width: 22px; height: 22px; accent-color: var(--emerald-600); flex: none; }
.small-mark { width: 36px; height: 36px; border-radius: 50%; font-size: .85rem; }

/* privacy page */
.prose { line-height: 1.65; }
.prose h1 { font-size: 1.6rem; margin-bottom: 4px; }
.prose h2 { font-size: 1.15rem; margin: 26px 0 6px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 4px 0; }

/* the Hold/Tap switch: a full-size target next to the big button (review 2 L-12) */
.mode button { min-height: 44px; }
