/* Base styles provided by user */
html {
    text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Trebuchet MS', Arial, sans-serif;
    background-color: #f0ffe0;
    color: #013220;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hide overflow from rain effect */
    position: relative; /* Needed for positioning the rain */
}

a {
    color: #006400;
    text-decoration: none;
}

a:hover {
    color: #228B22;
}

.mascot {
    width: 200px;
    height: auto;
    margin-bottom: 15px;
}

/* New and adapted styles */
.sci-fi-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #006400;
    text-shadow: 0 0 5px rgba(129, 199, 132, 0.7), 0 0 10px rgba(0, 100, 0, 0.5);
    margin: 0 0 15px 0;
    letter-spacing: 2px;
    position: relative;
}

/* Glitch effect for title */
.glitch {
    position: relative;
    color: #4CAF50;
    text-shadow: 
        -1px -1px 0 #ff00c1, 
        1px 1px 0 #00ffff;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    background: #f0ffe0;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
}
.glitch::before {
    left: -2px;
    text-shadow: 1px 0 #00ffff;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(45% 0 56% 0); }
    100% { clip-path: inset(5% 0 96% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(95% 0 6% 0); }
    100% { clip-path: inset(55% 0 6% 0); }
}

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

header h1 {
    font-size: 48px;
    font-weight: bold;
    color: #006400;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin: 0;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    flex-grow: 1;
    position: relative;
    z-index: 2; /* Ensure main content is above the background */
}

.circle-container {
    width: clamp(320px, 90vw, 700px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    padding: 20px;
    box-sizing: border-box;
    background-color: #f0ffe0; /* Make opaque to hide background effect */
    border: 3px solid #81C784;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.circle-container.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.circle-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 25px;
    box-sizing: border-box;
}

.circle-content h2 {
    margin: 0 0 5px 0;
    font-size: 32px;
    color: #006400;
    font-family: 'Share Tech Mono', monospace;
}

.circle-content .subtitle {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2E8B57;
    max-width: 80%;
}

.quote {
    font-size: 14px;
    font-style: italic;
    line-height: 1.6;
    color: #013220;
    margin: 0;
    max-width: 90%;
}

@keyframes rotate-menu {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes counter-rotate-menu {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.circular-menu {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    animation: rotate-menu 360s linear infinite; /* Slowed down rotation */
    pointer-events: none; /* Отключаем клики на самом .circular-menu */
}

.circular-menu-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 50% 50%; /* Changed transform origin to center for correct counter-rotation */
    animation: counter-rotate-menu 360s linear infinite; /* Counter-rotation animation */
    pointer-events: auto; /* Кнопки кликабельны */
}

.circular-menu-item a {
    display: block;
    width: auto;
    min-width: 70px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 20px;
    background-color: #A5D6A7;
    color: #013220;
    transition: background-color 0.3s, transform 0.3s;
    white-space: nowrap;
    transform: translate(-50%, -50%); /* Center the link inside the orbiting div */
}

.circular-menu-item a:hover {
    background-color: #81C784;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 10;
}

.circular-menu-item a.bold {
    font-weight: bold;
}

.view {
    display: flex;
}

.view:not(.active) {
    display: none;
}

.hidden {
    display: none !important;
}

.back-button {
    cursor: pointer;
    text-decoration: underline;
    z-index: 100; /* Выше .circular-menu и .circular-menu-item */
    position: relative; /* Для поднятия над absolute-элементами */
    color: #2E8B57;
}

.back-button:hover {
    color: #006400;
}

/* Background Rain Effect */
#background-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(105vh);
    }
}

@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    .circle-container {
        flex-basis: auto;
        width: 90vw;
        max-width: 500px;
        min-width: 320px;
    }
}