/* Practice - Neobrutalism */

:root {
  --ink: #111111;
  --paper: #FAF6EC;
  --paper-2: #FFFFFF;
  --green: #7CFF9E;
  --cyan: #5CE1E6;
  --yellow: #FFDE59;
  --red: #FF4B4B;
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  background-image: radial-gradient(circle, rgba(17,17,17,0.06) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ===== Setup card ===== */

.setup-card {
  width: 100%;
  max-width: 460px;
  background: var(--paper-2);
  border: 5px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
  padding: 28px 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(34px, 9vw, 52px);
  margin: 0;
  line-height: 1;
}

.setup-sub {
  margin: -6px 0 4px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.7;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

.field-input {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 14px;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.field-input:focus {
  outline: none;
  background: #fffef8;
}

.gender-toggle {
  display: flex;
  gap: 12px;
}

.gender-btn {
  flex: 1;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 16px;
  padding: 13px 0;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.1s ease;
}

.gender-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.gender-btn.is-selected {
  background: var(--yellow);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.setup-error {
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  box-shadow: 4px 4px 0 var(--ink);
}

.home-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.setup-card .big-btn {
  flex: 1;
  font-size: clamp(22px, 6vw, 30px);
  padding: 22px 0;
  box-shadow: 8px 8px 0 var(--ink);
}

.setup-card .big-btn:hover {
  box-shadow: 10px 10px 0 var(--ink);
}

.setup-card .big-btn:active {
  box-shadow: 3px 3px 0 var(--ink);
}

.big-btn {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(28px, 6vw, 48px);
  padding: 36px 64px;
  border: 5px solid var(--ink);
  background: var(--green);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 12px 12px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.12s ease;
}

.big-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 14px 14px 0 var(--ink);
}

.big-btn:active {
  transform: translate(6px, 6px);
  box-shadow: 4px 4px 0 var(--ink);
}

.big-btn-chat {
  background: var(--cyan);
}

.big-btn.is-connecting {
  background: var(--yellow);
  cursor: wait;
}

.big-btn.is-live {
  background: var(--red);
  color: var(--paper);
}

/* ===== Call status ===== */

.call-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.call-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 10px 20px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: clamp(13px, 2.2vw, 18px);
}

.call-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #bbb;
}

.call-status-badge.state-connecting { background: var(--yellow); }
.call-status-badge.state-connecting .call-dot { background: var(--orange, #FF9142); animation: blink 0.8s infinite; }

.call-status-badge.state-ringing { background: var(--cyan); }
.call-status-badge.state-ringing .call-dot { background: var(--ink); animation: blink 0.5s infinite; }

.call-status-badge.state-live { background: var(--green); }
.call-status-badge.state-live .call-dot { background: var(--ink); animation: pulse 1.1s infinite; }

.call-status-badge.state-ended { background: #ddd; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.call-timer {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 52px);
  letter-spacing: 0.04em;
  visibility: hidden;
}

.call-timer.is-visible {
  visibility: visible;
}

/* ===== Chat view ===== */

.chat-stage {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 16px;
}

.msg {
  max-width: 80%;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  font-size: 15.5px;
  line-height: 1.45;
  box-shadow: 4px 4px 0 var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-agent {
  align-self: flex-end;
  background: var(--cyan);
}

.msg-customer {
  align-self: flex-start;
  background: var(--yellow);
}

.msg-speaker {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.65;
}

.chat-status {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  padding: 6px 0;
}

.chat-bar {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 3px solid var(--ink);
}

.chat-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.chat-input:focus {
  outline: none;
  background: #fffef8;
}

.chat-input:disabled {
  opacity: 0.55;
}

.chat-send,
.chat-end {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 14px;
  padding: 0 18px;
  border: 3px solid var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.chat-send {
  background: var(--green);
  color: var(--ink);
}

.chat-end {
  background: var(--red);
  color: var(--paper);
}

.chat-send:hover,
.chat-end:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.chat-send:active,
.chat-end:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 2px 2px 0 var(--ink);
  transform: none;
}
