* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fredoka', Arial, sans-serif;
  height: 100vh;
  background: #000;
  color: white;
  overflow: hidden;
}

:root{
  --social-icon-size: 28px;
  --social-padding-x: calc(var(--social-icon-size) * 0.6);
  --social-padding-y: calc(var(--social-icon-size) * 0.4);
  --social-gap: calc(var(--social-icon-size) * 0.7);
}

/* ====================== ЭКРАНЫ ====================== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: #000;
}

.screen.active {
  display: block !important;
}

/* ====================== ПЕРВЫЙ ЭКРАН ====================== */
#incoming {
  background-color: #000;
  background-image: url('assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Размытый фон */
.skype-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Фоновое изображение для первого экрана */
.skype-background {
  background-image: url('assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.skype-blur-bg {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at 30% 30%, rgba(0,175,240,0.45) 0%, rgba(0,128,192,0.25) 30%, rgba(0,64,128,0.15) 70%, rgba(0,0,0,0.0) 100%);
  filter: blur(30px);
  opacity: 0.35;
  animation: bgPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Контейнер звонка */
.skype-call-container {
  width: 280px !important;
  height: 360px !important;
  max-width: 85vw;
  max-height: 70vh;
  
  background: rgba(20, 20, 30, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  padding: 24px 16px 20px 16px;
  
  box-shadow: 0 30px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.08);
  
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes containerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Информационная панель справа от звонка */
.info-text-panel {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-height: 400px;
  background: rgba(20, 20, 30, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(0, 136, 255, 0.3);
  box-shadow: 0 15px 40px rgba(0, 136, 255, 0.15);
  display: none; /* скрывается по умолчанию */
  flex-direction: column;
  gap: 16px;
  z-index: 9;
}

/* Показываем панель только на втором экране */
#call.active .info-text-panel {
  display: flex;
}

/* Левая панель (зеркальная) */
.info-text-panel.left-panel {
  left: 40px;
  right: auto;
}

.info-text-panel.left-panel .copy-text-button {
  display: none;
}

/* Адаптив для телефонов и планшетов */
@media (max-width: 1024px) {
  /* Скрываем левую панель на маленьких экранах */
  .info-text-panel.left-panel {
    display: none !important;
  }
  
  /* Перемещаем правую панель в верх центра */
  .info-text-panel {
    right: auto !important;
    left: 50% !important;
    top: 20px !important;
    transform: translateX(-50%) !important;
    width: 85vw !important;
    max-width: 400px;
  }
}

.info-text-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.info-text-content p {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  word-break: break-word;
}

.copy-text-button {
  background: linear-gradient(135deg, #0088ff, #0066cc);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(0, 136, 255, 0.3);
}

.copy-text-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 136, 255, 0.5);
}

.copy-text-button:active {
  transform: translateY(0);
}

.copy-text-button.copied {
  background: linear-gradient(135deg, #0066cc, #00449e);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

/* Аватар */
.skype-avatar-wrapper {
  position: relative;
  width: 100px !important;
  height: 100px !important;
  margin: 10px 0 5px 0;
}

.skype-avatar-pulse {
  position: absolute;
  top: -9px;
  left: -9px;
  right: -9px;
  bottom: -9px;
  border-radius: 50%;
  background: rgba(0, 175, 240, 0.28);
  animation: avatarPulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes avatarPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.skype-avatar-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.skype-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 175, 240, 0.3);
}

/* Статус (зеленая точка) */
.skype-status {
  position: absolute;
  bottom: 5px;                        /* Смещение от нижнего края */
  right: 5px;                          /* Смещение от правого края */
  width: 18px !important;              /* Размер круга */
  height: 18px !important;             /* Размер круга */
  background: #4caf50;                  /* Зеленый цвет */
  border-radius: 50% !important;        /* ДЕЛАЕМ КРУГОМ (важно!) */
  border: 3px solid rgba(0, 0, 0, 0.5); /* Темная обводка для контраста */
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.8); /* Свечение */
  z-index: 3;
  animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  50% { transform: scale(1.1); opacity: 0.9; box-shadow: 0 0 15px 5px rgba(76, 175, 80, 0.5); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* Информация */
.skype-caller-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  z-index: 5;
}

/* Имя звонящего */
.skype-name {
  font-size: 28px !important;
  font-weight: 600;
  line-height: 1.2;
  margin: 5px 0 0 0;
  text-align: center;
}

.skype-subtitle {
  font-size: 14px !important;
  letter-spacing: 1px;
  opacity: 0.9;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

@keyframes textPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Кнопки */
.skype-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 10px;
  width: 100%;
}

.skype-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.skype-action-item:hover {
  transform: translateY(-3px);
}

.skype-action-button {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;        /* ИДЕАЛЬНЫЙ КРУГ */
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.skype-action-button:hover {
  transform: scale(1.1);
}

.skype-action-icon {
  width: 28px !important;
  height: 28px !important;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}


#accept .skype-action-icon {
  transform: rotate(135deg);
}

.decline-button {
  background: #ff3b30;
  background: radial-gradient(circle at 30% 30%, #ff5e5e, #c0392b);
}

.accept-button, .video-button {
  background: #2ecc71;
  background: radial-gradient(circle at 30% 30%, #6bff8b, #27ae60);
}

.skype-action-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Кнопки соц сетей в правом верхнем углу */
.top-right-social {
  position: fixed;
  top: 30px;
  right: clamp(12px, 4vw, 40px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--social-gap);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: var(--social-padding-y) var(--social-padding-x);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 50;
  /* keep the pill tightly wrapping the icons */
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100% - 80px);
  white-space: nowrap;
}

.top-right-social .social-link {
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-right-social .social-link:hover {
  transform: scale(1.2);
}

.top-right-social .social-icon {
  width: var(--social-icon-size);
  height: var(--social-icon-size);
  object-fit: contain;
  opacity: 0.8;
}

.top-right-social .ca-button {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  padding: 6px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 5px;
}

.top-right-social .ca-button:hover {
  background: #00ff88;
  color: #000;
  border-color: #00ff88;
  transform: scale(1.05);
}

/* ====================== ВТОРОЙ ЭКРАН ====================== */
#call {
  background: #000;
  position: relative;
  display: none;
}

#call.active {
  display: block;
}

/* Контейнер для хомяка */
.hamster-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hamster-gif-wrapper {
  width: 100%;
  height: calc(100% - 100px);
  overflow: hidden;
}

.hamster-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bottom-black-bar {
  width: 100%;
  height: 100px;
  background: #000;
  z-index: 2;
}

/* Call Duration Display */
.call-duration-display {
  position: fixed;
  bottom: 30px;
  left: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 30;
  visibility: hidden;
}

#call.active .call-duration-display {
  visibility: visible;
}

.call-duration-display span {
  font-size: 14px;
  font-weight: 600;
  color: #0088ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.call-duration-timer {
  font-size: clamp(24px, 2vw, 48px);
  font-weight: 700;
  color: #0088ff;
  font-family: 'Courier New', monospace;
  min-width: 80px;
  text-align: center;
}

/* Социальные кнопки справа снизу (второй экран) */
.bottom-right-social {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 30;
  visibility: hidden;
}

#call.active .bottom-right-social {
  visibility: visible;
}

.bottom-right-social .social-link {
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-right-social .social-link:hover {
  transform: scale(1.15);
}

.bottom-right-social .social-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.bottom-right-social .social-link:hover .social-icon {
  opacity: 1;
}

/* Панель управления звонком */
.call-controls-bar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 30;
}

.call-control-btn {
  background: rgba(40, 40, 40, 0.9);
  color: white;
  border: 2px solid #0088ff;
  border-radius: 50px;
  padding: 12px 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.call-control-btn:hover {
  background: #0088ff;
  color: #fff;
  transform: scale(1.05);
}

.call-control-btn.end-call-btn {
  background: #ff3b30;
  border-color: #ff3b30;
}

.control-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ====================== ПОПАПЫ ====================== */
.ca-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 11000;
  justify-content: center;
  align-items: center;
}

.ca-popup.active {
  display: flex !important;
}

.ca-popup-content {
  background: #000;
  border: 5px solid #00ff88;
  border-radius: 30px;
  /* responsive padding and constrained width so text always fits */
  padding: clamp(18px, 4vw, 60px) clamp(24px, 6vw, 80px);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 255, 136, 0.3);
  max-width: min(90vw, 900px);
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ca-popup-content p {
  /* responsive headline: won't overflow the popup on any viewport */
  font-size: clamp(18px, 3.5vw + 0.5rem, 48px);
  line-height: 1.05;
  font-weight: 700;
  color: #00ff88;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
  margin: 0;
  max-width: 100%;
}

.ca-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 40px;
  color: #00ff88;
  cursor: pointer;
}

/* ====================== СКРЫТИЕ ПЕРВОГО ЭКРАНА ====================== */
/* Полностью скрываем первый экран, когда активен второй */
#call.active ~ #incoming {
  display: none !important;
}

/* Синие цвета для элементов второго экрана */
#call.active .ca-popup-content {
  border: 5px solid #0088ff;
}

#call.active .ca-popup-content p {
  color: #0088ff;
}

#call.active .ca-close {
  color: #0088ff;
}

/* Также скрываем все элементы первого экрана по отдельности */
#call.active ~ #incoming,
#call.active ~ #incoming .skype-call-container,
#call.active ~ #incoming .top-right-social,
#call.active ~ #incoming .skype-background,
#call.active ~ #incoming .skype-avatar-wrapper,
#call.active ~ #incoming .skype-caller-info,
#call.active ~ #incoming .skype-actions {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Дополнительная защита для body */
body:has(#call.active) #incoming {
  display: none !important;
}

.copy-button {
  background: #00ff88;
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 12px 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 30px;
  transition: all 0.3s ease;
  align-self: center;
}

.copy-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.copy-button.copied {
  background: #4caf50;
  color: white;
}

/* ====================== АДАПТИВ ====================== */
@media (max-width: 768px) {
  .skype-call-container { width: 500px; padding: 40px 30px; }
  .skype-avatar-wrapper { width: 150px; height: 150px; }
  .skype-name { font-size: 36px; }
  .skype-subtitle { font-size: 18px; }
  .skype-actions { gap: 25px; }
  .skype-action-button { width: 70px; height: 70px; }
  .skype-action-icon { width: 35px; height: 35px; }
  
  .top-right-social { top: 20px; right: 20px; }
  :root { --social-icon-size: 22px; }
  .top-right-social .ca-button { padding: 4px 14px; font-size: 14px; }
  
  .top-info-bar { top: 20px; padding: 12px 30px; gap: 20px; }
  .top-info-btn { padding: 8px 20px; font-size: 16px; min-width: 120px; }
  .call-controls-bar { bottom: 20px; gap: 15px; }
  .call-control-btn { padding: 10px 20px; font-size: 16px; min-width: 100px; }
  .hamster-gif-wrapper { height: calc(100% - 80px); }
  .bottom-black-bar { height: 80px; }
  
  .call-duration-display { bottom: 110px; left: 15px; gap: 4px; }
  .call-duration-display span { font-size: 12px; }
  .call-duration-timer { font-size: 28px; min-width: 70px; }
  
  .bottom-right-social { bottom: 110px; right: 15px; gap: 12px; padding: 10px 12px; }
}

@media (max-width: 480px) {
  .skype-call-container { width: 90vw; padding: 30px 20px; }
  .skype-avatar-wrapper { width: 120px; height: 120px; }
  .skype-name { font-size: 28px; }
  .skype-subtitle { font-size: 16px; }
  .skype-actions { gap: 15px; }
  .skype-action-button { width: 60px; height: 60px; }
  .skype-action-icon { width: 30px; height: 30px; }
  
  .top-right-social { top: 15px; right: 15px; }
  :root { --social-icon-size: 18px; }
  .top-right-social .ca-button { padding: 3px 10px; font-size: 12px; }
  
  .top-info-bar { top: 15px; padding: 8px 15px; gap: 10px; }
  .top-info-btn { padding: 6px 12px; font-size: 12px; min-width: 80px; }
  .call-controls-bar { bottom: 15px; gap: 10px; }
  .call-control-btn { padding: 8px 15px; font-size: 14px; min-width: 80px; }
  .hamster-gif-wrapper { height: calc(100% - 70px); }
  .bottom-black-bar { height: 70px; }
  
  .call-duration-display { bottom: 95px; left: 10px; gap: 3px; }
  .call-duration-display span { font-size: 11px; }
  .call-duration-timer { font-size: 20px; min-width: 60px; }
  
  .bottom-right-social { bottom: 95px; right: 10px; gap: 10px; padding: 8px 10px; }
  .bottom-right-social .social-icon { width: 24px; height: 24px; }
}

/* Центрируем панель соцкнопок сверху для разрешений ниже 1920 */
@media (max-width: 1919px) {
  .top-right-social {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: clamp(12px, 3.5vh, 40px);
  }
}

/* ========= larger screens ========= */
@media (min-width: 1024px) {
  .skype-call-container { width: 700px; }
  .skype-name { font-size: 64px; }
  .skype-subtitle { font-size: 32px; }
  .skype-action-button { width: 110px; height: 110px; }
  .skype-action-icon { width: 55px; height: 55px; }
  .top-right-social { top: 40px; right: 40px; padding: var(--social-padding-y) var(--social-padding-x); gap: var(--social-gap); }
  .call-control-btn { padding: 14px 40px; font-size: 24px; min-width: 200px; }
}

@media (min-width: 1440px) {
  .skype-call-container { width: 850px; }
  .skype-name { font-size: 72px; }
  .skype-subtitle { font-size: 36px; }
  .skype-action-button { width: 120px; height: 120px; }
  .skype-action-icon { width: 60px; height: 60px; }
}

@media (min-width: 1920px) {
  .skype-call-container { width: 900px; }
  .skype-name { font-size: 72px; }
  .skype-subtitle { font-size: 36px; }
  .skype-action-button { width: 140px; height: 140px; }
  .skype-action-icon { width: 70px; height: 70px; }

  .call-control-btn { padding: 16px 50px; }
}

@media (min-width: 2560px) {
  .skype-call-container { width: 1100px; }
  .skype-name { font-size: 90px; }
  .skype-subtitle { font-size: 48px; }
  .skype-action-button { width: 160px; height: 160px; }
  .skype-action-icon { width: 80px; height: 80px; }
}

@media (min-width: 3840px) {
  .skype-call-container { width: 1200px; }
  .skype-name { font-size: 100px; }
  .skype-subtitle { font-size: 56px; }
  .skype-action-button { width: 180px; height: 180px; }
  .skype-action-icon { width: 90px; height: 90px; }
}
