/* Главная haruhiism.ru: обои с Харухи под переливающимся розовым, розовое стекло, Comfortaa. */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&display=swap');

:root {
    --accent: #d81b60;
    --accent-2: #c2185b;
    --btn: var(--accent);   /* заливка кнопок: в тёмной теме темнее акцента, чтобы белый текст читался */
    --btn-2: var(--accent-2);
    --ink: #3a2430;
    --ink-2: #7a5566;
    --card: rgba(252, 228, 236, 0.9);
    --tile: rgba(255, 255, 255, 0.75);
    --line: #f8bbd0;
    --shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    --veil: linear-gradient(135deg, rgba(255, 230, 241, 0.5), rgba(255, 240, 246, 0.5), rgba(217, 241, 255, 0.5), rgba(230, 217, 255, 0.5));
}
@media (prefers-color-scheme: dark) {
    :root {
        --accent: #ff5fa2;
        --accent-2: #ff7fb5;
        --btn: #d0307a;
        --btn-2: #e0448c;
        --ink: #f3dbe7;
        --ink-2: #c3a3b6;
        --card: rgba(30, 18, 36, 0.88);
        --tile: rgba(50, 30, 58, 0.8);
        --line: #5a2a44;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        --page-bg: #1a1022;
        --veil: linear-gradient(135deg, rgba(26, 16, 48, 0.62), rgba(42, 18, 48, 0.6), rgba(16, 32, 58, 0.62), rgba(32, 16, 58, 0.62));
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Comfortaa', cursive;
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    background: var(--page-bg, #fce4ec);
}

/* фон: четыре обоев сменяют друг друга плавно, с лёгким приближением */
.slideshow-background { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--page-bg, #f3d9e4); }
.slide {
    position: absolute; inset: -2%;
    background-size: cover; background-position: center;
    opacity: 0;
    animation: slideFade 40s infinite ease-in-out;
    will-change: opacity, transform;
}
.s1 { background-image: url('img/bg-1.webp'); animation-delay: -2s; }
.s2 { background-image: url('img/bg-2.webp'); animation-delay: 8s; }
.s3 { background-image: url('img/bg-3.webp'); animation-delay: 18s; }
.s4 { background-image: url('img/bg-4.webp'); animation-delay: 28s; }
@keyframes slideFade {
    0% { opacity: 0; transform: scale(1); }
    5% { opacity: 1; }
    25% { opacity: 1; }
    32% { opacity: 0; transform: scale(1.06); }
    100% { opacity: 0; transform: scale(1.06); }
}
.gradient-overlay {
    position: absolute; inset: 0;
    background: var(--veil);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) {
    .slide { animation: none; }
    .s1 { opacity: 1; }
    .gradient-overlay { animation: none; }
}

/* страница */
.page { width: 92%; max-width: 640px; margin: 0 auto; padding: 32px 0 24px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border-radius: 15px; box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
h2 { font-size: 1.15rem; color: var(--accent); margin-bottom: 12px; }

/* шапка */
.hero { text-align: center; padding-top: 22px; }
.emblem {
    width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--btn); color: #fff; font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1;
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35), 0 4px 12px rgba(216, 27, 96, 0.35);
    transition: transform .2s;
}
.emblem b { display: block; font-size: 14px; font-weight: 400; margin-top: 3px; }
.emblem:hover { transform: rotate(-8deg) scale(1.06); }
.emblem:active { transform: scale(.94); }
.kicker { margin-top: 10px; font-size: .78rem; color: var(--ink-2); letter-spacing: .3px; }
.hero h1 { font-size: 2rem; color: var(--accent); margin: 4px 0 12px; }
.quote { font-size: .92rem; line-height: 1.55; color: var(--ink); max-width: 520px; margin: 0 auto; }
.quote cite { display: block; margin-top: 4px; font-size: .78rem; font-style: normal; color: var(--ink-2); }
.quote.show { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* доска */
.sos { display: block; text-decoration: none; color: var(--ink); border: 2px solid transparent; transition: transform .2s, border-color .2s; }
.sos:hover { transform: translateY(-3px); border-color: var(--accent); }
.sos-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sos-title { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.sos-title small { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.live { font-size: .78rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); display: inline-block; }
.live.on i { background: #43a047; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.sos-last { margin: 10px 0; padding: 10px 12px; background: var(--tile); border-radius: 10px; border: 1px solid var(--line); font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.sos-last .msg { display: block; }
.sos-last .who { display: block; margin-top: 4px; font-size: .76rem; color: var(--ink-2); }
.sos-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .8rem; color: var(--ink-2); }
.go { background: var(--btn); color: #fff; padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.sos:hover .go { background: var(--btn-2); }

/* сообщество */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.links a {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
    text-decoration: none; color: #fff; background: var(--btn); border-radius: 10px; font-weight: 700; font-size: .92rem;
    transition: background .3s ease, transform .2s ease;
}
.links a:hover { background: var(--btn-2); transform: translateY(-3px); }
.ic { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; }
.ic svg { width: 20px; height: 20px; fill: #fff; }

/* игры — неприметной строкой внизу */
.games-mini { align-self: center; text-align: center; font-size: .76rem; color: var(--ink-2); line-height: 1.8; background: var(--card); padding: 4px 14px; border-radius: 14px; max-width: 100%; }
.games-mini a { color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted currentColor; }
.games-mini a:hover { color: var(--accent); }
/* карточка игры «Бригада SOS» на главной */
.card.game { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); padding: 14px; box-shadow: var(--shadow), 0 0 0 3px var(--accent); transition: transform .2s; }
.card.game:hover { transform: translateY(-3px); }
.card.game .shot { position: relative; display: block; border-radius: 11px; overflow: hidden; }
.card.game .shot img { display: block; width: 100%; height: auto; }
.card.game .badge { position: absolute; left: 10px; top: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: #fff; background: var(--btn); padding: 3px 10px; border-radius: 12px; }
.card.game .game-title { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.card.game .game-sub { font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.card.game .game-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card.game .go { font-weight: 700; color: #fff; background: var(--btn); padding: 7px 18px; border-radius: 18px; }
.card.game .tr { font-size: .85rem; color: var(--accent); border-bottom: 1px dotted currentColor; cursor: pointer; }
.games-mini a.hot { color: var(--accent); font-weight: 700; border-bottom-style: solid; }

.foot { text-align: center; font-size: .76rem; color: var(--ink-2); padding: 6px 0 4px; }
.foot span { display: inline-block; max-width: 100%; background: var(--card); padding: 5px 12px; border-radius: 14px; line-height: 1.5; }

/* ↑↑↓↓←→←→BA */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.stars span { position: absolute; top: -40px; color: var(--accent); font-weight: 700; animation: fall 5.5s linear forwards; text-shadow: 0 0 8px rgba(255, 255, 255, .8); }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

@media (max-width: 520px) {
    .page { width: 100%; padding: 12px 12px 20px; gap: 12px; }
    .card { padding: 16px 14px; }
    .hero h1 { font-size: 1.6rem; }
    .links { grid-template-columns: repeat(2, 1fr); }
    .sos-title { font-size: 1.3rem; }
}
