body {
  margin: 0;
  padding: 0;
  background: url('/static/img/background.webp') no-repeat center center fixed;
  background-size: cover;
  font-family: sans-serif;
  color: white;
  text-align: center;
}

body.lock-scroll {
  overflow: hidden;
  height: 100vh;
}

.sphere-hitbox {
  position: absolute;
  top: 75%;
  left: 69.6%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-text {
  font-size: 1.5em;
  color: #33FF00;
  text-shadow: 1px 1px 2px black;
  text-align: center;
  pointer-events: none;
  width: 96%;
  max-width: 96%;
  margin: 0 auto;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
  line-height: 1.18em;
}

.blink {
  animation: blink 1.2s infinite;
}

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

.question-overlay,
.response-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: #33FF00;
  padding: 30px;
  width: 80%;
  max-width: 800px;
  border-radius: 8px;
  text-align: center;
  z-index: 100;
  font-family: "Courier New", monospace;
  border: 1px solid #33FF00;
  max-height: 90vh;
  overflow: hidden;
}

.question-overlay textarea {
  width: 100%;
  height: 120px;
  padding: 15px;
  font-size: 1em;
  resize: none;
  background-color: black;
  color: #33FF00;
  border: 1px solid #33FF00;
  font-family: "Courier New", monospace;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #33FF00 black;
}

.question-overlay textarea::-webkit-scrollbar {
  width: 8px;
}

.question-overlay textarea::-webkit-scrollbar-track {
  background: black;
}

.question-overlay textarea::-webkit-scrollbar-thumb {
  background-color: #33FF00;
  border-radius: 4px;
}

.question-overlay button {
  margin-top: 15px;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  background-color: black;
  color: #33FF00;
  border: 1px solid #33FF00;
  font-family: "Courier New", monospace;
}

.response-overlay {
  font-size: 1.1em;
  line-height: 1.6;
  max-height: 90vh;
  overflow: hidden;   /* было overflow: hidden; */
}

.response-overlay::-webkit-scrollbar {
  width: 8px;
}

.response-overlay::-webkit-scrollbar-track {
  background: black;
}

.response-overlay::-webkit-scrollbar-thumb {
  background-color: #33FF00;
  border-radius: 4px;
}

.loading {
  animation: blink 1.2s infinite;
}

.restart-btn {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  background-color: black;
  color: #33FF00;
  border: 1px solid #33FF00;
  border-radius: 4px;
  font-family: "Courier New", monospace;
}

.restart-btn:hover {
  background-color: #111;
}

.card-images {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 15px;
  padding: 6px 0;
  margin-bottom: 10px;
}

/* --- Выделение названий карт в трактовке --- */
.card-name {
  color: #39ff14;
  font-weight: bold;
  background: rgba(60,255,80,0.10);
  border-radius: 3px;
  padding: 0 3px;
  font-family: "Courier New", monospace;
}

.top-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  user-select: none;
}

.menu-button {
  background: transparent;
  color: rgba(51, 255, 0, 0.8); /* 80% яркости */
  font-family: "Courier New", monospace;
  font-size: 0.92em;
  cursor: pointer;
  padding: 4px 10px; /* уже */
  border: 1px solid rgba(51, 255, 0, 0.4);
  border-radius: 4px;
  line-height: 1.1em;
}

.dropdown-menu {
  margin-top: 5px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #33FF00;
  border-radius: 4px;
  padding: 4px 0;
  font-family: "Courier New", monospace;
  min-width: 120px;
}

.dropdown-item {
  padding: 5px 10px;
  color: rgba(51, 255, 0, 0.8);
  cursor: pointer;
  text-align: left;
  font-size: 0.9em;
}

.dropdown-item:hover {
  background: rgba(60, 255, 80, 0.1);
}

/* --- Контактная модалка (стиль из первой версии) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal-content {
  background: black;
  color: rgba(51, 255, 0, 0.8);
  padding: 30px;
  border: 1px solid #33FF00;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  text-align: left;
  max-width: 400px;
  width: 90%;
  position: relative;
}

.modal-content a {
  color: rgba(51, 255, 0, 0.8);
  text-decoration: underline;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(51, 255, 0, 0.8);
  font-size: 1.5em;
  cursor: pointer;
}

@media (max-width: 600px) {
  body {
    background: url('/static/img/mobile_background.webp') no-repeat center center fixed !important;
    background-size: cover !important;
  }
 
  /* Скрываем меню */
.top-menu {
  display: none;
}

  .sphere-hitbox {
    top: 55%;
    left: 84%;
    width: 29vw;
    height: 29vw;
    min-width: 96px;
    min-height: 96px;
    max-width: 180px;
    max-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: auto;
  }
  .start-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96%;
    max-width: 96%;
    font-size: 1.08em;
    color: #33FF00;
    text-shadow: 1px 1px 2px black, 0 0 6px #000;
    text-align: center;
    line-height: 1.18em;
    background: none;
    border-radius: 7px;
    margin: 0 auto;
    padding: 0 2vw;
    pointer-events: none;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    position: static;
  }
}

.reading-text {
  max-height: 250px;
  overflow-y: auto;
  text-align: left;
  padding: 1em;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  line-height: 1.5em;
  scrollbar-width: thin;
  scrollbar-color: #33FF00 black;
}

.reading-text::-webkit-scrollbar {
  width: 8px;
}

.reading-text::-webkit-scrollbar-track {
  background: black;
}

.reading-text::-webkit-scrollbar-thumb {
  background-color: #33FF00;
  border-radius: 4px;
}

  /* Карты: строго в одну строку */
  .card-images {
    flex-wrap: nowrap;
    justify-content: space-around;
    gap: 2vw;
    padding: 2vw 0;
  }

   /* Контейнер карты: убираем max-width, задаём стабильную ширину */
  .card-box {
    flex: 1 1 auto;
    width: 32vw;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* вместо center */
  }

  /* Сами изображения */
  .tarot-card-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
  }

    /* Названия карт: растягиваем по ширине карты, минимальные отступы */
.card-label {
    width: 100%;
    max-width: 100%;
    padding: 0 0.5vw;
    font-size: clamp(0.68em, 0.8em, 0.92em);
    text-align: center;
    font-family: 'Trebuchet MS', 'Georgia', serif;
    font-weight: normal;
    color: #33FF00;
    line-height: 1.3em;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
    margin-top: 6px;
    margin-left: 0;
    margin-right: 0;
}

  /* Поведение reading overlay */
  .response-overlay {
    max-height: 95vh;
    padding: 2vw; /* стало меньше, было 30px */
  }
  
  /* Десктопные стили для области карт и подписей */
@media (min-width: 601px) {
  .card-images {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;              /* или 15px, если тебе так больше нравится */
    padding: 6px 0;
    margin-bottom: 10px;
  }
  .tarot-card-img {
    width: 125px;           /* поуже, чтобы освободить больше места вверху */
    max-width: 125px;
    height: auto;
    margin: 0; /* было 6px */
    border-radius: 6px;
    box-shadow: 0 0 8px #000;
  }
  .card-label {
    text-align: center;
    margin-top: 8px;
    font-family: 'Trebuchet MS', 'Georgia', serif;
    font-weight: normal;
    color: #33FF00;
    line-height: 1.3em;
    width: 125px;
    padding: 0 4px;
    font-size: clamp(0.85em, 1.05em, 1.25em); /* регулируй если нужно крупнее/мельче */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}