/* ==========================================================================
   Boundless SMP - OtterSMP Layout
   ========================================================================== */

/* --- Variables --- */
:root {
    --bg: #12171d;
    --bg-card: #1a1527;
    --bg-nav: rgba(18, 23, 29, 0.92);
    --accent: #6e2b83;
    --accent-light: #a855f7;
    --accent-teal: #78ced4;
    --text: #ffffff;
    --text-muted: #c5cad4;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 8px;
    --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: linear-gradient(180deg, #12171d, #1a1527, #12171d);
    color: var(--text-muted);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }

/* --- Announcement Bar --- */
.announce {
    background: linear-gradient(90deg, #6e2b83, #501d51, #1a1527);
    color: var(--accent-teal);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* --- Splash --- */
.splash {
    background: linear-gradient(180deg, rgba(18,23,29,0.3), rgba(26,21,39,0.7)),
                url("assets/home-background.png") center 58% / cover no-repeat;
    min-height: 270px;
    position: relative;
    overflow: hidden;
}
.splash::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 42%;
    background: linear-gradient(transparent, rgba(18,23,29,0.94));
}

/* --- Masthead --- */
.masthead {
    display: grid;
    grid-template-columns: 1fr minmax(190px, 300px) 1fr;
    gap: 24px;
    align-items: end;
    max-width: 1240px;
    margin: -215px auto 18px;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}
.masthead-logo { display: flex; justify-content: center; }
.masthead-logo img { display: none; }
.masthead-logo::before {
    content: "BOUNDLESS SMP\A MC.BFSMP.COM";
    color: #fff;
    display: grid;
    place-items: center;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.92rem, 2.5vw, 1.95rem);
    font-weight: 900;
    line-height: 1.35;
    min-height: 132px;
    width: min(520px, 76vw);
    white-space: pre;
    text-shadow: 0 4px 0 #1a1527, 0 7px 0 #12171d, 0 14px 22px rgba(0,0,0,0.45);
}
.masthead-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    min-height: 66px;
    margin-bottom: 18px;
    position: relative;
    transition: transform var(--transition), filter var(--transition);
    text-align: left;
}
.masthead-btn:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 16px rgba(110,43,131,0.25)); }
.masthead-btn strong {
    display: block;
    color: var(--accent-teal);
    font-size: 1.02rem;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.masthead-btn small {
    display: block;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}
.masthead-discord { justify-content: flex-end; text-align: right; }
.masthead-icon {
    color: var(--accent-teal);
    width: 54px; height: 54px;
    stroke-width: 2.6px;
    flex-shrink: 0;
}
.masthead-btn.ip .masthead-icon { fill: var(--accent-teal); }
.masthead-count {
    background: var(--accent-teal);
    color: #12171d;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 999px;
    position: absolute;
    transform: translate(28px, -42px);
}
.masthead-discord .masthead-count { transform: translate(-32px, -42px); }

/* --- Nav Panel --- */
.nav-panel {
    max-width: min(1320px, calc(100% - 30px));
    margin: 0 auto;
    position: relative;
    z-index: 4;
}
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    min-height: 64px;
    background: rgba(26, 21, 39, 0.96);
    border: 1px solid rgba(110, 43, 131, 0.3);
    border-radius: 6px;
}
.nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
    min-height: 44px;
    cursor: pointer;
}
.ham {
    position: relative;
    width: 28px;
    height: 20px;
    display: block;
}
.ham span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-teal);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.ham span:nth-child(1) { top: 0; }
.ham span:nth-child(2) { top: 8px; opacity: 1; }
.ham span:nth-child(3) { top: 16px; }
.nav-toggle.active .ham span:nth-child(1) {
    top: 8px;
    transform: rotate(45deg);
}
.nav-toggle.active .ham span:nth-child(2) {
    opacity: 0;
    transform: translateX(8px);
}
.nav-toggle.active .ham span:nth-child(3) {
    top: 8px;
    transform: rotate(-45deg);
}
.nav-links {
    display: none;
    list-style: none;
    align-items: stretch;
    gap: clamp(18px, 3vw, 48px);
    margin: 0;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.68);
    font-size: 1rem;
    font-weight: 900;
    min-height: 84px;
    position: relative;
    white-space: nowrap;
}
.nav-link:hover,
.nav-link.active { color: #fff; }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 66px;
    height: 3px;
    background: var(--accent-teal);
    border-radius: 999px;
}
.nav-link svg { width: 32px; height: 32px; stroke-width: 3px; flex-shrink: 0; }
.nav-dropdown {
    display: none;
    list-style: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(26, 21, 39, 0.98);
    border: 1px solid rgba(110, 43, 131, 0.3);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 20;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 6px;
    transition: background var(--transition);
}
.nav-dropdown a:hover,
.nav-dropdown a.active { background: rgba(120,206,212,0.08); color: #fff; }
.nav-dropdown svg { width: 24px; height: 24px; flex-shrink: 0; stroke-width: 3px; }

/* hide IP/Discord on mobile */
.hide-mobile { display: none; }

/* --- Home Intro --- */
.home-intro {
    max-width: 780px;
    margin: 0 auto;
    padding: 44px 24px 18px;
    text-align: center;
}
.section-tag {
    display: inline-flex;
    background: rgba(120,206,212,0.1);
    border: 1px solid rgba(120,206,212,0.35);
    border-radius: 6px;
    color: var(--accent-teal);
    font-weight: 900;
    padding: 7px 12px;
    text-transform: uppercase;
}
.home-intro h1 {
    color: #fff;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    line-height: 0.95;
    margin: 14px 0 10px;
    text-shadow: 0 12px 24px rgba(0,0,0,0.22);
}
.home-intro p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* --- News Feed --- */

/* --- Info Cards (OtterSMP style) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1360px;
    margin: 0 auto;
    padding: 10px 24px 60px;
}
.info-card {
    background: rgba(26, 21, 39, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    transition: transform var(--transition);
}
.info-card:hover { transform: translateY(-3px); }
.info-card.featured { grid-column: span 2; }
.card-media {
    aspect-ratio: 16/9;
    background: #1e222a center / cover no-repeat;
    border-bottom: 1px solid var(--border);
    position: relative;
    transition: filter 0.3s ease;
}
.info-card:hover .card-media { filter: brightness(1.1); }
.card-body { padding: 20px; }
.card-body .tag {
    display: inline-flex;
    background: rgba(120,206,212,0.1);
    border: 1px solid rgba(120,206,212,0.35);
    border-radius: 6px;
    color: var(--accent-teal);
    font-weight: 900;
    padding: 6px 12px;
    text-transform: uppercase;
}
.card-title {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 900;
    line-height: 1.15;
    margin: 12px 0 8px;
}
.card-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.card-body p strong { color: var(--accent-teal); font-weight: 800; }
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #12171d;
    border-top: 1px solid var(--border);
}
.card-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.author-icon {
    width: 40px; height: 40px;
    background: #1e222a;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-teal);
    flex-shrink: 0;
}
.author-icon svg { width: 18px; height: 18px; }
.card-author small { display: block; font-size: 0.7rem; color: var(--text-muted); }
.card-author strong { display: block; font-size: 0.85rem; color: #fff; }
.card-action {
    background: linear-gradient(135deg, var(--accent), #501d51);
    color: #fff;
    font-weight: 900;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: filter var(--transition);
}
.card-action:hover { filter: brightness(1.15); }

/* --- Home Commands (minimal) --- */
.home-cmds {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px 80px;
    text-align: center;
}
.home-cmds > .section-tag { margin-bottom: 20px; }
.home-cmds-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 20px;
    text-align: left;
}
.home-cmd {
    background: rgba(26, 21, 39, 0.94);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color var(--transition);
}
.home-cmd:hover { border-color: rgba(110,43,131,0.3); }
.home-cmd code {
    background: rgba(120,206,212,0.1);
    border: 1px solid rgba(120,206,212,0.2);
    border-radius: 4px;
    color: var(--accent-teal);
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.home-cmd span { color: var(--text-muted); font-size: 0.88rem; }
.home-cmd-note {
    margin-top: 20px;
    color: var(--accent-teal);
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(120,206,212,0.08);
    border: 1px solid rgba(120,206,212,0.2);
    border-radius: 6px;
    padding: 12px 20px;
    display: inline-block;
}

/* --- Subpage --- */
.subpage {
    max-width: 1220px;
    margin: 0 auto;
    padding: 54px 24px 100px;
}
.subpage h2 {
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1;
}
.subpage > p { color: var(--text-muted); margin-top: 8px; }
.subpage-header { margin-bottom: 34px; }

/* --- Rules --- */
.rules-list { display: flex; flex-direction: column; gap: 12px; max-width: 800px; }
.rule-item {
    background: rgba(26,21,39,0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.rule-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: #1e222a;
    cursor: pointer;
    font-weight: 800;
    color: #fff;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}
.rule-header .num { color: var(--accent-teal); font-size: 1.4rem; }
.rule-header .arrow { margin-left: auto; transition: transform var(--transition); }
.rule-item.open .rule-header .arrow { transform: rotate(180deg); }
.rule-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.rule-item.open .rule-body { max-height: 300px; }
.rule-body p { padding: 18px 24px; background: #12171d; font-size: 0.95rem; }

/* --- Enforcement Ladder --- */
.enforcement-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 700px;
    margin: 24px auto 0;
    flex-wrap: wrap;
}
.enforcement-step {
    background: rgba(26,21,39,0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.step-num {
    width: 28px; height: 28px;
    background: var(--accent-teal);
    color: #12171d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    flex-shrink: 0;
}
.enforcement-arrow {
    display: flex;
    align-items: center;
    color: var(--accent-teal);
    flex-shrink: 0;
}

/* --- Map --- */
.map-box {
    background: rgba(26,21,39,0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.map-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #12171d;
    border-bottom: 1px solid var(--border);
}
.map-bar span { font-size: 0.85rem; color: var(--text-muted); }
.map-bar a:hover { text-decoration: underline; }
.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 24px;
    text-align: center;
    color: var(--text-muted);
}
.map-placeholder svg { color: var(--accent-teal); opacity: 0.5; }
.map-placeholder h3 { color: #fff; font-size: 1.4rem; font-weight: 900; }
.map-placeholder p { max-width: 400px; font-size: 0.95rem; }
.map-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent), #501d51);
    color: #fff;
    font-weight: 900;
    padding: 16px 32px;
    border-radius: 6px;
    font-size: 1.05rem;
    transition: filter var(--transition);
    margin-top: 8px;
}
.map-open-btn:hover { filter: brightness(1.15); }

/* --- Image Backgrounds --- */
body[data-page="rules"] #page-content {
    background: linear-gradient(180deg, rgba(18,23,29,0.88), rgba(26,21,39,0.96)),
                url("assets/1780611554923.png") center / cover no-repeat fixed;
}
body[data-page="map"] #page-content {
    background: linear-gradient(180deg, rgba(18,23,29,0.88), rgba(26,21,39,0.96)),
                url("assets/image-9.jpg") center / cover no-repeat fixed;
}

/* --- Footer --- */
.footer {
    background: #12171d;
    border-top: 1px solid var(--border);
    padding: 48px 24px 20px;
}
.footer-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.footer-brand img { width: 48px; height: 48px; margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; max-width: 300px; }
.footer-col h5 { color: var(--accent-teal); font-size: 0.85rem; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a {
    display: block;
    color: var(--text-muted);
    padding: 4px 0;
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-col a:hover { color: var(--accent-teal); }
.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

/* --- Loader & Transitions --- */
#loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    z-index: 9999;
    background: rgba(255,255,255,0.05);
    opacity: 0;
    transition: opacity 0.2s;
}
#loader.active { opacity: 1; }
#loader .bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #6e2b83, #78ced4);
    border-radius: 2px;
    animation: slide 1s ease infinite;
}
@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}
.page-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (min-width: 1025px) {
    .nav-toggle { display: none; }
    .nav-toggle-label { display: none; }
    .nav-dropdown { display: none !important; }
    .hide-mobile { display: flex; }
    .nav-bar { padding: 0 18px 0 34px; min-height: 110px; }
    .nav-links { display: flex; }
    .masthead-logo::before { min-height: 132px; }
}

@media (max-width: 1024px) {
    .masthead {
        grid-template-columns: 1fr;
        margin-top: -190px;
        text-align: center;
        gap: 8px;
    }
    .masthead-logo { order: -1; }
    .masthead-logo::before { min-height: 90px; font-size: clamp(0.75rem, 2.5vw, 0.95rem); width: min(400px, 85vw); }
    .masthead-count { font-size: 0.7rem; padding: 2px 8px; transform: translate(18px, -32px); }
    .masthead-discord .masthead-count { transform: translate(-18px, -32px); }
    .masthead-icon { width: 40px; height: 40px; }
    .masthead-btn strong { font-size: 0.85rem; }
    .masthead-btn small { font-size: 0.68rem; }
    .masthead-btn { gap: 10px; min-height: 52px; margin-bottom: 0; }
    .card-grid { grid-template-columns: repeat(2, 1fr); padding: 10px 24px 40px; }
    .news-feed { grid-template-columns: repeat(2, 1fr); }
    .news-card.featured { grid-column: span 2; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
    .splash { min-height: 280px; }
    .masthead { margin-top: -240px; }
    .card-grid { grid-template-columns: 1fr; padding: 10px 16px 30px; }
    .card-body { padding: 16px; }
    .card-footer { padding: 12px 14px; }
    .news-feed { grid-template-columns: 1fr; padding: 20px 12px 48px; }
    .news-card.featured { grid-column: span 1; }
    .news-media { border-width: 8px; }
    .news-footer { flex-direction: column; align-items: flex-start; }
    .subpage { padding: 32px 16px 48px; }
    .map-placeholder { padding: 60px 20px; }
    .home-cmds { padding: 0 16px 60px; }
    .home-cmds-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .announce { font-size: 0.6rem; padding: 8px 10px; }
    .home-intro { padding: 24px 16px 12px; }
    .home-intro h1 { font-size: clamp(1.6rem, 10vw, 2.4rem); }
    .home-intro p { font-size: 0.9rem; }
    .nav-bar { padding: 10px 12px; min-height: 56px; }
    .nav-toggle { font-size: 0.9rem; gap: 8px; }
    .ham { width: 24px; height: 18px; }
    .ham span:nth-child(2) { top: 7px; }
    .ham span:nth-child(3) { top: 14px; }
    .nav-toggle.active .ham span:nth-child(1) { top: 7px; }
    .nav-toggle.active .ham span:nth-child(3) { top: 7px; }
    .nav-dropdown a { padding: 16px 16px; font-size: 0.95rem; }
    .nav-dropdown svg { width: 22px; height: 22px; }
    .card-grid { padding: 10px 10px 24px; gap: 16px; }
    .card-body { padding: 12px; }
    .card-body .tag { font-size: 0.75rem; padding: 4px 10px; }
    .card-title { font-size: 1.05rem; }
    .card-body p { font-size: 0.85rem; }
    .card-footer { padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .card-action { width: 100%; text-align: center; }
    .news-feed { padding: 12px 10px 36px; }
    .news-body { padding: 12px; }
    .news-body h2 { font-size: 1rem; }
    .news-media { border-width: 5px; }
    .home-cmds { padding: 0 10px 48px; }
    .home-cmd { padding: 10px 12px; gap: 8px; }
    .home-cmd code { font-size: 0.7rem; padding: 3px 6px; }
    .home-cmd span { font-size: 0.8rem; }
    .subpage { padding: 24px 12px 36px; }
    .subpage h2 { font-size: clamp(1.4rem, 8vw, 2rem); }
    .rule-header { padding: 14px 14px; font-size: 0.85rem; }
    .rule-body p { padding: 12px 14px; font-size: 0.85rem; }
    .enforcement-box { flex-direction: column; gap: 6px; }
    .enforcement-step { width: 100%; justify-content: center; }
    .enforcement-arrow { transform: rotate(90deg); }
    .commands-section { padding: 0 10px 48px; }
    .cmd { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
    .cmd code { font-size: 0.75rem; }
    .cmd span { font-size: 0.82rem; }
}
