/* ============================================
   СТИЛИ САЙТА ПРИЁМНОЙ КОМИССИИ РТУ МИРЭА
   Специальность: 09.02.11 Разработка и управление программным обеспечением
   ============================================ */

/* --- Шрифты --- */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(./fonts/fa-regular-400.woff2) format("woff2"), url(./fonts/fa-regular-400.ttf) format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url(./fonts/fa-solid-900.woff2) format("woff2"), url(./fonts/fa-solid-900.ttf) format("truetype");
}

@font-face {
  font-family: 'Geometria';
  src: url('./fonts/Geometria.eot');
  src: local('Geometria'),
    url('./fonts/Geometria.eot-#iefix') format('embedded-opentype'),
    url('./fonts/Geometria.woff') format('woff'),
    url('./fonts/Geometria.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Geometria';
  src: url('./fonts/Geometria-Bold.eot');
  src: local('Geometria Bold'), local('Geometria-Bold'),
    url('./fonts/Geometria-Bold.eot-#iefix') format('embedded-opentype'),
    url('./fonts/Geometria-Bold.woff') format('woff'),
    url('./fonts/Geometria-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Geometria';
  src: url('./fonts/Geometria-Medium.eot');
  src: local('Geometria Medium'), local('Geometria-Medium'),
    url('./fonts/Geometria-Medium.eot-#iefix') format('embedded-opentype'),
    url('./fonts/Geometria-Medium.woff') format('woff'),
    url('./fonts/Geometria-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Geometria';
  src: url('./fonts/Geometria-Light.eot');
  src: local('Geometria Light'), local('Geometria-Light'),
    url('./fonts/Geometria-Light.eot-#iefix') format('embedded-opentype'),
    url('./fonts/Geometria-Light.woff') format('woff'),
    url('./fonts/Geometria-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

/* --- Переменные цветов --- */
:root {
  --pk-purple: #8B5CF6;
  --pk-dark-purple: #6D28D9;
  --pk-darker-purple: #5B21B6;
  --pk-blue: #8B5CF6;
  --pk-dark-blue: #6D28D9;
  --pk-white: #FFFFFF;
  --pk-link: #8B5CF6;
  --pk-gray: #B5B4B4;
  --pk-light-gray: #E6E6E6;
  --pk-dark-white: #F4F4F4;
  --pk-black: #363E52;
  --pk-teal: #5FC1CF;
  --pk-meeting: #E48F0D;
}

/* --- Базовые стили --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: Geometria, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Geometria, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pk-black);
  background-color: #fff;
}

a {
  color: var(--pk-link);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #044cd0;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- Контейнер --- */
.content-container {
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
  padding: 0 39px;
}

@media (min-width: 576px) {
  .content-container {
    padding: 0 100px;
  }
}

/* ============================================
   ШАПКА САЙТА (HEADER)
   ============================================ */
#sp-header-priem {
  background: rgba(48, 55, 66, 0.49);
  backdrop-filter: blur(13.5px);
  -webkit-backdrop-filter: blur(13.5px);
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  color: white;
  height: 100px;
}

#sp-header-priem .header-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

#sp-header-priem .img-section {
  display: flex;
  align-items: center;
  gap: 21px;
  flex-shrink: 0;
}

#logo {
  height: 65px;
  width: auto;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1000;
  position: relative;
}

#logo-link {
  display: inline-block;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1000;
  position: relative;
}

/* Навигация */
#sp-header-priem nav {
  display: none;
}

@media (min-width: 1440px) {
  #sp-header-priem nav {
    display: block;
  }
}

.sp-megamenu-parent {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 30px;
}

.sp-megamenu-parent > li {
  position: relative;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  border-radius: 8px;
}

.sp-megamenu-parent > li:hover {
  background-color: #78C0CC;
}

.sp-megamenu-parent > li > a {
  display: inline-block;
  padding: 0 10px;
  line-height: 100px;
  font-size: 18px;
  color: #ffffff;
  text-decoration: none;
}

.sp-megamenu-parent > li:hover > a {
  color: white;
}

/* Бadge уведомлений в ПК навигации */
.sp-megamenu-parent .notifications-badge {
  position: absolute;
  top: 25px;
  right: -5px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  pointer-events: none;
}

/* Кнопки в шапке */
#sp-header-priem .buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#sp-header-priem .buttons > a {
  display: block;
  padding: 0.625rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 18px;
  transition: all 0.3s ease;
  cursor: pointer;
  color: white;
}

#sp-header-priem .buttons > a:hover {
  background-color: #78C0CC;
  text-decoration: none;
}

#sp-header-priem .buttons > a img {
  width: 24px;
  height: 24px;
}

/* Бургер меню */
.offcanvas-control {
  display: block;
  padding-left: 20px;
}

.offcanvas-control img {
  cursor: pointer;
}

@media (min-width: 1440px) {
  .offcanvas-control {
    display: none;
  }
}

.d-md-none {
  display: none;
}

@media (min-width: 768px) {
  .d-md-none {
    display: block;
  }
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */
.main-content {
  margin-top: 100px;
}

/* Синяя (фиолетовая) шапка страницы */
.page-header-section {
  background: linear-gradient(135deg, var(--pk-purple) 0%, var(--pk-dark-purple) 100%);
  padding: 40px 0 60px;
  margin-bottom: 0;
}

.page-header-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .page-header-inner {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Кнопка "Назад" */
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.back-button svg {
  width: 28px;
  height: 18px;
}

/* Заголовок страницы */
.page-title-block {
  flex: 1;
}

.page-title {
  font-weight: bold;
  font-size: 41px;
  line-height: 49.2px;
  color: white;
  margin: 0 0 15px 0;
}

@media (max-width: 767px) {
  .page-title {
    font-size: 28px;
    line-height: 1.3;
  }
}

.page-subtitle-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.page-code {
  font-size: 18px;
  color: white;
  margin: 0;
}

.page-college {
  font-size: 18px;
  margin: 0;
}

.page-college a {
  color: white;
  text-decoration: underline;
}

/* Кнопка "В избранное" */
.favorite-block {
  display: flex;
  align-items: center;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

.favorite-button:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  color: white;
}

.favorite-button svg {
  width: 22px;
  height: 21px;
}

.favorite-button span {
  font-size: 18px;
}

.favorite-button.active {
  background: rgba(255, 215, 0, 0.3);
}

/* Краткое описание */
.short-description {
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.short-description p {
  font-size: 18px;
  line-height: 1.6;
  color: white;
  margin: 0;
  max-width: 1200px;
}

/* ============================================
   КНОПКИ НАВИГАЦИИ К СЕКЦИЯМ
   ============================================ */
.tab-buttons-container {
  background: #fff;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 100;
}

.tab-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.tab-button {
  padding: 15px 30px;
  font-size: 18px;
  font-family: Geometria, sans-serif;
  font-weight: 500;
  border: 2px solid var(--pk-blue);
  background: white;
  color: var(--pk-blue);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.tab-button:hover {
  background: rgba(53, 92, 168, 0.1);
  text-decoration: none;
  color: var(--pk-blue);
}

/* ============================================
   СЕКЦИИ КОНТЕНТА
   ============================================ */
.content-section {
  padding: 60px 0;
  scroll-margin-top: 200px;
}

/* Заголовки секций */
.section-title {
  font-weight: bold;
  font-size: 24px;
  color: var(--pk-black);
  margin-bottom: 25px;
}

/* Сетка для информации о программе */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Список информации */
.info-list-block {
  background: var(--pk-dark-white);
  padding: 25px;
  border-radius: 12px;
}

.info-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 16px;
}

.info-list li:last-child {
  border-bottom: none;
}

/* Блок с местами и баллами */
.places-and-scores-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.places-info {
  background: var(--pk-dark-white);
  padding: 25px;
  border-radius: 12px;
}

.places-header {
  font-weight: bold;
  font-size: 18px;
  color: var(--pk-black);
  margin-bottom: 20px;
}

.places-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.place-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.place-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: white;
  padding: 15px;
  border-radius: 8px;
}

.place-label {
  font-size: 14px;
  color: var(--pk-gray);
}

.place-value {
  font-weight: bold;
  font-size: 18px;
  color: var(--pk-blue);
}

/* Проходные баллы */
.scores-info {
  background: white;
  padding: 25px;
  border-radius: 12px;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 20px;
}

.score-item:last-child {
  margin-bottom: 0;
}

.score-label {
  font-size: 16px;
  color: var(--pk-black);
}

.score-value {
  font-weight: bold;
  font-size: 24px;
  color: var(--pk-blue);
}

/* ============================================
   АККОРДЕОН
   ============================================ */
.details-section {
  max-width: 1000px;
  margin: 0 auto;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.accordion-item {
  border: 1px solid var(--pk-light-gray);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.accordion-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: white;
  border: none;
  cursor: pointer;
  font-family: Geometria, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--pk-black);
  transition: all 0.3s ease;
  text-align: left;
}

.accordion-button:hover {
  background: rgba(53, 92, 168, 0.05);
}

.accordion-button.active {
  background: var(--pk-blue);
  color: white;
}

.accordion-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.accordion-button.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.accordion-panel.active {
  max-height: 1000px;
  overflow-y: auto;
}

.accordion-panel-content {
  padding: 25px;
  background: white;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.accordion-panel-content p {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
}

.accordion-panel-content p:last-child {
  margin-bottom: 0;
}

.accordion-panel-content ol {
  padding-left: 25px;
  margin: 10px 0;
}

.accordion-panel-content ol li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.6;
}

/* ============================================
   КОНТАКТЫ
   ============================================ */
#contacts {
  background-color: #f2f2f2;
  padding: 60px 0;
}

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

@media (min-width: 768px) {
  .contacts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contact-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-label {
  font-size: 18px;
  font-weight: 500;
  color: var(--pk-gray);
}

.contact-phone {
  font-size: 33px;
  font-weight: 700;
  color: var(--pk-blue);
  margin: 0;
}

.contact-email {
  font-size: 20px;
  font-weight: 500;
  color: var(--pk-blue);
}

.contact-address {
  font-size: 20px;
  font-weight: 500;
  color: var(--pk-blue);
  margin: 0;
  line-height: 1.5;
}

.contact-column small {
  font-size: 20px;
  font-weight: 400;
  color: var(--pk-blue);
}

.contact-column p {
  font-size: 20px;
  font-weight: 500;
  color: var(--pk-blue);
  margin: 0;
}

.contact-social-text {
  font-size: 18px;
  color: var(--pk-black);
  margin: 0;
}

/* Социальные сети */
.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px 0;
}

.social-icons a {
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.2);
  text-decoration: none;
}

.social-icons img {
  width: 40px;
  height: 40px;
}

.social-icon-max {
  width: 40px;
}

.contact-excursion {
  margin-top: 15px;
}

.contact-excursion a {
  font-size: 18px;
  color: var(--pk-blue);
  text-decoration: underline;
}

/* ============================================
   ПОДВАЛ (FOOTER)
   ============================================ */
#footer {
  background-image: url("./images/footer.svg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 100% 50%;
  background-color: #1c4289;
  padding: 30px 0;
}

.footer-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 40px 0 80px;
}

@media (min-width: 992px) {
  .footer-wrapper {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column p {
  color: white;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.footer-column a {
  color: white;
  text-decoration: underline;
}

.footer-column a:hover {
  color: var(--pk-teal);
}

/* ============================================
   КНОПКИ НАВИГАЦИИ ВВЕРХ/ВНИЗ
   ============================================ */
.scroll-buttons {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.scroll-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--pk-blue);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.scroll-button:hover {
  background: #2a4a8a;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.scroll-button svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.scroll-button-up {
  opacity: 0;
  pointer-events: none;
}

.scroll-button-up.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-button-down.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 1439px) {
  #sp-header-priem nav {
    display: none;
  }
  
  .offcanvas-control {
    display: block;
  }
  
  #sp-header-priem .buttons {
    display: none;
  }
}

@media (max-width: 767px) {
  #sp-header-priem {
    height: 70px;
  }

  #logo {
    height: 45px;
  }

  .main-content {
    margin-top: 70px;
  }
  
  .mobile-menu {
    top: 70px;
    height: calc(100vh - 70px);
  }

  .page-header-section {
    padding: 30px 0 40px;
  }
  
  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .page-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  
  .page-code,
  .page-college {
    font-size: 16px;
  }

  .tab-buttons {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
    text-align: center;
  }

  .short-description {
    padding: 20px;
  }
  
  .short-description p {
    font-size: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .places-and-scores-block {
    gap: 15px;
  }
  
  .places-info,
  .scores-info {
    padding: 20px;
  }
  
  .place-value,
  .score-value {
    font-size: 16px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .contact-phone {
    font-size: 24px;
  }
  
  .social-icons {
    justify-content: flex-start;
  }

  .footer-wrapper {
    padding: 20px 0 40px;
    gap: 25px;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  .accordion-button {
    font-size: 16px;
    padding: 15px 20px;
  }
  
  .accordion-panel-content {
    padding: 20px;
  }
  
  .scroll-buttons {
    right: 15px;
    bottom: 15px;
  }
  
  .scroll-button {
    width: 45px;
    height: 45px;
  }
  
  .scroll-button svg {
    width: 20px;
    height: 20px;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  .modal-header {
    flex-direction: column;
    text-align: center;
  }
  
  .modal-icon {
    width: 40px;
    height: 40px;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-body p {
    font-size: 15px;
  }
  
  .modal-question {
    font-size: 16px;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
  
  .btn-modal {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .content-container {
    padding: 0 15px;
  }
  
  .page-title {
    font-size: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .page-code,
  .page-college {
    font-size: 13px;
  }
  
  .favorite-button {
    padding: 10px 15px;
  }
  
  .favorite-button span {
    font-size: 14px;
  }
  
  .tab-button {
    padding: 12px 20px;
    font-size: 16px;
  }
  
  .section-title {
    font-size: 18px;
  }
  
  .info-list li {
    font-size: 14px;
    padding: 10px 0;
  }
  
  .place-label,
  .score-label {
    font-size: 13px;
  }
  
  .place-value,
  .score-value {
    font-size: 14px;
  }
  
  .accordion-button {
    font-size: 15px;
    padding: 12px 15px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .accordion-panel-content {
    padding: 15px;
    overflow-x: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .accordion-panel-content p {
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .contact-label {
    font-size: 14px;
  }

  .contact-phone {
    font-size: 20px;
  }
  
  .contact-email,
  .contact-address {
    font-size: 14px;
  }
  
  .social-icons img {
    width: 35px;
    height: 35px;
  }
}

/* Пейзажная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-menu {
    overflow-y: auto;
  }
  
  .mobile-menu-list {
    margin-bottom: 15px;
  }
  
  .mobile-menu-link {
    padding: 10px 0;
  }
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ПРЕДУПРЕЖДЕНИЯ
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.modal-icon {
  width: 48px;
  height: 48px;
  color: var(--pk-purple);
  flex-shrink: 0;
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--pk-black);
  margin: 0;
}

.modal-body {
  margin-bottom: 25px;
}

.modal-body p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--pk-black);
  margin-bottom: 15px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-question {
  font-weight: bold;
  color: var(--pk-purple);
  font-size: 18px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .modal-buttons {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.btn-modal {
  padding: 12px 24px;
  font-size: 16px;
  font-family: Geometria, sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-modal-no {
  background: var(--pk-dark-white);
  color: var(--pk-black);
}

.btn-modal-no:hover {
  background: #e0e0e0;
}

.btn-modal-yes {
  background: var(--pk-purple);
  color: white;
}

.btn-modal-yes:hover {
  background: var(--pk-dark-purple);
}

/* ============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================ */
.mobile-menu {
  position: fixed;
  top: 100px;
  left: 0;
  width: 100%;
  height: calc(100vh - 100px);
  background: white;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-inner {
  padding: 20px;
}

.mobile-menu-timer-block {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.mobile-menu-timer-label {
  font-size: 14px;
  color: var(--pk-gray);
  font-weight: 500;
}

.mobile-menu-timer {
  font-size: 20px;
  font-weight: bold;
  color: #5FC1CF;
  text-shadow: 0 0 10px rgba(95, 193, 207, 0.5);
}

.mobile-menu-timer.warning {
  color: #fbbf24;
  animation: pulse-warning 1s infinite;
}

.mobile-menu-timer.danger {
  color: #ef4444;
  animation: pulse-warning 0.5s infinite;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--pk-light-gray);
}

.mobile-menu-item:last-child {
  border-bottom: none;
}

.mobile-menu-link {
  display: block;
  padding: 15px 0;
  font-size: 18px;
  font-family: Geometria, sans-serif;
  font-weight: 500;
  color: var(--pk-black);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.notifications-badge {
  position: absolute;
  top: 10px;
  right: 0;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.mobile-menu-link:hover {
  color: var(--pk-purple);
}

.mobile-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--pk-dark-white);
  border-radius: 8px;
  text-decoration: none;
  color: var(--pk-black);
  transition: background 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: Geometria, sans-serif;
  font-size: 16px;
}

.mobile-menu-btn:hover {
  background: var(--pk-light-gray);
  text-decoration: none;
}

.quest-mobile-exit-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.quest-mobile-exit-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.quest-mobile-exit-btn img {
  filter: brightness(0) invert(1);
}

.mobile-menu-btn img {
  width: 24px;
  height: 24px;
}

.mobile-menu-btn span {
  font-size: 16px;
  font-weight: 500;
}

/* Модальное окно уведомлений */
.quest-notifications-modal-content {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.quest-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.quest-notifications-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.quest-notification-item {
  background: rgba(139, 92, 246, 0.1);
  border-left: 4px solid #8B5CF6;
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-notification-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.quest-notification-content {
  flex: 1;
  font-size: 14px;
  color: #fff;
}

.quest-notification-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.quest-no-notifications {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  padding: 30px 0;
}

.quest-clear-notifications-btn {
  width: 100%;
  padding: 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-clear-notifications-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.7);
}

/* Блокировка прокрутки body при открытом меню */
body.mobile-menu-open {
  overflow: hidden;
}

/* ============================================
   КВЕСТ-ИГРА "КИБЕР-КВЕСТ АБИТУРИЕНТА"
   Аниме-киберпанк стиль с неоновыми эффектами
   ============================================ */

/* --- Приветственный экран --- */
.quest-welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.quest-welcome-content {
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 25px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

/* Стили для скроллбара в приветственном экране */
.quest-welcome-content::-webkit-scrollbar {
  width: 8px;
}

.quest-welcome-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.quest-welcome-content::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

.quest-welcome-content::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}

.quest-logo-section {
  text-align: center;
  margin-bottom: 30px;
}

.quest-logo {
  height: 80px;
  width: auto;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.quest-title {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  margin: 0 0 10px 0;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
}

.quest-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* --- Правила игры --- */
.quest-rules-block {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.quest-rules-title {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  margin: 0 0 15px 0;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.quest-rules-text {
  color: #FFFFFF;
  font-size: 14px;
  line-height: 1.6;
}

.quest-rules-text p {
  margin-bottom: 10px;
  color: #FFFFFF;
}

.quest-rules-text ol {
  padding-left: 20px;
  margin: 10px 0;
  color: #FFFFFF;
}

.quest-rules-text li {
  margin-bottom: 8px;
  color: #FFFFFF;
}

.quest-rules-text p {
  margin-bottom: 10px;
}

.quest-rules-text ol {
  padding-left: 20px;
  margin: 10px 0;
}

.quest-rules-text li {
  margin-bottom: 8px;
}

.quest-coding-link {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(139, 92, 246, 0.3);
}

.quest-coding-link a {
  color: #5FC1CF;
  text-decoration: underline;
}

.quest-coding-link a:hover {
  color: #8B5CF6;
  text-decoration: none;
}

.quest-login-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.quest-login-toggle-btn {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-family: Geometria, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-login-toggle-btn.active {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border-color: #8B5CF6;
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.quest-login-toggle-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* --- Форма регистрации --- */
.quest-registration-form,
.quest-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quest-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-label {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

.quest-input {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-family: Geometria, sans-serif;
  transition: all 0.3s ease;
}

.quest-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.quest-input:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

.quest-input-error {
  font-size: 13px;
  color: #ff6b6b;
  display: none;
}

.quest-input-error.visible {
  display: block;
}

.quest-input-success {
  font-size: 13px;
  color: #4ade80;
  display: none;
}

.quest-input-success.visible {
  display: block;
}

.quest-start-btn {
  padding: 16px 30px;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quest-start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.quest-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Игровой интерфейс --- */
.quest-game-interface {
  position: relative;
}

/* --- Верхняя панель с таймером --- */
.quest-top-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 15px 20px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-timer-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quest-timer-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.quest-timer {
  font-size: 24px;
  font-weight: bold;
  color: #5FC1CF;
  text-shadow: 0 0 10px rgba(95, 193, 207, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-timer:hover {
  color: #8B5CF6;
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
}

.quest-timer.warning {
  color: #fbbf24;
  animation: pulse-warning 1s infinite;
}

.quest-timer.danger {
  color: #ef4444;
  animation: pulse-warning 0.5s infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.quest-hints-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.quest-hints-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.quest-hint-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-hint-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.quest-hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Панель найденных букв --- */
.quest-letters-panel {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85) 0%, rgba(109, 40, 217, 0.85) 100%);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 20px;
  border: 2px solid rgba(167, 139, 250, 0.6);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5), inset 0 0 30px rgba(167, 139, 250, 0.15);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 90%;
  min-width: 300px;
}

.quest-letters-label {
  font-size: 13px;
  color: #FFFFFF;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(167, 139, 250, 0.5);
  flex-shrink: 0;
}

.quest-collected-letters {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.5) transparent;
}

.quest-collected-letters::-webkit-scrollbar {
  height: 4px;
}

.quest-collected-letters::-webkit-scrollbar-track {
  background: transparent;
}

.quest-collected-letters::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.5);
  border-radius: 2px;
}

.quest-letter-tile {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: default;
  transition: all 0.3s ease;
  animation: letter-appear 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  user-select: none;
}

@keyframes letter-appear {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes letter-glow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
    opacity: 1;
  }
  50% {
    text-shadow: 0 0 40px rgba(139, 92, 246, 1);
    opacity: 0.8;
  }
}

/* Бегущая буква */
.quest-running-letter {
  animation: letter-glow 1s infinite;
  will-change: left, top;
}

/* Мини-игра: Угадай фишинговую ссылку */
.phishing-game-block {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(109, 40, 217, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
}

.phishing-game-header {
  text-align: center;
  margin-bottom: 20px;
}

.phishing-game-header h4 {
  font-size: 20px;
  font-weight: bold;
  color: #8B5CF6;
  margin: 0 0 10px 0;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.phishing-game-header p {
  font-size: 14px;
  color: #8B5CF6;
  font-weight: 500;
  margin: 0;
}

.phishing-game-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.phishing-link-btn {
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(109, 40, 217, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 10px;
  color: #8B5CF6;
  font-size: 14px;
  font-family: Geometria, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  text-decoration: none;
  display: block;
}

.phishing-link-btn:hover {
  border-color: rgba(139, 92, 246, 0.8);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(109, 40, 217, 0.2) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.phishing-link-btn.correct {
  border-color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.3) 0%, rgba(34, 197, 94, 0.3) 100%);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
  pointer-events: none;
}

.phishing-link-btn.wrong {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.phishing-game-message {
  text-align: center;
  font-size: 14px;
  color: #8B5CF6;
  font-weight: 600;
  min-height: 20px;
  padding: 10px;
  border-radius: 8px;
}

.phishing-game-message.success {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.2);
}

.phishing-game-message.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* Мини-игра: Приветствие айтишника */
.hello-world-game-block {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(109, 40, 217, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.hello-world-game-header {
  text-align: center;
  margin-bottom: 20px;
}

.hello-world-game-header h4 {
  font-size: 20px;
  font-weight: bold;
  color: #8B5CF6;
  margin: 0 0 10px 0;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.hello-world-instruction {
  font-size: 14px;
  color: #8B5CF6;
  font-weight: 600;
  margin: 0 0 15px 0;
}

.hello-world-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.hello-world-input {
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 8px;
  color: #363E52;
  font-size: 16px;
  font-family: Geometria, sans-serif;
  outline: none;
  transition: all 0.3s ease;
}

.hello-world-input:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.hello-world-submit-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.2) 100%);
  border: 2px solid rgba(74, 222, 128, 0.5);
  border-radius: 10px;
  color: #4ade80;
  font-size: 14px;
  font-weight: 600;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hello-world-submit-btn:hover {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.3) 0%, rgba(34, 197, 94, 0.3) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(74, 222, 128, 0.4);
}

.hello-world-message {
  text-align: center;
  font-size: 16px;
  color: #8B5CF6;
  font-weight: 700;
  min-height: 30px;
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
  transition: all 0.3s ease;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.hello-world-message.success {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.3);
  border: 2px solid #22c55e;
  font-size: 18px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.hello-world-message.error {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.3);
  border: 2px solid #ef4444;
  font-size: 18px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Анимация выигрыша для Hello World */
@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

@keyframes win-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.quest-virus {
  position: fixed;
  font-size: 40px;
  cursor: pointer;
  z-index: 10001;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: manipulation;
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.8));
  animation: virus-pulse 2s ease-in-out infinite, virus-float 3s ease-in-out infinite;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.quest-virus:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 20px rgba(74, 222, 128, 1));
}

@keyframes virus-pulse {
  0%, 100% {
    opacity: 0.7;
    filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.8));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(74, 222, 128, 1));
  }
}

@keyframes virus-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(5deg);
  }
  75% {
    transform: translateY(-10px) rotate(-5deg);
  }
}

@media (max-width: 767px) {
  .quest-running-letter {
    font-size: 48px;
  }
}

.quest-letter-tile:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.quest-letter-tile.removing {
  animation: letter-disappear 0.3s ease forwards;
}

@keyframes letter-disappear {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}

/* --- Поле ввода ответа --- */
.quest-answer-section {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90%;
  max-width: 500px;
}

.quest-answer-container {
  display: flex;
  gap: 10px;
  width: 100%;
}

.quest-answer-input {
  flex: 1;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(109, 40, 217, 0.2) 100%);
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 10px;
  color: #8B5CF6;
  font-size: 16px;
  font-weight: 600;
  font-family: Geometria, sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.quest-answer-input::placeholder {
  color: rgba(139, 92, 246, 0.6);
}

.quest-answer-input:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(109, 40, 217, 0.3) 100%);
  color: #A78BFA;
}

.quest-check-btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border: none;
  border-radius: 10px;
  color: #1a1a2e;
  font-size: 16px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.quest-check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.4);
}

.quest-answer-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  min-height: 20px;
}

.quest-answer-message.error {
  color: #ff6b6b;
}

.quest-answer-message.success {
  color: #4ade80;
}

/* --- Модальные окна --- */
.quest-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
}

.quest-modal-overlay.active {
  display: flex;
}

.quest-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
  text-align: center;
}

/* Кнопка закрытия в хедере уведомлений */
.quest-notifications-modal-content .quest-modal-close-btn {
  position: relative;
  z-index: 10002;
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 16px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quest-modal-title {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  margin: 0 0 20px 0;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.quest-hint-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 20px;
}

.quest-modal-close-btn,
.quest-close-simple-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-modal-close-btn:hover,
.quest-close-simple-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

/* --- Модальное окно результата --- */
.quest-result-header {
  margin-bottom: 20px;
}

.quest-result-icon {
  font-size: 64px;
  margin-bottom: 15px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.quest-result-title {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  margin: 0;
}

.quest-result-message {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 25px;
  line-height: 1.6;
  white-space: pre-wrap; /* Поддержка переноса строк */
}

.quest-rating-section {
  margin-bottom: 25px;
}

.quest-rating-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
}

.quest-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.quest-star {
  font-size: 36px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quest-star:hover,
.quest-star.active {
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
  transform: scale(1.1);
}

.quest-comment {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: Geometria, sans-serif;
  resize: vertical;
  transition: all 0.3s ease;
}

.quest-comment::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.quest-comment:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.quest-submit-rating-btn,
.quest-exit-btn,
.quest-logout-btn,
.quest-return-game-btn,
.quest-finish-btn {
  padding: 14px 30px;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
}

.quest-submit-rating-btn:hover,
.quest-exit-btn:hover,
.quest-logout-btn:hover,
.quest-return-game-btn:hover,
.quest-finish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.quest-logout-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.quest-logout-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.quest-return-game-btn {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.quest-return-game-btn:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.4);
}

/* --- Конверт с буквой --- */
.quest-envelope {
  position: fixed;
  font-size: 48px;
  cursor: pointer;
  z-index: 9999;
  animation: envelope-fly 5s linear forwards;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
}

@keyframes envelope-fly {
  0% {
    top: 100px;
    right: 20px;
    opacity: 0;
    transform: scale(0);
  }
  10% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    top: 50%;
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* --- Призрачная буква --- */
.quest-ghost-letter {
  position: fixed;
  font-size: 32px;
  font-weight: bold;
  color: rgba(139, 92, 246, 0.6);
  background: rgba(139, 92, 246, 0.2);
  padding: 10px 15px;
  border-radius: 10px;
  border: 2px solid rgba(139, 92, 246, 0.4);
  cursor: pointer;
  z-index: 9998;
  animation: ghost-fade 2s ease-in-out forwards;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

@keyframes ghost-fade {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* --- Глобальный баг-хантер --- */
.quest-glitch-element {
  position: fixed;
  bottom: 200px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: rgba(239, 68, 68, 0.2);
  border: 2px dashed #ef4444;
  border-radius: 10px;
  cursor: pointer;
  z-index: 9997;
  animation: glitch-pulse 2s infinite;
  display: none;
}

.quest-glitch-element.visible {
  display: block;
}

.quest-glitch-element.fixed {
  background: rgba(74, 222, 128, 0.2);
  border: 2px solid #4ade80;
  border-style: solid;
  animation: none;
}

@keyframes glitch-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* --- Админ-панель --- */
.quest-admin-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  z-index: 10002;
  overflow-y: auto;
  padding: 20px;
}

.quest-admin-content {
  max-width: 1200px;
  margin: 0 auto;
}

.quest-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.quest-admin-title {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  margin: 0;
}

.quest-admin-close-btn {
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  border-radius: 10px;
  color: #ef4444;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-admin-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

.quest-admin-stats {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.quest-admin-subtitle {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  margin: 0 0 20px 0;
}

.quest-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.quest-stat-card {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.quest-stat-value {
  display: block;
  font-size: 36px;
  font-weight: bold;
  color: #5FC1CF;
  margin-bottom: 5px;
}

.quest-stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.quest-rating-chart {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  height: 200px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.quest-chart-bar {
  flex: 1;
  background: linear-gradient(to top, #8B5CF6, #6D28D9);
  border-radius: 8px 8px 0 0;
  min-height: 20px;
  position: relative;
  transition: all 0.3s ease;
}

.quest-chart-bar:hover {
  opacity: 0.8;
}

.quest-chart-value {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #fff;
}

.quest-chart-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.quest-players-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.quest-players-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.quest-players-table th,
.quest-players-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.quest-players-table th {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.quest-players-table td {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.quest-players-table tr:hover {
  background: rgba(139, 92, 246, 0.1);
}

.quest-delete-btn {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-delete-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

.quest-create-player-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border: none;
  border-radius: 10px;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: bold;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-create-player-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.4);
}

.quest-admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Адаптивность для квеста --- */
@media (max-width: 767px) {
  .quest-welcome-content {
    padding: 15px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-height: 85vh;
    overflow-y: auto;
  }

  .quest-title {
    font-size: 18px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .quest-subtitle {
    font-size: 13px;
    line-height: 1.3;
  }

  .quest-rules-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .quest-rules-text ol {
    padding-left: 20px;
  }

  .quest-rules-text li {
    margin-bottom: 6px;
  }

  .quest-top-panel {
    top: 70px;
    right: 10px;
    padding: 10px 15px;
  }

  .tab-buttons-container {
    position: relative;
    top: 0;
    padding: 15px 0;
  }

  .tab-buttons {
    flex-direction: column;
    padding: 0 20px;
    gap: 10px;
  }

  .tab-button {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
  }

  .quest-timer-block {
    display: none;
  }

  .mobile-menu-timer-block {
    display: flex;
  }

  .quest-timer {
    font-size: 20px;
  }

  .quest-letters-panel {
    bottom: 130px;
    padding: 10px 15px;
    max-width: 98%;
    min-width: 280px;
    gap: 8px;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.85) 0%, rgba(109, 40, 217, 0.85) 100%);
    border: 2px solid rgba(167, 139, 250, 0.6);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5), inset 0 0 30px rgba(167, 139, 250, 0.15);
  }

  .quest-letters-label {
    font-size: 11px;
    color: #FFFFFF;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(167, 139, 250, 0.5);
    font-weight: 600;
  }

  .quest-collected-letters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.5) transparent;
  }

  .quest-letter-tile {
    width: 32px;
    height: 32px;
    font-size: 16px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }

  .quest-answer-section {
    bottom: 20px;
    width: calc(100% - 120px);
    max-width: calc(100% - 120px);
    left: 60px;
    transform: none;
  }

  .quest-answer-container {
    flex-direction: column;
    gap: 8px;
  }

  .quest-answer-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(109, 40, 217, 0.2) 100%);
    border: 2px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
  }

  .quest-check-btn {
    width: 100%;
    padding: 12px 20px;
  }

  .quest-admin-header {
    flex-direction: column;
    gap: 15px;
  }

  .quest-stats-grid {
    grid-template-columns: 1fr;
  }

  .quest-rating-chart {
    height: 150px;
  }

  .quest-players-table th,
  .quest-players-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Мини-игра: Взлом пароля (графический ключ) */
.bruteforce-game-block {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(109, 40, 217, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
}

.bruteforce-game-header {
  text-align: center;
  margin-bottom: 20px;
}

.bruteforce-game-header h4 {
  font-size: 20px;
  font-weight: bold;
  color: #8B5CF6;
  margin: 0 0 10px 0;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.bruteforce-game-header p {
  font-size: 14px;
  color: #8B5CF6;
  font-weight: 500;
  margin: 0;
}

.pattern-lock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

#patternCanvas {
  display: block;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.1);
  cursor: crosshair;
  touch-action: none;
  position: relative;
  z-index: 1;
}

.pattern-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pattern-reset-btn,
.pattern-submit-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pattern-reset-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
  border: 2px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: Geometria, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.pattern-reset-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
  transform: translateY(-2px);
}

.pattern-reset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pattern-submit-btn {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.2) 100%);
  border: 2px solid rgba(74, 222, 128, 0.5);
  color: #4ade80;
}

.pattern-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.3) 0%, rgba(34, 197, 94, 0.3) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(74, 222, 128, 0.4);
}

.pattern-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pattern-message {
  text-align: center;
  font-size: 14px;
  color: #8B5CF6;
  font-weight: 600;
  min-height: 20px;
  padding: 10px;
  border-radius: 8px;
}

.pattern-message.success {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.2);
}

.pattern-message.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* ============================================
   МИНИ-ИГРА: ВЗЛОМ СЕЙФА (ГРАФИЧЕСКИЙ КЛЮЧ)
   ============================================ */
.safe-button {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    border: none;
    border-radius: 10px;
    color: white;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
    margin-top: 15px;
}

.safe-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.7);
}

.safe-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.safe-modal-content {
    background: #2a2a3a;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 30%),
                      linear-gradient(145deg, #3a3a4a, #1a1a2a);
    border-radius: 30px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 3px solid rgba(180, 150, 100, 0.8);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(0,0,0,0.5);
    color: white;
    position: relative;
}

.safe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 15px;
}

.safe-modal-title {
    font-size: 26px;
    font-weight: bold;
    text-shadow: 0 0 10px #ffaa00;
    color: #ffd700;
    margin: 0;
    letter-spacing: 2px;
}

.safe-modal-close-btn {
    background: rgba(200, 50, 50, 0.3);
    border: 1px solid #ff4444;
    border-radius: 50%;
    color: #ff8888;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.safe-modal-close-btn:hover {
    background: rgba(255, 68, 68, 0.5);
    color: white;
    transform: scale(1.1);
}

.safe-modal-body {
    text-align: center;
}

.safe-image {
    font-size: 70px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px gold);
}

.safe-hint {
    font-size: 18px;
    color: #ffd966;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid #ffaa00;
    display: inline-block;
}

.pattern-container {
    background: #111;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #555;
    box-shadow: inset 0 0 20px #000;
}

#patternCanvas {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 300px;
    height: auto;
    background: #222;
    border-radius: 20px;
    cursor: crosshair;
    touch-action: none;
}

.pattern-reset-btn {
    background: #ffaa00;
    border: none;
    border-radius: 30px;
    color: #1a1a2e;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 25px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid #ffdd88;
}

.pattern-reset-btn:hover {
    background: #ffc34d;
    transform: translateY(-2px);
}

.safe-message {
    margin-top: 20px;
    font-size: 18px;
    min-height: 28px;
    font-weight: 600;
    color: #ffd700;
}

.attempt-counter {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 10px;
}

@media (max-width: 767px) {
    .safe-modal-content {
        padding: 20px;
    }
    .safe-image {
        font-size: 50px;
    }
    #patternCanvas {
        max-width: 250px;
    }
}

/* ============================================
   АНИМАЦИЯ ВЫИГРЫША
   ============================================ */
.safe-win-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10002;
    display: none;
}

.safe-win-animation.active {
    display: block;
}

.win-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

.win-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: win-pulse 1s ease-in-out;
}

@keyframes win-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.safe-open-animation {
    animation: safe-shake 0.5s ease-in-out;
}

@keyframes safe-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}
