/* styles.css */
body {
    margin: 0;
    overflow: hidden;
    background: black;
    font-family: Arial, sans-serif;
    color: white;
}

#stars {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

#startScreen {
    position: fixed;
    width: 100%;
    height: 100%;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#startBtn {
    padding: 20px 40px;
    font-size: 20px;
    background: black;
    color: white;
    border: 2px solid white;
    cursor: pointer;
}

#ticker {
    position: fixed;
    top: 0;
    width: 100%;
    height: 40px;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    display: none;
}

#tickerText {
    position: absolute;
    white-space: nowrap;
    color: yellow;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    top: 12px;
    left: 100%;
    animation: scrollText 10s linear infinite;
}

@keyframes scrollText {
    from { left: 100%; }
    to { left: -100%; }
}

.window {
    width: 600px;
    background: #111;
    border: 2px solid #333;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 5;
}

.titlebar {
    height: 30px;
    background: black;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #333;
    font-family: 'Press Start 2P', monospace;
}

.windowButtons {
    display: flex;
    gap: 5px;
}

.winBtn {
    width: 28px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    color: white;
    border: 1px solid white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

@keyframes rainbow {
    0% { background-position: 0%; }
    100% { background-position: 400%; }
}

.field {
    margin: 0 20px 15px 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
}

select {
    width: 100%;
    padding: 8px;
    background: black;
    color: white;
    border: 1px solid #444;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin: 20px;
}

button {
    background: black;
    color: white;
    border: 1px solid white;
    cursor: pointer;
    padding: 10px 15px;
}

.cookieWindow {
    width: 600px;
    background: #111;
    border: 2px solid white;
    padding: 40px;
    font-family: 'Press Start 2P', monospace;
    text-align: center;
}

.cookieTitle {
    font-size: 20px;
    margin-bottom: 30px;
}

.cookieText {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 40px;
}

.cookieButtons {
    display: flex;
    justify-content: space-around;
}

.cookieDecline,
.cookieAccept {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 15px 30px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.cookieDecline {
    background: #7a0000;
    color: white;
}

.cookieAccept {
    background: #006b00;
    color: white;
}

.cookieDecline:hover,
.cookieAccept:hover {
    transform: scale(1.1);
}

.musicBtn {
    width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    border: 1px solid white;
    color: white;
    cursor: pointer;
}

.icon-btn {
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-btn:hover {
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modalContent {
    background: black;
    border: 2px solid white;
    padding: 20px;
    position: relative;
}

.modalClose {
    position: absolute;
    top: -25px;
    right: 0;
    cursor: pointer;
}

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

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

.attention {
    animation: bounce1 3s infinite;
}

.attention:nth-child(2) {
    animation: bounce2 4s infinite;
}

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

.placeholder {
    height: 200px;
    margin: 20px;
    position: relative;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.placeholder canvas {
    position: relative;
    z-index: 1;
    display: block;
}

.placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 3px solid transparent;
    background: linear-gradient(90deg, red, orange, yellow, green, cyan, blue, violet, red) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    background-size: 400% 100%;
    animation: rainbow 6s linear infinite;
    pointer-events: none;
    z-index: 10;
}

#changelogTab {
    position: fixed;
    left: calc(50% - 300px - 44px);
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 140px;
    background: #111;
    border: 2px solid #333;
    border-right: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: left 0.35s ease;
}

#changelogTab.visible {
    display: flex;
}

#changelogTab.open {
    left: calc(50% - 300px - 44px - 220px);
}

.changelogLabel {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    font-weight: bold;
    color: white;
    animation: flicker 2.5s infinite;
    user-select: none;
    padding-left: 6px;
}

@keyframes flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.2; }
    97% { opacity: 1; }
    98% { opacity: 0.1; }
    99% { opacity: 0.9; }
}

#changelogPanel {
    position: fixed;
    left: calc(50% - 300px - 220px);
    top: 50%;
    transform: translateY(-50%) translateX(220px);
    width: 220px;
    max-height: 400px;
    background: #0a0a0a;
    border: 2px solid #333;
    border-right: none;
    overflow-y: auto;
    z-index: 4;
    display: none;
    transition: transform 0.35s ease;
    scrollbar-width: thin;
    scrollbar-color: #333 #0a0a0a;
}

#changelogPanel.visible {
    display: block;
}

#changelogPanel.open {
    transform: translateY(-50%) translateX(0%);
}

.changelogItem {
    padding: 12px 14px;
    border-bottom: 1px solid #222;
}

.changelogItem:last-child {
    border-bottom: none;
}

.changelogDate {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #ffcc00;
    margin-bottom: 6px;
}

.changelogItem p {
    margin: 0;
    font-size: 11px;
    color: #ccc;
    line-height: 1.5;
}

#animatedTitle,
#animatedTitle span {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 11px;
}
/* =====================
   ANIMATED TITLE — outer glow flicker (не весь titlebar)
===================== */
@keyframes titleGlow {
    0%,  88%, 100% { text-shadow: 0 0 0px transparent; }
    90%  { text-shadow: 0 0 6px white, 0 0 12px white; }
    92%  { text-shadow: 0 0 2px rgba(255,255,255,0.3); }
    94%  { text-shadow: 0 0 8px white, 0 0 16px rgba(255,255,255,0.6); }
    96%  { text-shadow: 0 0 3px rgba(255,255,255,0.4); }
    98%  { text-shadow: 0 0 10px white, 0 0 20px white; }
}
#animatedTitle {
    animation: titleGlow 3.5s infinite;
}
/* Span-ы внутри не должны переопределять анимацию родителя */
#animatedTitle span {
    animation: wave 1s ease-in-out infinite;
}

/* =====================
   HOVER CARD
===================== */
#hoverCard {
    position: fixed;
    width: 200px;
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 14px;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.8);
}
#hoverCard.visible {
    display: flex;
}
.hoverPhoto {
    width: 100%;
    aspect-ratio: 1;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hoverPhoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hoverText p {
    margin: 0 0 5px 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #ccc;
    line-height: 1.6;
}

/* =====================
   DOCK BOUNCE
===================== */
@keyframes dockBounce {
    0%   { transform: translateY(0);     }
    8%   { transform: translateY(-22px); }
    16%  { transform: translateY(0);     }
    22%  { transform: translateY(-11px); }
    28%  { transform: translateY(0);     }
    33%  { transform: translateY(-5px);  }
    38%  { transform: translateY(0);     }
    100% { transform: translateY(0);     }
}
.dockBounce {
    animation: dockBounce 2.8s ease infinite;
}

/* SFX button width */
#sfxBtn {
    width: 38px;
    font-size: 6px;
    font-family: 'Press Start 2P', monospace;
    letter-spacing: -0.5px;
}

/* =====================
   PROJECTS WINDOW
===================== */
#projectsWindow {
    width: 340px;
    position: fixed;
    left: calc(50% + 300px + 20px);
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    z-index: 5;
}
#projectsWindow.visible {
    display: flex;
}
.projectsFilters {
    padding: 12px 14px 8px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
.filterGroup { margin-bottom: 10px; }
.filterLabel {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #ffcc00;
    display: block;
    margin-bottom: 6px;
}
.filterCheckboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filterCheckboxes label {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.filterCheckboxes input[type=checkbox] {
    accent-color: #ffcc00;
    cursor: pointer;
    width: 12px;
    height: 12px;
}
.projectsList {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #333 #0a0a0a;
}
.projectsLoading, .projectsEmpty {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #555;
    text-align: center;
    padding: 30px 0;
}
.projectCard {
    border: 1px solid #2a2a2a;
    background: #0d0d0d;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: border-color 0.2s;
}
.projectCard:hover { border-color: #444; }
.projectCardHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}
.projectTitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: white;
    line-height: 1.4;
}
.projectDate {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}
.projectDesc {
    font-size: 11px;
    color: #aaa;
    line-height: 1.6;
    margin: 0 0 10px 0;
}
.projectTags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    padding: 3px 6px;
    border-radius: 2px;
}
.tagStack  { background: #1a1a2e; color: #7b7bff; border: 1px solid #2a2a4e; }
.tagTopic  { background: #1a2e1a; color: #7bff7b; border: 1px solid #2a4e2a; }
.projectLink {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #ffcc00;
    text-decoration: none;
}
.projectLink:hover { text-decoration: underline; }