:root {
  --bg: #0b0b0b;
  --white: #ffffff;
  --accent: #378ad1;
  --border-default: #535353;
  --border-secondary: #2f2f2f;
  --surface-secondary: rgba(255, 255, 255, 0.06);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --fade-ms: 200ms;
  --blink-rate: 700ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Fustat', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 80px 24px 120px;
}

.message-section {
  width: 100%;
  max-width: 696px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.16px;
}

.block { display: flex; flex-direction: column; }
.block.h { font-weight: 800; }
.block.p { font-weight: 500; }

.ul { display: flex; flex-direction: column; gap: 8px; }

.li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.li .bullet {
  flex-shrink: 0;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--white);
  margin-top: 8px;
  transition: opacity var(--fade-ms) ease;
}
.li .bullet.hidden { opacity: 0; }
.li .text { flex: 1; min-width: 0; }
.li .text .b { font-weight: 800; }

.divider {
  height: 1px;
  width: 100%;
  background: var(--border-secondary);
  transition: opacity var(--fade-ms) ease;
}
.divider.hidden { opacity: 0; }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 400ms ease;
}
.actions.visible { opacity: 1; }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 99px;
  background: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.action-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* characters */
.char {
  color: var(--white);
  transition: color var(--fade-ms) ease;
}
.char.active { color: var(--accent); }
body.no-transition .char,
body.no-transition .bullet,
body.no-transition .divider { transition: none; }

/* cursor */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink var(--blink-rate) step-end infinite;
}
body.no-cursor .cursor { display: none; }
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* control panel */
.control-panel {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 280px;
  background: rgba(20, 20, 20, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-secondary);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.control-panel h2 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0;
}
.collapse-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.collapse-btn:hover { color: var(--white); }
.control-panel.collapsed { width: auto; padding: 8px 12px; }
.control-panel.collapsed .panel-body { display: none; }
.control-panel.collapsed .collapse-btn { position: static; }

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.control-row label {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-weight: 500;
}
.control-row .val { color: var(--white); font-weight: 800; }
.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.control-row.toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.control-row.toggle label { color: var(--white); font-weight: 500; }
.control-row.toggle input[type="checkbox"] {
  width: 32px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background 150ms ease;
}
.control-row.toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 150ms ease;
}
.control-row.toggle input[type="checkbox"]:checked {
  background: var(--accent);
}
.control-row.toggle input[type="checkbox"]:checked::after {
  transform: translateX(14px);
}

.control-buttons {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.control-buttons button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.control-buttons button:hover {
  border-color: var(--white);
}
.control-buttons button.primary {
  background: var(--accent);
  border-color: var(--accent);
}
.control-buttons button.primary:hover {
  background: #2c78ba;
  border-color: #2c78ba;
}
