:root {
  --bg: #010101;
  --panel: #0a0a0a;
  --text: #f3f3f3;
  --muted: #9aa4ab;
  --cyan: #24d8df;
  --danger: #ff6f00;
  --line: #1e272d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Mono", "Fira Code", Menlo, Monaco, monospace;
  background:
    radial-gradient(circle at 80% 10%, rgba(36, 216, 223, 0.08), transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(255, 111, 0, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.16;
  background: repeating-linear-gradient(
    180deg,
    rgba(170, 255, 210, 0.12) 0px,
    rgba(170, 255, 210, 0.12) 1px,
    transparent 1px,
    transparent 4px
  );
}

#matrixBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: screen;
}

.app {
  width: min(820px, 100%);
  position: relative;
  z-index: 1;
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.app-nav:hover {
  color: var(--cyan);
}

.app-logo,
.app-logo-fallback {
  height: 24px;
  width: 24px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(36, 216, 223, 0.4);
}

.app-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 216, 223, 0.1);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
}

.brand-dot {
  color: var(--danger);
}

.panel {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(1px);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(88, 250, 146, 0.08), 0 8px 30px rgba(0, 0, 0, 0.45);
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(126, 255, 180, 0.35);
  pointer-events: none;
}

.panel::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.panel::after {
  right: 8px;
  bottom: 8px;
  border-left: none;
  border-top: none;
}

.hidden {
  display: none;
}

h1 {
  margin-top: 0;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}

input,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0c1114;
  color: var(--text);
  font: inherit;
  padding: 12px;
}

input:focus,
button:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

button {
  margin-top: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #102127, #0c181d);
}

.entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.entry-actions button {
  margin-top: 0;
}

.copy-btn {
  margin-top: 10px;
  border-color: rgba(36, 216, 223, 0.4);
  background: linear-gradient(180deg, #0f1a1f, #0b1418);
}

.copy-btn:hover {
  border-color: var(--cyan);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.hud-strip {
  margin: 12px 0 6px;
  height: 9px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.hud-strip span {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 110, 56, 0.35), rgba(122, 255, 169, 0.75));
  box-shadow: 0 0 10px rgba(93, 255, 145, 0.3);
  animation: hudPulse 2.2s ease-in-out infinite;
}

.hud-strip span:nth-child(2) {
  animation-delay: 0.16s;
}

.hud-strip span:nth-child(3) {
  animation-delay: 0.32s;
}

.hud-strip span:nth-child(4) {
  animation-delay: 0.48s;
}

.hud-strip span:nth-child(5) {
  animation-delay: 0.64s;
}

@keyframes hudPulse {
  0%, 100% { opacity: 0.4; transform: scaleX(0.92); }
  50% { opacity: 1; transform: scaleX(1); }
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  min-height: 20px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.timer {
  color: var(--danger);
  font-weight: 700;
}

.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.participant-chip {
  background: rgba(72, 187, 120, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.participant-chip.me {
  background: rgba(72, 187, 120, 0.28);
  border-color: var(--accent);
}

#countdown {
  color: var(--text);
}

.alerts {
  min-height: 34px;
  margin-top: 10px;
}

.alert {
  background: rgba(255, 111, 0, 0.15);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.messages {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 44vh;
  min-height: 240px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.message {
  border: 1px solid #183138;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(36, 216, 223, 0.06);
  /* Kompakte, schmale Karten: nie volle Breite, nie flächenfüllend */
  max-width: 78%;
  justify-self: start;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 2px;
  font-size: 11px;
}

.ttl {
  color: var(--danger);
}

.send-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.send-row input {
  flex: 1;
}

.send-row button {
  width: 160px;
  margin-top: 0;
}

.danger-row {
  margin-top: 12px;
}

.panic {
  border-color: var(--danger);
  background: linear-gradient(180deg, #2a1408, #1b0d06);
}

@media (max-width: 700px) {
  .chat-header {
    flex-direction: column;
  }

  .send-row {
    flex-direction: column;
  }

  .send-row button {
    width: 100%;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }
}
