@font-face {
  font-family: 'Oxanium';
  src: url('fonts/Oxanium-wght.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel2: #18212c;
  --line: #243041;
  --text: #e8edf3;
  --muted: #93a1b3;
  --green: #40ff78;
  --green-dim: #1f7a3c;
  --tg-in: #1d2733;
  --tg-out: #2b5278;
  --tg-accent: #5aa9e6;
  --warn: #ffb454;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--tg-accent); }
button { font: inherit; color: inherit; cursor: pointer; user-select: none; -webkit-user-select: none; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 14px 16px 10px; max-width: 1360px; margin: 0 auto;
}
.top h1 { margin: 0; font: 600 22px/1.2 'Oxanium', system-ui, sans-serif; letter-spacing: 0.2px; }
.top h1 span { color: var(--green); font-weight: 400; }
.pitch { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.what { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.links a { text-decoration: none; font-weight: 500; }
.links a:hover { text-decoration: underline; }
#btn-restart {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
}
#btn-restart:hover { border-color: var(--green-dim); }

/* moments strip */
.steps {
  list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 auto; padding: 0 16px 12px; max-width: 1360px; overflow-x: auto;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.steps li {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; white-space: nowrap; cursor: default;
  padding: 2px 4px; color: var(--muted); font-size: 13px;
}
.steps li + li::before { content: '›'; color: var(--line); margin-right: 6px; }
.steps li span {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--panel2); font-size: 12px; font-weight: 600;
}
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now span { background: var(--green); color: #00210b; }
.steps li.past span { background: var(--green-dim); color: var(--text); }

/* layout */
.grid {
  display: grid; grid-template-columns: minmax(0, 620px) minmax(340px, 1fr); gap: 18px;
  max-width: 1360px; margin: 0 auto; padding: 0 16px 16px;
}
section { min-width: 0; }

/* glasses */
.glasses { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.lens-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.clock { font: 600 20px 'Oxanium', system-ui, sans-serif; color: var(--green); }
.moment { color: var(--muted); font-size: 14px; text-align: right; }
.lens-frame {
  background: #000; border-radius: 10px; padding: 0; border: 1px solid #1a2a1f;
  box-shadow: 0 0 0 4px #05080a, 0 0 28px rgba(64, 255, 120, 0.08) inset;
  overflow: hidden;
}
#lens { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; cursor: pointer; }
.lens-cap { margin: 6px 2px 4px; color: var(--muted); font-size: 13px; }
.lens-legend { margin: 0 2px 8px; color: #b9c6d4; font-size: 12.5px; }
.pad { margin-top: 6px; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.ctl {
  padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
  font-weight: 600; font-size: 15px; transition: transform 0.08s, border-color 0.2s;
}
.ctl.tap { border-color: var(--green-dim); }
.ctl:hover { border-color: var(--green); }
.ctl:active, .ctl.hit { transform: scale(0.97); }
.ctl.point { border-color: var(--green); box-shadow: 0 0 0 2px rgba(64, 255, 120, 0.35); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(64, 255, 120, 0.12); } }
@media (prefers-reduced-motion: reduce) { .ctl.point { animation: none; } }
.keys { margin: 8px 2px 0; color: var(--muted); font-size: 12.5px; }
.guide {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 10px;
  background: #0f1d15; border: 1px solid var(--green-dim);
}
.hint { margin: 0; flex: 1; font-size: 14.5px; }
.hint b { color: var(--green); font-weight: 600; }
.next {
  flex: 0 0 auto; padding: 10px 14px; border-radius: 10px; border: 0; background: var(--green); color: #00210b; font-weight: 700;
}
.next:disabled { background: var(--green-dim); color: var(--text); cursor: default; }
.error { margin: 10px 0 0; color: var(--warn); }

/* phones */
.phones { display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.tab {
  position: relative; flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); font-size: 14px; font-weight: 500;
}
.tab.on { background: var(--tg-out); border-color: var(--tg-out); }
.tab.unread::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}
.chat {
  flex: 1; display: flex; flex-direction: column; min-height: 0; background: #0e1621; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.chat-head { padding: 10px 14px; background: #17212b; border-bottom: 1px solid #0b1118; }
.chat-title { font-weight: 600; }
.chat-sub { color: var(--muted); font-size: 12.5px; }
.press-as { padding: 8px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid #0b1118; }
.press-as button {
  margin-left: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
}
.press-as button.on { background: var(--tg-out); border-color: var(--tg-out); color: #fff; }
.chat-body { flex: none; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; height: 520px; }
.msg {
  max-width: 88%; padding: 8px 11px 7px; border-radius: 12px; white-space: normal; overflow-wrap: anywhere; font-size: 14.5px;
}
.msg.in { align-self: flex-start; background: var(--tg-in); border-bottom-left-radius: 4px; }
.msg.in.owner { border: 1px solid #3b5f84; }
.msg.out { align-self: flex-end; background: var(--tg-out); border-bottom-right-radius: 4px; }
.who { font-size: 12.5px; color: var(--tg-accent); font-weight: 600; margin-bottom: 2px; }
.msg.out .who { color: #b9d6f2; }
.tag { font-weight: 400; color: var(--muted); margin-left: 4px; }
.t, .edited { display: block; text-align: right; font-size: 11.5px; color: #9fb7cc; margin-top: 2px; }
.edited { color: var(--muted); }
.kbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kb {
  flex: 1 1 auto; padding: 8px 10px; border-radius: 8px; border: 0; background: #2a3a4c; color: #fff; font-weight: 600; font-size: 14px;
}
.kb:hover { background: #35506b; }
.note { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: var(--muted); background: #121c27; padding: 4px 10px; border-radius: 999px; }
.note.only { color: #cfe8d6; background: #12301e; border-radius: 10px; }
.empty { color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }

/* footer */
.foot { max-width: 1360px; margin: 0 auto; padding: 4px 16px 28px; color: var(--muted); font-size: 13px; }
.foot p { margin: 6px 0; max-width: 980px; }
.foot b { color: var(--text); }

/* short laptop screens (125–150 % zoom): the glasses column stays on top, chats fit the height */
@media (min-width: 901px) and (max-height: 780px) {
  .top { padding-top: 8px; padding-bottom: 6px; }
  .glasses { position: sticky; top: 0; align-self: start; z-index: 5; padding: 10px 12px; }
  .lens-head { margin-bottom: 4px; }
  .keys { display: none; }
  .guide { margin-top: 8px; padding: 8px 10px; }
  .hint { font-size: 14px; line-height: 1.35; }
  .chat-body { height: calc(100vh - 230px); min-height: 220px; }
}

/* phone: the lens, touchpad and hint stay on top while the chats scroll under them */
@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); padding: 0 0 16px; gap: 10px; }
  .top h1 { font-size: 20px; }
  .pitch { font-size: 15px; }
  .steps li { font-size: 13px; }
  .keys { display: none; }
  .glasses {
    position: sticky; top: 0; z-index: 5; align-self: start;
    border-radius: 0 0 14px 14px; border-left: 0; border-right: 0; padding: 6px 0 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  }
  .lens-head { padding: 0 12px; margin-bottom: 4px; }
  .clock { font-size: 17px; }
  .moment { font-size: 12.5px; }
  .lens-frame { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .lens-cap { margin: 4px 12px 6px; font-size: 11.5px; }
  .pad { padding: 0 12px; gap: 6px; }
  .ctl { padding: 9px 6px; font-size: 14px; }
  .guide { margin: 8px 12px 0; padding: 8px 10px; gap: 8px; }
  .hint { font-size: 13.5px; line-height: 1.35; }
  .next { padding: 9px 10px; font-size: 14px; }
  .error { margin: 6px 12px 0; }
  .phones { padding: 0 16px; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .tab { padding: 6px 11px; font-size: 13.5px; }
  .chat-body { height: 270px; }
  .lens-cap { font-size: 12.5px; }
  .lens-legend { margin: 0 12px 4px; font-size: 12px; }
  .t, .edited { font-size: 12.5px; }
  .foot code { font-size: 13px; }
}
