/* ============================================================
   YOSSUP — Design tokens
   Direction: "signal" — a dark, broadcast/viewfinder-inspired
   app shell built around the idea of tuning in to a stranger.
   ============================================================ */
:root {
  /* surfaces */
  --bg: #0a0a0f;
  --bg-soft: #0e0e15;
  --panel: #15151e;
  --panel-2: #1c1c27;
  --field: #191922;

  /* lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* ink */
  --ink: #f3f2f8;
  --ink-mute: #8d8da3;
  --ink-faint: #55556b;

  /* accent */
  --signal: #7c5cff;
  --signal-strong: #9679ff;
  --signal-soft: rgba(124, 92, 255, 0.16);
  --signal-line: rgba(124, 92, 255, 0.55);
  --live: #34d399;
  --alert: #ff6161;

  /* shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* fx */
  --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  padding: 0px;
  margin: 0px;
  -webkit-font-smoothing: antialiased;
}

p {
  padding: 0px;
  margin: 0px;
}

::selection {
  background: var(--signal-soft);
  color: var(--ink);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 2px solid var(--signal-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   general
   ============================================================ */
.button {
  font-family: var(--font-body);
  background-color: var(--signal);
  border: none;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin: 5px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.button:hover {
  background-color: var(--signal-strong);
  transform: translateY(-1px);
}
.button:active {
  background-color: #6647e0;
  transform: translateY(0);
}
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.mirror {
  transform: scaleX(-1);
}

/* ============================================================
   main container
   ============================================================ */
#main {
  height: 100vh;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 8% auto 9%;
  grid-template-columns: 30% auto;
  grid-template-areas:
    'top top'
    'vid msg'
    'vid inp';
  background-color: var(--bg);
}

/* ============================================================
   top bar
   ============================================================ */
#top-bar {
  grid-area: top;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 10px 28px;
  background-color: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
#logo {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
#logo img {
  height: 28px;
  width: 28px;
}
#logo h1 {
  cursor: default;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0px;
  color: var(--ink);
}
#top-right {
  display: flex;
  flex-direction: row;
  align-items: center;
}
#peopleOnline {
  display: flex;
  align-items: center;
  padding: 7px 16px 7px 12px;
  margin: 5px;
  margin-right: 14px;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
#peopleOnline::before {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--live);
  margin-right: 9px;
  animation: livePulse 2s infinite;
}
#peopleOnline p {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
#peopleOnline span {
  color: var(--ink);
  font-weight: 600;
}
@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}
#feedback-btn {
  margin: 0;
  padding: 9px 16px;
  background-color: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--ink-mute);
  box-shadow: none;
  font-size: 14px;
}
#feedback-btn:hover {
  background-color: var(--field);
  color: var(--ink);
}
#feedback-btn:active {
  background-color: var(--panel);
}

/* ============================================================
   video container
   ============================================================ */
#videos {
  grid-area: vid;
  position: relative;
  margin: 14px;
  margin-right: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--panel);
  box-shadow: var(--shadow-md);
}

#peer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#peer::before {
  content: 'STRANGER';
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  background-color: rgba(10, 10, 15, 0.55);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
#peer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line)),
    linear-gradient(var(--signal-line), var(--signal-line));
  background-size:
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px;
  background-position:
    top 16px left 16px, top 16px left 16px,
    top 16px right 16px, top 16px right 16px,
    bottom 16px left 16px, bottom 16px left 16px,
    bottom 16px right 16px, bottom 16px right 16px;
}

#peer-video-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 2px solid var(--signal);
  z-index: 4;
  animation: radarPulse 1.8s var(--ease) infinite;
}
#peer-video-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--signal);
  animation: radarPulse 1.8s var(--ease) infinite 0.6s;
}
#peer-video-loader::after {
  content: '';
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background-color: var(--signal);
  box-shadow: 0 0 20px 4px var(--signal-soft);
}
@keyframes radarPulse {
  0% {
    transform: scale(0.35);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

#watermark {
  position: absolute;
  width: 26px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  opacity: 0.45;
  pointer-events: none;
}

#self {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 22%;
  max-width: 190px;
  min-width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  z-index: 5;
  background-color: var(--panel-2);
}
#self::before {
  content: 'YOU';
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
  background-color: rgba(10, 10, 15, 0.55);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.video-player {
  width: 100%;
  height: 100%;
  background-color: var(--panel-2);
  object-fit: cover;
  display: block;
}

/* ============================================================
   message area
   ============================================================ */
#message-area {
  background-color: var(--bg-soft);
  grid-area: msg;
  margin: 14px;
  margin-bottom: 8px;
  padding: 18px;
  overflow-y: auto;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.message-status {
  margin: 4px 0 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.message {
  margin: 0 0 14px;
  line-height: 1.55;
  color: var(--ink);
  animation: messageIn 0.2s var(--ease);
  overflow-wrap: break-word;
}
.message .you {
  color: var(--signal-strong);
  font-weight: 600;
}
.message .strange {
  color: var(--live);
  font-weight: 600;
}
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#typing {
  font-style: italic;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ============================================================
   input area
   ============================================================ */
#input-area {
  grid-area: inp;
  display: flex;
  align-items: center;
  padding: 0 14px 14px;
  gap: 8px;
  min-width: 0;
}

#skip-btn {
  margin: 0;
  padding: 0 18px;
  height: 46px;
  font-size: 15px;
  min-width: 0;
  flex-shrink: 0;
  background-color: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  box-shadow: none;
}
#skip-btn:hover {
  background-color: var(--field);
  border-color: var(--alert);
  color: var(--alert);
}
.btn-key {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  border-radius: 4px;
}
#skip-btn .btn-key {
  color: var(--ink-faint);
  background-color: var(--bg);
  border: 1px solid var(--border);
}
#send-btn .btn-key {
  color: rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.15);
}

#message-input {
  flex-grow: 1;
  height: 46px;
  padding: 0 16px;
  background-color: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  min-width: 0;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
#message-input::placeholder {
  color: var(--ink-faint);
}
#message-input:focus {
  border-color: var(--signal);
  background-color: var(--panel-2);
}

#send-btn {
  margin: 0;
  padding: 0 20px;
  height: 46px;
  font-size: 15px;
  flex-shrink: 0;
}

/* ============================================================
   feedback popup
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: auto;
  background-color: rgba(6, 6, 10, 0.7);
  backdrop-filter: blur(6px);
  animation: overlayIn 0.18s ease;
}
.modal-content {
  background-color: var(--panel);
  margin: 8% auto;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 40%;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.22s var(--ease);
}
.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.close {
  float: right;
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-mute);
  background-color: var(--panel-2);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
}
.close:hover,
.close:focus {
  color: var(--ink);
  background-color: var(--field);
  border-color: var(--border-strong);
  text-decoration: none;
}
#feedbackText {
  width: 100%;
  padding: 12px 14px;
  margin-top: 16px;
  margin-bottom: 18px;
  background-color: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.15s var(--ease);
}
#feedbackText::placeholder {
  color: var(--ink-faint);
}
#feedbackText:focus {
  border-color: var(--signal);
}
#submit-btn {
  padding: 10px 24px;
}
@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   motion preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
