@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #161616;
  font-family: 'Open Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #ffffff;
  padding: 20px;
}

.card {
  width: 900px;
  max-width: 100%;
  min-height: 400px;
  background: #2d2d2d;
  border-radius: 6px;
  padding: 28px;
  user-select: none;
  -webkit-user-select: none;
}

#homeScreen {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.radio-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.station-tile {
  background: #1a1a1a;
  border: 2px solid #404040;
  border-radius: 20px;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 150px;
  cursor: pointer;
  opacity: 1;
  transition: opacity 400ms ease, background 0.2s, border-color 0.2s;
}

.station-tile.active {
  background: rgba(40, 167, 69, 0.14);
  border-color: #28a745;
}

.station-tile.off.active {
  background: rgba(220, 53, 69, 0.14);
  border-color: #dc3545;
}

.station-tile.fading {
  opacity: 0.35;
}

.station-tile .label {
  font-size: 26px;
  font-weight: 700;
}

.station-tile .status {
  font-size: 16px;
  color: #cccccc;
}

.station-tile svg {
  stroke: #cccccc;
}

.station-tile.active svg {
  stroke: #3ddc84;
}

.station-tile.off.active svg {
  stroke: #ff8a80;
}

.volume-control {
  background: #1a1a1a;
  border: 1px solid #404040;
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.vol-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #404040;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.vol-btn:active {
  background: #232323;
}

.vol-bar-touch {
  flex: 1;
  padding: 20px 0;
  cursor: pointer;
  touch-action: none;
}

.vol-bar {
  height: 10px;
  background: #404040;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.vol-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #0d6efd;
  border-radius: 6px;
  transition: width 0.15s ease;
}

.contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-tile {
  background: rgba(13, 110, 253, 0.14);
  border: 2px solid #0d6efd;
  border-radius: 20px;
  padding: 28px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  cursor: pointer;
}

.contact-tile .name {
  font-size: 26px;
  font-weight: 700;
}

.contact-tile .sub {
  font-size: 16px;
  color: #cccccc;
}

.contact-test-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: #232323;
  border: 1px dashed #404040;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  margin-top: 6px;
}

/* Call screens */

.call-screen {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 10px;
}

@keyframes mx-ring {
  0% { transform: scale(0.9); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes mx-typing {
  0%, 60%, 100% { transform: scale(0.6); opacity: 0.5; }
  30% { transform: scale(1); opacity: 1; }
}

.ring-avatar {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #0d6efd;
  animation: mx-ring 1.8s ease-out infinite;
}

.ring.green {
  border-color: #28a745;
  animation-duration: 1.6s;
}

.avatar-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 700;
}

.avatar-circle.green {
  background: #28a745;
}

.call-name {
  font-size: 34px;
  font-weight: 700;
  text-align: center;
}

.typing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  color: #cccccc;
}

.typing-dots {
  display: flex;
  gap: 5px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cccccc;
  display: inline-block;
  animation: mx-typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

.danger-btn {
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  background: #dc3545;
  border: none;
  border-radius: 50px;
  padding: 20px 48px;
  cursor: pointer;
}

.incoming-label {
  font-size: 16px;
  color: #3d8bfd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.incoming-actions {
  display: flex;
  gap: 36px;
  margin-top: 16px;
}

.incoming-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.incoming-action-label {
  font-size: 16px;
  color: #cccccc;
}

.round-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.round-btn.danger { background: #dc3545; }
.round-btn.success { background: #28a745; }

.active-screen {
  align-items: stretch;
  justify-content: flex-start;
}

.active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.active-timer {
  font-size: 20px;
  color: #cccccc;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.jitsi-wrap {
  position: relative;
  flex: 1;
  min-height: 420px;
}

.jitsi-container {
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  border: 1px solid #404040;
  border-radius: 10px;
  overflow: hidden;
}

.jitsi-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.connecting-overlay {
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  border: 1px solid #404040;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.connecting-overlay.hidden {
  display: none;
}
