* {
    box-sizing: border-box;
}

html {
    background: #000;
    color-scheme: dark;
}

body {
    margin: 0;
    background: #000;
    color: #0f0;
    font-family: Menlo, Monaco, "Noto Sans Devanagari", "Courier New", monospace;
}

.container {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 40px;
    overflow: hidden;
    cursor: text;
}

#terminal {
    flex: 1;
    min-height: calc(100vh - 40px);
    padding: 10px;
    cursor: text;
    outline: 0;
}

.status-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    gap: 14px;
    min-height: 40px;
    padding: 8px 10px;
    overflow: hidden;
    background: #000;
    border-top: 1px solid #0f0;
    transition: transform 0.3s ease;
}

.status-bar.hidden,
:fullscreen .status-bar,
:-webkit-full-screen .status-bar {
    transform: translateY(100%);
    visibility: hidden;
}

.status-bar-content {
    display: flex;
    flex: 1;
    gap: 14px;
    overflow-x: auto;
}

.status-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 8px 10px;
    color: #0f0;
    font: inherit;
    white-space: nowrap;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.status-item:hover,
.status-item:focus-visible {
    color: #000;
    background: #0f0;
    outline: 0;
}

.status-item:not(:last-child)::after {
    position: absolute;
    right: -9px;
    color: #0f0;
    content: "|";
    opacity: 0.5;
}

.close-button {
    padding: 2px 10px;
    color: #0f0;
    font-family: inherit;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.modal {
    position: fixed;
    right: 10px;
    bottom: 58px;
    left: 10px;
    z-index: 1100;
    display: none;
    max-height: 75vh;
    overflow-y: auto;
    color: #0f0;
    background: #000;
    border: 1px solid #0f0;
    box-shadow: 0 0 18px rgba(0, 255, 0, 0.16);
}

.modal-content {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    max-width: 920px;
    margin: 0 auto;
    padding: 20px;
}

.language-group {
    flex: 1;
    min-width: 190px;
}

.language-group-title,
.settings-title {
    padding: 8px;
    margin-bottom: 8px;
    color: #9f9;
    border-bottom: 1px solid #174d27;
}

.language-option {
    padding: 7px 8px;
    line-height: 1.5;
    cursor: pointer;
}

.language-option:hover,
.language-option.selected {
    color: #000;
    background: #0f0;
}

.language-option a {
    color: inherit;
}

.settings-content,
.settings-group {
    width: 100%;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.setting-item > label:first-child {
    min-width: 145px;
}

.theme-options,
.sound-style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-option,
.sound-option {
    min-width: 32px;
    min-height: 32px;
    padding: 7px;
    border: 1px solid #174d27;
    cursor: pointer;
}

.theme-option.selected,
.sound-option.selected {
    border-color: #fff;
}

.theme-option.matrix { background: #00ff00; }
.theme-option.cyberpunk { background: #ff00ff; }
.theme-option.hacker { background: #00ffff; }
.theme-option.retro { background: #ffa500; }

.color-picker-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
}

.color-picker-wrapper input {
    width: 32px;
    height: 32px;
    opacity: 0;
}

.color-picker-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 1px solid #0f0;
    cursor: pointer;
}

input[type="range"] {
    flex: 1;
    min-width: 100px;
}

.switch input {
    width: 20px;
    height: 20px;
    accent-color: #0f0;
}

.crt-overlay,
.access-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.crt-overlay {
    z-index: 10;
    display: none;
}

.crt-overlay.enabled {
    display: block;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0, rgba(0, 0, 0, 0.18) 1px, transparent 1px, transparent 3px);
}

.access-overlay {
    z-index: 9999;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.88);
}

.access-overlay.show {
    display: grid;
}

.access-content {
    text-align: center;
}

.access-text {
    margin-bottom: 18px;
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 700;
    text-shadow: 0 0 12px #0f0;
}

.progress-bar {
    width: min(300px, 70vw);
    height: 4px;
    margin: 20px auto;
    background: #063;
}

.help-divider {
    border-top: 1px solid #174d27;
}

.about-section {
    padding: 48px 20px 90px;
    border-top: 1px solid #0f0;
}

.about-inner {
    max-width: 820px;
    margin: 0 auto;
}

.about-section h1 {
    margin: 0 0 18px;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.about-section h2 {
    margin: 42px 0 14px;
    font-size: 1.25rem;
}

.about-section p,
.about-section li {
    color: #9f9;
    line-height: 1.75;
}

.about-section a {
    color: #0f0;
    text-underline-offset: 4px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.guide-card {
    padding: 18px;
    background: #031006;
    border: 1px solid #174d27;
}

.guide-card h3 {
    margin: 0 0 8px;
}

.guide-card p {
    margin: 8px 0 14px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 720px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .setting-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .setting-item > label:first-child {
        min-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
