/* REAL™ Cafe — dark theme, Colombia-flag accents. Function over art for now. */

:root {
  --bg: #000000;
  --bg-2: #0d0d0f;
  --card: #131316;
  --line: #232327;
  --text: #ffffff;
  --muted: #9a9aa2;
  --faint: #6a6a72;

  --yellow: #ffe600;   /* neon yellow */
  --blue: #1fa2ff;     /* neon electric blue */
  --blue-deep: #003893;
  --red: #ff2a45;      /* neon red */
  --neon-green: #39ff14;  /* selected tab icon + unread DM glow */

  --tab-h: 64px;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overscroll-behavior: none;
}

/* Phone-shaped shell so the desktop preview reads like an iPhone. */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------------------------------------------------------------- header */

#header { position: sticky; top: 0; z-index: 20; }
.hdr {
  padding: calc(var(--safe-top) + 14px) 18px 12px;
  background: rgba(0,0,0,0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800; font-size: 32px; letter-spacing: 0.2px;
  display: inline-block; position: relative; color: #fff;
}
.brand-bar {
  display: block; height: 5px; width: 100%; margin-top: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--yellow) 0 50%, var(--blue) 50% 75%, var(--red) 75% 100%);
}
.hdr-title { font-size: 16px; font-weight: 700; margin-top: 9px; letter-spacing: 0; color: var(--muted); }
.hdr-sub { font-size: 12px; color: var(--faint); margin-top: 1px; }

.hdr-chat {
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 12px) 12px 12px;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-back { background: none; border: none; color: var(--yellow); font-size: 30px; line-height: 1; padding: 0 6px; }
.hdr-chat-name { font-weight: 700; font-size: 17px; }
.hdr-spacer { flex: 1; }

/* ---------------------------------------------------------------- screen */

#screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px); }
.screen-pad { padding: 16px 18px 24px; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); margin: 22px 2px 10px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 8px 2px 0; }
.hint.center { text-align: center; }
.hint.small { font-size: 11px; color: var(--faint); margin-top: 26px; }

/* ---------------------------------------------------------------- buttons */

.btn { border: none; border-radius: 12px; padding: 13px 16px; font-size: 15px; font-weight: 700; color: #fff; background: var(--card); transition: transform .06s ease, opacity .15s ease; }
.btn:active { transform: scale(0.98); }
.btn-block { display: block; width: 100%; margin-top: 12px; text-align: center; }
.btn-primary { background: var(--yellow); color: #111; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: #fff; }
.btn-text { background: transparent; color: var(--muted); font-weight: 600; }
.btn-text.danger, .danger { color: var(--red); }
.btn.sm { padding: 9px 13px; font-size: 13.5px; border-radius: 10px; }

/* ---------------------------------------------------------------- fields */

.field { display: block; margin-top: 14px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 2px 6px; }
.input {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: #fff;
  border-radius: 12px; padding: 13px 14px; font-size: 16px; outline: none; appearance: none;
}
.input:focus { border-color: var(--blue); }
select.input { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aa2' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* distance-radius slider */
input[type="range"].range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 3px; background: var(--line); outline: none; margin: 10px 0 2px;
}
input[type="range"].range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--yellow); cursor: pointer; box-shadow: 0 0 8px rgba(255,230,0,0.55);
}
input[type="range"].range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: none; cursor: pointer;
}

/* read-only field (looks rating — set by Discover, not editable) */
.readonly-field { display: flex; flex-direction: column; justify-content: center; gap: 1px; color: var(--yellow); font-weight: 800; line-height: 1.15; }
.readonly-field .ro-tag { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px; }

/* voice intro recorder */
.voice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 14px; padding: 12px 14px; margin-top: 4px; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.voice-rec { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; border: none; border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 14px; }
.voice-rec:active { transform: scale(0.97); }
.voice-rec .ic { width: 18px; height: 18px; }
.voice-hint { font-size: 12px; color: var(--muted); }
.voice-label { font-weight: 700; font-size: 14px; flex: 1; min-width: 90px; }
.voice-play { width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); color: #111; border: none; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.voice-play .ic { width: 18px; height: 18px; }
.icon-btn { background: none; border: none; color: var(--muted); padding: 6px; display: inline-flex; }
.icon-btn .ic { width: 18px; height: 18px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: rec-pulse 1s ease-in-out infinite; flex-shrink: 0; box-shadow: 0 0 8px var(--red); }
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* dealbreakers textarea */
textarea.input { resize: vertical; min-height: 80px; line-height: 1.4; font-family: inherit; }

.at-wrap { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding-left: 14px; }
.at-wrap:focus-within { border-color: var(--blue); }
.at { color: var(--yellow); font-weight: 800; font-size: 16px; }
.at-input { background: transparent; border: none; }
.at-input:focus { border: none; }

/* photo picker */
.photo-pick { text-align: center; padding: 6px 0 2px; }
.photo-frame {
  width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 12px;
  background-size: cover; background-position: center; border: 3px solid var(--line);
}
.photo-btn { display: inline-flex; align-items: center; }

/* ---------------------------------------------------------------- discover */

.deck { padding: 14px 16px 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55); will-change: transform; touch-action: pan-y;
}
.card.dragging { transition: none; }
.card-photo { position: relative; height: 40vh; max-height: 360px; background-size: cover; background-position: center; }
.card-meta { position: absolute; left: 16px; bottom: 14px; right: 16px; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.card-name { font-size: 24px; font-weight: 800; }
.card-age { font-weight: 500; opacity: 0.92; }
.card-loc { font-size: 14px; color: #e8e8ec; margin-top: 2px; }
.card-body { padding: 12px 16px 16px; }
.card-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.card-row:last-child { border-bottom: none; }
.card-row .k { color: var(--muted); }
.card-row .v { font-weight: 600; text-align: right; }

.card-stamp {
  position: absolute; top: 22px; padding: 6px 14px; font-weight: 900; font-size: 22px;
  letter-spacing: 2px; border: 4px solid; border-radius: 10px; opacity: 0; transform: rotate(-12deg);
}
.card-stamp.like { right: 18px; color: var(--yellow); border-color: var(--yellow); }
.card-stamp.nope { left: 18px; color: var(--red); border-color: var(--red); transform: rotate(12deg); }
.card.show-like .card-stamp.like { opacity: 1; }
.card.show-nope .card-stamp.nope { opacity: 1; }

.deck-actions { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 2px; }
.deck-buttons { display: flex; align-items: center; gap: 22px; }
.round {
  border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: #fff;
  width: 62px; height: 62px; font-size: 24px; display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.round.red { color: var(--red); border-color: var(--red); }
.round.yellow { color: var(--yellow); border-color: var(--yellow); }
.round.big { width: 74px; height: 74px; font-size: 30px; }
.round:active { transform: scale(0.93); }

/* ---------------------------------------------------------------- buzz */

.buzz-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; max-width: 360px; margin: 16px auto 0;
  background: linear-gradient(180deg, rgba(31,162,255,0.22), rgba(31,162,255,0.06));
  border: 1px solid var(--blue); color: #fff; border-radius: 14px;
  padding: 14px 16px; font-size: 15.5px; font-weight: 700;
}
.buzz-btn:active { transform: scale(0.985); }
.buzz-btn .ic-buzz { width: 20px; height: 20px; color: var(--blue); }
.buzz-count { margin-left: 4px; font-size: 12px; font-weight: 800; color: var(--blue);
  background: rgba(31,162,255,0.18); padding: 3px 9px; border-radius: 999px; }
.buzz-btn.done { border-color: var(--line); color: var(--muted); background: rgba(255,255,255,0.04); }
.buzz-btn.done .ic-buzz { color: var(--muted); }
.buzz-btn.out { border-color: var(--yellow); color: var(--yellow); background: rgba(255,230,0,0.08); }
.buzz-btn.out .ic-buzz { color: var(--yellow); }

@keyframes buzz-shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-7px); }
  30%, 60%, 90% { transform: translateX(7px); }
}
#app.buzzing { animation: buzz-shake 0.55s cubic-bezier(.36,.07,.19,.97); }

#buzz-banner {
  position: fixed; top: 0; left: 50%; z-index: 70;
  width: 100%; max-width: 430px; padding: calc(var(--safe-top) + 8px) 12px 0;
  transform: translateX(-50%) translateY(-140%);
  transition: transform .32s cubic-bezier(.2,.9,.2,1); pointer-events: none;
}
#buzz-banner.show { transform: translateX(-50%) translateY(0); }
.bz-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(18,18,22,0.82); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--blue); border-radius: 16px; padding: 13px 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 18px rgba(31,162,255,0.45);
}
.bz-card .ic-buzz { width: 26px; height: 26px; color: var(--blue); flex-shrink: 0; }
.bz-title { font-weight: 800; font-size: 15px; }
.bz-body { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.buzz-pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bp-n { display: block; font-size: 22px; font-weight: 800; color: #fff; }
.bp-p { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 3px; }

.buzz-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.buzz-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.buzz-left { font-weight: 800; font-size: 14px; color: var(--blue); }

/* buzz pill on the discover card (always visible, top-right) */
.buzz-pill {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(15,11,26,0.55); backdrop-filter: blur(10px) saturate(160%); -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid var(--blue); color: #fff; border-radius: 999px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 800; line-height: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 14px rgba(31,162,255,0.45);
}
.buzz-pill:active { transform: scale(0.94); }
.buzz-pill .ic-buzz { width: 16px; height: 16px; color: var(--blue); }
.buzz-pill .bz-n { background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.buzz-pill.out { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 14px rgba(255,230,0,0.4); }
.buzz-pill.out .ic-buzz { color: var(--yellow); }
.buzz-pill.done { border-color: rgba(255,255,255,0.25); color: var(--muted); box-shadow: none; }
.buzz-pill.done .ic-buzz { color: var(--muted); }
.card.dragging .buzz-pill { opacity: 0; }

/* white avatar needs a bottom scrim so the white username/location stays readable */
.card-photo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44%;
  background: linear-gradient(transparent, rgba(0,0,0,0.62)); pointer-events: none; z-index: 1;
}
.card-meta { z-index: 2; }

/* ---------------------------------------------------------------- LCD counters */

@font-face {
  font-family: 'DSEG7';
  src: url('../fonts/DSEG7.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
.lcd { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.lcd-disp {
  min-width: 64px; height: 40px; padding: 8px 12px;
  background: #0a0c0a; border: 1px solid rgba(255,255,255,0.12); border-radius: 7px;
  box-shadow: inset 0 1px 7px rgba(0,0,0,0.9);
  font-family: 'DSEG7', 'Courier New', monospace; font-weight: 700; font-size: 22px;
  line-height: 24px; text-align: center; color: #fff;
}
.lcd-red .lcd-disp { color: var(--red); text-shadow: 0 0 9px rgba(255,42,69,0.9); }
.lcd-yellow .lcd-disp { color: var(--yellow); text-shadow: 0 0 9px rgba(255,230,0,0.85); }
.lcd-cap { font-size: 9px; font-weight: 800; letter-spacing: 1.6px; color: var(--faint); }
.lcd-red .lcd-cap { color: rgba(255,42,69,0.8); }
.lcd-yellow .lcd-cap { color: rgba(255,230,0,0.78); }

/* ---------------------------------------------------------------- matches */

.block-card {
  background: linear-gradient(180deg, rgba(31,162,255,0.16), var(--card)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 10px;
}
.block-main { flex: 1; }
.block-when { font-weight: 800; font-size: 15px; }
.block-who { color: var(--text); font-size: 14px; margin-top: 1px; }
.block-where { color: var(--muted); font-size: 13px; margin-top: 4px; }
.block-pay { color: var(--yellow); font-size: 12.5px; margin-top: 6px; font-weight: 600; }

.match-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px;
}
.match-row.is-expired { opacity: 0.55; }
.match-av { width: 54px; height: 54px; border-radius: 12px; background-size: cover; background-position: center; flex-shrink: 0; }
.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 700; font-size: 15px; }
.match-where { font-size: 12.5px; color: var(--muted); margin: 1px 0 5px; }
.match-actions { display: flex; flex-direction: column; gap: 6px; }

.timer { font-size: 12px; font-weight: 700; color: var(--yellow); }
.timer.connected { color: #34c759; }
.timer.expired { color: var(--faint); }

/* ---------------------------------------------------------------- messages */

.conv-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; color: #fff;
}
.conv-av { width: 50px; height: 50px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.conv-info { min-width: 0; flex: 1; }
.conv-name { font-weight: 700; font-size: 15px; }
.conv-prev { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* Unread DM: pulsating neon-green outline (demo: one row only). */
.conv-row.unread { border-color: var(--neon-green); animation: unread-glow 1.8s ease-in-out infinite; }
.conv-row.unread .conv-prev { color: #eafff0; font-weight: 700; }
.conv-row.unread .conv-name::after {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--neon-green); margin-left: 8px; vertical-align: middle;
  box-shadow: 0 0 8px var(--neon-green);
}
@keyframes unread-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(57,255,20,0.45), 0 0 6px rgba(57,255,20,0.20); }
  50% { box-shadow: 0 0 0 1.5px rgba(57,255,20,1), 0 0 16px rgba(57,255,20,0.55); }
}

.chat { display: flex; flex-direction: column; height: 100%; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { color: var(--faint); text-align: center; margin: auto; font-size: 14px; }
.bubble {
  max-width: 76%; padding: 9px 13px 16px; border-radius: 18px; font-size: 15px; line-height: 1.35;
  position: relative; word-wrap: break-word;
}
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bub-time { position: absolute; right: 11px; bottom: 4px; font-size: 9.5px; opacity: 0.6; }

.emoji-bar { display: flex; gap: 4px; overflow-x: auto; padding: 8px 10px; border-top: 1px solid var(--line); }
.emoji { background: none; border: none; font-size: 22px; padding: 2px 4px; flex-shrink: 0; }
.composer { display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.composer .msg-input { flex: 1; }
.send { padding: 11px 18px; }

/* ---------------------------------------------------------------- settings */

.status-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; }
.status-dot.on { background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,0.18); }
.status-dot.idle { background: var(--yellow); }
.status-dot.off { background: var(--faint); }
.status-text { font-weight: 700; font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--yellow); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-text { flex: 1; }
.set-label { font-size: 16px; font-weight: 600; }
.set-note { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* iOS-style toggle */
.switch { width: 52px; height: 32px; border-radius: 16px; border: none; background: #39393d; position: relative; flex-shrink: 0; transition: background .2s ease; padding: 0; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.switch.on { background: var(--blue); }
.switch.on .knob { transform: translateX(20px); }

/* ---------------------------------------------------------------- empty */

.empty { padding: 60px 30px; text-align: center; }
.empty-title { font-size: 19px; font-weight: 800; }
.empty-body { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 8px; }

/* ---------------------------------------------------------------- tab bar */

#tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 430px;
  height: calc(var(--tab-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: flex; background: rgba(8,8,10,0.92);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line); z-index: 30;
}
.tab { flex: 1; background: none; border: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding-top: 8px; }
.tab .ic { width: 24px; height: 24px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); transform-origin: 50% 55%; }
.tab:not(.active):active .ic { transform: scale(0.84); }
.tab.active { color: var(--neon-green); }
/* active icon: breathing scale + layered neon bloom */
.tab.active .ic { animation: tab-active 2.4s ease-in-out infinite; }
@keyframes tab-active {
  0%, 100% { transform: translateY(-2px) scale(1.15); filter: drop-shadow(0 0 2px rgba(57,255,20,0.55)); }
  50%      { transform: translateY(-3px) scale(1.22); filter: drop-shadow(0 0 9px rgba(57,255,20,1)) drop-shadow(0 0 16px rgba(57,255,20,0.45)); }
}
/* the outline draws itself on each time the tab becomes active */
.tab.active .ic .s { stroke-dasharray: 1; animation: tab-draw 0.6s ease both; }
@keyframes tab-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- overlay */

#overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.6); display: none; align-items: flex-end; justify-content: center; }
#overlay.show { display: flex; }
.sheet {
  width: 100%; max-width: 430px; background: var(--bg-2); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--line); padding: 10px 18px calc(20px + var(--safe-bottom)); max-height: 88vh; overflow-y: auto;
  animation: sheet-up .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet-head { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.pay-note { background: rgba(252,209,22,0.08); border: 1px solid rgba(252,209,22,0.25); color: #f3e6a8; border-radius: 12px; padding: 12px; font-size: 12.5px; line-height: 1.5; margin-top: 14px; }

.match-pop { text-align: center; padding: 8px 4px 4px; }
.match-kicker { color: var(--yellow); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }
.match-photo { width: 120px; height: 120px; border-radius: 50%; margin: 14px auto 10px; background-size: cover; background-position: center; border: 3px solid var(--yellow); }
.match-pop h2 { font-size: 21px; margin: 4px 0 0; }

.topup-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.topup-opt { background: var(--card); border: 1px solid var(--line); color: #fff; border-radius: 12px; padding: 18px 0; font-weight: 800; font-size: 16px; }
.topup-opt:active { border-color: var(--yellow); }

/* ---------------------------------------------------------------- toast */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px); transform: translateX(-50%) translateY(12px);
  background: #1c1c20; border: 1px solid var(--line); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================================================================
   Synthwave glass theme + animated Three.js backdrop
   Frosted panels over a hotpink→violet→blue gradient with a wavy
   yellow wireframe grid (rendered in js/bg.js).
   ================================================================ */

:root {
  --glass: rgba(20, 16, 34, 0.52);
  --glass-strong: rgba(15, 11, 26, 0.66);
  --glass-brd: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(18px) saturate(150%);
}

/* --- animated backdrop --- */
#bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(160deg, #ff2d83 0%, #c81f96 20%, #8a23bf 44%, #4b27cf 66%, #16205f 86%, #070a2a 100%);
  background-size: 100% 200%;
  animation: bg-drift 26s ease-in-out infinite;
}
@keyframes bg-drift {
  0%, 100% { background-position: 50% 0%; }
  50% { background-position: 50% 55%; }
}
#bg::after {           /* vignette + scrim so white text stays readable */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 92% at 50% 6%, rgba(0,0,0,0) 40%, rgba(4,2,14,0.52) 100%),
    linear-gradient(180deg, rgba(6,3,18,0.28) 0%, rgba(6,3,18,0.04) 34%, rgba(4,2,14,0.42) 100%);
}
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* lift the app above the backdrop and let it show through */
body { background: #07061a; }
#app {
  background: transparent; position: relative; z-index: 1;
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
}

/* --- frosted chrome --- */
.hdr, .hdr-chat, #tabbar, #toast {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.hdr, .hdr-chat { border-bottom: 1px solid var(--glass-brd); }
#tabbar { border-top: 1px solid var(--glass-brd); }
#toast { border: 1px solid var(--glass-brd); }

/* --- glass panels --- */
.card, .card-body, .block-card, .match-row, .conv-row, .stat, .status-card,
.sheet, .topup-opt, .bubble.them, .emoji-bar, .composer, .btn-ghost, .input,
.at-wrap, .round, .set-row, .buzz-row {
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.card { background: var(--glass); border: 1px solid var(--glass-brd);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.09); }
.card-body { background: rgba(20,16,34,0.40); }
.card-photo { background-color: rgba(20,16,34,0.5); }
.block-card { background: linear-gradient(180deg, rgba(31,162,255,0.18), var(--glass)); border: 1px solid var(--glass-brd); }
.match-row, .conv-row, .status-card, .stat, .topup-opt, .bubble.them {
  background: var(--glass); border: 1px solid var(--glass-brd); }
.sheet { background: var(--glass-strong); border-top: 1px solid var(--glass-brd); }
.input, select.input, .at-wrap { background: rgba(20,16,34,0.5); border: 1px solid var(--glass-brd); }
.btn-ghost { background: rgba(255,255,255,0.06); border: 1px solid var(--glass-brd); }
.emoji-bar, .composer { background: rgba(12,9,24,0.5); border-top: 1px solid var(--glass-brd); }
.round { background: rgba(20,16,34,0.45); }
#overlay { background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* settings rows read better as faint glass strips over the moving bg */
.set-row, .buzz-row {
  background: rgba(20,16,34,0.34); border: 1px solid var(--glass-brd);
  border-radius: 12px; padding: 14px; margin-bottom: 8px;
}
