* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: transparent; /* transparent so it can be laid over streaming apps */
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.panel input {
  user-select: text;
  -webkit-user-select: text;
}

/* ---------- Comment card ---------- */

.card {
  position: fixed;
  top: 30px;
  left: 60px;
  right: 60px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.68);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bubble {
  min-width: 0;
}

.username {
  font-weight: 700;
  font-size: calc(clamp(22px, 3.2vw, 32px) * var(--font-scale, 1));
  color: #6cf0ff;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  word-break: break-word;
}

.question {
  font-size: calc(clamp(24px, 3.6vw, 34px) * var(--font-scale, 1));
  line-height: 1.35;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  word-break: break-word;
}

/* Attention animation: plays once for 7s when a new question lands */
.card.attn {
  animation: cardZoom 7s ease-out 1;
}
.card.attn .question {
  animation: colorCycle 7s linear 1;
}

@keyframes cardZoom {
  0%   { transform: scale(0.75); }
  10%  { transform: scale(1.12); }
  22%  { transform: scale(0.95); }
  34%  { transform: scale(1.05); }
  46%  { transform: scale(0.99); }
  58%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes colorCycle {
  0%   { color: #ffffff; }
  15%  { color: #ff5b5b; }
  30%  { color: #ffd93d; }
  45%  { color: #4dff88; }
  60%  { color: #4dc4ff; }
  75%  { color: #ff8bf0; }
  100% { color: #ffffff; }
}

/* ---------- Top-right controls ---------- */

.top-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
  z-index: 20;
}

.icon-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 24, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.15;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { background: rgba(20, 20, 24, 0.85); opacity: 1; }

.gear-btn { font-size: 12px; }

/* ---------- Settings panel ---------- */

.panel {
  position: fixed;
  top: 108px;
  right: 12px;
  width: 320px;
  max-width: 90vw;
  padding: 16px;
  border-radius: 12px;
  background: rgba(24, 24, 28, 0.94);
  color: #eee;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.hidden { display: none; }

.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.panel label {
  display: block;
  font-size: 12px;
  color: #bbb;
  margin-bottom: 10px;
}

.panel input[type="text"],
.panel input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 13px;
}

.radio-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  color: #ddd !important;
}
.radio-label input { width: auto; margin: 0; }

.btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-row button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #2a2a30;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
}
.btn-row button:hover { background: #3a3a42; }

.status {
  margin-top: 6px;
  font-size: 12px;
  color: #9fd89f;
  min-height: 16px;
}
.status.error { color: #ff8080; }

/* ---------- Copyright ---------- */

.copyright {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: 5px;
  margin: 0;
  border: none;
  background: none;
  text-align: center;
  font-size: 11px;
  font-weight: 200;
  color: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 5;
}
