:root {
  --bg: #14171c;
  --surface: #1c2027;
  --surface-raised: #232833;
  --border: #2b313d;
  --text: #f2f1ed;
  --text-muted: #868c98;
  --amber: #ff8a3d;
  --amber-dim: #a35a29;
  --mint: #7fe7c4;
  --danger: #ff5c5c;
  --font-mono: "IBM Plex Mono", monospace;
  --font-sans: "Inter", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 138, 61, 0.08), transparent 55%);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.dot.ready {
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}
.dot.on-call {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: pulse 1.1s infinite;
}
.dot.error {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.phone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}

.display {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.number-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.04em;
  padding: 4px 2px;
}
.number-input::placeholder {
  color: var(--text-muted);
  font-size: 17px;
  letter-spacing: normal;
}

.backspace-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.backspace-btn:hover { color: var(--text); background: var(--surface-raised); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s, box-shadow 0.15s;
  user-select: none;
}

.key:active,
.key.pressed {
  background: var(--amber-dim);
  transform: scale(0.94);
  box-shadow: 0 0 14px rgba(255, 138, 61, 0.5);
}

.key .digit {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 500;
}

.key .letters {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 1px;
}

.call-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.call-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--mint);
  color: #0b1410;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 8px 24px -6px rgba(127, 231, 196, 0.5);
}

.call-btn:hover { transform: translateY(-1px); }
.call-btn:active { transform: scale(0.95); }

.call-btn.on-call {
  background: var(--danger);
  color: #2a0b0b;
  box-shadow: 0 8px 24px -6px rgba(255, 92, 92, 0.5);
  transform: rotate(135deg);
}

.call-btn.disabled {
  background: var(--surface-raised);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.call-timer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  height: 14px;
  margin: 0;
}

.app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

@media (max-width: 380px) {
  .phone { padding: 18px 14px 20px; }
  .keypad { gap: 9px; }
}
