/* Uphold's look. Loaded after styles.css and wins over it: colours, type, buttons, navigation, Home, sign-in, the full-screen chat, the ring.
   Works at phone width and on desktop; teen accounts get the same design in violet. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("plus-jakarta-sans.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --brand: #0d9668; --brand-dark: #0a6b52; --brand-deep: #07423a; --mint: #e2f6ee; --sun: #ffb648; --coral: #ff7a59;
  --ink: #10211d; --muted: #566762; --border: #e3e9e5; --card: #ffffff; --page-bg: #f3f6f1;
  --grad: linear-gradient(145deg, #07423a 0%, #0a6b52 48%, #12a077 100%);
  --grad-btn: linear-gradient(135deg, #0a6b52, #0f9a6f);
  --shadow-sm: 0 1px 2px rgba(16,33,29,.05), 0 2px 8px rgba(16,33,29,.05);
  --shadow-md: 0 2px 4px rgba(16,33,29,.05), 0 10px 28px rgba(16,33,29,.09);
  --r-lg: 22px; --r-md: 15px;
  font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="teen"] {
  --brand: #7c4dff; --brand-dark: #5b34d6; --brand-deep: #2c1673; --mint: #efe9ff; --sun: #ffc24d;
  --grad: linear-gradient(145deg, #2c1673 0%, #5b34d6 50%, #8f62ff 100%);
  --grad-btn: linear-gradient(135deg, #5b34d6, #8456ff);
}
body { color: var(--ink); background: var(--page-bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }
h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 8px; }
h2 { font-weight: 800; letter-spacing: -0.015em; }
p { line-height: 1.6; }
.subtitle { font-size: 15px; color: var(--muted); }
.muted, .subtitle { color: var(--muted); }
.page-enter { animation: page-in .28s cubic-bezier(.2,.7,.3,1); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- cards ---- */
.card { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px; }
.card-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; gap: 10px; margin-bottom: 8px; }
.card-title .icon { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--mint); color: var(--brand-dark); }
.consent-box { background: #f6f9f6; border: 0; border-radius: var(--r-md); }
.callout { border-radius: var(--r-md); border-width: 0; }
.callout-warn { background: #fff5dd; }
details.fold { padding: 0; }
details.fold > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; min-height: 60px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .card-title { margin: 0; flex: 1; }
details.fold > summary::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform .18s; margin-right: 4px; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > .fold-body { padding: 0 20px 20px; }

/* ---- buttons and fields ---- */
.btn { border-radius: 14px; padding: 12px 18px; font-size: 14.5px; font-weight: 700; min-height: 46px; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-dark, :root[data-theme="teen"] .btn-dark { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 16px -6px rgba(10,107,82,.55); }
.btn-dark:hover { background: var(--grad-btn); filter: brightness(1.06); box-shadow: 0 8px 20px -6px rgba(10,107,82,.6); }
.btn-outline { background: #fff; border: 1.5px solid var(--border); }
.btn-outline:hover { background: #f7faf8; border-color: var(--brand); }
.btn-danger-outline { border-radius: 14px; }
.btn-link { color: var(--brand-dark); font-weight: 600; }
.btn.big { min-height: 54px; font-size: 16px; border-radius: 16px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; font-size: 16px; background: #fbfcfb; min-height: 48px; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
.consent-check { font-size: 14.5px; line-height: 1.45; align-items: flex-start; gap: 10px; }
label.field-label { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; margin-top: 4px; }
.dob-row { display: grid; grid-template-columns: 1fr 1.5fr 1.1fr; gap: 8px; }
.dob-row select { padding-left: 10px; padding-right: 4px; margin: 0; }
.age-group .small { margin-top: 8px; }

/* ---- navigation ---- */
.sidebar { background: var(--grad); border: 0; color: #fff; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-tag, .sidebar-footer { color: rgba(255,255,255,.7); }
.brand-icon { background: rgba(255,255,255,.16); }
.nav-item { position: relative; color: rgba(255,255,255,.78); font-weight: 600; border-radius: 13px; padding: 11px 13px; font-size: 14.5px; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand-dark); font-weight: 800; }
.nav-dot, .row-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--coral); color: #fff; font-size: 11.5px; font-weight: 800; }
.nav-dot { position: absolute; top: 5px; right: 8px; box-shadow: 0 0 0 2px #fff; }
.row-dot { flex: none; margin-left: auto; }
.content { padding: 30px 36px 70px; max-width: 900px; }
@media (max-width: 700px) {
  .app { padding-bottom: 96px; }
  .sidebar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; padding: 6px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(16,33,29,.06); border-radius: 24px; box-shadow: 0 10px 32px rgba(16,33,29,.18); }
  .nav-item { color: #63736e; padding: 7px 2px 6px; border-radius: 18px; min-height: 56px; font-size: 11px; gap: 3px; }
  .nav-item:hover { background: transparent; color: #63736e; }
  .nav-item.active, .nav-item.active:hover { background: var(--mint); color: var(--brand-dark); }
  .nav-item .icon { width: 23px; height: 23px; }
  .nav-label { font-size: 11px; font-weight: 700; }
  .nav-dot { top: 3px; right: calc(50% - 22px); }
  .content { padding: 18px 16px 24px; }
  h1 { font-size: 25px; }
}
.more-panel { border-radius: 26px 26px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.more-panel button.more-item { font-weight: 700; font-size: 15.5px; min-height: 58px; color: var(--ink); }
.more-panel button.more-item .icon { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--mint); color: var(--brand-dark); }

/* ---- Home ---- */
.home-clean { min-height: 0; display: block; padding: 0; }
.home-hero { position: relative; overflow: hidden; background: var(--grad); color: #fff; border-radius: 28px; padding: 26px 22px 22px; box-shadow: var(--shadow-md); margin-bottom: 18px; }
.home-hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,182,72,.55), rgba(255,182,72,0) 68%); pointer-events: none; }
.home-hero::after { content: ""; position: absolute; width: 200px; height: 200px; left: -70px; bottom: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), rgba(255,255,255,0) 70%); pointer-events: none; }
.hh-row { position: relative; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.home-hello { font-size: clamp(27px, 7.4vw, 38px); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 6px; }
.hh-word { display: block; font-size: .56em; font-weight: 600; letter-spacing: -0.01em; opacity: .85; margin-bottom: 2px; }
.hh-name, :root[data-theme="teen"] .hh-name { color: #fff; display: block; }
.home-sub { color: rgba(255,255,255,.88); font-size: 14px; margin: 0; min-height: 21px; }
.hh-ring { position: relative; flex: none; width: 68px; height: 68px; }
.hh-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.hh-ring .r-bg { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 6; }
.hh-ring .r-fg { fill: none; stroke: var(--sun); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.3,1); }
.home-verse { position: relative; margin: 18px 0 0; padding: 15px 17px; border: 1px solid rgba(255,255,255,.2); border-left: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 18px; }
.home-verse blockquote { font-size: 16.5px; line-height: 1.55; color: #fff; }
.home-verse figcaption { color: var(--sun); font-weight: 700; font-size: 13px; margin-top: 9px; }
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 701px) { .home-tiles { grid-template-columns: repeat(3, 1fr); } }
.home-tile { position: relative; border: 0; border-radius: 22px; padding: 16px; gap: 3px; min-height: 124px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s; }
.home-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.home-tile:active { transform: scale(.97); }
.home-tile .badge { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 9px; color: #fff; }
.home-tile .badge .icon { width: 23px; height: 23px; }
.home-tile strong { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.tile-sub { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tone-green .badge { background: linear-gradient(135deg, #0a6b52, #18b583); }
.tone-violet .badge { background: linear-gradient(135deg, #5b34d6, #9a72ff); }
.tone-blue .badge { background: linear-gradient(135deg, #1763c9, #45a0f5); }
.tone-amber .badge { background: linear-gradient(135deg, #d97a06, #ffb648); }
.tone-rose .badge { background: linear-gradient(135deg, #c62e74, #fb6fa8); }
.tone-red .badge { background: linear-gradient(135deg, #c5321c, #ff7a59); }
.tone-red { background: #fff4f0; }

/* ---- sign in and sign up ---- */
body.signed-out { background: var(--page-bg); }
body.signed-out::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 330px; background: var(--grad); border-radius: 0 0 36px 36px; z-index: -1; }
body.signed-out .content { max-width: 100%; }
.auth-page { max-width: 460px; margin: 0 auto; }
.auth-brand { color: #fff; }
.auth-brand .muted { color: rgba(255,255,255,.85); font-size: 15px; }
.auth-logo { background: rgba(255,255,255,.16); color: #fff; width: 62px; height: 62px; border-radius: 20px; }
.auth-logo .icon { width: 32px; height: 32px; }
.auth-name { font-weight: 800; font-size: 30px; letter-spacing: -0.03em; color: #fff; }
.auth-card { border-radius: 26px; box-shadow: var(--shadow-md); padding: 24px 22px; }
.auth-title { font-size: 25px; }
.auth-old-user { border-radius: 14px; }
.auth-more { border: 0; border-radius: 16px; box-shadow: var(--shadow-sm); }
.auth-help .btn-link { color: var(--brand-dark); font-weight: 700; }
.lang-row .lang-switch, .lang-row { filter: none; }

/* ---- onboarding ---- */
.ob-chip { border: 1.5px solid var(--border); font-weight: 600; padding: 12px 17px; border-radius: 24px; transition: transform .1s; }
.ob-chip:active { transform: scale(.96); }
.ob-chip.on { background: var(--grad-btn); border-color: transparent; }
.ob-dots span { height: 6px; border-radius: 3px; }
.choice-card { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ---- Recovery ---- */
.ci-row { gap: 10px; }
.ci-row .btn { flex-direction: column; gap: 4px; min-height: 84px; font-size: 13px; border: 0; color: var(--ink); line-height: 1.2; white-space: normal; box-shadow: none; }
.rec-ci::before { font-size: 25px; line-height: 1; }
.rec-ci[data-status="held"] { background: #e2f6ee; }
.rec-ci[data-status="held"]::before { content: "💪"; }
.rec-ci[data-status="struggled"] { background: #fff4d9; }
.rec-ci[data-status="struggled"]::before { content: "😓"; }
.rec-ci[data-status="slipped"] { background: #ffece6; }
.rec-ci[data-status="slipped"]::before { content: "🌱"; }
.rec-ci:hover { filter: brightness(.97); }
.rec-urge-btn { background: linear-gradient(135deg, #5b34d6, #9a72ff); box-shadow: 0 8px 20px -8px rgba(91,52,214,.7); min-height: 54px; }
.rec-urge-btn:hover { background: linear-gradient(135deg, #5b34d6, #9a72ff); }
.prog { border: 0; background: #f6f9f6; border-radius: 18px; }
.cal-day { border-radius: 6px; }
.status-badge { font-size: 12px; padding: 5px 12px; }

/* ---- Help ---- */
.call-btn { border-radius: 14px; }
.read-item { background: #f6f9f6; }

/* ---- Circles list ---- */
.circle-row { border: 0; border-radius: 20px; box-shadow: var(--shadow-sm); padding: 14px; transition: transform .1s, box-shadow .15s; }
.circle-row:hover { box-shadow: var(--shadow-md); }
.circle-row:active { transform: scale(.985); }
.avatar { width: 46px; height: 46px; flex-basis: 46px; font-size: 18px; border-radius: 15px; }

/* ---- the chat fills the screen ---- */
body.chat-open { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body.chat-open .app { flex: 1; min-height: 0; padding-bottom: 0; }
body.chat-open .content { padding: 0; max-width: none; display: flex; flex-direction: column; min-height: 0; height: 100%; }
body.chat-open #page-circles { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--card); }
@media (max-width: 700px) { body.chat-open .sidebar { display: none; } }
.chat-head { flex: none; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 8px 10px 8px 6px; background: var(--grad); color: #fff; padding-top: calc(8px + env(safe-area-inset-top)); }
.chat-head strong { font-size: 16px; font-weight: 800; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .muted { color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .btn-link { color: #fff; }
.chat-head .btn-outline { background: rgba(255,255,255,.14); border: 0; color: #fff; min-height: 38px; font-size: 13px; white-space: nowrap; }
.chat-head .avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.chat-head > div.chat-title > div { min-width: 0; }
.chat-head .chip { background: rgba(255,255,255,.2); color: #fff; }
#ci-call { flex: none; }
#ci-call:empty { display: none; }
.call-banner { margin: 0; border-radius: 0; border: 0; padding: 8px 14px; min-height: 0; font-size: 13px; background: #f6f9f6; }
.chat-tabs { flex: none; margin: 0; padding: 7px 12px; gap: 4px; background: #fff; box-shadow: 0 1px 0 var(--border); position: relative; z-index: 1; }
.chat-tab { min-height: 36px; padding: 5px 12px; border: 0; background: transparent; font-size: 13.5px; }
.chat-tab.active { background: var(--mint); color: var(--brand-dark); }
body.chat-open .chat-feed { flex: 1; min-height: 0; height: auto !important; max-height: none; border: 0; border-radius: 0; overflow-y: auto; padding: 12px 12px 10px; background-color: #eef3ee; background-image: radial-gradient(rgba(10,107,82,.06) 1.2px, transparent 1.2px); background-size: 18px 18px; }
:root[data-theme="teen"] body.chat-open .chat-feed { background-color: #f1ecff; }
.feed-note { max-width: 88%; margin: 2px auto 12px; padding: 7px 12px; background: #fff7e6; border-radius: 12px; font-size: 12.5px; line-height: 1.4; text-align: center; color: #6b4a00; }
.day { margin: 12px 0; }
.day { display: block; }
.msg { max-width: 84%; margin-bottom: 7px; }
.bubble { position: relative; padding: 9px 13px; border-radius: 19px; box-shadow: 0 1px 2px rgba(16,33,29,.08); cursor: pointer; }
.msg.theirs .bubble { background: #fff; border-bottom-left-radius: 6px; }
.msg.mine .bubble, :root[data-theme="teen"] .msg.mine .bubble { background: var(--grad-btn); color: #fff; border-bottom-right-radius: 6px; }
.msg.mine .bubble .meta { color: rgba(255,255,255,.8); }
.msg.mine .bubble .quote { background: rgba(255,255,255,.16); color: #fff; border-left-color: rgba(255,255,255,.7); }
.msg.mine .voice-play { background: #fff; color: var(--brand-dark); }
.msg.mine .voice-time { color: #fff; }
.msg.mine .voice-bar { background: rgba(255,255,255,.3); }
.msg.mine .voice-fill { background: #fff; }
.msg.mine .chip.pray { background: rgba(255,255,255,.2); color: #fff; }
.bubble .text { font-size: 15.5px; line-height: 1.42; }
.bubble .who { font-size: 12.5px; }
.msg-actions { margin-top: 3px; gap: 4px; }
.msg-actions:not(:has(.react:not(.zero):not(.ghost))) { margin-top: 0; }
.msg:not(.active) .react.zero, .msg:not(.active) .react.ghost { display: none; }
.react { box-shadow: var(--shadow-sm); border: 0; min-height: 30px; }
.composer { position: relative; bottom: auto !important; flex: none; background: #fff; padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--border); z-index: 2; }
.composer-row { align-items: flex-end; flex-wrap: nowrap !important; gap: 6px; }
.composer-row textarea { min-height: 46px; border-radius: 23px; padding: 11px 16px; background: #f3f6f3; border-color: transparent; line-height: 1.35; width: auto; min-width: 0; }
.comp-icon { flex: none; width: 46px; height: 46px; min-height: 46px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: #f3f6f3; color: var(--brand-dark); font-size: 19px; line-height: 1; cursor: pointer; transition: background .15s, transform .1s; }
.comp-icon .icon { width: 22px; height: 22px; }
.comp-icon:active { transform: scale(.92); }
.comp-icon.on { background: #efe9ff; box-shadow: inset 0 0 0 2px #7c4dff; }
#ci-voice-btn { display: inline-flex; flex: none; }
#ci-voice-btn:empty { display: none; }
.send-btn { flex: none; width: 46px; height: 46px; min-height: 46px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--grad-btn); color: #fff; cursor: pointer; box-shadow: 0 6px 14px -6px rgba(10,107,82,.7); transition: transform .1s; }
.send-btn .icon { width: 21px; height: 21px; }
.send-btn:active { transform: scale(.92); }
.send-btn:disabled { opacity: .5; }
.new-pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 78px !important; margin: 0; z-index: 3; box-shadow: var(--shadow-md); }
.reply-chip { border-radius: 12px; border: 0; background: #f3f6f3; border-left: 4px solid var(--brand); }
body.chat-open #ci-sheet, body.chat-open #ci-mod { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 74vh; overflow-y: auto; margin: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -12px 40px rgba(16,33,29,.25); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 701px) { body.chat-open #ci-sheet, body.chat-open #ci-mod { left: 250px; } }
.call-bar { flex: none; }

/* ---- incoming call ---- */
body.ring-open { overflow: hidden; }
.ring { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: calc(56px + env(safe-area-inset-top)) 24px calc(56px + env(safe-area-inset-bottom)); background: var(--grad); color: #fff; text-align: center; animation: page-in .25s ease-out; }
.ring-kicker { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ring h2 { font-size: 30px; margin: 26px 0 6px; color: #fff; }
.ring p { font-size: 16px; opacity: .9; margin: 0; }
.ring-orb { position: relative; width: 120px; height: 120px; margin: 44px auto 0; }
.ring-orb b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 46px; font-weight: 800; }
.ring-orb span { position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,.22); animation: ring-pulse 2s ease-out infinite; }
.ring-orb span:nth-child(2) { animation-delay: 1s; }
@keyframes ring-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(2.1); opacity: 0; } }
.ring-actions { display: flex; gap: 64px; }
.ring-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.ring-btn .icon { width: 72px; height: 72px; padding: 21px; border-radius: 50%; color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.28); transition: transform .1s; }
.ring-btn:active .icon { transform: scale(.92); }
.ring-btn.accept .icon { background: #18c07f; animation: ring-bounce 1.2s ease-in-out infinite; }
.ring-btn.decline .icon { background: #e5482d; }
@keyframes ring-bounce { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .ring-orb span, .ring-btn.accept .icon { animation: none; } }

/* ---- banner for a new message while the app is open ---- */
#alert-host { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 1500; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.alert-banner { pointer-events: auto; width: 100%; max-width: 460px; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 12px 34px rgba(16,33,29,.22); text-align: left; color: var(--ink); cursor: pointer; animation: alert-in .28s cubic-bezier(.2,.8,.3,1.1); transition: opacity .3s, transform .3s; }
.alert-banner.leaving { opacity: 0; transform: translateY(-12px); }
@keyframes alert-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
.alert-dot { flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--grad-btn); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.alert-text { min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.alert-text strong { font-size: 14px; font-weight: 800; }
.alert-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.celebrate { border: 0; border-radius: 18px; }
.chat-back { padding: 6px; flex: none; }
.chat-back .icon { width: 24px; height: 24px; }

/* tabs and the call button share one row; a call in progress takes its own full-width row */
.chat-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; background: #fff; box-shadow: 0 1px 0 var(--border); position: relative; z-index: 1; }
.chat-bar .chat-tabs { flex: 1; min-width: 0; box-shadow: none; background: transparent; }
.chat-bar #ci-call:not(.is-quiet) { flex: 1 0 100%; }
#ci-call.is-quiet { flex: none; padding-right: 10px; }
#ci-call.is-quiet .call-banner { padding: 0; background: transparent; }
#ci-call.is-quiet .muted { display: none; }
#ci-call.is-quiet .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
/* the welcome plays quickly: people came here to do something */
.home-clean.animate .hh-word { animation: hh-up .4s ease both; }
.home-clean.animate .hh-name { animation: hh-up .4s .1s ease both; }
.home-clean.animate .home-verse { animation: hh-fade .5s .3s ease both; }
.home-clean.animate .home-tile { animation: hh-up .35s calc(.4s + var(--i) * .05s) ease both; }

/* ---- during a call: the bar takes its own space, so the back arrow and page headings stay reachable ---- */
.call-bar { position: sticky; top: 0; padding-top: calc(8px + env(safe-area-inset-top)); }
body.in-call { padding-top: 0; }
body.chat-open .call-bar { position: relative; }
body.chat-open #call-open { display: none; }
.call-bar .call-top strong { flex: 1 1 100%; font-size: 14px; }
.call-more summary { min-height: 30px; }

.call-route { white-space: nowrap; }

/* ---- games ---- */
.tone-teal .badge { background: linear-gradient(135deg, #0b7a8a, #2cc6c1); }
.home-tile.tone-teal { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 14px; }
.home-tile.tone-teal .badge { margin: 0; flex: none; }
.home-tile.tone-teal .tile-sub { display: block; }
@media (min-width: 701px) { .home-tile.tone-teal { grid-column: auto; flex-direction: column; align-items: flex-start; } }
.gm-start { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.gm-new { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 18px; border: 0; background: var(--mint); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .1s; }
.gm-new:active { transform: scale(.97); }
.gm-ic { font-size: 32px; line-height: 1; margin-bottom: 6px; }
.gm-ic.small { font-size: 24px; margin: 0; }
.gm-soon { margin-top: 8px; }
.gm-list { margin-top: 12px; display: grid; gap: 8px; }
.gm-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.gm-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gm-row .row-dot { font-size: 11px; padding: 0 9px; }
.gm-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.gm-title { margin: 0; font-size: 22px; }
.gm-status { text-align: center; font-weight: 800; padding: 10px; border-radius: 14px; background: var(--surface2, #eef3ee); margin-bottom: 12px; color: var(--ink); }
.gm-status.mine { background: var(--grad-btn); color: #fff; }
.gm-status.over { background: #fff4d9; color: #6b4a00; }
.gboard { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); user-select: none; }
.sq { position: relative; border: 0; padding: 0; margin: 0; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; }
.chess .sq.lt { background: #eeeed2; } .chess .sq.dk { background: #6f9e74; }
.draughts .sq.lt { background: #f3e2c0; } .draughts .sq.dk { background: #8b5a3c; }
.sq.last { box-shadow: inset 0 0 0 100px rgba(255, 214, 79, .38); }
.sq.sel { box-shadow: inset 0 0 0 4px #ffd64f; }
.sq.tgt::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(10, 40, 30, .35); }
.sq.tgt:has(.pc, .disc)::after { width: 86%; height: 86%; background: transparent; border: 4px solid rgba(10, 40, 30, .4); }
.pc { font-size: min(9.2vw, 44px); line-height: 1; }
.pc-w { color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000, 0 0 1px #000; }
.pc-b { color: #121212; text-shadow: 0 0 1px #fff4; }
.disc { width: 74%; height: 74%; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.28), 0 2px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.disc-b { background: radial-gradient(circle at 35% 30%, #ff6b5a, #b3261e); }
.disc-w { background: radial-gradient(circle at 35% 30%, #ffffff, #d9d2c3); }
.disc.king::after { content: "♛"; font-size: min(5vw, 22px); color: #ffd64f; text-shadow: 0 1px 1px #0008; }
.gm-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px auto 6px; max-width: 440px; }
.gm-promo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 12px 0; }

/* ---- the four game buttons ---- */
.gm-start { grid-template-columns: 1fr 1fr; }
.gm-ludo { background: linear-gradient(135deg, #ffe8e3, #fff6d8); }
.gm-whot { background: linear-gradient(135deg, #f7e1e6, #fdeef1); }
.gm-chess { background: #e7f3ec; } .gm-draughts { background: #f6ecdf; }

/* ---- ludo ---- */
.ludo { display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); background: #fff; }
.lc { position: relative; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); background: #fff; }
.lc.yard { box-shadow: none; }
.yard.red { background: #e5483c; } .yard.green { background: #2ea860; } .yard.yellow { background: #f2c230; } .yard.blue { background: #2f7de1; }
.lc.spot::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 3px rgba(0,0,0,.25); }
.hc.red, .st.red { background: #f07b70; } .hc.green, .st.green { background: #6cc893; } .hc.yellow, .st.yellow { background: #f7d76d; } .hc.blue, .st.blue { background: #6fa8ee; }
.lc.centre { box-shadow: none; } .lc.cg { background: #2ea860; } .lc.cr { background: #e5483c; } .lc.cy { background: #f2c230; } .lc.cb { background: #2f7de1; } .lc.cc { background: #10211d; } .lc.ch { background: #fff; } .lc.ch::after { content: "🏠"; font-size: min(3.4vw, 15px); }
.lstar { position: absolute; font-size: min(3vw, 13px); color: #9aa5a0; }
.toks { position: relative; z-index: 1; width: 100%; height: 100%; display: grid; place-items: center; }
.toks.n2, .toks.n3, .toks.n4 { grid-template-columns: 1fr 1fr; }
.tok { width: 86%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; padding: 0; margin: 0; min-height: 0; box-shadow: 0 2px 4px rgba(0,0,0,.45); cursor: default; }
.toks.n2 .tok, .toks.n3 .tok, .toks.n4 .tok { width: 92%; border-width: 1px; }
.tok-r { background: radial-gradient(circle at 35% 30%, #ff8a7d, #c42d22); }
.tok-y { background: radial-gradient(circle at 35% 30%, #ffe27a, #d9a400); }
.tok.can { cursor: pointer; animation: tok-bob 1s ease-in-out infinite; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #10211d, 0 3px 6px rgba(0,0,0,.5); }
@keyframes tok-bob { 50% { transform: translateY(-3px) scale(1.08); } }
.ludo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 440px; margin: 14px auto 0; }
.home-count { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; }
.home-count .tok { width: 18px; height: 18px; animation: none; }
.dice { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: var(--card); color: var(--ink); border-radius: 18px; padding: 6px 18px; box-shadow: var(--shadow-sm); font: inherit; min-height: 0; }
.dice span { font-size: 54px; line-height: 1; }
.dice b { font-size: 13px; }
.dice.can { background: var(--grad-btn); color: #fff; cursor: pointer; box-shadow: 0 8px 18px -6px rgba(10,107,82,.7); animation: tok-bob 1.4s ease-in-out infinite; }
.dice.rolled span { animation: die-roll .55s cubic-bezier(.3,.7,.4,1); }
@keyframes die-roll { 0% { transform: rotate(-200deg) scale(.4); } 70% { transform: rotate(20deg) scale(1.15); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tok.can, .dice.can, .dice.rolled span { animation: none; } }

/* ---- whot ---- */
.whot { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.w-backs { display: flex; margin-top: 6px; padding-left: 10px; }
.w-backs .wcard { margin-left: -14px; }
.w-table { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px 10px; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #1f7a55, #0d4d36); box-shadow: inset 0 2px 12px rgba(0,0,0,.35); }
.w-market { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: inherit; padding: 0; min-height: 0; cursor: default; }
.w-market.can { cursor: pointer; }
.w-market.can .wcard { animation: tok-bob 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px #ffd64f, 0 6px 14px rgba(0,0,0,.4); }
.w-market b { font-size: 12.5px; background: #ffd64f; color: #3b2a00; padding: 2px 10px; border-radius: 10px; }
.w-pile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.w-ask { color: #fff; font-size: 13px; background: rgba(0,0,0,.25); padding: 3px 10px; border-radius: 10px; }
.w-hand { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 8px; scroll-snap-type: x proximity; }
.wcard { position: relative; flex: none; width: 64px; height: 92px; border-radius: 10px; background: #fff; color: #8b1c2b; border: 1.5px solid #e2d5d7; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; font: inherit; padding: 0; scroll-snap-align: start; }
.wcard.big { width: 84px; height: 120px; }
.wcard.small { width: 34px; height: 50px; border-radius: 6px; }
.wcard .wsym { font-size: 34px; line-height: 1; }
.wcard.big .wsym { font-size: 46px; }
.wcard .wbig { font-weight: 900; font-size: 13px; letter-spacing: .04em; transform: rotate(-30deg); }
.wcard .wn { position: absolute; top: 4px; left: 6px; font-weight: 800; font-size: 13px; }
.wcard .wn.rot { top: auto; left: auto; bottom: 4px; right: 6px; transform: rotate(180deg); }
.wcard.back { background: repeating-linear-gradient(45deg, #8b1c2b 0 6px, #a3263a 6px 12px); border-color: #6d1421; color: #fff; }
.wcard.back span { font-weight: 900; font-size: 11px; letter-spacing: .05em; background: #8b1c2b; padding: 2px 4px; border-radius: 4px; }
.wcard.small.back span { font-size: 7px; }
.wcard.can { cursor: pointer; transform: translateY(-8px); box-shadow: 0 0 0 3px var(--brand), 0 8px 16px rgba(0,0,0,.25); }
.wcard:not(.can):not(.back):not(.big) { opacity: .62; }
:root[data-mode="dark"] .wcard:not(.back) { background: #f6f1f2; }
:root[data-mode="dark"] .gm-ludo, :root[data-mode="dark"] .gm-whot, :root[data-mode="dark"] .gm-chess, :root[data-mode="dark"] .gm-draughts { background: var(--surface2); }
:root[data-mode="dark"] .dice:not(.can) { background: var(--surface2); }
