/* ============================================
   БАЗОВЫЕ СТИЛИ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4ECDC4;
    --secondary-color: #FF6B6B;
    --accent-color: #FFD700;
    --bg-color: #1a1a2e;
    --text-color: #fff;
    --card-bg: rgba(255, 255, 255, 0.95);
    --locked-color: #666;
    --open-color: #4ECDC4;
    --completed-color: #FFD700;
    --transition-speed: 0.3s;
    --teal-border: #4ECDC4;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    -webkit-user-drag: none;
    user-select: none;
}

/* Блокируем перетаскивание картинок */
.main-frame-bg,
.character-img,
.about-character,
.game-character,
.loading-piglet {
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* ============================================
   ЭКРАН ЗАГРУЗКИ
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeOutLoading 0.5s ease 2s forwards;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-piglet {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: #FFB6C1;
    border-radius: 50%;
    position: relative;
    animation: bounce 1s ease infinite;
}

.loading-piglet::before,
.loading-piglet::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 40px;
    background: #FFB6C1;
    border-radius: 50%;
    top: -10px;
}

.loading-piglet::before { left: 10px; transform: rotate(-20deg); }
.loading-piglet::after { right: 10px; transform: rotate(20deg); }

.loading-bar {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    width: 0;
    height: 100%;
    background: var(--accent-color);
    border-radius: 5px;
    animation: loadingProgress 1.5s ease forwards;
}

@keyframes loadingProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes fadeOutLoading {
    to { opacity: 0; visibility: hidden; }
}

/* ============================================
   ГЛАВНОЕ МЕНЮ — ВНЕШНЯЯ РАМКА
   ============================================ */
.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Внешняя жёлтая рамка */
.outer-border {
    width: 99vw;
    height: 98vh;
    max-width: 1800px;
    max-height: 1000px;
    position: relative;
    border: 5px solid var(--accent-color);
    border-radius: 40px;
    overflow: hidden;
}

/* Фоновое изображение университета (Rectangle 1) */
.outer-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('details/Rectangle 1.png') no-repeat center center;
    background-size: cover;
    z-index: 0;
}

/* Затемнение фона */
.outer-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   ЗАГОЛОВОК PIGLET — ЧЁРНАЯ ПЛАШКА
   ============================================ */
.title-bar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 0px 165px;
    border-radius: 30px;
    border: 3px solid var(--accent-color);
    z-index: 1000;
}

.title-bar h1 {
    color: white;
    font-size: 50px;
    letter-spacing: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}

.title-logo {
    max-height: 46px;
    display: block;
}

/* ============================================
   ОСНОВНАЯ РАМКА — БИРЮЗОВАЯ
   ============================================ */
.main-frame {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -75%);
    left: 50%;
    width: 55%;
    max-width: 700px;
    height: 44%;
    max-height: 380px;
    min-height: 260px;
    border: 6px solid var(--teal-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.5), inset 0 0 40px rgba(78, 205, 196, 0.1);
    background: linear-gradient(180deg, rgba(78, 205, 196, 0.15) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(78, 205, 196, 0.1) 100%);
    z-index: 1000;
}

.main-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(78, 205, 196, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.main-frame-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* ============================================
   ПЕРСОНАЖ
   ============================================ */
.character {
    position: relative;
    z-index: 3;
    width: 450px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: -87px;
    cursor: pointer;
}

.character-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    transition: transform 1s ease-in-out;
}

.character:hover .character-img {
    animation: piggyBreathe 4s ease-in-out infinite;
}

@keyframes piggyBreathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    75% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.character::before {
    display: none;
}

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

/* ============================================
   РЕЧЕВОЙ ПУЗЫРЬ
   ============================================ */
.speech-bubble {
    position: absolute;
    top: 60px;
    right: -20px;
    background: #fff;
    border: 3px solid #4169E1;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    z-index: 4;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #4169E1 transparent;
}

.speech-img {
    max-height: 30px;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #4169E1 transparent;
}

/* ============================================
   НИЖНИЕ КОНТРОЛЫ — КНОПКИ
   ============================================ */
.bottom-controls {
    position: absolute;
    bottom: 11%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 1000;
}

/* Контейнер кнопок */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* Подпись под "Играть" */
.btn-subtitle {
    display: block;
    font-size: 13px;
    font-weight: normal;
    opacity: 0.75;
    margin-top: 2px;
    letter-spacing: 1px;
}

/* Текст "Карта кампуса" через псевдоэлемент */
.menu-btn-play::after {
    content: 'Карта кампуса';
    display: block;
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    font-size: 14px;
    font-weight: normal;
    opacity: 0.75;
    letter-spacing: 1.5px;
    pointer-events: none;
}

/* Сдвигаем текст "Играть" вверх */
.menu-btn-play {
    padding-top: 6px;
}

/* Кнопки — цветастые */
.menu-btn {
    width: 320px;
    height: 68px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    cursor: pointer;
    font-size: 26px;
    font-weight: bold;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.menu-btn img {
    max-width: 100%;
    max-height: 100%;
}

.menu-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.menu-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Стили кнопки карты кампуса — удалено */

.menu-btn-play {
    background: linear-gradient(180deg, #66BB6A, #388E3C);
    border-color: rgba(0, 80, 0, 0.4);
}

.menu-btn-settings {
    background: linear-gradient(180deg, #42A5F5, #1565C0);
    border-color: rgba(0, 50, 100, 0.4);
}

.menu-btn-about {
    background: linear-gradient(180deg, #FFA726, #E65100);
    border-color: rgba(100, 50, 0, 0.4);
}

/* ============================================
   КАРТА КАМПУСА
   ============================================ */
.campus-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #90EE90 60%, #228B22 100%);
    display: none;
    z-index: 100;
    overflow: hidden;
}

.campus-map.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Кнопка назад на карте */
.back-btn-map {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--secondary-color), #e55a5a);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 110;
    transition: all var(--transition-speed);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.back-btn-map:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.back-btn-map img {
    max-width: 100%;
    max-height: 100%;
}

/* Заголовок карты */
.map-title {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 0px 30px;
    border-radius: 30px;
    border: 3px solid var(--accent-color);
    z-index: 110;
}

.map-title h2 {
    color: white;
    font-size: 28px;
    letter-spacing: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}

/* Контейнер карты */
.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

/* SVG пути */
.map-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.map-paths path {
    stroke: #8B4513;
    stroke-width: 4;
    fill: none;
    stroke-dasharray: 10, 5;
    animation: pathDash 1s linear infinite;
}

.map-paths path.path-unlocked {
    stroke: var(--open-color);
    filter: drop-shadow(0 0 5px var(--open-color));
}

.map-paths path.path-completed {
    stroke: var(--completed-color);
    filter: drop-shadow(0 0 5px var(--completed-color));
}

@keyframes pathDash {
    to { stroke-dashoffset: -15; }
}

/* Уровни на карте */
.map-levels {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px;
    z-index: 2;
}

.level-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    transform: translate(-50%, -50%);
    font-size: 30px;
}

.level-node .level-number {
    font-size: 14px;
    font-weight: bold;
    margin-top: 2px;
}

.level-node .level-name {
    display: none;
    position: absolute;
    bottom: -25px;
    font-size: 10px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
}

/* Состояния уровней */
.level-node.level-locked {
    background: linear-gradient(135deg, #888, #666);
    border: 4px solid #555;
    filter: grayscale(100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.level-node.level-open {
    background: linear-gradient(135deg, var(--open-color), #45B7AA);
    border: 4px solid #3AA89B;
    animation: levelPulse 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes levelPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(78, 205, 196, 0.3);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.level-node.level-completed {
    background: linear-gradient(135deg, var(--completed-color), #FFC700);
    border: 4px solid #E6B800;
    cursor: pointer;
}

.level-node.level-completed::after {
    content: '⭐';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    animation: starSpin 3s linear infinite;
}

@keyframes starSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.level-node:hover:not(.level-locked) {
    transform: translate(-50%, -50%) scale(1.15) !important;
}

.level-node:active:not(.level-locked) {
    transform: translate(-50%, -50%) scale(0.95) !important;
}

/* Информация об игроке */
.player-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 30px;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    color: white;
    text-align: center;
    z-index: 110;
}

.player-score {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.score-icon {
    margin-right: 5px;
}

.player-progress {
    font-size: 14px;
    opacity: 0.8;
}

/* ============================================
   ПОПАП УРОВНЯ
   ============================================ */
.level-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.level-popup-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.level-popup {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.popup-header h3 {
    font-size: 22px;
    color: #333;
}

.popup-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    transition: color var(--transition-speed);
}

.popup-close:hover {
    color: var(--secondary-color);
}

.popup-body {
    text-align: center;
}

.popup-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.popup-body p {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.popup-status {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}

.popup-status.status-open {
    background: #E8F5E9;
    color: #4CAF50;
}

.popup-status.status-completed {
    background: #FFF8E1;
    color: #FF9800;
}

.popup-start-btn {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #45B7AA);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.popup-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.4);
}

/* ============================================
   ПОПАП ЗАКРЫТОГО УРОВНЯ
   ============================================ */
.locked-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.locked-popup-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.locked-popup {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: shakePop 0.5s ease, popIn 0.4s ease;
}

@keyframes shakePop {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

.locked-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: lockShake 1s ease infinite;
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.locked-popup h3 {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.locked-popup p {
    color: #666;
    margin-bottom: 25px;
}

.locked-close-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #666, #888);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.locked-close-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   ЭКРАН ИГРЫ
   ============================================ */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
    animation: screenSlideIn 0.5s ease;
}

@keyframes screenSlideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-screen-container {
    max-width: 700px;
    width: 90%;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.level-header {
    text-align: center;
    margin-bottom: 30px;
}

.level-icon-display {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
}

.level-header h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.level-progress-bar {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.question-container {
    text-align: center;
}

.question-number {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.question-text {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option-btn {
    padding: 15px 20px;
    font-size: 18px;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: bold;
}

.option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.option-btn.correct {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-color: #388E3C;
    animation: correctPop 0.5s ease;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.option-btn.wrong {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border-color: #c62828;
    animation: wrongShake 0.5s ease;
}

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

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.result-container {
    text-align: center;
    padding: 20px;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: resultBounce 1s ease;
}

@keyframes resultBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.result-container h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.result-container p {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.result-score {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 25px;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.result-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.retry-btn { background: linear-gradient(135deg, #FF9800, #F57C00); }
.next-btn { background: linear-gradient(135deg, #4CAF50, #45a049); }
.map-btn { background: linear-gradient(135deg, #2196F3, #1976D2); }

.game-character {
    width: 100px;
    height: 100px;
    margin: 20px auto 0;
    background: url('drive-download-20260322T102816Z-1-001/Персонаж\ игрв.png') no-repeat center center;
    background-size: contain;
}

.game-character::before {
    display: none;
}

.game-character.happy { animation: happyJump 0.5s ease 3; }

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

.game-character.sad { animation: sadShake 0.5s ease; }

@keyframes sadShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* ============================================
   ЭКРАНЫ (настройки, о нас)
   ============================================ */
.screen-content {
    color: white;
    font-size: 32px;
    text-align: center;
}

.screen-content h2 {
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.settings-panel {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.setting-item label {
    font-size: 16px;
}

.setting-item input[type="range"] {
    width: 120px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.reset-progress-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    transition: all var(--transition-speed);
}

.reset-progress-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(244, 67, 54, 0.4);
}

.about-panel {
    max-width: 500px;
    margin: 0 auto;
}

.about-character {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: url('drive-download-20260322T102816Z-1-001/Персонаж\ игрв.png') no-repeat center center;
    background-size: contain;
    animation: characterFloat 3s ease-in-out infinite;
}

.about-character::before {
    display: none;
}

.about-panel p {
    font-size: 18px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.about-version {
    margin-top: 30px;
    font-size: 14px !important;
    opacity: 0.7;
}

.back-btn {
    margin-top: 30px;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--secondary-color), #e55a5a);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

/* ============================================
   ЭФФЕКТЫ ПЕРЕХОДОВ
   ============================================ */
.screen-fade {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.screen-fade.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   КОНФЕТТИ
   ============================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .outer-border {
        width: 99vw;
        height: 98vh;
        border-width: 3px;
        border-radius: 30px;
    }

    .title-bar {
        padding: 0px 50px;
    }

    .title-bar h1 {
        font-size: 30px;
        letter-spacing: 4px;
    }

    .main-frame {
        width: 72%;
        height: 40%;
        top: 50%;
        transform: translate(-50%, -75%);
        left: 50%;
        border-width: 4px;
    }

    .character {
        width: 350px;
        height: 350px;
        margin-bottom: -40px;
    }

    .character::before {
        font-size: 50px;
    }

    .speech-bubble {
        right: -30px;
        font-size: 13px;
        padding: 6px 12px;
    }

    .menu-btn {
        width: 260px;
        height: 60px;
        font-size: 22px;
    }

    .map-title {
        padding: 0px 50px;
    }

    .map-title h2 {
        font-size: 30px;
        letter-spacing: 4px;
    }

    .level-node {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .level-node .level-number {
        font-size: 12px;
    }

    .options-container {
        grid-template-columns: 1fr;
    }

    .question-text {
        font-size: 18px;
    }

    .game-screen-container {
        padding: 20px;
    }

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

    .result-btn {
        width: 100%;
    }

    .popup-icon {
        font-size: 50px;
    }

    .level-popup {
        padding: 20px;
    }

    .locked-popup {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .title-bar h1 {
        font-size: 24px;
        letter-spacing: 3px;
    }

    .title-bar {
        padding: 0px 40px;
    }

    .map-title {
        padding: 0px 40px;
    }

    .map-title h2 {
        font-size: 24px;
        letter-spacing: 3px;
    }

    .main-frame {
        width: 85%;
        height: 36%;
        top: 50%;
        transform: translate(-50%, -75%);
        left: 50%;
        border-width: 3px;
    }

    .character {
        width: 280px;
        height: 280px;
        margin-bottom: -35px;
    }

    .menu-btn {
        width: 230px;
        height: 54px;
        font-size: 20px;
    }

    .bottom-controls {
        bottom: 8%;
        gap: 12px;
    }

    .menu-buttons {
        gap: 8px;
    }

    .player-info {
        padding: 10px 20px;
    }

    .player-score {
        font-size: 22px;
    }

    .back-btn-map {
        padding: 10px 18px;
        font-size: 14px;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Ландшафтная ориентация */
@media (orientation: landscape) and (max-height: 500px) {
    .outer-border {
        width: 99vw;
        height: 98vh;
        border-radius: 30px;
    }

    .main-frame {
        height: 55%;
        top: 50%;
        transform: translate(-50%, -75%);
        left: 50%;
    }

    .character {
        width: 250px;
        height: 250px;
        margin-bottom: -30px;
    }

    .menu-btn {
        width: 170px;
        height: 42px;
        font-size: 15px;
    }
}

/* ============================================
   ОТКЛЮЧЕНИЕ АНИМАЦИЙ
   ============================================ */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* ============================================
   ТЁМНАЯ ТЕМА
   ============================================ */

/* Затемнение основного фона */
body.dark-theme .outer-border::before {
    filter: brightness(0.5) saturate(0.7);
}

/* Затемнение фона основной рамки */
body.dark-theme .main-frame-bg {
    filter: brightness(0.6) saturate(0.8);
}

body.dark-theme .main-frame {
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.2), inset 0 0 40px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, rgba(78, 205, 196, 0.05) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(78, 205, 196, 0.05) 100%);
}

/* Тёмный заголовок */
body.dark-theme .title-bar {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Приглушённые кнопки */
body.dark-theme .menu-btn-play {
    background: linear-gradient(180deg, #2E7D32, #1B5E20);
}

body.dark-theme .menu-btn-settings {
    background: linear-gradient(180deg, #1565C0, #0D47A1);
}

body.dark-theme .menu-btn-about {
    background: linear-gradient(180deg, #E65100, #BF360C);
}

/* Речевой пузырь */
body.dark-theme .speech-bubble {
    background: #2a2a4a;
    color: #eee;
    border-color: #555;
}

body.dark-theme .speech-bubble::after {
    border-color: #555 transparent;
}

/* Карта кампуса */
body.dark-theme .campus-map {
    background: linear-gradient(180deg, #1a1a3e 0%, #2d4a3e 60%, #1a3a1a 100%);
}

body.dark-theme .map-title {
    background: rgba(0, 0, 0, 0.9);
}

body.dark-theme .level-popup,
body.dark-theme .locked-popup {
    background: rgba(30, 30, 50, 0.95);
    color: #eee;
}

body.dark-theme .popup-header h3 {
    color: #eee;
}

body.dark-theme .popup-body p {
    color: #ccc;
}

body.dark-theme .game-screen-container {
    background: rgba(30, 30, 50, 0.95);
    color: #eee;
}

body.dark-theme .question-text {
    color: #eee;
}

body.dark-theme .option-btn {
    background: linear-gradient(135deg, #3a3a5a, #4a4a6a);
    color: #eee;
}
