/* Mate — phone UI. Dark by design: it is a boat at night and the beacon has to pop. */

:root {
  --bg: #0b0d12;
  --panel: #151925;
  --panel-2: #1c2130;
  --text: #f3efe8;
  --muted: #9a97a3;
  --brand: #e0ccbb;
  --line: #2a3040;
  --danger: #ff5a3c;
  --warn: #ffb020;

  --teal: #14e1c8;
  --azure: #2f8fff;
  --violet: #8f5cff;
  --magenta: #ff2fa0;
  --coral: #ff5a3c;
  --amber: #ffb020;
  --lime: #b8f21c;
  --mint: #4ff5a6;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-t);
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 6px;
}
.logo { height: 26px; width: auto; }
.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 15px; color: var(--muted);
  min-width: 4ch; text-align: right;
}
.clock.live { color: var(--text); }
.clock.soon { color: var(--warn); }

#app { flex: 1; padding: 8px 18px 24px; max-width: 560px; width: 100%; margin: 0 auto; }
.screen { animation: in .18s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 30px; line-height: 1.1; margin: 10px 0 6px; letter-spacing: -0.01em; }
.lead { margin: 0 0 18px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* -------------------------------------------------------------- search */
.search { display: block; }
.step {
  display: block; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); margin: 0 2px 8px;
}
.step-2 { margin: 6px 2px 2px; }
#q {
  width: 100%; font-size: 20px; padding: 14px 16px;
  background: var(--panel); color: var(--text);
  border: 2px solid var(--brand); border-radius: 14px; outline: none;
  -webkit-appearance: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent), 0 0 24px color-mix(in srgb, var(--brand) 35%, transparent);
  animation: ring 1.6s ease-in-out infinite;
}
#q:focus, #q:not(:placeholder-shown) { animation: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent); }
@keyframes ring {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent), 0 0 24px color-mix(in srgb, var(--brand) 35%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 12%, transparent), 0 0 36px color-mix(in srgb, var(--brand) 55%, transparent); }
}
.hint { margin: 8px 2px 14px; font-size: 14px; color: var(--muted); }

.people { list-style: none; margin: 0; padding: 0; }
.people li {
  padding: 14px 6px; border-bottom: 1px solid var(--line);
  font-size: 19px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.people li:active { background: var(--panel); }
.people li .chev { color: var(--muted); }
.people li.dim { color: var(--muted); cursor: default; }
.people li.dim .chev { font-size: 13px; }
.hint.matched { color: var(--mint); margin-bottom: 4px; }
.dup { border: 1px solid var(--warn); border-radius: 12px; margin-bottom: 10px; }
.people li.more { color: var(--muted); font-size: 15px; cursor: default; justify-content: center; }

.empty, .dup { padding: 22px 4px; }
.empty p, .dup p { margin: 0 0 6px; }

.selfadd { margin-top: 18px; border: 1px dashed var(--line); border-radius: 14px; padding: 4px 14px; }
.selfadd summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.selfadd form { padding-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.selfadd input {
  font-size: 18px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
.notpublished { padding: 24px 4px; font-size: 18px; }

/* -------------------------------------------------------------- buttons */
.btn {
  font: inherit; font-weight: 600; font-size: 17px;
  padding: 13px 18px; border-radius: 12px; border: 0;
  background: var(--brand); color: #1a1410; cursor: pointer;
}
.btn.ghost { background: rgba(0,0,0,.28); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn:active { transform: scale(.98); }
.link {
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; margin-left: 8px;
}
.card .name .li {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 28px; height: 28px; margin-left: 10px; border-radius: 6px;
  background: #0a66c2; color: #fff; font: 700 14px/1 -apple-system, sans-serif; text-decoration: none;
}
.card.small .name .li { width: 22px; height: 22px; font-size: 11px; margin-left: 8px; }
.back { background: none; border: 0; color: var(--muted); font: inherit; padding: 6px 0 12px; cursor: pointer; }

/* -------------------------------------------------------------- cards */
.you { margin: 4px 0 14px; font-size: 16px; color: var(--muted); }
.you span { color: var(--text); font-weight: 600; font-size: 18px; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--line);
  cursor: pointer; user-select: none;
  transition: padding .35s ease, transform .35s ease;
}
.card:active { transform: scale(.985); }
.card .label {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center;
}
.card .label .tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); }
.card .label .tag.live { background: var(--c, var(--brand)); color: #10120a; }
.card .name { font-weight: 700; margin: 8px 0 6px; line-height: 1.1; }
.card .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.card .swatch {
  width: 14px; height: 14px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 10px var(--c);
}
.card .timer { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: auto; font-size: 18px; color: var(--text); }
.card .tap { font-size: 13px; color: var(--muted); margin-top: 8px; }

.card.big { padding: 26px 22px 22px; border-color: var(--c, var(--line)); }
.card.big .name { font-size: 34px; }
/* The emoji is the thing you match against another phone across a dark deck, so on the live
   card it is the biggest element after the name, not a bullet next to the colour word. */
.card.big .emoji { font-size: 68px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.card.big .meta { gap: 14px; font-size: 17px; }
.card.big .swatch { width: 20px; height: 20px; box-shadow: 0 0 16px var(--c); }
.card.big .timer { font-size: 26px; }
.card.big::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 60%);
}
.card.small { opacity: .82; }
.card.small .name { font-size: 20px; }
.card.small .emoji { font-size: 32px; line-height: 1; }

.card.waiting { border-style: dashed; }
.card.waiting .name { color: var(--muted); font-size: 22px; }

.card.ending .timer { color: var(--warn); }
.card.final .timer { color: var(--danger); font-size: 40px; }

.status { margin: 18px 2px 0; color: var(--muted); font-size: 15px; }

/* -------------------------------------------------------------- beacon */
.beacon {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background: var(--c, #fff);
  color: #0a0a0a;
  cursor: pointer;
  padding-bottom: calc(24px + var(--safe-b));
}
.beacon-emoji { font-size: clamp(150px, 52vw, 280px); line-height: 1; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); }
.beacon-name { font-size: clamp(28px, 8vw, 44px); font-weight: 800; margin-top: 18px; line-height: 1.05; letter-spacing: -0.01em; }
.beacon-round { margin-top: 8px; font-weight: 600; opacity: .8; }
.beacon-help { margin-top: 22px; font-size: 15px; opacity: .75; max-width: 28ch; }
.beacon-actions { position: absolute; bottom: calc(22px + var(--safe-b)); left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.beacon-actions .btn { color: #0a0a0a; border-color: rgba(0,0,0,.35); background: rgba(255,255,255,.35); }

/* -------------------------------------------------------------- footer */
.foot {
  display: flex; justify-content: space-between; padding: 8px 18px calc(12px + var(--safe-b));
  font-size: 12px; color: var(--muted);
}

/* -------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: var(--brand); color: #1a1410; padding: 12px 16px; border-radius: 12px;
  font-weight: 600; z-index: 20; max-width: 90vw; text-align: center;
  animation: in .15s ease-out;
}
