/* =============================================================================
   MGM News 1.5.0 — the /news/ front page.

   Loads after mgm-guilds.css and reuses its tokens (--g-*), hero, stat strip,
   buttons and the reveal/count-up engine in mgm-guilds.js. Only the parts a
   news page needs are defined here.

   Each world has one accent, shared with the calendar and the game hubs, so a
   Star Wars story is cyan wherever it appears.

   Motion: one-shot reveals only (.mgg-rise, handled by the shared engine).
   The one endless loop — the broadcast rings — runs on html.mgfx-full only,
   and animates transform/opacity.
   ============================================================================= */

.mgn { --n-radius: 16px; }

/* ── World accents ─────────────────────────────────────────────────────────
   --wc is the world's colour; everything below tints from it, so adding a
   world means adding one line here and one entry in MGM_News::worlds(). */
.mgn-w-swg  { --wc: #7fd4ff; }
.mgn-w-wow  { --wc: #f4c95d; }
.mgn-w-coh  { --wc: #3d8bff; }
.mgn-w-eq   { --wc: #46e6cc; }
.mgn-w-loa  { --wc: #ff7a2e; }
.mgn-w-daoc { --wc: #ecd08a; }
.mgn-w-war  { --wc: #e2312d; }
.mgn-w-mh   { --wc: #ffd83a; }
.mgn-w-uo   { --wc: #5cb6ff; }
.mgn-w-none { --wc: var(--g-gold); }
.mgn         { --wc: var(--g-gold); }

/* ── Hero art: a broadcast from the middle of the multiverse ───────────── */

.mgn-hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
.mgn-broadcast {
    grid-column: 2; grid-row: 1;
    position: relative; z-index: 0;
    display: grid; place-items: center;
    min-height: 300px;
}
.mgn-bc-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(232, 201, 107, .26);
}
.mgn-bc-r1 { width: 150px; height: 150px; }
.mgn-bc-r2 { width: 244px; height: 244px; border-style: dashed; opacity: .75; }
.mgn-bc-r3 { width: 336px; height: 336px; opacity: .45; }
.mgn-bc-core {
    position: relative; z-index: 2;
    display: grid; place-items: center;
    width: 78px; height: 78px;
    border-radius: 50%;
    border: 1px solid var(--g-line-strong);
    background: radial-gradient(circle at 50% 35%, rgba(240, 212, 123, .28), rgba(10, 10, 20, .92) 70%);
    box-shadow: 0 0 34px rgba(232, 201, 107, .3);
}
.mgn-bc-core svg { width: 34px; height: 34px; color: var(--g-gold2); }

/* Five nodes evenly around the middle ring. */
.mgn-bc-node {
    position: absolute;
    display: grid; place-items: center;
    width: 58px; height: 58px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--wc) 55%, transparent);
    background: rgba(8, 8, 18, .86);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 16px color-mix(in srgb, var(--wc) 22%, transparent);
    transform: rotate(calc(var(--i) * 72deg)) translateY(-122px) rotate(calc(var(--i) * -72deg));
}
.mgn-bc-node img { width: 40px; height: 26px; object-fit: contain; }

@keyframes mgnPing { from { transform: scale(.82); opacity: .75; } to { transform: scale(1.18); opacity: 0; } }
html.mgfx-full .mgn-broadcast.mgg-anim .mgn-bc-r2 { animation: mgnPing 4.5s ease-out infinite; }
html.mgfx-full .mgn-broadcast.mgg-anim .mgn-bc-r3 { animation: mgnPing 4.5s ease-out 1.5s infinite; }

/* ── Shared bits: chips, dates, "go" links ─────────────────────────────── */

.mgn-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mgn-chip {
    display: inline-flex; align-items: center;
    padding: 3px 11px;
    border: 1px solid color-mix(in srgb, var(--wc) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--wc) 13%, transparent);
    color: var(--wc);
    font-size: .76rem; font-weight: 800; letter-spacing: .04em;
    white-space: nowrap;
}
.mgn-when { color: var(--g-muted); font-size: .85rem; }
.mgn-quiet { color: var(--g-muted); font-style: italic; }

.mgn-go {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--wc);
    font-size: .88rem; font-weight: 800; letter-spacing: .02em;
}
.mgn-go i {
    width: 7px; height: 7px;
    border-top: 2px solid currentColor; border-right: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s;
}
.mgn-go-strong {
    padding: 11px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 92%, #fff), var(--wc));
    color: #12100a;
}

/* ── Section heads ─────────────────────────────────────────────────────── */

.mgn-sec { margin-top: 46px; }
.mgn-sechead {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.mgn-sechead h2 {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 2.4vw, 2.05rem); line-height: 1.15; font-weight: 800; color: #fff;
}
.mgn-sechead h2 svg { width: .9em; height: .9em; color: var(--g-gold); flex: none; }
.mgn-sechead p { margin: 0; color: var(--g-muted); font-size: 1.02rem; max-width: 70ch; }
.mgn-alllink { display: inline-flex; align-items: center; gap: 8px; color: var(--g-gold); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.mgn-alllink i { width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
.mgn-alllink:hover i { transform: rotate(45deg) translate(2px, -2px); }

/* ── Lead story ────────────────────────────────────────────────────────── */

.mgn-leadwrap { margin-top: 26px; }
.mgn-lead {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--wc) 36%, transparent);
    border-radius: var(--n-radius);
    background:
        radial-gradient(ellipse 70% 100% at 100% 50%, color-mix(in srgb, var(--wc) 12%, transparent), transparent 70%),
        linear-gradient(135deg, rgba(24, 20, 44, .96), rgba(14, 14, 26, .96));
    box-shadow: 0 14px 46px rgba(0, 0, 0, .46);
    color: var(--g-text) !important;
    text-decoration: none !important;
    transition: border-color .22s, transform .22s, box-shadow .22s;
}
.mgn-lead:hover { border-color: color-mix(in srgb, var(--wc) 70%, transparent); transform: translateY(-3px); box-shadow: 0 20px 54px rgba(0, 0, 0, .55); }
.mgn-lead:hover .mgn-go i { transform: rotate(45deg) translate(2px, -2px); }
.mgn-lead--noart { grid-template-columns: 1fr; }
.mgn-lead-art { position: relative; overflow: hidden; min-height: 290px; }
.mgn-lead-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.mgn-lead:hover .mgn-lead-art img { transform: scale(1.035); }
.mgn-lead-art::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 45%, rgba(14, 14, 26, .55) 78%, rgba(14, 14, 26, .95) 100%);
}
.mgn-lead-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 34px 38px; }
.mgn-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
    color: var(--wc);
}
.mgn-kicker svg { width: 15px; height: 15px; }
.mgn-lead-title { margin: 0; font-size: clamp(1.5rem, 2.7vw, 2.3rem); line-height: 1.14; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.mgn-lead-ex { color: var(--g-soft); font-size: 1.06rem; line-height: 1.6; overflow-wrap: anywhere; }
.mgn-lead .mgn-go-strong { margin-top: 6px; }

/* ── Filters ───────────────────────────────────────────────────────────── */

.mgn-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mgn-filter {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 8px 16px;
    border: 1px solid var(--g-line);
    border-radius: 999px;
    background: rgba(10, 10, 20, .55);
    color: var(--g-soft);
    font: inherit; font-size: .9rem; font-weight: 700;
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}
.mgn-filter:hover { border-color: color-mix(in srgb, var(--wc) 60%, transparent); color: #fff; }
.mgn-filter.is-active {
    border-color: color-mix(in srgb, var(--wc) 70%, transparent);
    background: color-mix(in srgb, var(--wc) 15%, transparent);
    color: #fff;
}
.mgn-fn {
    padding: 1px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    font-size: .76rem; font-variant-numeric: tabular-nums;
}
.mgn-filter.is-active .mgn-fn { background: color-mix(in srgb, var(--wc) 34%, transparent); color: #fff; }

/* ── Feed grid ─────────────────────────────────────────────────────────── */

.mgn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.mgn-card { display: flex; }
.mgn-card[hidden] { display: none; }
.mgn-card-link {
    position: relative;
    display: flex; flex-direction: column;
    width: 100%; overflow: hidden;
    border: 1px solid var(--g-line);
    border-radius: var(--n-radius);
    background: linear-gradient(160deg, rgba(22, 19, 40, .95), rgba(14, 14, 26, .95));
    color: var(--g-text) !important;
    text-decoration: none !important;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.mgn-card-link::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--wc), color-mix(in srgb, var(--wc) 25%, transparent));
    z-index: 2;
}
.mgn-card-link:hover { border-color: color-mix(in srgb, var(--wc) 55%, transparent); transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0, 0, 0, .46); }
.mgn-card-link:hover .mgn-go i { transform: rotate(45deg) translate(2px, -2px); }
.mgn-card-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: rgba(0, 0, 0, .35); }
.mgn-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.mgn-card-link:hover .mgn-card-art img { transform: scale(1.05); }
.mgn-card-noart { display: grid; place-items: center; width: 100%; height: 100%; }
.mgn-card-noart svg { width: 46px; height: 46px; color: color-mix(in srgb, var(--wc) 55%, transparent); }
.mgn-card-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 18px 18px; flex: 1; }
.mgn-card-title { margin: 0; font-size: 1.1rem; line-height: 1.3; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.mgn-card-ex { color: var(--g-muted); font-size: .93rem; line-height: 1.55; flex: 1; overflow-wrap: anywhere; }
.mgn-card .mgn-go { margin-top: 2px; }

.mgn-nomatch, .mgn-note { margin: 18px 0 0; color: var(--g-muted); font-style: italic; }
.mgn-nomatch[hidden] { display: none; }

.mgn-empty {
    text-align: center; padding: 48px 24px;
    border: 1px dashed var(--g-line); border-radius: var(--n-radius);
    background: rgba(0, 0, 0, .2);
}
.mgn-empty-ico { width: 46px; height: 46px; color: var(--g-gold); opacity: .55; }
.mgn-empty h3 { margin: 10px 0 6px; color: #fff; font-size: 1.3rem; }
.mgn-empty p { margin: 0; color: var(--g-muted); }

/* ── Browse by world ───────────────────────────────────────────────────── */

.mgn-worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mgn-world {
    position: relative;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    grid-template-areas: "art id" "latest latest" "go go";
    gap: 6px 16px; align-items: center;
    padding: 18px 20px;
    overflow: hidden;
    border: 1px solid var(--g-line);
    border-left: 3px solid color-mix(in srgb, var(--wc) 70%, transparent);
    border-radius: 14px;
    background: linear-gradient(100deg, color-mix(in srgb, var(--wc) 9%, transparent), rgba(16, 16, 30, .95) 60%);
    color: var(--g-text) !important;
    text-decoration: none !important;
    transition: border-color .2s, transform .2s, background .2s;
}
.mgn-world:hover { border-color: color-mix(in srgb, var(--wc) 55%, transparent); transform: translateY(-2px); }
.mgn-world:hover .mgn-go i { transform: rotate(45deg) translate(2px, -2px); }
.mgn-world-art { grid-area: art; display: grid; place-items: center; width: 74px; height: 46px; }
.mgn-world-art img { max-width: 74px; max-height: 46px; object-fit: contain; }
.mgn-world-initial {
    display: grid; place-items: center; width: 44px; height: 44px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--wc) 45%, transparent);
    background: color-mix(in srgb, var(--wc) 12%, transparent);
    color: var(--wc); font-weight: 800; font-size: 1.3rem;
}
.mgn-world-id { grid-area: id; min-width: 0; }
.mgn-world-name { display: block; color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.mgn-world-server { display: block; color: var(--g-muted); font-size: .85rem; }
.mgn-world-latest { grid-area: latest; margin-top: 8px; min-width: 0; }
.mgn-world-head {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 2px; color: var(--g-soft); font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere;
}
.mgn-world .mgn-go { grid-area: go; margin-top: 10px; }
.mgn-world.is-soon { opacity: .82; }
.mgn-world.is-soon:hover { opacity: 1; }
.mgn-world.is-soon .mgn-world-art img { filter: grayscale(.4); }
.mgn-world.is-soon:hover .mgn-world-art img { filter: none; }
.mgn-soon {
    position: absolute; top: 10px; right: 12px;
    padding: 2px 9px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--wc) 50%, transparent);
    background: rgba(0, 0, 0, .55);
    color: var(--wc);
    font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
    .mgn-hero { grid-template-columns: 1fr; }
    .mgn-broadcast { grid-column: 1; grid-row: 2; min-height: 330px; }
    .mgn-lead { grid-template-columns: 1fr; }
    .mgn-lead-art { min-height: 220px; max-height: 300px; }
    .mgn-lead-art::after { background: linear-gradient(180deg, transparent 40%, rgba(14, 14, 26, .9) 100%); }
}

@media (max-width: 680px) {
    .mgn-sec { margin-top: 34px; }
    .mgn-lead-body { padding: 22px 20px; }
    .mgn-grid { grid-template-columns: 1fr; }
    .mgn-worlds { grid-template-columns: 1fr; }
    .mgn-broadcast { min-height: 300px; transform: scale(.86); }
    .mgn-filters { gap: 6px; }
    .mgn-filter { padding: 7px 13px; font-size: .84rem; }
    .mgn-sechead { align-items: flex-start; }
}
