@import url('/css/fontawesome/css/all.min.css');

/* Poppy Playtime Fan Site — Themed CSS */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --primary-light: #fde8ea;
    --accent: #1d3557;
    --accent-light: #457b9d;
    --bg: #f1faee;
    --surface: #ffffff;
    --text: #1d3557;
    --text-secondary: #457b9d;
    --border: #a8dadc;
    --shadow: 0 2px 6px rgba(29,53,87,0.08), 0 1px 3px rgba(29,53,87,0.06);
    --shadow-lg: 0 10px 20px rgba(29,53,87,0.12), 0 4px 8px rgba(29,53,87,0.06);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --sidebar-width: 280px;
    --gap: 24px;
    --yellow: #f4a261;
    --yellow-light: #fff3e0;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a { transition: color 0.2s; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ======= HEADER ======= */
header {
    background: var(--accent);
    border-bottom: 3px solid var(--primary);
    position: static;
    z-index: 100;
}

.header-inner { padding: 0 20px; }

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.site-logo:hover { opacity: 0.85; }

.site-logo i { color: var(--primary); font-size: 1.2rem; }

.unofficial-notice {
    background: rgba(244,162,97,0.2);
    color: var(--yellow);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(244,162,97,0.3);
}

/* Nav */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    padding-bottom: 8px;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.nav-dropdown { position: relative; }

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    z-index: 200;
    padding: 4px;
}

.nav-dropdown:hover .nav-dropdown-content { display: block; }

.nav-dropdown-content a {
    display: block;
    padding: 9px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.nav-dropdown-content a:hover, .nav-dropdown-content a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.arrow { font-size: 0.7em; transition: transform 0.3s; }

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Burger animation when open */
nav.open ~ .header-top .mobile-menu-btn span:nth-child(1),
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ======= MAIN LAYOUT ======= */
.main-layout {
    display: flex;
    gap: var(--gap);
    max-width: var(--max-width);
    margin: var(--gap) auto;
    padding: 0 20px;
}

.content-area { flex: 1; min-width: 0; }

.sidebar { width: var(--sidebar-width); flex-shrink: 0; }

/* ======= BREADCRUMBS ======= */
.breadcrumbs {
    padding: 14px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .separator { margin: 0 8px; color: var(--border); }

/* ======= GAME HEADER ======= */
.game-header {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.game-header h1 {
    color: var(--text);
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 12px;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    background: var(--primary);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-info {
    background: var(--accent);
}

.badge-warning {
    background: var(--yellow);
    color: var(--accent);
}

/* ======= INTRODUCTION ======= */
.introduction {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    margin-bottom: var(--gap);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
    font-size: 1.05rem;
}

/* ======= ARTICLE CONTENT ======= */
.game-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: var(--gap);
    line-height: 1.8;
    box-shadow: var(--shadow);
}

.game-content h2 {
    color: var(--accent);
    margin: 32px 0 14px;
    font-size: 1.6rem;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.game-content h2:first-child { margin-top: 0; }

.game-content h3 {
    color: var(--text);
    margin: 24px 0 10px;
    font-size: 1.25rem;
}

.game-content p {
    margin-bottom: 14px;
    color: #334155;
}

.game-content ul, .game-content ol {
    margin: 14px 0;
    padding-left: 28px;
    color: #334155;
}

.game-content li { margin: 6px 0; }

.game-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.game-content a:hover {
    border-bottom-color: var(--primary);
}

/* Override for buttons/cards inside game-content */
.game-content .download-btn,
.game-content .store-btn,
.game-content .download-card,
.game-content .btn-secondary,
.game-content .btn-outline,
.game-content .related-link {
    border-bottom: none;
    color: inherit;
}

.game-content .download-btn { color: #fff; }
.game-content .store-btn { color: #fff; }
.game-content .store-btn-rustore { color: #fff; }
.game-content .store-btn-android { color: #1a1a2e; }
.game-content .download-card { color: var(--text); }
.game-content .download-card:hover { color: var(--text); border-bottom: none; }

.game-content strong { color: var(--text); }

.game-content blockquote {
    background: var(--yellow-light);
    border-left: 4px solid var(--yellow);
    padding: 14px 20px;
    margin: 18px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
}

.table-wrapper {
    overflow-x: auto;
    margin: 18px 0;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.game-content table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

.game-content th, .game-content td {
    padding: 11px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.game-content th {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.game-content td {
    color: #334155;
}

.game-content tr:nth-child(even) td {
    background: #f8fafb;
}

@media (max-width: 768px) {
    .game-content th, .game-content td { padding: 8px 10px; font-size: 0.88rem; }
}

/* ======= INFO CARDS ======= */
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.info-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
}

.info-card p {
    color: #334155;
    margin: 0;
}

/* ======= FAQ SECTION ======= */
.faq-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
}

.faq-section h2 { margin-bottom: 18px; font-size: 1.5rem; color: var(--accent); }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    color: var(--text);
    transition: background 0.2s;
}

.faq-question:hover { background: var(--primary-light); }

.faq-icon { font-size: 1.2rem; transition: transform 0.3s; color: var(--primary); }

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer { max-height: 500px; }

.faq-answer p { padding: 0 18px 14px; color: #334155; margin: 0; }

/* ======= RELATED PAGES ======= */
.related-pages {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
}

.related-pages h3 {
    margin-bottom: 14px;
    font-size: 1.2rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.related-link:hover { background: var(--primary); color: #fff; }

/* ======= SIDEBAR ======= */
.sidebar-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-widget p { font-size: 0.9rem; color: var(--text-secondary); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.sidebar-nav a i { color: var(--primary); font-size: 0.85rem; width: 16px; text-align: center; }

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* ======= FOOTER ======= */
footer {
    background: var(--accent);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 24px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 3px 0;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-disclaimer {
    background: rgba(244,162,97,0.15);
    border: 1px solid rgba(244,162,97,0.3);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    color: var(--yellow);
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.footer-copy {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ======= DOWNLOAD BUTTON ======= */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: #fff;
    padding: 14px 32px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(230, 57, 70, 0.4);
}

.download-btn i { font-size: 1.1rem; }

/* Download section */
.download-section {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 24px 0;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.download-section h2 {
    color: var(--primary);
    margin-top: 0;
    border-bottom: none;
}

.download-section h3 {
    text-align: left;
}

.download-section .torrent-info {
    text-align: left;
}

.download-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 16px 0;
}

.download-grid .download-card {
    flex: 0 1 320px;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.download-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.download-card i {
    font-size: 1.4rem;
    color: var(--primary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.download-card-info { flex: 1; }

.download-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    display: block;
}

.download-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Store buttons row */
.store-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    justify-content: center;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #fff;
}

.store-btn:hover { transform: translateY(-1px); opacity: 0.9; }

.store-btn-steam { background: #1b2838; }
.store-btn-epic { background: #2a2a2a; }
.store-btn-rustore { background: #00c853; color: #fff; }
.store-btn-android { background: #3ddc84; color: #1a1a2e; }

/* Torrent info block */
.torrent-info {
    background: var(--yellow-light);
    border-left: 4px solid var(--yellow);
    padding: 14px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 10px 0;
    font-size: 0.9rem;
    color: var(--text);
}

.torrent-info code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .download-grid { grid-template-columns: 1fr; }
    .store-buttons { flex-direction: column; }
    .store-btn { justify-content: center; }
}

/* Secondary button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #15294a;
    transform: translateY(-1px);
}

/* Outline button */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    padding: 10px 22px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ======= CHAPTER CARDS ======= */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.chapter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.chapter-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.chapter-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.chapter-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* ======= RESPONSIVE ======= */
@media (max-width: 1024px) {
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }

    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 12px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0;
        transition: all 0.3s ease;
    }

    nav.open { display: flex; }

    .nav-dropdown { width: 100%; }
    .nav-dropdown-btn { width: 100%; justify-content: space-between; }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        display: block;
        background: rgba(255,255,255,0.08);
        border-radius: 6px;
    }

    .nav-dropdown-content a {
        color: rgba(255,255,255,0.85);
    }

    .nav-dropdown-content a:hover,
    .nav-dropdown-content a.active {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

    .nav-dropdown.mobile-open .nav-dropdown-content { max-height: 500px; }
    .nav-dropdown.mobile-open .arrow { transform: rotate(180deg); }

    /* hover не работает на тач */
    .nav-dropdown:hover .nav-dropdown-content { max-height: 0; }
    .nav-dropdown.mobile-open:hover .nav-dropdown-content { max-height: 500px; }

    .game-header h1 { font-size: 1.6rem; }
    .game-header { padding: 20px; }
    .game-content { padding: 20px; }
    .game-content h2 { font-size: 1.35rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .header-top { flex-wrap: wrap; gap: 8px; }
    .game-header h1 { font-size: 1.3rem; }
    .badges { gap: 6px; }
    .badge { font-size: 0.78rem; padding: 4px 10px; }
    .download-btn { padding: 12px 24px; font-size: 1rem; width: 100%; justify-content: center; }
}

/* ======= Scroll to Top ======= */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ======= Images ======= */
.game-figure {
    margin: 24px 0;
    text-align: center;
}

.game-figure figcaption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.game-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
    margin: 0 auto;
}

.game-header-figure { margin: 16px 0 0; text-align: center; }
.game-header-img { width: 100%; border-radius: var(--radius-lg); }

/* ======= Author Box ======= */
.author-box-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.author-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin: 30px 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.author-avatar svg { display: block; }
.author-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.author-name { font-weight: 600; color: var(--primary); text-decoration: none; display: block; margin: 2px 0; }
.author-name:hover { text-decoration: underline; }
.author-desc { font-size: 0.85rem; color: var(--text-secondary); margin: 4px 0 0; }
.author-page-box { text-align: center; margin-bottom: 30px; }
.author-avatar-large svg { width: 96px; height: 96px; margin: 0 auto 12px; display: block; }
.author-role { color: var(--text-secondary); }

/* ======= Utility ======= */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Wiki-style inline links */
.game-content a.wiki-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
}

.game-content a.wiki-link:hover {
    border-bottom-style: solid;
}

/* Highlight box */
.highlight-box {
    background: var(--yellow-light);
    border: 1px solid var(--yellow);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 18px 0;
}

.highlight-box i {
    color: var(--yellow);
    margin-right: 8px;
}

/* Platform icons in lists */
.platform-list {
    list-style: none;
    padding: 0;
}

.platform-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-list li:last-child { border-bottom: none; }

.platform-list i { color: var(--primary); width: 20px; text-align: center; }
