:root {
    --accent-pink: #a84d6b;
    --muted-pink: #b97272;
    --deep-pink: #a27791;
    --bg-dark: #050508;
    --shadow-dark: #3d2a2f;
    --top-panel-h: 60px;
    --bottom-panel-h: 40px;
    --font-primary: 'Pixelify Sans', monospace;
    --font-secondary: 'Tiny5', monospace;
    --text-primary: #a27791;
    --text-secondary: #8d8d8d;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { background: var(--bg-dark); overflow: hidden; }
body {
    background: transparent; color: var(--text-secondary); font-family: var(--font-secondary);
    font-display: swap;
    height: 100vh; height: 100dvh;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}
.text-primary {
    font-family: var(--font-primary);
    color: var(--text-primary);
}
.text-secondary {
    font-family: var(--font-secondary);
    color: var(--text-secondary);
}
#neuro-bg { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1; pointer-events:none; }

/* === TOP PANEL === */
.top-panel {
    position: fixed; top:0; left:0; right:0;
    height: var(--top-panel-h);
    background: #050505;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    z-index:200;
}
.top-panel::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515);
}
.panel-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.9rem !important;
    text-shadow: 0 0 20px rgba(255,255,255,0.25);
    cursor: pointer;
    text-transform: uppercase;
    padding: 8px 0;
}
.panel-close {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}
.panel-close img { width:32px; height:32px; image-rendering:pixelated; }
.panel-close-label {
    font-size: 11px;
    margin-top: 3px;
    letter-spacing: 1px;
    text-transform: lowercase;
}

/* === LENIS WRAPPER === */
.journal-wrapper {
    height: calc(100vh - var(--top-panel-h) - var(--bottom-panel-h));
    height: calc(100dvh - var(--top-panel-h) - var(--bottom-panel-h));
    width: 100%;
    margin-top: var(--top-panel-h);
    overflow: hidden;
    position: relative;
    z-index: 10;
    touch-action: none;
}
.journal-horizontal {
    display: flex;
    height: 100%;
    width: max-content;
    will-change: transform;
}
.journal-horizontal::-webkit-scrollbar { display: none; }

.journal-page {
    flex: 0 0 100vw;
    width: 100vw;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 12px 15px 12px;
    box-sizing: border-box;
    min-height: 0;
}

/* ================= СТРАНИЦА 1 ================= */
.page1-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 8px;
}
.ticker-wrapper {
    flex-shrink: 0;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    padding: 5px 0;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}
.ticker {
    display: inline-block;
    font-size: 20px;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    text-shadow: 1px 1px 0 #2e2e2e, 2px 2px 0 #3d2a2f !important;
    animation: scrollTicker 150s linear infinite;
    pointer-events: auto;
}
.ticker-link {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
}
.ticker-link:hover {
    text-decoration: underline;
}
.ticker-wrapper:hover .ticker,
.ticker-wrapper.is-paused .ticker {
    animation-play-state: paused;
}
@keyframes scrollTicker {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* Десктоп: арт‑блок ~60%, архив ~20% → соотношение около 3:1 */
.art-archive-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    margin: 4px 0 6px;
    flex-shrink: 1;
}
.art-block {
    flex: 0 1 clamp(320px, 46vw, 560px);
    width: clamp(320px, 46vw, 560px);
    max-height: calc(100dvh - 280px);
    aspect-ratio: 1/1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.art-block img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}
.archive-block {
    flex: 0 0 clamp(140px, 18vw, 220px);
    width: clamp(140px, 18vw, 220px);
    aspect-ratio: 1/1;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 8px;
}
.archive-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
}
.archive-label {
    color: var(--text-primary);
    font-size: 30px;
    text-transform: uppercase;
    font-family: var(--font-primary);
}

/* Строка для Paint (десктоп) */
.paint-row {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}
.page1-controls-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
}
.paint-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.paint-trigger-img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    cursor: pointer;
}

/* Нижняя строка с mood (десктоп) */
.bottom-row {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}
.bottom-cell {
    display: flex;
    justify-content: center;
}
.mood-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.mood-img-large {
    width: 52px;
    height: 52px;
    image-rendering: pixelated;
}
.mood-label {
    font-family: var(--font-primary);
    font-size: 30px;
    color: var(--text-primary);
    margin-top: 5px;
    text-transform: lowercase;
}
.control-label,
.twitter-label {
    font-family: var(--font-primary);
    font-size: 30px;
    margin-top: 4px;
    text-transform: lowercase;
    letter-spacing: 1px;
}
.twitter-section {
    flex-direction: column;
}

@media (min-width: 769px) {
    .page1-layout {
        justify-content: flex-start;
    }
    .page1-controls-row {
        display: grid;
        grid-template-columns: clamp(320px, 46vw, 560px) clamp(120px, 16vw, 190px);
        column-gap: clamp(12px, 2vw, 24px);
        justify-content: center;
        align-items: start;
        width: max-content;
        margin: 2px auto 0;
    }
    .page1-controls-row .paint-row,
    .page1-controls-row .bottom-row {
        margin-top: 0;
        justify-content: center;
    }
    .page1-controls-row .mood-label {
        margin-top: 4px;
        font-size: 30px;
    }
}

/* ================= СТРАНИЦА 2: TWITTER ================= */
.carousel-section {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 0;
    gap: 0;
}
.carousel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.carousel img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.carousel img:not(.active) { display: none; }
.hashtag-row {
    flex-shrink: 0;
    text-align: center;
    padding: 5px 0 0 0;
}
.hashtag {
    font-size: 20px;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    text-shadow: 1px 1px 0 #4b3d3d, 2px 2px 0 #3d2a2f !important;
}
.twitter-section {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5px;
}
.x-btn-img {
    width: 44px;
    cursor: pointer;
}

/* ================= СТРАНИЦА 3: FONTS ================= */
.fonts-layout {
    justify-content: flex-start;
    padding-top: 10px;
    gap: 15px;
}
.mx-narrow-image {
    width: min(100%, 1016px);
    aspect-ratio: 1016 / 379;
    overflow: hidden;
    border: none;
    background: transparent;
}
.mx-narrow-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mx-description {
    font-size: 20px;
    color: var(--text-secondary);
    margin: 5px 0;
    text-align: center;
}
.styler-embedded {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}
.styler-input {
    width: 100%;
    background: #000;
    color: #fff;
    padding: 10px 15px;
    font-family: var(--font-secondary);
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515) 1;
    text-align: center;
    font-size: 20px;
}
.styler-preview {
    background: #000;
    padding: 12px;
    margin-top: 10px;
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    font-family: 'Arial', 'Helvetica', sans-serif;
    word-break: break-all;
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515) 1;
    color: #888888;
}

/* ================= СТРАНИЦА 4: SOUND ================= */
.sound-layout {
    justify-content: space-evenly;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    gap: clamp(18px, 3vh, 40px);
    padding: clamp(10px, 2vh, 24px) 0;
}
.text-synth-embedded {
    width: min(92%, 820px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.text-synth-embedded h4 {
    font-family: var(--font-primary);
    font-size: 30px;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.sound-layout .styler-input {
    width: 100%;
    max-width: 820px;
    min-height: 46px;
    font-size: 20px;
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515) 1;
}
#ttsSpeakBtn {
    margin-top: 2px;
}
#ttsStatus {
    min-height: 18px;
    font-family: var(--font-secondary);
    color: var(--text-secondary);
    font-size: 13px;
}
.spotify-icon {
    color: #1DB954;
    cursor: pointer;
    padding: 10px;
    font-size: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.radio-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
}
.radio-img-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
}
.spotify-label {
    font-family: var(--font-primary);
    font-size: 20px;
    color: var(--text-primary);
    margin-top: 8px;
    text-transform: uppercase;
}

/* ================= СТРАНИЦА 4: PINTEREST ================= */
.pinterest-layout {
    justify-content: center;
    gap: 20px;
}
.pinterest-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.pinterest-nav-btn {
    background: #79434a;
    color: #fff;
    border: 2px solid #000;
    padding: 10px 15px;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    font-family: var(--font-primary);
}
.pinterest-nav-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}
.pinterest-widget-container {
    max-width: 400px;
    width: 100%;
}

/* ================= СТРАНИЦА 5: TOP + TETRIS ================= */
.top-tetris-layout {
    justify-content: center;
    gap: 15px;
}
.top-title {
    font-size: 30px;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}
.top-players-framed {
    max-width: 400px;
    width: 80%;
    margin: 0 auto;
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515) 1;
    padding: 12px;
    background: #000;
}
.top-players-list {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    line-height: 1.4;
}
.top-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: var(--font-secondary);
}
.tetris-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}
.tetris-big img {
    width: 110px;
    image-rendering: pixelated;
}
.tetris-big span {
    font-size: 30px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    margin-top: 25px;
}

/* ================= СТРАНИЦА 6: FORUM + SUPPORT ================= */
.forum-support-layout {
    padding: 20px 15px;
    justify-content: space-between;
}
.forum-embedded {
    display: flex;
    width: 100%;
    flex: 1;
}
.forum-tabs-panel-embedded {
    width: 55px;
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 5px 0;
}
.forum-tab {
    padding: 10px 0;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid #3d2a2f;
    font-family: var(--font-primary);
    color: var(--text-primary);
}
.forum-tab.active {
    border-left: 3px solid #a27791;
    color: #fff;
}
.forum-content-embedded {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
}
.forum-content-embedded h3 {
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    margin-bottom: 15px;
}
.forum-content-embedded p {
    font-size: 15px;
    font-family: var(--font-secondary);
}
.forum-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

/* ================= УНИВЕРСАЛЬНАЯ КНОПКА ================= */
.universal-btn {
    cursor: pointer;
    border: 2px solid #000;
    background: #565656;
    padding: 0 0 3px 0;
    display: inline-block;
    text-decoration: none;
    user-select: none;
}
.universal-btn .btn-inner {
    display: block;
    background: #fff;
    border: 2px solid #a0a0a0;
    padding: 4px 12px;
    transform: translateY(-3px);
    transition: transform 0.08s;
}
.universal-btn .btn-inner span {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #000;
    text-transform: uppercase;
}
.universal-btn:active .btn-inner { transform: translateY(0); }

/* ================= МОДАЛКИ ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: #000;
    border: 4px solid transparent;
    border-image: linear-gradient(90deg, #4a1515, #8B3A3A, #a84d6b, #8B3A3A, #4a1515) 1;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-header {
    background: #000;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
}
.modal-title-text {
    font-size: 30px;
    color: var(--text-primary);
    text-shadow: 2px 2px 0 #000;
    font-family: var(--font-primary);
}
.modal-close-btn {
    background: #fff;
    color: #000;
    border: 2px solid #b97272;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
}
.modal-inner {
    padding: 20px;
    background: #000;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
}
.modal-inner p {
    font-family: var(--font-secondary);
    color: var(--text-secondary);
    font-size: 20px !important;
    line-height: 1.4;
}
.modal-inner iframe {
    width: 100%;
    border: 0;
}
.support-modal-inner {
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}
.contents-item {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid #79434a;
    cursor: pointer;
    color: var(--text-secondary) !important;
    text-shadow: 1px 1px 0 #aaa;
    font-family: var(--font-secondary);
    position: relative;
    overflow: hidden;
}
.contents-item pixel-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.contents-item:hover pixel-canvas {
    opacity: 1;
}
.contents-item:hover {
    background: #1a1a2a;
    color: #fff !important;
}

/* ================= BOTTOM PANEL ================= */
.bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-panel-h);
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.page-indicator {
    display: flex;
    justify-content: center;
    gap: 0;
    align-items: center;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: inset 1px 1px 0 #000000, inset -1px -1px 0 #dfdfdf;
    padding: 2px;
    height: 20px;
}
.dot {
    width: 12px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    margin: 0 1px;
    transition: none;
    cursor: pointer;
}
.dot.active {
    width: 12px;
    background: #000080;
    border-color: #000040 #0000a0 #0000a0 #000040;
    position: relative;
}
.dot.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: repeating-linear-gradient(
        90deg,
        #000080 0px,
        #000080 2px,
        #0000a0 2px,
        #0000a0 4px
    );
}
.dot:hover {
    background: #a0a0a0;
}
.dot.active:hover {
    background: #000080;
}

/* ================= АДАПТИВНОСТЬ (МОБИЛЬНЫЕ) ================= */
@media (max-width: 768px) {
    .top-panel { height: 50px; padding: 0 12px; }
    .panel-btn { font-size: 0.7rem; }
    .panel-close img { width: 28px; height: 28px; }
    .bottom-panel { height: 35px; }
    .page-indicator { height: 16px; padding: 1px; }
    .dot { width: 10px; height: 12px; margin: 0 1px; }
    .dot.active { width: 10px; }

    /* Мобильные: арт‑блок 60%, архив 20% */
    .art-archive-row {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin: 8px 0;
        padding: 0 8px;
    }
    .art-block {
        flex: 0 0 60%;
        aspect-ratio: 1/1;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .art-block img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        image-rendering: pixelated;
    }
    .archive-block {
        flex: 0 0 18%;
        aspect-ratio: 1/1;
        background: #0a0a0a;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        gap: 4px;
    }
    .archive-img {
        width: 35px;
        height: 35px;
    }
    .archive-label {
        color: var(--text-primary);
        font-size: 20px;
        text-transform: uppercase;
    }

    /* Paint — слева */
    .page1-controls-row {
        display: block;
        width: 100%;
    }
    .paint-row {
        display: flex;
        justify-content: flex-start;
        margin-top: 8px;
        padding-left: 30px;
    }
    .paint-cell {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .paint-trigger-img {
        width: 48px;
        height: 48px;
    }
    .control-label {
        font-size: 30px;
    }

    /* Mood — справа */
    .bottom-row {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
        padding-right: 15px;
    }
    .bottom-cell {
        display: flex;
        justify-content: flex-end;
    }
    .mood-img-large {
        width: 48px;
        height: 48px;
    }

    .mx-narrow-image {
        width: 100%;
        aspect-ratio: 1016 / 379;
    }
    .ticker { font-size: 20px; }
    .ticker { animation-duration: 180s; }
    .hashtag { font-size: 20px; }
    .x-btn-img { width: 40px; }
    .sound-layout {
        justify-content: center;
        gap: 24px;
        padding: 8px 0 16px;
    }
    .text-synth-embedded {
        width: 100%;
        gap: 10px;
    }
    .sound-layout .styler-input {
        min-height: 42px;
        font-size: 20px;
    }
    .modal-content {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    .support-modal-inner {
        min-height: 70vh;
        max-height: 80vh;
        padding: 5px;
    }
    .support-modal-inner iframe {
        min-height: 65vh;
    }
    .pinterest-nav {
        gap: 10px;
    }
    .pinterest-nav-btn {
        padding: 8px 12px;
        font-size: 20px;
    }
    .pinterest-widget-container {
        max-width: 280px;
    }
}