body {
    margin: 0;
    padding: 0;
    background-color: #0a0a2a;
    font-family: Arial, sans-serif;
    touch-action: manipulation;
    overflow: hidden;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh; /* Гарантируем, что содержимое не будет больше высоты экрана */
}

/* Хедер - фиксированная высота */
header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    z-index: 10;
}

/* #score {
    background-color: #1a1a4a;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    padding: 4px 20px;
    border-radius: 24px;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(80, 100, 255, 0.25);
    border: 2px solid #5050ff;
    margin-bottom: 5px;
} */

#next-figure {
    position: absolute;
    top: 4px;
    right: 10px;
    margin: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
}

#share-button {
    position: absolute;
    top: 4px;
    left: 10px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #1a1a4a;
    border: 2px solid #5050ff; /* Оставляем тонкий бордер */
    font-size: 14px;
    cursor: pointer;
}

#game-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #5050ff;
}

/* Основной стакан - растягивается по доступной высоте */
#game-container {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: visible; /* Чтобы видеть элементы за пределами контейнера */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: 0; /* Убираем отступ сверху */
    padding-bottom: 0;
}

#glass {
    position: relative;
    width: 100%;
    max-width: 500px; /* Ограничиваем максимальную ширину */
    height: calc(100% - 25px); /* Уменьшаем высоту, оставляя место для шарика сверху */
    border: 3px solid #5050ff; /* Уменьшаем бордер */
    border-radius: 10px; /* Уменьшаем скругление углов */
    background-color: #101040;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(80, 100, 255, 0.3); /* Уменьшаем тень */
    z-index: 10; /* Должен быть меньше, чем у next-area */
    margin: 0 auto; /* Центрируем стакан */
}

#glass-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-radius: 8px; /* Скругление внутри стакана */
}

#next-area {
    position: absolute;
    width: 100%;
    max-width: 500px; /* Ограничиваем ширину так же, как у стакана */
    height: 40px;
    top: -20px; /* Позиция над стаканом */
    left: 50%;
    transform: translateX(-50%); /* Центрируем относительно стакана */
    display: flex;
    align-items: flex-end; /* Выравнивание по нижнему краю */
    justify-content: center;
    z-index: 50; /* Увеличиваем z-index, чтобы быть поверх всего */
    pointer-events: none; /* Пропускаем события мыши через область */
}

#current-circle {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, 0); /* Половина шарика выступает снизу */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 55; /* Должен быть выше next-area */
    box-shadow: 0 4 4px rgba(255, 255, 255, 0.5); /* Уменьшаем радиус тени */
    bottom: 0; 
    pointer-events: auto; /* Шарик должен реагировать на события мыши */
}

.circle {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    user-select: none;
    will-change: transform;
}

/* Футер - фиксированная высота */
footer {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px; /* Увеличиваем отступ снизу */
}

#circle-selector {
    border-radius: 32px;
    padding: 4px;
    display: flex;
    justify-content: center;
    width: 92%;
    max-width: 500px;
    min-height: 22px;
    box-shadow: 0 4px 6px rgba(80, 100, 255, 0.25); /* Уменьшаем тень */
    border: 3px solid #5050ff; /* Уменьшаем бордер */
}

.selector-dot {
    width: 30px;
    /* height: 28px; */
    border-radius: 50%;
    margin: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4 4px rgba(255, 255, 255, 0.4); /* Уменьшаем тень */
}

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#win-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(30, 30, 80, 0.9);
    color: white;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

button {
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #5050ff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(80, 100, 255, 0.4);
}

button:hover {
    background-color: #6060ff;
}

/* Стили для всплывающего текста */
.floating-text {
    position: absolute;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    transform: translate(-50%, -50%);
    /* text-shadow: 0 0 5px #5050ff, 0 0 10px #5050ff; */
    opacity: 1;
    z-index: 100; /* Увеличиваем z-index, чтобы быть поверх всех элементов */
    background-color: rgba(10, 10, 42, 0.7);
    padding: 4px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Анимация для всплывающего текста */
.floating-text-animate {
    animation: float-up-fade-out 1.2s ease-out forwards;
}

@keyframes float-up-fade-out {
    0% {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    20% {
        transform: translate(-50%, -60%);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -120%);
        opacity: 0;
    }
}

/* Стили для подсказок в селекторе кружков */
.selector-dot {
    position: relative;
}

.selector-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 10, 42, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    margin-bottom: 5px;
    text-align: center;
    z-index: 100;
}

.selector-dot:hover .selector-tooltip {
    opacity: 1;
}

/* Стиль для начальной инструкции */
#start-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    text-align: center;
    width: 80%;
    padding: 10px 16px;
    z-index: 20;
    cursor: pointer;
    text-shadow: 0 0 5px #5050ff, 0 0 10px #5050ff;
    pointer-events: none;
}

#shake-button {
    position: absolute;
    top: 4px;
    left: 60px; /* Размещаем справа от кнопки шаринга */
    margin: 0;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #1a1a4a;
    border: 2px solid #5050ff;
    font-size: 14px;
    cursor: pointer;
}

#build-number {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  color: rgba(150, 150, 150, 0.5);
  z-index: 10;
  font-family: monospace;
}

.shake-screen-modal-button .button-loader,
.remove-planets-modal-button .button-loader /* Если будете использовать такой же подход для другой кнопки */
 {
  display: inline-block;
  width: 1em; /* Размер относительно шрифта кнопки */
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle; /* Выравнивание по центру текста */
  box-sizing: border-box;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}