:root {
    --theme-primary: #d92d20;
    --theme-accent: #0f172a;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --text: #0b1220;
    --muted: #5b6473;
    --line: #d9dfe8;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #edf2ff 0%, #f6f8fb 38%, #f6f8fb 100%);
}

a { color: inherit; }
.shell { width: min(1200px, 92vw); margin: 0 auto; }

.site-header {
    background: #0f172a;
    border-bottom: 3px solid var(--theme-primary);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100px;
    padding: 15px 0;
    gap: 1rem;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}
.brand-logo {
    height: clamp(52px, 7vw, 105px);
    width: auto;
    display: block;
    object-fit: contain;
    max-width: min(44vw, 320px);
}
.brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.brand.has-logo .brand-title { display: none; }
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.nav-item {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    border: 1px solid transparent;
    padding: 0.5rem 0.65rem;
}
.nav-item.active,
.nav-item:hover {
    color: #fff;
    border-color: rgba(217, 45, 32, 0.8);
    background: rgba(217, 45, 32, 0.15);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.hamburger span {
    width: 24px;
    height: 3px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.hero {
    padding: 4rem 0 3rem;
}
.hero-inner {
    background: linear-gradient(125deg, #09101e 0%, #111b31 52%, #1c2743 100%);
    color: #fff;
    border: 1px solid #25304a;
    border-left: 7px solid var(--theme-primary);
    padding: 2.4rem;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #fca5a5;
    margin: 0 0 0.7rem;
    font-size: 0.78rem;
    font-weight: 800;
}
.hero h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.hero p { color: #d1d7e5; line-height: 1.5; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }

.category-hub {
    padding: 0 0 2rem;
}
.category-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}
.category-hub-card {
    background: linear-gradient(125deg, #09101e 0%, #111b31 52%, #1c2743 100%);
    color: #fff;
    border: 1px solid #25304a;
    border-left: 6px solid var(--theme-primary);
    text-decoration: none;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(13, 24, 46, 0.16);
}
.category-hub-card h3 {
    margin: 0.2rem 0 0.4rem;
    color: #fff;
}
.category-hub-card p {
    margin: 0;
    color: #d1d7e5;
}

.subcategory-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.subcategory-chip {
    border: 1px solid #7f8aa1;
    background: #fff;
    color: #1c2740;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.subcategory-chip:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}
.subcategory-chip.active {
    border-color: var(--theme-primary);
    background: var(--theme-primary);
    color: #fff;
}

.section { padding: 2rem 0 3rem; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.section-head h1,
.section-head h2 { margin: 0; }
.text-link { color: var(--theme-primary); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(13, 24, 46, 0.08);
    padding: 1.2rem;
}
.warning-panel {
    border-color: #f2b8b5;
    background: #fff8f7;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(13, 24, 46, 0.14);
}
.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.card-image.fallback {
    background: linear-gradient(130deg, #0f172a, #22314f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    letter-spacing: 0.1em;
    font-weight: 800;
}
.card-body { padding: 1rem; }
.card-tags {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.card-tags span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #eaf0ff;
    color: #1d2f53;
    padding: 0.2rem 0.45rem;
    border: 1px solid #c8d6f0;
}
.card-tags a {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #eaf0ff;
    color: #1d2f53;
    padding: 0.2rem 0.45rem;
    border: 1px solid #c8d6f0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.card-tags .tag-master {
    border: 2px solid #1d2f53;
    font-weight: 800;
    background: #dce8ff;
}
.card h3 { margin: 0.2rem 0 0.4rem; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted); }
.card-meta { margin-top: 0.75rem; font-size: 0.9rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
}
.form-grid .full { grid-column: 1 / -1; }
label {
    display: block;
    font-weight: 700;
    font-size: 0.86rem;
    margin-bottom: 0.3rem;
    color: #24344f;
}
input,
select,
textarea {
    width: 100%;
    border: 1px solid #cdd7e5;
    background: #fff;
    color: var(--text);
    padding: 0.72rem 0.75rem;
    font-size: 0.96rem;
}
.multi-subcategory {
    min-height: 170px;
    padding: 0.5rem;
}
.multi-subcategory option {
    padding: 0.35rem 0.4rem;
}
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(217, 45, 32, 0.2);
    border-color: var(--theme-primary);
}

.btn {
    border: 2px solid transparent;
    padding: 0.65rem 0.9rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-primary {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary {
    background: #fff;
    border-color: #7f8aa1;
    color: #1c2740;
}
.btn-secondary:hover { border-color: var(--theme-primary); color: var(--theme-primary); }
.btn-danger {
    background: #8b1111;
    border-color: #8b1111;
    color: #fff;
}

.actions-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.section-gap { margin-top: 1rem; }
.empty { margin-top: 0.9rem; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 0.7rem; }
.line-item {
    border: 1px solid var(--line);
    background: #fbfcff;
    padding: 0.8rem;
    display: grid;
    gap: 0.5rem;
}
.line-item.compact { grid-template-columns: 1fr auto auto; align-items: center; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tiny-delete {
    border: 1px solid #d33d35;
    background: #fff;
    color: #d33d35;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
}

.detail-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.detail-cover:hover {
    opacity: 0.85;
}
.detail-content { padding: 1rem 0; }
.detail-content h3 {
    margin: 1.5rem 0 0.8rem;
    font-size: 1.3rem;
    color: var(--text);
}
.tournament-description p,
.tournament-description div {
    margin: 0 0 0.6rem;
}
.tournament-description ul,
.tournament-description ol {
    margin: 0.4rem 0 0.7rem 1.2rem;
}
.tournament-description li {
    margin-bottom: 0.35rem;
}
.detail-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.poster-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    animation: zoomIn 0.2s ease;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close:hover {
    color: #f87171;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.detail-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.detail-grid div {
    border: 1px solid var(--line);
    padding: 0.6rem;
    display: grid;
    gap: 0.3rem;
    background: #f9fbff;
}
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.site-footer {
    border-top: 3px solid var(--theme-primary);
    background: #0b1221;
    color: #d2d9e8;
    margin-top: 2rem;
}
.footer-inner {
    min-height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-links { display: flex; gap: 0.9rem; }
.footer-links a { color: #d2d9e8; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-disclaimer {
    color: #9fb0c9;
    font-size: 0.82rem;
    line-height: 1.5;
    padding-bottom: 1.2rem;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    border-top: 2px solid var(--theme-primary);
    z-index: 120;
}
.cookie-banner-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 0;
}
.cookie-banner p {
    margin: 0;
    color: #d2d9e8;
}

@media (max-width: 800px) {
    .header-inner { 
        min-height: auto; 
        padding: 0.8rem 0;
        flex-wrap: nowrap;
        position: relative;
    }
    .brand { font-size: 1rem; }
    .brand-logo { height: clamp(60px, 26vw, 125px); max-width: 56vw; }
    
    .hamburger { 
        display: flex;
        z-index: 30;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(105deg, #080b13, var(--theme-accent));
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-top: 1px solid rgba(217, 45, 32, 0.3);
    }
    
    .main-nav.active {
        max-height: 300px;
    }
    
    .main-nav .nav-item {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding-bottom: 1.5rem;
        padding-top: 1.5rem;
    }
    .footer-disclaimer {
        text-align: center;
        padding-bottom: 1.2rem;
    }
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner .btn {
        width: 100%;
    }
    
    .card-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .category-hub-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .line-item.compact { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-head .share-row { margin-bottom: 0.75rem; margin-top: -1rem; }
}
