@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Nunito+Sans:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Roboto+Mono:wght@400;500&display=swap');

:root {
    --primary-color: #7899d4;
    --secondary-color: #f7c5cc;
    --accent-color: #f3e5ab;
    --text-color: #4a4a4a;
    --bg-color: #fdfcfa;
    --container-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --font-header: 'Playfair Display', serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-accent: 'Montserrat', sans-serif;
    --font-code: 'Roboto Mono', monospace;
    --achievement-bg: #282828;
    --achievement-text: #ffffff;
    --achievement-accent: #96c93d;
    --team-modal-bg: rgba(40, 44, 52, 0.98);
    --team-card-bg: #21252b;
    --achievement-gallery-bg: rgba(50, 50, 60, 0.98);
    --achievement-gallery-item-locked: #4a4a55;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    transition: background 1s ease-in-out;
    scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* --- Скрыть вертикальный скроллбар на всех устройствах (глобально) --- */
html {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
html::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: opacity 1s ease-in-out;
}

.bg-reality {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0), radial-gradient(circle at 10px 10px, rgba(0,0,0,0.03) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 1;
}

.bg-digital-vortex {
    background: linear-gradient(-45deg, #0e0c1d, #1a143a, #3b2f6d, #5d4c92);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0;
}
.bg-digital-vortex.active-bg { opacity: 1; }

.bg-wonderland-room {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    opacity: 0;
}
.bg-wonderland-room.active-bg { opacity: 1; }
.bg-wonderland-room::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 20px, transparent 20px, transparent 40px), repeating-linear-gradient(-45deg, rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 20px, transparent 20px, transparent 40px);
    opacity: 0.5;
    transform: perspective(100px) rotateX(30deg) scale(1.5);
    transform-origin: bottom center;
}

.bg-cheshire-cat {
    background: radial-gradient(circle, #4a00e0, #8e2de2, #1c002e);
    background-size: 200% 200%;
    animation: gradientBG 20s ease infinite alternate;
    opacity: 0;
}
.bg-cheshire-cat.active-bg { opacity: 1; }
.bg-cheshire-cat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(200,100,250,0.1) 10px, rgba(200,100,250,0.1) 20px);
    animation: scrollStripes 60s linear infinite;
    opacity: 0.7;
}
@keyframes scrollStripes { to { background-position-y: -1000px; } }

.bg-caterpillar {
    background: linear-gradient(to bottom, #6a11cb 0%, #2575fc 100%);
    opacity: 0;
}
.bg-caterpillar.active-bg { opacity: 1; }
.bg-caterpillar::before {
    content: ''; position: absolute; width: 300px; height: 300px;
    left: 20%; top: 30%; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: smokeRing 15s infinite alternate;
}
.bg-caterpillar::after {
    content: ''; position: absolute; width: 400px; height: 400px;
    right: 15%; bottom: 20%; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: smokeRing 20s infinite alternate-reverse -5s;
}
@keyframes smokeRing {
    0% { transform: scale(0.8) translate(0,0); opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { transform: scale(1.3) translate(20px, -30px); opacity: 0.3; }
}

.bg-mad-hatter {
    background: #f0e6d2;
    opacity: 0;
}
.bg-mad-hatter.active-bg { opacity: 1; }
.bg-mad-hatter::before {
    content: ''; position: absolute; top:0; left:0; width:100%; height:100%;
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23a1887f' fill-opacity='0.1'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: jitterPattern 30s linear infinite;
}
@keyframes jitterPattern {
    0%, 100% { background-position: 0 0; }
    25% { background-position: 5px 5px; }
    50% { background-position: 0 10px; }
    75% { background-position: -5px 5px; }
}

.bg-empress {
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    opacity: 0;
}
.bg-empress.active-bg { opacity: 1; }
.bg-empress::before {
    content: ''; position: absolute; top:0; left:0; right:0; bottom:0;
    width:100%; height:100%;
    background-image: radial-gradient(white .5px, transparent .5px), radial-gradient(white .5px, transparent .5px);
    background-size: 30px 30px, 50px 50px;
    background-position: 0 0, 15px 15px;
    animation: starsShine 5s linear infinite alternate;
}
@keyframes starsShine { to { opacity: 0.3; } }

@keyframes gradientBG {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: var(--container-bg);
    padding: 40px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    margin: 0 auto 0 auto;
}

/* --- Исправление отступов контейнера на мобильных --- */
@media (max-width: 600px) {
  .container {
    max-width: 100vw;
    width: 100vw;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 16px;
    padding-bottom: 16px;
    box-sizing: border-box;
  }
}

.scene {
    display: none;
    animation: sceneFadeIn 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
.scene.active { display: block; }

h1, h2 {
    font-family: var(--font-header);
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 700;
}
h1 { font-size: 2.6em; line-height: 1.2; }
h2 { font-size: 2em; line-height: 1.3; margin-top: 10px; }

p {
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: left;
    color: var(--text-color);
}

.character-quote {
    font-family: var(--font-body);
    font-style: italic;
    color: #6c7a89;
    margin: 25px auto;
    padding: 15px 20px;
    border-left: 4px solid var(--secondary-color);
    background-color: #f9f9f9;
    border-radius: 0 8px 8px 0;
    max-width: 90%;
    text-align: left;
}
.character-quote::before {
    content: '“';
    font-family: var(--font-header);
    font-size: 1.8em;
    color: var(--secondary-color);
    float: left;
    margin-right: 8px;
    line-height: 0.8;
}

button, .choice-button {
    font-family: var(--font-accent);
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    margin: 10px 5px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.05em;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(120, 153, 212, 0.3);
    letter-spacing: 0.5px;
}
button:hover, .choice-button:hover {
    background-color: #607fa8;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 7px 15px rgba(96, 127, 168, 0.4);
}
button:active, .choice-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 5px rgba(120, 153, 212, 0.3);
}

.choices {
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.choices .choice-button { width: 90%; max-width: 380px; }
.choice-button.secondary {
    background-color: var(--accent-color);
    color: var(--text-color);
    box-shadow: 0 4px 10px rgba(243, 229, 171, 0.3);
}
.choice-button.secondary:hover {
    background-color: #e0d190;
    box-shadow: 0 7px 15px rgba(224, 209, 144, 0.4);
}

img.story-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 25px auto;
    box-shadow: 0 8px 25px var(--shadow-color);
    border: 1px solid #eee;
    display: block;
}

@keyframes sceneFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.dynamic-text-effect {
    font-style: italic;
    color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(120, 153, 212, 0.1);
    display: inline-block;
    margin-top: 10px;
    opacity: 1;
    transform-origin: center center;
}
@keyframes shrinkEffect {
    0% { transform: scale(1); opacity: 1; }
    80% { transform: scale(0.2); opacity: 0.8; }
    100% { transform: scale(0.1); opacity: 0; }
}
.is-shrinking { animation: shrinkEffect 2s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards; }
@keyframes growEffect {
    0% { transform: scale(1); }
    100% { transform: scale(2.5); }
}
.is-growing { animation: growEffect 1.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards; }

.minigame-container {
    padding: 25px;
    border: 1px dashed var(--primary-color);
    border-radius: 12px;
    margin: 30px 0;
    background-color: rgba(120, 153, 212, 0.05);
}
.color-picker-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.target-color-code {
    font-size: 1.2em;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: rgba(120, 153, 212, 0.1);
    border: 1px solid var(--primary-color);
    margin-bottom: 10px;
}
.color-options-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.color-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}
@keyframes shakeHorizontal {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.logo-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.logo-options img, .whack-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    padding: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
}
.logo-options img:hover, .whack-logo:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(247, 197, 204, 0.5);
}

.whack-a-mole-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    max-width: 450px;
    margin: 25px auto;
}
.whack-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 130px;
}
.whack-logo { border-radius: 50%; }
#logo_game_feedback, #whack_game_feedback, #color_game_feedback_start {
    font-weight: 600;
    margin-top: 15px;
    min-height: 20px;
}

.portal-effect {
    width: 85vw;
    max-width: 220px;
    height: 70px;
    font-size: 1em;
    border-radius: 10px;
    margin: 30px auto;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 1.1em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: rgba(120, 153, 212, 0.05);
}
.portal-effect::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: conic-gradient(var(--primary-color) 0deg, var(--secondary-color) 60deg, var(--accent-color) 120deg, var(--primary-color) 180deg, var(--secondary-color) 240deg, var(--accent-color) 300deg, var(--primary-color) 360deg);
    opacity: 0.2;
    animation: spinPortal 8s linear infinite;
    transition: opacity 0.3s ease;
}
.portal-effect:hover::before { opacity: 0.4; }
.portal-effect:hover {
    color: white;
    background-color: var(--primary-color);
    border-style: solid;
}
.portal-effect span { position: relative; z-index: 1; }
@keyframes spinPortal {
    from { transform: translate(-50%, -50%) rotate(0deg) scale(1); top: 50%; left: 50%; }
    to { transform: translate(-50%, -50%) rotate(360deg) scale(1); top: 50%; left: 50%; }
}

.digital-vortex {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-family: var(--font-accent);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.digital-vortex.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s;
}
.vortex-content {
    font-size: 1.5em;
    text-align: center;
    animation: pulseText 1.5s infinite alternate;
    padding: 20px;
    max-width: 80%;
}
.vortex-content span.char-anim {
    display: inline-block;
    opacity: 0;
    animation: fadeInChars 0.3s forwards;
}
@keyframes pulseText {
    from { transform: scale(0.95); opacity: 0.8; }
    to { transform: scale(1.05); opacity: 1; }
}
@keyframes fadeInChars { to { opacity: 1; } }
.vortex-rings {
    position: absolute; width: 100%; height: 100%;
    pointer-events: none;
}
.vortex-rings::before, .vortex-rings::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    border: 2px dashed var(--secondary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: expandRing 3s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
}
.vortex-rings::after { animation-delay: 1.5s; }
@keyframes expandRing {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 150vmax; height: 150vmax; opacity: 0; }
}

@keyframes popIn {
    0% { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    70% { transform: scale(1.1) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes fadeOutCorrect {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.7) translateY(-20px); filter: drop-shadow(0 0 8px limegreen); }
}
@keyframes fadeOutMiss {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8) translateY(10px); filter: grayscale(50%); }
}

#achievement-container {
    position: fixed; top: 20px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.achievement-toast {
    background-color: var(--achievement-bg); color: var(--achievement-text);
    padding: 12px 18px; border-radius: 8px; display: flex; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    min-width: 280px; max-width: 350px; font-family: var(--font-accent);
}
.achievement-toast.show { opacity: 1; transform: translateX(0); }
.achievement-icon {
    width: 40px; height: 40px; background-color: var(--achievement-accent);
    border-radius: 50%; margin-right: 15px; display: flex;
    justify-content: center; align-items: center; font-size: 1.5em; font-weight: bold;
}
.achievement-icon::before { content: '🏆'; }
.achievement-details { display: flex; flex-direction: column; }
.achievement-title { font-size: 0.95em; font-weight: 700; margin-bottom: 3px; line-height: 1.2; }
.achievement-subtitle { font-size: 0.8em; color: #aaa; }
.achievement-points { font-size: 0.8em; color: var(--achievement-accent); font-weight: bold; }

.easter-egg {
    cursor: pointer; text-decoration: underline; text-decoration-style: dotted;
    text-decoration-color: var(--secondary-color); transition: color 0.2s;
}
.easter-egg:hover { color: var(--highlight-color-1); }
.popup {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background-color: white; padding: 25px; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 3000;
    display: none; text-align: center; border: 2px solid var(--primary-color);
    max-width: 90%; width: 400px;
}
.popup-content img { max-width: 100px; margin-bottom: 15px; }
.popup-close {
    position: absolute; top: 10px; right: 15px; cursor: pointer;
    font-size: 1.8em; color: var(--text-color); line-height: 1;
}

.floating-team-button {
    position: fixed; bottom: 25px; left: 25px; background-color: #96c93d;
    color: white; font-family: var(--font-code); font-size: 1.8em; font-weight: 500;
    width: 60px; height: 60px; border-radius: 50%; border: none;
    display: flex; justify-content: center; align-items: flex-start; padding-top: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); cursor: pointer; z-index: 1500;
    transition: transform .3s ease, background-color .3s ease;
}
.floating-team-button:hover { background-color: #7fad2e; transform: scale(1.1) rotate(10deg); }

.team-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); z-index: 2500;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.team-modal-overlay.active { opacity: 1; visibility: visible; transition: opacity 0.4s ease, visibility 0s; }
.team-modal {
    background-color: var(--team-modal-bg); color: #abb2bf;
    padding: 30px 40px; border-radius: 15px; width: 90%; max-width: 750px;
    max-height: 85vh; overflow-y: auto; position: relative;
    /* Скрыть вертикальную полосу прокрутки, но оставить прокрутку */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
.team-modal::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.team-modal-overlay.active .team-modal { transform: scale(1) translateY(0); }
.team-modal-close {
    position: absolute; top: 15px; right: 20px; font-size: 2.5em;
    color: #61afef; cursor: pointer; transition: transform 0.2s ease; line-height: 1;
}
.team-modal-close:hover { transform: rotate(90deg) scale(1.1); color: #c678dd; }
.team-modal h2 {
    font-family: var(--font-code); color: #61afef; text-align: center;
    margin-bottom: 30px; font-size: 2em; border-bottom: 1px dashed #454a54; padding-bottom: 15px;
}
.team-members-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.team-member-card {
    background-color: var(--team-card-bg); border-radius: 10px; padding: 20px;
    text-align: center; border: 1px solid #323840;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.team-member-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.team-member-photo {
    width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
    margin-bottom: 15px; border: 3px solid #61afef;
}
.team-member-name {
    font-family: var(--font-accent); font-size: 1.3em; font-weight: 700;
    color: #e5c07b; margin-bottom: 8px;
}
.team-member-role {
    font-family: var(--font-code); font-size: 0.95em; color: #98c379;
    margin-bottom: 10px; line-height: 1.4;
}
.team-member-role strong { color: #abb2bf; }

.floating-achievements-button {
    position: fixed; bottom: 25px; right: 25px; background-color: var(--primary-color);
    color: white; font-family: var(--font-accent); font-size: 1.5em;
    width: 60px; height: 60px; border-radius: 50%; border: none;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); cursor: pointer; z-index: 1500;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.floating-achievements-button:hover { background-color: var(--secondary-color); transform: scale(1.1) rotate(-10deg); }

.achievements-gallery-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); z-index: 2600;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.achievements-gallery-overlay.active { opacity: 1; visibility: visible; transition: opacity 0.4s ease, visibility 0s; }
.achievements-gallery {
    background-color: var(--achievement-gallery-bg); color: var(--achievement-text);
    padding: 30px; border-radius: 15px; width: 90%; max-width: 600px;
    max-height: 85vh; overflow-y: auto; position: relative;
    overflow-x: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border: 1px solid #5c6370;
}
.achievements-gallery-overlay.active .achievements-gallery { transform: scale(1) translateY(0); }
.achievements-gallery-close {
    position: absolute; top: 15px; right: 20px; font-size: 2.5em;
    color: var(--primary-color); cursor: pointer; transition: transform 0.2s ease; line-height: 1;
}
.achievements-gallery-close:hover { transform: rotate(90deg) scale(1.1); color: var(--secondary-color); }
.achievements-gallery h2 {
    font-family: var(--font-header); color: var(--primary-color); text-align: center;
    margin-bottom: 25px; font-size: 1.8em; border-bottom: 1px solid #5c6370; padding-bottom: 10px;
}
.achievements-list { display: flex; flex-direction: column; gap: 15px; }
.achievement-item {
    background-color: var(--achievement-bg); padding: 15px; border-radius: 8px;
    display: flex; align-items: center; opacity: 0.5;
    border-left: 5px solid var(--achievement-gallery-item-locked);
}
.achievement-item.unlocked { opacity: 1; border-left-color: var(--achievement-accent); }
.achievement-item .achievement-icon { flex-shrink: 0; }
.achievement-item .achievement-details { text-align: left; }
.achievement-item .achievement-title { font-size: 1.1em; margin-bottom: 5px; }
.achievement-item .achievement-description { font-size: 0.85em; color: #b0b8c4; line-height: 1.4; }
.reset-achievements-button {
    display: block; margin: 30px auto 10px; padding: 10px 20px;
    background-color: var(--highlight-color-1); color: white;
    border: none; border-radius: 20px; cursor: pointer;
    font-family: var(--font-accent); transition: background-color 0.3s;
}
.reset-achievements-button:hover { background-color: #c51350; }

/* Стили для теста на тип дизайнера */
#scene_designer_test_q1 h2,
#scene_designer_test_q2 h2,
#scene_designer_test_q3 h2,
#scene_test_results h2 {
    color: var(--primary-color);
    font-family: var(--font-header);
    margin-bottom: 15px;
}

#scene_designer_test_q1 p,
#scene_designer_test_q2 p,
#scene_designer_test_q3 p {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
}

#scene_test_results p {
    text-align: center;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--text-color);
    margin-top: 10px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

#designer_type_result {
    color: var(--achievement-accent);
    font-weight: bold;
}

/* === Footer Styles === */
footer {
    width: 100vw;
    left: 0;
    right: 0;
    padding: 20px 0;
    background-color: var(--team-modal-bg, #282c34);
    color: #abb2bf;
    text-align: center;
    font-family: var(--font-code, 'Roboto Mono', monospace);
    font-size: 0.9em;
    position: relative;
    border-top: 1px solid #454a54;
    overflow: hidden;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.powered-by {
    opacity: 0.7;
}

.footer-link {
    color: var(--achievement-accent, #96c93d);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #c678dd;
    text-decoration: underline;
    text-decoration-style: dashed;
}

/* Анимация мигающего курсора */
.blinking-cursor {
    font-weight: bold;
    animation: blink 1s step-end infinite;
    color: var(--achievement-accent, #96c93d);
    opacity: 0;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Продвинутая анимация глитча для ника */
.glitch-text {
    position: relative;
    text-shadow: 0.05em 0 0 rgba(0, 255, 255, 0.75),
                 -0.025em -0.05em 0 rgba(255, 0, 0, 0.75),
                 0.025em 0.05em 0 rgba(0, 255, 0, 0.75);
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--team-modal-bg, #282c34);
    overflow: hidden;
    clip-path: inset(50% 50% 50% 50%);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00ff;
    animation: glitch-before 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00ffff, 1px 1px #ff00ff;
    animation: glitch-after 2s infinite linear alternate-reverse;
}

@keyframes glitch-before {
    0% { clip-path: inset(82% -6px 1% 0); }
    5% { clip-path: inset(49% -6px 40% 0); }
    10% { clip-path: inset(13% -6px 82% 0); }
    15% { clip-path: inset(28% -6px 48% 0); }
    20% { clip-path: inset(39% -6px 23% 0); }
    25% { clip-path: inset(43% -6px 50% 0); }
    30% { clip-path: inset(8% -6px 63% 0); }
    35% { clip-path: inset(56% -6px 38% 0); }
    40% { clip-path: inset(18% -6px 72% 0); }
    45% { clip-path: inset(93% -6px 1% 0); }
    50% { clip-path: inset(10% -6px 91% 0); }
    55% { clip-path: inset(55% -6px 11% 0); }
    60% { clip-path: inset(33% -6px 20% 0); }
    65% { clip-path: inset(82% -6px 1% 0); }
    70% { clip-path: inset(40% -6px 40% 0); }
    75% { clip-path: inset(13% -6px 82% 0); }
    80% { clip-path: inset(28% -6px 48% 0); }
    85% { clip-path: inset(39% -6px 23% 0); }
    90% { clip-path: inset(43% -6px 50% 0); }
    95% { clip-path: inset(8% -6px 63% 0); }
    100% { clip-path: inset(56% -6px 38% 0); }
}

@keyframes glitch-after {
    0% { clip-path: inset(34% 0 50% -4px); }
    5% { clip-path: inset(88% 0 1% -4px); }
    10% { clip-path: inset(45% 0 23% -4px); }
    15% { clip-path: inset(22% 0 30% -4px); }
    20% { clip-path: inset(5% 0 60% -4px); }
    25% { clip-path: inset(51% 0 10% -4px); }
    30% { clip-path: inset(74% 0 5% -4px); }
    35% { clip-path: inset(7% 0 84% -4px); }
    40% { clip-path: inset(40% 0 45% -4px); }
    45% { clip-path: inset(28% 0 15% -4px); }
    50% { clip-path: inset(51% 0 50% -4px); }
    55% { clip-path: inset(10% 0 5% -4px); }
    60% { clip-path: inset(80% 0 15% -4px); }
    65% { clip-path: inset(34% 0 50% -4px); }
    70% { clip-path: inset(88% 0 1% -4px); }
    75% { clip-path: inset(45% 0 23% -4px); }
    80% { clip-path: inset(22% 0 30% -4px); }
    85% { clip-path: inset(5% 0 60% -4px); }
    90% { clip-path: inset(51% 0 10% -4px); }
    95% { clip-path: inset(74% 0 5% -4px); }
    100% { clip-path: inset(7% 0 84% -4px); }
}

/* Анимация "пульсирующей линии" под футером */
footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--achievement-accent), transparent);
    animation: footerLinePulse 4s infinite ease-in-out;
}

@keyframes footerLinePulse {
    0% { width: 0%; opacity: 0.5; }
    50% { width: 60%; opacity: 1; }
    100% { width: 0%; opacity: 0.5; }
}

/* --- Мобильная адаптация --- */
@media (max-width: 600px) {
  body {
    font-size: 15px;
    padding: 0;
  }
  .container {
    max-width: 100vw;
    width: 100vw;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 16px;
    padding-bottom: 16px;
    box-sizing: border-box;
  }
  h1 {
    font-size: 1.5em;
  }
  h2 {
    font-size: 1.15em;
  }
  .character-quote {
    padding: 10px 8px;
    font-size: 0.98em;
  }
  .choices {
    gap: 10px;
  }
  .choices .choice-button {
    width: 100%;
    max-width: 100%;
    font-size: 1em;
    padding: 12px 8px;
  }
  button, .choice-button {
    padding: 12px 8px;
    font-size: 1em;
    margin: 7px 0;
  }
  .minigame-container {
    padding: 10px 2vw;
    margin: 15px 0;
  }
  .color-options-picker {
    gap: 6px;
  }
  .color-option {
    width: 36px;
    height: 36px;
  }
  .logo-options {
    gap: 8px;
  }
  .logo-options img, .whack-logo {
    width: 70px;
    height: 70px;
    padding: 2px;
  }
  .whack-a-mole-grid {
    gap: 7px;
    max-width: 98vw;
  }
  .whack-logo-container {
    min-height: 70px;
  }
  .portal-effect {
    width: 85vw;
    max-width: 220px;
    height: 70px;
    font-size: 1em;
    border-radius: 10px;
  }
  .vortex-content {
    font-size: 1.1em;
    padding: 10px;
  }
  .team-modal {
    padding: 12px 4vw;
    max-width: 99vw;
  }
  .team-members-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .team-member-photo {
    width: 70px;
    height: 70px;
  }
  .achievements-gallery {
    padding: 12px 4vw;
    max-width: 99vw;
  }
  .achievement-item {
    padding: 8px;
    font-size: 0.95em;
  }
  .popup {
    width: 95vw;
    max-width: 99vw;
    padding: 10px 2vw;
  }
  .popup-content img {
    max-width: 60px;
  }
  .floating-team-button, .floating-achievements-button {
    width: 44px;
    height: 44px;
    font-size: 1.1em;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding-top: 4px;
  }
}

/* --- Кнопки "команда" и "достижения" друг над другом справа --- */
@media (max-width: 600px), (min-width: 601px) {
  .floating-team-button, .floating-achievements-button {
    position: fixed;
    right: 10px;
    left: auto;
    margin: 0;
    z-index: 1500;
    /* размеры уже заданы выше */
  }
  .floating-team-button {
    bottom: 90px;
  }
  .floating-achievements-button {
    bottom: 20px;
  }
}

/* --- Корректировка расположения и выравнивания кнопок --- */
@media (min-width: 601px) {
  .floating-team-button {
    bottom: 90px;
  }
  .floating-achievements-button {
    bottom: 20px;
  }
}

@media (max-width: 600px) {
  .floating-team-button {
    bottom: 64px;
  }
  .floating-achievements-button {
    bottom: 10px;
  }
  .floating-team-button, .floating-achievements-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
  }
  .floating-team-button > *, .floating-achievements-button > * {
    margin: 0 auto;
    display: block;
    line-height: 1;
  }
}

.floating-team-button, .floating-achievements-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}
.floating-team-button > *, .floating-achievements-button > * {
  margin: 0 auto;
  display: block;
  line-height: 1;
}