:root {
  /* Black Box Golf V3 Brand Palette */
  --bbg-black: #111111;
  --bbg-charcoal: #242122;
  --bbg-golf-green: #83B451;
  --bbg-forest-green: #153B29;
  --bbg-white: #FFFFFF;
  --bbg-warm-grey: #F2F1EE;

  /* Derived UI tokens */
  --bg-page: #E5E3DE;
  --bg-app: var(--bbg-warm-grey);
  --surface: var(--bbg-white);
  --border-subtle: rgba(17, 17, 17, 0.08);
  --text-primary: var(--bbg-black);
  --text-secondary: rgba(36, 33, 34, 0.68);
  --text-muted: rgba(36, 33, 34, 0.5);
  --radius-card: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 10px rgba(17, 17, 17, 0.04);
  --shadow-composer: 0 8px 28px rgba(17, 17, 17, 0.12);
  --font-sans: "Calibri", "Carlito", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0B0B0B;
  --bg-app: var(--bbg-black);
  --surface: var(--bbg-charcoal);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-primary: var(--bbg-white);
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.5);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-composer: 0 10px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .brand-logo,
[data-theme="dark"] .auth-logo {
  mix-blend-mode: normal;
}

[data-theme="dark"] .greeting,
[data-theme="dark"] .card-title-sm,
[data-theme="dark"] .lb-score,
[data-theme="dark"] .drawer-item,
[data-theme="dark"] .drawer-signout,
[data-theme="dark"] .subpage-title,
[data-theme="dark"] .back-btn,
[data-theme="dark"] .composer-input,
[data-theme="dark"] .review-input,
[data-theme="dark"] .choice-btn,
[data-theme="dark"] .plus-tile {
  color: var(--bbg-white);
}

[data-theme="dark"] .eyebrow {
  color: var(--bbg-golf-green);
}

[data-theme="dark"] .lb-row:not(.is-you),
[data-theme="dark"] .presence-chip,
[data-theme="dark"] .note-row,
[data-theme="dark"] .history-row,
[data-theme="dark"] .review-field,
[data-theme="dark"] .choice-btn:not(.is-selected),
[data-theme="dark"] .plus-tile,
[data-theme="dark"] .drawer-signout,
[data-theme="dark"] .icon-btn:not(.icon-camera):not([aria-pressed="true"]) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--bbg-white);
}

[data-theme="dark"] .composer-wrap {
  background: linear-gradient(to top, var(--bg-app) 78%, rgba(17, 17, 17, 0));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.edge-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  box-shadow: inset 0 0 36px rgba(131, 180, 81, 0.45);
  z-index: 50;
}

.edge-glow.is-active {
  opacity: 1;
}

.device-shell {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 12px;
}

.app-screen {
  width: 100%;
  max-width: 412px;
  height: min(844px, calc(100dvh - 40px));
  background: var(--bg-app);
  border-radius: 36px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.main-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

@media (max-width: 480px) {
  .device-shell { padding: 0; }
  .app-screen {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* Auth Screen */
.auth-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 30px 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-logo {
  height: 30px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.auth-title {
  font-size: 23px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: var(--bbg-warm-grey);
  font-family: inherit;
  font-size: 15px;
  color: var(--bbg-black);
  outline: none;
}

.auth-error {
  font-size: 13px;
  color: #9e2a2b;
  font-weight: 600;
}

.auth-switch {
  margin-top: 14px;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--bbg-forest-green);
  cursor: pointer;
}

.btn-google {
  margin-top: 18px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: var(--surface);
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  background: transparent;
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

[data-theme="dark"] .menu-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--bbg-white);
}

.brand-logo {
  height: 24px;
  width: auto;
  display: block;
}

.brand-sep {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 2px;
}

.header-vb-mark {
  height: 13px;
  width: auto;
  display: block;
  opacity: 0.78;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bbg-golf-green);
}

.status-dot.is-playing {
  background: #E09F3E;
}

.status-dot.is-away {
  background: rgba(128, 128, 128, 0.55);
}

/* Ambient Golf Video + VenBuilder Backdrop */
.ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
  filter: blur(2px) saturate(0.85);
  transition: opacity 0.6s ease;
}

.ambient-video.is-switching {
  opacity: 0 !important;
}

[data-theme="dark"] .ambient-video {
  opacity: 0.24;
  filter: blur(2px) brightness(0.8);
}

.ambient-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(242, 241, 238, 0.72) 0%, rgba(242, 241, 238, 0.35) 55%, rgba(242, 241, 238, 0.85) 100%);
}

[data-theme="dark"] .ambient-veil {
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0.72) 0%, rgba(17, 17, 17, 0.4) 55%, rgba(17, 17, 17, 0.88) 100%);
}

.ambient-vb-mark {
  position: absolute;
  right: 18px;
  bottom: 88px;
  width: 108px;
  height: auto;
  opacity: 0.14;
}

.top-bar,
.feed,
.composer-wrap {
  position: relative;
  z-index: 1;
}

/* Floating Status Popover (top-right press-and-hold) */
.popover-backdrop {
  position: absolute;
  inset: 0;
  z-index: 36;
}

.status-popover {
  position: absolute;
  top: 60px;
  right: 18px;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 14px 36px rgba(17, 17, 17, 0.2);
  z-index: 42;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeSlideUp 150ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.popover-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.popover-option:hover,
.popover-option.is-selected {
  background: rgba(131, 180, 81, 0.16);
}

.popover-check {
  margin-left: auto;
  font-size: 12px;
  color: var(--bbg-golf-green);
}

/* Slide-over Menu Drawer */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.34);
  z-index: 30;
}

.nav-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 82%);
  background: var(--surface);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  box-shadow: 12px 0 36px rgba(17, 17, 17, 0.16);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bbg-forest-green);
  color: var(--bbg-white);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.drawer-name {
  font-size: 15px;
  font-weight: 700;
}

.drawer-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  overflow-y: auto;
}

.drawer-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.drawer-item:hover {
  background: var(--bbg-warm-grey);
}

.drawer-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.drawer-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-footer-logo {
  height: 22px;
  width: auto;
  margin: 0 auto 2px;
}

.powered-by {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.powered-by:hover {
  background: rgba(131, 180, 81, 0.12);
}

.powered-vb-v {
  height: 14px;
  width: auto;
  display: block;
}

.sync-hint {
  color: var(--bbg-forest-green);
}

[data-theme="dark"] .sync-hint {
  color: var(--bbg-golf-green);
}

.drawer-signout {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bbg-warm-grey);
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Main Feed */
.feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.greeting-block {
  padding: 24px 8px 10px;
  text-align: center;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bbg-forest-green);
  margin-bottom: 4px;
}

.greeting {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bbg-black);
  line-height: 1.15;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow: 0 3px 14px rgba(17, 17, 17, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.card.is-collapsed:hover {
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.1);
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(131, 180, 81, 0.16);
  color: var(--bbg-forest-green);
  font-size: 12px;
  font-weight: 700;
}

[data-theme="dark"] .streak-pill {
  background: rgba(131, 180, 81, 0.22);
  color: var(--bbg-golf-green);
}

.streak-progress-wrap {
  padding: 2px 0 10px;
}

.streak-bar {
  width: 100%;
  height: 7px;
  border-radius: var(--radius-pill);
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
  margin-top: 8px;
}

[data-theme="dark"] .streak-bar {
  background: rgba(255, 255, 255, 0.1);
}

.streak-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--bbg-golf-green);
  transition: width 300ms ease;
}

.streak-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bbg-warm-grey);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--bbg-golf-green);
}

.chevron-pill {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-challenge .chevron-pill {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .card:not(.card-challenge) .chevron-pill {
  background: rgba(255, 255, 255, 0.1);
}

.card-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.card-toggle-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-toggle-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-title-inline {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collapsed-summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-challenge .collapsed-summary { color: rgba(255, 255, 255, 0.8); }

.chevron {
  font-size: 13px;
  opacity: 0.65;
  transition: transform 160ms ease;
}

.card-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.card-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.card-challenge .card-body { border-top-color: rgba(255, 255, 255, 0.14); }

.card-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-challenge {
  background: var(--bbg-forest-green);
  color: var(--bbg-white);
  border-color: transparent;
}

.card-challenge .meta-text,
.card-challenge .card-subtitle,
.card-challenge .stat-label {
  color: rgba(255, 255, 255, 0.72);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.badge-live {
  background: rgba(131, 180, 81, 0.22);
  color: #C7E8A2;
}

.meta-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.card-subtitle { font-size: 13.5px; }

.challenge-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 11.5px; }
.stat-value { font-size: 14px; font-weight: 700; }

.card-title-sm {
  font-size: 16px;
  font-weight: 700;
  color: var(--bbg-black);
}

.text-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbg-forest-green);
  cursor: pointer;
  padding: 4px 2px;
}

/* Leaderboard & Notes */
.leaderboard-list,
.notes-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bbg-warm-grey);
  font-size: 14px;
}

.lb-row.is-you {
  background: rgba(131, 180, 81, 0.16);
  border: 1px solid rgba(21, 59, 41, 0.18);
}

.lb-left { display: flex; align-items: center; gap: 10px; }
.lb-pos { width: 20px; font-weight: 700; color: var(--text-secondary); }
.lb-name { font-weight: 600; }
.lb-sim { font-size: 11.5px; color: var(--text-muted); }
.lb-score { font-weight: 700; color: var(--bbg-black); }

.note-row {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bbg-warm-grey);
  font-size: 13.5px;
}

.note-author {
  font-weight: 700;
  font-size: 12px;
  color: var(--bbg-forest-green);
  margin-bottom: 2px;
}

/* Presence & Voice */
.voice-room-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(21, 59, 41, 0.22);
  background: var(--bbg-warm-grey);
  color: var(--bbg-forest-green);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.voice-room-btn[aria-pressed="true"] {
  background: var(--bbg-forest-green);
  color: var(--bbg-white);
  border-color: transparent;
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bbg-golf-green);
}

.presence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--bbg-warm-grey);
  font-size: 12.5px;
  color: var(--text-primary);
}

.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-playing { background: var(--bbg-golf-green); }
.dot-voice { background: var(--bbg-forest-green); }

/* Action Sheet */
.card-sheet { border: 1.5px solid var(--bbg-forest-green); }

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.sheet-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bbg-black);
  color: var(--bbg-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bbg-warm-grey);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.score-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.review-field {
  background: var(--bbg-warm-grey);
  border-radius: 12px;
  padding: 10px 12px;
}

.review-field.is-flagged {
  background: rgba(131, 180, 81, 0.18);
  border: 1px dashed var(--bbg-forest-green);
}

.review-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.review-input {
  width: 100%;
  margin-top: 2px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--bbg-black);
  outline: none;
}

.photo-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
}

.sheet-error {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #9e2a2b;
}

.history-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bbg-warm-grey);
}

.history-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.history-info {
  flex: 1;
  min-width: 0;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.choice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bbg-warm-grey);
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.choice-btn.is-selected {
  background: rgba(131, 180, 81, 0.18);
  border-color: var(--bbg-forest-green);
}

.choice-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  font-weight: 600;
}

.toggle-row:last-child {
  border-bottom: none;
}

/* Bottom Multimodal Composer */
.composer-wrap {
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg-app) 78%, rgba(242, 241, 238, 0));
  flex-shrink: 0;
}

.recording-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--bbg-black);
  color: var(--bbg-white);
  font-size: 13px;
}

.bars { display: flex; align-items: center; gap: 3px; height: 18px; }
.bar {
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--bbg-golf-green);
  transition: height 80ms ease;
}

.recording-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--bbg-golf-green);
  font-weight: 700;
}

.composer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(17, 17, 17, 0.1);
  box-shadow: var(--shadow-composer);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bbg-warm-grey);
  color: var(--bbg-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}

.icon-mic[aria-pressed="true"] {
  background: var(--bbg-golf-green);
  color: var(--bbg-black);
}

.composer-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--bbg-black);
  padding: 6px 4px;
  outline: none;
}

.composer-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bbg-black);
  color: var(--bbg-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawerSlideIn {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Tactile micro-interactions */
button {
  transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1), background-color 160ms ease, opacity 160ms ease;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

.nav-drawer:not([hidden]) {
  animation: drawerSlideIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-sheet:not([hidden]),
.card-body:not([hidden]) {
  animation: fadeSlideUp 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes micAttention {
  0% { box-shadow: 0 0 0 0 rgba(131, 180, 81, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(131, 180, 81, 0); }
  100% { box-shadow: 0 0 0 0 rgba(131, 180, 81, 0); }
}

.mic-intro {
  animation: micAttention 1.5s ease-out 0.4s 3;
}

.icon-camera {
  background: var(--bbg-forest-green);
  color: var(--bbg-white);
}

.card-challenge .lb-row {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bbg-white);
}

.card-challenge .lb-row.is-you {
  background: rgba(131, 180, 81, 0.28);
  border-color: rgba(199, 232, 162, 0.5);
}

.card-challenge .lb-pos,
.card-challenge .lb-sim,
.card-challenge .lb-score {
  color: rgba(255, 255, 255, 0.88);
}

/* Bottom Sheet ("+" Attachment Menu) */
.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.34);
  z-index: 35;
}

.bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  box-shadow: 0 -10px 32px rgba(17, 17, 17, 0.16);
  animation: fadeSlideUp 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(17, 17, 17, 0.18);
  margin: 0 auto 14px;
}

.plus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.plus-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bbg-warm-grey);
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.plus-tile-icon {
  font-size: 20px;
  line-height: 1;
}

.card-remove-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(17, 17, 17, 0.18);
  font-size: 12.5px;
}

.card-challenge .card-remove-bar {
  border-top-color: rgba(255, 255, 255, 0.25);
}

/* Dedicated Sub-page Overlay (Settings, Profile, My Rounds, etc.) */
.subpage-view {
  position: absolute;
  inset: 0;
  background: var(--bg-app);
  z-index: 38;
  display: flex;
  flex-direction: column;
  animation: fadeSlideUp 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.subpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-app);
  flex-shrink: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--bbg-black);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.subpage-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--bbg-black);
}

.subpage-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
}

.subpage-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

@media (prefers-reduced-motion: reduce) {
  .edge-glow, .bar, button { transition: none; }
  .auth-card, .nav-drawer:not([hidden]), .card-sheet:not([hidden]), .card-body:not([hidden]), .mic-intro {
    animation: none;
  }
}
