/* ==================================================================
   boombeachwiki — feuille de style principale (réplique PHP)
   Palette "Boom Beach tropical & militaire" : sable, bleu lagon, or.
   ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Montserrat:wght@400;600;700&display=swap');

:root {
    --sand:           #e0caa0;
    --sand-dark:      #d4ba86;
    --ink:            #2c2013;

    --bx-bg:          #0b3550;
    --bx-topbar-1:    #0f4e77;
    --bx-topbar-2:    #0d3f61;
    --bx-topbar-3:    #082c44;
    --bx-panel:       #1a6fa0;
    --bx-panel-dark:  #145a85;
    --bx-teal:        #3f7686;
    --bx-teal-dark:   #2c5866;
    --bx-cream:       #f4e6c6;
    --bx-cream-alt:   #ecdcb2;

    --gold:           #ffb400;
    --gold-dark:      #a95e00;
    --gold-light:     #ffe066;
    --card-border:    #f4e6bf;
    --window-blue:    #2a8fc7;
    --positive:       #7ec13a;
    --negative:       #e0542f;

    --topbar-h: 90px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Montserrat', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    color: #fff;
    background: var(--sand);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-topbar { padding-top: var(--topbar-h); }

a { color: inherit; }
img { max-width: 100%; }

h1, h2, h3, h4 { font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-weight: 400; letter-spacing: 1px; }

/* ============================== TOPBAR ============================== */

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 22px;
    background: linear-gradient(180deg, var(--bx-topbar-1) 0%, var(--bx-topbar-2) 60%, var(--bx-topbar-3) 100%);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 3px 10px rgba(0,0,0,.4), inset 0 -8px 14px -10px rgba(0,0,0,.5);
}

.topbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: 1.9em;
    letter-spacing: 1px;
    line-height: 1;
}
.topbar-logo img { height: 44px; width: auto; filter: drop-shadow(0 3px 0 rgba(8,28,48,.55)); }
.topbar-logo span {
    color: #fff;
    -webkit-text-stroke: 0;
    paint-order: stroke fill;
    text-shadow: 0 1px 0 #0b2238, 0 2px 4px rgba(0,0,0,.6);
    padding: 3px 4px 5px 0;
}

.topbar-nav {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
}

.nav-link {
    flex: 1 1 0;
    max-width: 184px;
    min-width: 0;
    height: 47px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3px 8px;
    color: #fff;
    text-decoration: none;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: clamp(.68em, 1.3vw, .95em);
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.05;
    white-space: normal;
    border-radius: 2px 2px 0 0;
    border-bottom: 3px solid transparent;
    background-image: url('/assets/images/icons/tabs_back.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    text-shadow: 0 2px 3px rgba(0,0,0,.45);
    transition: border-color .15s ease;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--gold-light); border-bottom-color: var(--gold); }

.nav-connexion {
    flex-shrink: 0;
    width: 184px;
    height: 47px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: .98em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 3px rgba(0,0,0,.5);
    background-image: url('/assets/images/icons/75.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transition: filter .15s ease;
}
.nav-connexion:hover { filter: brightness(1.08); }

.topbar-actions { flex-shrink: 0; display: flex; align-items: center; gap: 12px; }

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    background: linear-gradient(180deg, #2a8fc7 0%, #0d3f61 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,.4);
    transition: transform .15s ease, border-color .15s ease;
    text-decoration: none;
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.icon-btn img { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }

.topbar-burger { display: none; }

/* Panneau de recherche (topbar) */
.topbar-search {
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0;
    z-index: 999;
    background: rgba(8,44,68,.97);
    border-bottom: 3px solid var(--gold);
    padding: 14px 22px;
    display: none;
}
.topbar-search.open { display: block; }
.topbar-search-inner { max-width: 900px; margin: 0 auto; position: relative; }
.topbar-search input {
    width: 100%;
    padding: 14px 18px 14px 50px;
    border: 2px solid var(--card-border);
    border-radius: 4px;
    background: #f4ecd8;
    font-size: 1.05em;
    font-family: inherit;
}
.topbar-search .s-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; }
.search-results {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 6px);
    background: #f4ecd8;
    color: var(--ink);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    max-height: 60vh;
    overflow-y: auto;
}
.search-results a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.search-results a:hover { background: #e6d7b3; }
.search-results img { width: 38px; height: 38px; object-fit: contain; }
.search-results .sr-cat { margin-left: auto; font-size: .8em; opacity: .65; }
.search-empty { padding: 14px; text-align: center; opacity: .7; }

/* Menu mobile */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(5,25,40,.6);
    display: none;
}
.mobile-menu.open { display: block; }
.mobile-menu-panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: min(264px, 76vw);
    background: linear-gradient(180deg, var(--bx-topbar-1), var(--bx-topbar-3));
    padding: 22px 18px;
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(0,0,0,.4);
}
.mobile-menu-close {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid var(--card-border);
    background: transparent; color: #fff; font-size: 20px; cursor: pointer;
}
.mobile-menu-panel .nav-link,
.mobile-menu-panel .nav-connexion {
    width: 100%;
    max-width: 100%;   /* 覆盖顶栏 nav-link 的 max-width:184px，避免面板右侧留白 */
    margin: 6px 0;
}

/* ============================ LAYOUT HOME ============================ */

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 18px; }

.home-hero { padding: 26px 18px 8px; text-align: center; }
.home-hero-title {
    margin: 6px 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: clamp(2.4em, 5vw, 3.6em);
    color: #2a1c0c;
    text-shadow: 2px 2px 0 rgba(255,255,255,.35);
}
.home-hero-title img { width: 56px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }

.cycle-banner {
    max-width: 1100px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(180deg, #2a7fb0, #1c6491);
    border: 2px solid #57a7d4;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 4px 10px rgba(0,0,0,.18);
}
.cycle-banner img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.cycle-banner-body { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cycle-banner-label { font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; letter-spacing: 1px; font-size: 1.35em; text-transform: uppercase; }
.cycle-banner-event { color: var(--gold-light); font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; letter-spacing: 1px; font-size: 1.35em; text-transform: uppercase; }
.cycle-banner-countdown { color: #bfe3f7; font-weight: 600; }

.home-tickers { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: rgba(20,50,70,.55);
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    transition: background .15s ease;
}
a.ticker:hover { background: rgba(20,50,70,.75); }
.ticker-icon { width: 30px; height: 30px; object-fit: contain; }
.ticker-body { flex: 1; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .92em; }
.ticker-text { font-weight: 700; }
.ticker-countdown { color: #b9d9ee; }
.ticker-go { width: 20px; opacity: .8; }
.ticker-emoji {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; line-height: 1; flex: none;
}

.hero-search {
    max-width: 560px;
    margin: 22px auto 4px;
    position: relative;
}
.hero-search input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: none;
    border-radius: 4px;
    background: #17283a;
    color: #fff;
    font-family: inherit;
    font-size: 1.05em;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.hero-search input::placeholder { color: #8fb0c8; }
.hero-search > img { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; opacity: .75; }

/* Colonnes accueil */
.home-columns {
    max-width: 1440px;
    margin: 26px auto 40px;
    padding: 0 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}
.home-col-right { display: flex; flex-direction: column; gap: 22px; }
.home-col-right .section-title { justify-content: center; }

.section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #2a7fb0, #1c6491);
    border: 2px solid #57a7d4;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 1.5em;
    text-transform: uppercase;
    text-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.section-title img { width: 30px; height: 30px; object-fit: contain; }

.news-section { background: rgba(26,111,160,.25); border: 2px solid rgba(26,111,160,.45); border-radius: 4px; padding-bottom: 10px; }
.news-section .section-title { border: none; border-radius: 0; }
.news-group-title {
    margin: 14px 18px 8px;
    color: #234f70;
    font-size: 1.3em;
    text-transform: uppercase;
}

.news-grid { display: flex; flex-direction: column; gap: 12px; padding: 0 14px; }
.news-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: rgba(255,255,255,.95);
    color: var(--ink);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
    transition: transform .15s ease, box-shadow .15s ease;
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.22); }
.news-img-wrap { position: relative; min-height: 150px; background: #0e3a57; }
.news-img-wrap img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.news-status {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 2;
    padding: 4px 12px;
    border-radius: 3px;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    letter-spacing: 1px;
    font-size: 1.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.news-status-live { background: #2f8fd1; color: #082033; }
.news-status-upcoming { background: #f39c12; color: #3a2400; }
.news-status-past { background: #7f8c8d; color: #fff; }
.news-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.news-name { font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-weight: 400; font-size: 1.5em; letter-spacing: .5px; color: #17283a; }
.news-desc { margin: 0; display: flex; align-items: center; gap: 8px; color: #555; font-size: .95em; }
.news-desc img { width: 22px; height: 22px; object-fit: contain; }
.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .85em; color: #777; margin-top: auto; }
.news-hq { background: #dcebf6; color: #2a608a; font-weight: 700; padding: 3px 10px; border-radius: 3px; }
.news-meta-category { font-weight: 700; }
.news-meta-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.news-comments { display: inline-flex; align-items: center; gap: 5px; }
.news-comments img { width: 18px; }
.news-more { color: #2f8fd1; font-weight: 700; }
.news-more-link { display: block; text-align: center; padding: 12px; color: #1c6491; font-weight: 700; text-decoration: none; }

/* Tableau mensuel (activités / tribus / protos) */
.monthly-table { background: #f5f1e6; border: 2px solid #57a7d4; border-top: none; padding: 14px 16px 18px; }
.monthly-main-title { margin: 0 0 10px; text-align: center; color: #17283a; font-size: 1.15em; }
.monthly-banner { position: relative; margin-bottom: 12px; }
.monthly-banner img { display: block; width: 100%; height: 130px; object-fit: cover; }
.monthly-banner span {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.1em;
    text-shadow: 0 2px 4px rgba(0,0,0,.7);
}
.monthly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.monthly-cell {
    background: #fff;
    border: 1px solid #d8d2c2;
    padding: 10px 8px;
    text-align: center;
    display: flex; flex-direction: column; gap: 3px;
    justify-content: center;
    color: #17283a;
}
.monthly-cell small { color: #6d6552; font-size: .82em; }
.monthly-sub-title {
    margin: 12px 0 8px;
    text-align: center;
    color: #fff;
    background: #6e6a5e;
    padding: 6px;
    font-size: .95em;
}
.monthly-events { margin-top: 14px; border: 1px solid #d8d2c2; }
.monthly-events-head {
    background: #37a93f;
    color: #fff;
    text-align: center;
    font-weight: 800;
    line-height: 1.4;
    padding: 8px;
    font-size: .95em;
}
.monthly-event-row {
    background: #fff;
    border-top: 1px solid #e4dfd2;
    text-align: center;
    padding: 8px 6px;
    display: flex; flex-direction: column; gap: 2px;
    color: #17283a;
}
.monthly-event-row b { font-size: .92em; }
.monthly-event-row span { font-size: .88em; color: #3d3a2e; }
.monthly-note { margin: 0; padding: 10px; text-align: center; color: #6d6552; font-size: .8em; background: #fff; border-top: 1px solid #e4dfd2; }
@media (max-width: 760px) { .monthly-grid { grid-template-columns: 1fr; } }

/* Accès rapide */
.side-title {
    margin: 0;
    padding: 12px 16px;
    text-align: center;
    background: linear-gradient(180deg, var(--bx-teal), var(--bx-teal-dark));
    border-radius: 4px 4px 0 0;
    font-size: 1.35em;
    text-transform: uppercase;
    text-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.quicklinks { display: flex; flex-direction: column; }
.quicklink {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: #21344a;
    border-bottom: 1px solid rgba(0,0,0,.07);
    transition: filter .15s ease;
}
.quicklink:hover { filter: brightness(1.05); }
.quicklink-icon { width: 46px; height: 46px; object-fit: contain; }
.quicklink-label { display: block; font-weight: 700; font-size: 1.05em; }
.quicklink-desc { display: block; font-size: .82em; color: #5c7285; margin-top: 2px; }
.quicklink-arrow { font-size: 1.3em; color: #5c7285; }
.quicklink-calc  { background: linear-gradient(180deg,#dceffb,#c7e3f6); }
.quicklink-tracker { background: linear-gradient(180deg,#dff4e8,#cdeedd); }
.quicklink-warships { background: linear-gradient(180deg,#fbe7d8,#f6d9c4); }

.side-section { border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.9); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.side-section .section-title { border: none; font-size: 1.2em; padding: 10px 14px; }
.side-section .section-title img { width: 26px; height: 26px; }

.pass-card { display: flex; gap: 12px; padding: 14px; text-decoration: none; color: var(--ink); align-items: center; }
.pass-card:hover { background: #f6edda; }
.pass-card img.skin { width: 80px; height: 80px; object-fit: contain; }
.pass-season { font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.3em; color: #17283a; letter-spacing: .5px; }
.pass-dates { display: block; font-size: .82em; color: #6a6a6a; }
.side-footer-link { display: block; text-align: center; padding: 12px; color: #1c6491; font-weight: 700; text-decoration: none; border-top: 1px solid rgba(0,0,0,.08); }

.officer-card { display: flex; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); position: relative; }
.officer-card:hover { background: #f6edda; }
.officer-card .rank { position: absolute; left: 12px; top: 12px; width: 30px; z-index: 2; }
.officer-banner { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; }
.officer-card-info { padding: 0 14px 12px; }
.officer-eyebrow { font-size: .75em; text-transform: uppercase; color: #9a7b3c; font-weight: 700; letter-spacing: .5px; }
.officer-name { display: block; font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.3em; color: #17283a; }
.officer-date { font-size: .8em; color: #777; }
.side-news-img { display: block; width: calc(100% - 28px); margin: 0 14px 10px; border-radius: 8px; object-fit: cover; }
.dex-skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 10px; }
.dex-skin-cell { margin: 0; background: rgba(255,255,255,.9); border: 1px solid #d8e2ec; border-radius: 8px; padding: 10px; text-align: center; }
.dex-skin-cell img { max-width: 100%; height: 90px; object-fit: contain; }
.dex-skin-cell figcaption { margin-top: 6px; font-size: .85em; color: #3d5a80; font-weight: 600; }
.side-news { display: block; margin: 0 14px 12px; padding: 10px 12px; background: rgba(0,0,0,.045); border-radius: 8px; font-size: .88em; color: var(--ink); line-height: 1.6; text-decoration: none; }
a.side-news:hover { background: rgba(0,0,0,.08); }

/* ============================== FOOTER ============================== */

.site-footer { margin-top: auto; background: linear-gradient(180deg, #0d3f61, #082c44); border-top: 4px solid var(--gold); }
body > :has(+ .site-footer) { margin-bottom: 50px; }
.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 22px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
}
.footer-artwork { display: flex; gap: 16px; align-items: flex-start; }
.footer-artwork > img { width: 96px; object-fit: contain; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.5em; color: #fff; text-decoration: none; }
.footer-logo img { width: 40px; }
.footer-tagline { color: #b9c9dc; font-size: .9em; line-height: 1.55; margin-top: 10px; }
.footer-col-title { display: block; font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.2em; letter-spacing: 1px; color: var(--gold-light); margin-bottom: 10px; }
.site-footer a:not(.footer-logo) { display: block; color: #cfe0f0; text-decoration: none; padding: 4px 0; font-size: .93em; }
.site-footer a:not(.footer-logo):hover { color: #fff; }
.social-links { display: flex; gap: 10px; }
.social-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex !important; align-items: center; justify-content: center;
    padding: 8px !important;
}
.social-btn svg { width: 22px; height: 22px; fill: #fff; }
.social-douyin { background: #161823; }
.social-bilibili { background: #00a1d6; }
.footer-fan {
    max-width: 1240px; margin: 0 auto; padding: 0 22px 26px;
    color: #8fa3ba; font-size: .8em; text-align: center;
}
.footer-fan a { display: inline !important; color: #b9c9dc; text-decoration: underline; }

/* ========================== PAGES DE TYPE DEX ========================== */

/* width:100% 很关键：body 是 flex 纵向容器，子项若只靠 margin:auto 会退化为内容宽度，
   导致详情卡片「内容多就宽、内容少就窄」。显式撑满再限宽，卡片宽度才稳定。 */
.dex-page { width: 100%; max-width: 1200px; box-sizing: border-box; margin: 24px auto 60px; padding: 0 18px; }
.dex-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.dex-filter {
    appearance: none;
    background: #17283a url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="%238fb0c8" d="M7 10l5 5 5-5z"/></svg>') no-repeat right 12px center;
    color: #dcebf6;
    border: 2px solid #3c6a8c;
    border-radius: 4px;
    padding: 10px 40px 10px 14px;
    font-family: inherit;
    font-size: .95em;
    cursor: pointer;
}
.dex-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.dex-layout.single { grid-template-columns: 1fr; }

.dex-groups { display: flex; flex-direction: column; gap: 22px; }
.dex-group-title {
    margin: 0 0 10px;
    color: #234f70;
    font-size: 1.5em;
    text-transform: uppercase;
    border-bottom: 3px solid rgba(35,79,112,.25);
    padding-bottom: 6px;
}
.dex-grid {
    display: grid;
    grid-template-columns: repeat(var(--units-row, 4), 1fr);
    gap: 10px;
}
.dex-icon {
    position: relative;
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    text-decoration: none;
    overflow: hidden;
}
.dex-icon:hover { transform: translateY(-3px); border-color: var(--window-blue); box-shadow: 0 6px 12px rgba(0,0,0,.2); }
.dex-icon.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.dex-icon-img {
    width: 100%;
    aspect-ratio: 1;
    min-height: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}
.dex-icon-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.dex-icon-label {
    width: 100%;
    background: rgba(23,40,58,.92);
    color: #fff;
    font-size: .82em;
    line-height: 1.25;
    padding: 5px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dex-icon-name {
    grid-column: 1 / -1;
    background: #17283a;
    color: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .9em;
}
.dex-icon-name a { color: var(--gold-light); text-decoration: none; }

.dex-side {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    background: rgba(255,255,255,.9);
    color: var(--ink);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    overflow: hidden;
}
.dex-side-header {
    background: linear-gradient(180deg, var(--bx-teal), var(--bx-teal-dark));
    padding: 14px;
    text-align: center;
}
.dex-side-header img { width: 130px; height: 130px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.dex-side-title { margin: 6px 0 0; font-size: 1.6em; color: #fff; }
.dex-side-sub { color: #cfe6ee; font-size: .85em; text-transform: uppercase; letter-spacing: 1px; }
.dex-side-body { padding: 14px 16px; }
.dex-side-body p { font-size: .9em; line-height: 1.55; color: #444; }

/* Fiche détail */
.dex-card {
    background: var(--bx-cream);
    color: var(--ink);
    border: 3px solid var(--bx-cream-alt);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
    overflow: hidden;
}
/* PC 端：详情卡片固定为页面宽度的 95% 并居中，所有条目宽度统一 */
@media (min-width: 1025px) {
    .dex-page > .dex-card { width: 95%; margin-left: auto; margin-right: auto; }
}
.dex-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, var(--wiki-teal, var(--bx-teal)), var(--bx-teal-dark));
    color: #fff;
}
.dex-back {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dex-back img { width: 22px; transform: rotate(180deg); }
.dex-card-top .class-icon { width: 40px; }
.dex-card-top .class-name {
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: 1.05em;
    letter-spacing: 1px;
    background: rgba(0,0,0,.25);
    padding: 4px 12px;
    border-radius: 3px;
}
.server-switch { display: inline-flex; gap: 6px; }
.server-btn {
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: 1.05em;
    letter-spacing: 1px;
    white-space: nowrap;
    color: #fff;
    text-decoration: none;
    background: rgba(0,0,0,.25);
    padding: 4px 14px;
    border-radius: 3px;
    border-bottom: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}
.server-btn:hover { background: rgba(0,0,0,.4); }
.server-btn.active { color: var(--gold-light); border-bottom-color: var(--gold); }
/* 浅色工具栏（如赛季页）上的服务器切换。 */
.server-switch-toolbar .server-btn {
    background: rgba(255,255,255,.85);
    color: #1c6491;
    padding: 8px 16px;
    border-radius: 999px;
}
.server-switch-toolbar .server-btn:hover { background: #fff; }
.server-switch-toolbar .server-btn.active { background: #1c6491; color: #fff; }
.dex-card-top .unit-name { margin: 0 0 0 auto; font-size: 1.8em; text-shadow: 0 2px 3px rgba(0,0,0,.4); }

.dex-card-body { padding: 20px; }
.dex-hero-grid { display: grid; grid-template-columns: 260px 1fr; gap: 22px; margin-bottom: 20px; align-items: start; }
.dex-carousel {
    background: linear-gradient(180deg,#e7d7ae,#dcc899);
    border-radius: 6px;
    border: 2px solid var(--bx-cream-alt);
    padding: 18px;
    text-align: center;
}
.dex-carousel img.main { width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.dex-carousel .caption { margin-top: 8px; font-size: .8em; text-transform: uppercase; letter-spacing: 1px; color: #6c5a3c; font-weight: 700; }
.dex-carousel-thumbs { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.dex-carousel-thumbs button {
    width: 54px; height: 54px; padding: 4px;
    border: 2px solid transparent; border-radius: 4px;
    background: rgba(255,255,255,.5); cursor: pointer;
}
.dex-carousel-thumbs button.active { border-color: var(--window-blue); }
.dex-carousel-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.dex-info h3 {
    margin: 0 0 10px;
    color: #fff;
    background: var(--bx-teal-dark);
    padding: 8px 14px;
    border-radius: 4px 4px 0 0;
    font-size: 1.2em;
    text-transform: uppercase;
}
.dex-info p { line-height: 1.6; }
.dex-info-section { margin-bottom: 18px; }

table.dex-table {
    width: 100%;
    border-collapse: collapse;
    background: #fbf4e2;
    font-size: .9em;
}
table.dex-table th {
    background: var(--bx-teal);
    color: #fff;
    text-transform: uppercase;
    font-size: .82em;
    letter-spacing: .5px;
    padding: 9px 10px;
    text-align: center;
}
table.dex-table td { padding: 8px 10px; border-bottom: 1px solid #e4d4ad; text-align: center; }
table.dex-table tr:nth-child(even) td { background: #f5ead0; }
table.dex-table .num { text-align: center; font-variant-numeric: tabular-nums; }

/* 第一列（等级列）固定不参与横向滚动 */
table.dex-table th:first-child,
table.dex-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 1px solid #e4d4ad;
}
table.dex-table th:first-child { background: var(--bx-teal); }
table.dex-table td:first-child { background: #fbf4e2; }
table.dex-table tr:nth-child(even) td:first-child { background: #f5ead0; }

/* 搜索数据表：顶部搜索框 + 可折叠表格 */
.dex-tbl-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.dex-tbl-search input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 2px solid var(--bx-cream-alt);
    border-radius: 5px;
    background: #fffdf6;
    color: var(--ink);
    font: inherit;
    font-size: .95em;
}
.dex-tbl-search input:focus {
    outline: none;
    border-color: var(--bx-teal);
    box-shadow: 0 0 0 3px rgba(35, 79, 112, .12);
}
.dex-tbl-count { font-size: .85em; color: #6b7783; white-space: nowrap; }
.dex-tbl-scroll { overflow-x: auto; }

/* 表格横向滚动条：统一成站内的细条样式（替代浏览器默认的粗糙灰条） */
.dex-scroll,
.dex-tbl-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(23,40,58,.35) transparent;
}
.dex-scroll::-webkit-scrollbar,
.dex-tbl-scroll::-webkit-scrollbar { height: 8px; }
.dex-scroll::-webkit-scrollbar-track,
.dex-tbl-scroll::-webkit-scrollbar-track { background: transparent; }
.dex-scroll::-webkit-scrollbar-thumb,
.dex-tbl-scroll::-webkit-scrollbar-thumb {
    background: rgba(23,40,58,.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.dex-scroll:hover::-webkit-scrollbar-thumb,
.dex-tbl-scroll:hover::-webkit-scrollbar-thumb { background: rgba(23,40,58,.45); background-clip: padding-box; }
body.theme-dark .dex-scroll,
body.theme-dark .dex-tbl-scroll { scrollbar-color: rgba(220,235,246,.35) transparent; }
body.theme-dark .dex-scroll::-webkit-scrollbar-thumb,
body.theme-dark .dex-tbl-scroll::-webkit-scrollbar-thumb { background: rgba(220,235,246,.3); background-clip: padding-box; }
.dex-tbl-empty { margin: 6px 0 0; color: #6b7783; font-size: .92em; }
.dex-acc {
    margin-bottom: 14px;
    border: 2px solid var(--bx-cream-alt);
    border-radius: 5px;
    overflow: hidden;
    background: #fbf4e2;
}
.dex-acc > summary {
    cursor: pointer;
    padding: 10px 14px;
    background: var(--bx-teal);
    color: #fff;
    font-family: Bangers, cursive;
    letter-spacing: .6px;
    font-size: 1.05em;
    list-style: none;
    user-select: none;
}
.dex-acc > summary::-webkit-details-marker { display: none; }
.dex-acc > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform .15s ease;
}
.dex-acc[open] > summary::before { transform: rotate(90deg); }
.dex-acc-plain { padding: 0; }
.dex-acc-plain > h3 { margin: 0; padding: 10px 14px; background: var(--bx-teal); color: #fff; font-size: 1.05em; }
body.theme-dark .dex-tbl-search input { background: #38472c; color: #eae5d3; border-color: #4b5b3c; }
body.theme-dark .dex-acc { background: #38472c; border-color: #4b5b3c; }

/* ============================ ÉVÉNEMENTS ============================ */

.page-head { max-width: 1240px; margin: 24px auto 8px; padding: 0 18px; }
.page-head h1 { color: #234f70; font-size: 2.2em; margin: 0; text-transform: uppercase; }
.page-head p { color: #45505e; margin: 6px 0 0; }

.event-types {
    max-width: 1240px;
    margin: 18px auto;
    padding: 14px 18px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.event-types::-webkit-scrollbar { display: none; }
.event-type-tile {
    flex-shrink: 0;
    width: 150px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    background: #145a85;
    box-shadow: 0 3px 8px rgba(0,0,0,.2);
    transition: transform .12s ease;
}
.event-type-tile:hover { transform: translateY(-3px); }
.event-type-tile img { width: 100%; height: 76px; object-fit: cover; display: block; }
.event-type-label {
    display: block;
    padding: 6px 8px;
    font-size: .75em;
    text-align: center;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}
.event-type-tile.active { outline: 3px solid var(--gold); }

/* Détail d'événement */
.event-hero {
    max-width: 1000px;
    margin: 22px auto;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bx-cream);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.event-hero-banner { position: relative; height: 260px; }
.event-hero-banner img { width: 100%; height: 100%; object-fit: cover; }
.event-hero-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(11,53,80,.85)); }
.event-hero-name { position: absolute; left: 22px; bottom: 14px; z-index: 2; margin: 0; font-size: 2.2em; color: #fff; text-shadow: 0 3px 6px rgba(0,0,0,.6); }
.event-hero-body { padding: 20px 24px 26px; }
.event-hero-body .dates { font-weight: 700; color: #1c6491; }
.event-countdown-big {
    display: inline-block; margin: 10px 0;
    background: #17283a; color: var(--gold-light);
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.5em; letter-spacing: 1px;
    padding: 8px 18px; border-radius: 4px;
}

/* =============================== PASS =============================== */

.pass-toolbar {
    max-width: 1100px; margin: 20px auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 0 18px;
}
.pass-season-select {
    background: #17283a; color: #dcebf6;
    border: 2px solid #3c6a8c; border-radius: 4px;
    padding: 10px 14px; font-family: inherit;
}
.pass-nav-link { color: #1c6491; font-weight: 700; text-decoration: none; }
.pass-track {
    max-width: 1100px; margin: 0 auto 60px; padding: 0 18px;
}
.pass-hero-card {
    background: linear-gradient(180deg, #2a7fb0, #1c6491);
    border: 2px solid #57a7d4;
    border-radius: 8px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.pass-hero-card img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.pass-hero-card h1 { margin: 0; font-size: 2.2em; text-transform: uppercase; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.pass-badge { background: var(--gold); color: #3a2400; font-weight: 700; padding: 3px 10px; border-radius: 3px; font-size: .8em; }
.pass-reward-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pass-reward {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.94);
    color: var(--ink);
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    border-left: 4px solid var(--gold);
}
.pass-reward.premium { border-left-color: #9b59b6; }
.pass-reward-points { font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.5em; color: #1c6491; min-width: 52px; }
.pass-reward-points small { display: block; font-size: .45em; color: #888; letter-spacing: 1px; }

/* ============================== FORMULAIRES ============================== */

.auth-wrap { max-width: 440px; margin: 40px auto 70px; padding: 0 18px; }
.auth-card {
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,230,198,.96));
    color: var(--ink);
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(0,0,0,.3);
    border: 3px solid var(--card-border);
    overflow: hidden;
}
.auth-tabs { display: flex; }
.auth-tab {
    flex: 1; text-align: center; padding: 14px;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.3em; letter-spacing: 1px;
    text-decoration: none; color: #6b7d8f; background: rgba(0,0,0,.07);
}
.auth-tab.active { background: transparent; color: #17283a; }
.auth-logo { display: block; width: 84px; height: 84px; margin: 0 auto 10px; object-fit: contain; }
.auth-title {
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    text-align: center;
    margin: 0 0 18px;
    font-size: 1.6em;
    letter-spacing: 1px;
    color: #17283a;
}
.auth-body { padding: 24px 26px 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .88em; margin-bottom: 6px; color: #2a3d50; }
.field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #c9d4de;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
    background: #fff;
}
.field input:focus { outline: none; border-color: var(--window-blue); }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(180deg, #3aa5df, #1c6f9f);
    color: #fff;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    font-size: 1.25em;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-shadow: 0 2px 3px rgba(0,0,0,.4);
    box-shadow: 0 4px 0 #12507a, 0 6px 10px rgba(0,0,0,.25);
    transition: filter .12s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #12507a; }
.btn-gold { background: linear-gradient(180deg, #ffd24d, #f2a900); color: #3a2400; text-shadow: none; box-shadow: 0 4px 0 #8f5900, 0 6px 10px rgba(0,0,0,.25); }
.btn-danger { background: linear-gradient(180deg, #ef6a47, #c13d1d); box-shadow: 0 4px 0 #8c2a12, 0 6px 10px rgba(0,0,0,.25); }
.btn-small { width: auto; padding: 8px 18px; font-size: 1em; }

.auth-or { text-align: center; color: #93a2af; margin: 16px 0; font-size: .85em; }
.oauth-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px;
    border-radius: 4px; border: 2px solid #c9d4de;
    background: #fff; font-weight: 700; cursor: pointer; margin-bottom: 10px;
    font-family: inherit; color: #2a3d50;
}
.oauth-btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.flash { padding: 11px 14px; border-radius: 4px; margin-bottom: 14px; font-size: .9em; font-weight: 600; }
.flash.success { background: #dff4e4; border: 2px solid var(--positive); color: #236a1d; }
.flash.error { background: #fde2da; border: 2px solid var(--negative); color: #8a2c12; }

/* ============================ PARAMÈTRES ============================ */

.settings-wrap { max-width: 720px; margin: 26px auto 70px; padding: 0 18px; color: #223; }
.settings-group {
    background: rgba(255,255,255,.94);
    border-radius: 6px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.settings-group h2 {
    margin: 0;
    padding: 12px 18px;
    background: linear-gradient(180deg, var(--window-blue), #185b83);
    color: #fff;
    font-size: 1.25em;
    text-transform: uppercase;
}
.settings-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.settings-row:last-child { border-bottom: none; }
.settings-row select, .settings-row input[type=email], .settings-row input[type=text] {
    padding: 8px 12px; border: 2px solid #c9d4de; border-radius: 4px; font-family: inherit;
}

/* 金色立体提交按钮（设置保存 / 反馈发送 / 后台登录共用） */
.auth-submit {
    display: inline-block;
    padding: 11px 38px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffd24d, #f2a900);
    color: #3a2400;
    font-family: inherit;
    font-size: .95em;
    font-weight: 800;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 4px 0 #8f5900, 0 6px 12px rgba(0,0,0,.25);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.auth-submit:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 5px 0 #8f5900, 0 8px 16px rgba(0,0,0,.28); }
.auth-submit:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f5900, 0 2px 5px rgba(0,0,0,.22); }
.auth-submit:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.settings-actions { display: flex; justify-content: flex-end; padding: 16px 2px 2px; }

/* ============================ CALCULATEURS ============================ */

.calc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.calc-tab {
    padding: 10px 18px; border-radius: 999px;
    background: rgba(255,255,255,.85); color: #1c6491;
    text-decoration: none; font-weight: 700; font-size: .9em;
    border: 2px solid transparent;
}
.calc-tab.active { background: #1c6491; color: #fff; }
.calc-card {
    background: rgba(255,255,255,.94);
    color: var(--ink);
    border-radius: 8px;
    padding: 22px 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,.14);
    max-width: 640px;
}
.calc-card h2 { color: #17283a; margin-top: 0; }
.calc-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.calc-row label { min-width: 200px; font-weight: 600; font-size: .92em; }
.calc-row input { width: 120px; padding: 9px 12px; border: 2px solid #c9d4de; border-radius: 4px; font-family: inherit; }
.calc-result {
    margin-top: 14px;
    background: #17283a; color: var(--gold-light);
    border-radius: 6px; padding: 16px 18px;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.5em; letter-spacing: 1px;
}
.calc-result small { display: block; font-family: 'Montserrat', 'Microsoft YaHei', sans-serif; font-size: .55em; color: #9db4c7; letter-spacing: 0; }

/* ---------------- Calculateur d'énergie ---------------- */
.calc-card-wide { max-width: 1200px; }
.energy-group-title {
    margin: 18px 0 10px;
    font-size: 1.05em; color: #17283a;
    border-left: 4px solid var(--gold); padding-left: 10px;
}
.energy-group-title:first-child { margin-top: 0; }
.energy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}
.energy-card {
    border: 1px solid rgba(43,74,97,.28);
    border-radius: 8px;
    background: rgba(255,255,255,.6);
    padding: 12px 10px 10px;
    text-align: center;
}
.energy-card img { width: 46px; height: 46px; object-fit: contain; }
.energy-name { font-weight: 700; color: #17283a; margin-top: 4px; font-size: .95em; }
.energy-cost { font-size: .78em; color: #54708a; margin: 2px 0 6px; }
.energy-ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; }
.energy-ctrl button {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid #b8860b;
    background: linear-gradient(180deg, #ffd75e 0%, #f0b429 100%);
    color: #5a3d00; font-weight: 900; font-size: 1.05em; line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 0 #8a6300, 0 3px 6px rgba(0,0,0,.25);
}
.energy-ctrl button:hover { filter: brightness(1.06); }
.energy-ctrl button:active { transform: translateY(2px); box-shadow: 0 0 0 #8a6300, 0 1px 3px rgba(0,0,0,.25); }
.energy-ctrl .energy-n { min-width: 26px; font-weight: 800; font-size: 1.1em; color: #17283a; }
.energy-sum { margin-top: 6px; font-size: .8em; font-weight: 700; color: #1c6491; }
.energy-total { margin-top: 20px; }
.energy-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.energy-reset { width: auto; flex-shrink: 0; padding: 5px 14px; font-size: .55em; font-family: 'Montserrat', 'Microsoft YaHei', sans-serif; letter-spacing: 0; }

/* ============================== TRACKER ============================== */

.tracker-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.tracker-row {
    display: flex; align-items: center; gap: 16px;
    background: #1e2b38;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 4px;
    padding: 10px 18px;
    margin-bottom: 8px;
}
.tracker-row img.bi { width: 52px; height: 52px; object-fit: contain; background: rgba(255,255,255,.08); border-radius: 4px; padding: 4px; }
.tracker-row .bn { font-weight: 700; }
.tracker-row select { margin-left: auto; background: #111a24; color: #7fc4ec; border: 1px solid rgba(255,255,255,.15); padding: 6px 10px; border-radius: 3px; }
.tracker-saved { color: var(--gold-light); font-size: .85em; font-weight: 700; opacity: 0; transition: opacity .3s; }
.tracker-saved.show { opacity: 1; }

/* Page légale */
.legal-wrap { max-width: 860px; margin: 30px auto 70px; padding: 0 18px; color: #243242; line-height: 1.7; }
.legal-card { background: rgba(255,255,255,.94); border-radius: 8px; padding: 26px 30px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.legal-card h1 { color: #17283a; margin-top: 0; }
.legal-card h2 { color: #1c6491; }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 1024px) {
    .home-columns { grid-template-columns: 1fr; }
    .dex-layout { grid-template-columns: 1fr; }
    .dex-side { position: static; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    :root { --topbar-h: 60px; }
    .topbar { padding: 8px 14px; gap: 10px; flex-wrap: nowrap; }
    .topbar-logo { font-size: clamp(1em, 4.2vw, 1.4em); min-width: 0; }
    .topbar-logo img { height: 30px; }
    .topbar-logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-nav, .nav-connexion { display: none; }
    .topbar-burger { display: flex; }
    .icon-btn { width: 38px; height: 38px; flex-shrink: 0; }
    .icon-btn img { width: 19px; }
    .topbar-actions { margin-left: auto; gap: 8px; flex-shrink: 0; }

    .news-card { grid-template-columns: 1fr; }
    .news-img-wrap { min-height: 170px; }
    .dex-hero-grid { grid-template-columns: 1fr; }
    /* 卡片标题条：换行排布，按钮不挤压、标题独占一行 */
    .dex-card-top { flex-wrap: wrap; row-gap: 8px; padding: 12px 14px; }
    .dex-card-top .server-switch { order: 3; }
    .dex-card-top .unit-name { order: 4; width: 100%; margin: 2px 0 0; font-size: 1.6em; }
    .footer-inner { grid-template-columns: 1fr; gap: 0; }
    /* 页脚手机端：分区卡片化、分隔线、链接带右箭头 */
    .site-footer { border-top-width: 3px; }
    .footer-inner { padding: 26px 18px 12px; }
    .footer-artwork { align-items: center; }
    .footer-artwork > img { width: 60px; }
    .footer-logo { font-size: 1.25em; }
    .footer-tagline { margin-top: 12px; font-size: .88em; }
    .footer-inner > div + div {
        margin-top: 18px; padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, .12);
    }
    .footer-col-title { font-size: 1.02em; margin-bottom: 4px; }
    .footer-inner a:not(.footer-logo):not(.social-btn) {
        display: flex; align-items: center; justify-content: space-between;
        padding: 10px 0; font-size: .95em;
    }
    .footer-inner a:not(.footer-logo):not(.social-btn)::after {
        content: '›'; color: rgba(255, 255, 255, .4);
        font-size: 1.3em; line-height: 1;
    }
    .social-btn { width: 46px; height: 46px; }
    .cycle-banner-body { flex-direction: column; align-items: flex-start; }
    .pass-hero-card { flex-direction: column; text-align: center; }
    .event-hero-banner { height: 180px; }
}

/* 窄屏（≤640px）才把图鉴卡片降到 3 列，641-900px 区间保持 4 列大卡 */
@media (max-width: 640px) {
    .dex-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ======================= BARRE D'ONGLETS MOBILE ======================= */

/* 移动端底部快捷导航：桌面不显示 */
.mobile-tabbar { display: none; }

@media (max-width: 900px) {
    /* 手机端防横向溢出：内容强制适配视口，数据表在自身容器内滑动 */
    html, body { overflow-x: hidden; }
    .dex-page { max-width: 100%; }
    .dex-card, .dex-card-body, .dex-info, .dex-info-section { min-width: 0; max-width: 100%; }
    .dex-card-body { overflow-x: hidden; }
    .dex-hero-grid > * { min-width: 0; max-width: 100%; }
    .dex-hero-grid > * > * { max-width: 100%; }

    body { padding-bottom: 76px; }
    .mobile-tabbar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1000;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, #14547e 0%, #0b3550 100%);
        border-top: 3px solid var(--gold);
        box-shadow: 0 -3px 10px rgba(0, 0, 0, .35);
    }
    .mobile-tabbar a {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 4px 0 2px;
        color: #fff;
        text-decoration: none;
        font-size: .66em;
        font-weight: 700;
        letter-spacing: .5px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
    }
    .mobile-tabbar a img {
        width: 26px; height: 26px;
        object-fit: contain;
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4));
    }
    .mobile-tabbar a.active { color: var(--gold-light); }
    .tabbar-menu-btn {
        flex: 0 0 auto;
        width: 56px; height: 56px;
        margin: -26px 4px 0;
        border-radius: 50%;
        border: 3px solid var(--gold);
        background: linear-gradient(180deg, #2a8fc7 0%, #0d3f61 100%);
        display: flex; align-items: center; justify-content: center;
        cursor: pointer;
        box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .2);
    }
    .tabbar-menu-btn:active { transform: scale(.94); }
}

/* ---------------- Modificateurs (fiche unité) ---------------- */
.mods-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 90;
    background: #1c6491; color: #fff; border: none; border-radius: 24px;
    padding: 12px 22px; cursor: pointer; text-transform: uppercase;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
    letter-spacing: 1px; font-size: 1.05em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.mods-fab:hover { background: #155070; }

/* 手机/平板端：加成修改器 FAB 避开底部导航栏 */
@media (max-width: 900px) {
    .mods-fab {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        z-index: 1100;
    }
}

/* 回到顶部：下滑超过 1000px 出现，叠在「计算加成」上方 */
.back-top {
    position: fixed; right: 22px; bottom: 84px; z-index: 90;
    width: 46px; height: 46px; border: none; border-radius: 50%;
    background: #1c6491; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none; transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { background: #155070; }
.back-top:active { transform: translateY(1px); }
.back-top svg { width: 22px; height: 22px; fill: currentColor; }
/* 页面没有「计算加成」按钮时贴到底部 */
.back-top.alone { bottom: 22px; }
@media (max-width: 900px) {
    .back-top { bottom: calc(158px + env(safe-area-inset-bottom, 0px)); z-index: 1100; }
    .back-top.alone { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

.mods-modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(10, 20, 30, .55);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.mods-modal[hidden] { display: none; }
.mods-dialog {
    background: #2b3a4a; color: #eef4f8; border-radius: 10px;
    width: min(580px, 100%); max-height: 90vh; overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.mods-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: #22303d;
}
.mods-head h3 {
    margin: 0; letter-spacing: 1px;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.4em;
}
.mods-close { background: none; border: none; color: #cfe0ec; font-size: 1.2em; cursor: pointer; }
.mods-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; background: #253341; }
.mods-tab {
    background: #1b2833; color: #cfe0ec; border: 1px solid #3a4f61;
    border-radius: 14px; padding: 5px 12px; font-size: .8em; font-weight: 700;
    cursor: pointer; text-transform: uppercase;
}
.mods-tab.active { background: #4aa3df; color: #0d1b26; border-color: #4aa3df; }
.mods-body { padding: 16px 18px; }
.mods-pane[hidden] { display: none; }
.mods-pane h4 {
    margin: 0 0 12px; color: #ffd23f; letter-spacing: 1px;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive; font-size: 1.2em;
}
.mods-field { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.mods-input { display: flex; align-items: center; gap: 6px; }
.mods-input input {
    width: 90px; padding: 8px; border-radius: 5px; text-align: right;
    border: 1px solid #3a4f61; background: #1b2833; color: #fff;
}
.mods-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.mods-apply, .mods-reset {
    flex: 1; border: none; border-radius: 6px; padding: 11px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 1px; font-size: 1.05em;
    font-family: 'Bangers', 'Microsoft YaHei', 'PingFang SC', cursive;
}
.mods-apply { background: #4aa3df; color: #0d1b26; }
.mods-apply:hover { background: #6bb6e8; }
.mods-reset { background: #4a5a68; color: #dcebf6; }
.mods-reset:hover { background: #5a6c7c; }
.dex-table td.mod-boosted { color: #2f9e44; font-weight: 800; }

/* ============================== 图标大小 ============================== */
body.icon-small .dex-icon-img img { width: 72%; height: 72%; }
body.icon-large .dex-icon-img img { width: 112%; height: 112%; }

/* ============================== 深色主题（军旅风） ============================== */
body.theme-dark { background: #222b1c; color: #eae5d3; }

body.theme-dark .side-section { background: #2e3a25; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
body.theme-dark .quicklink { color: #eae5d3; }
body.theme-dark .pass-card { color: #eae5d3; }
body.theme-dark .pass-card:hover { background: #3a4a2e; }
body.theme-dark .pass-season { color: #f2edd8; }
body.theme-dark .pass-dates { color: #b9b39e; }
body.theme-dark .side-footer-link { color: #ffd76a; border-top-color: rgba(255,255,255,.1); }
body.theme-dark .news-more-link { color: #ffd76a; }

body.theme-dark .monthly-table { background: #2e3a25; border-color: #57a7d4; }
body.theme-dark .monthly-main-title { color: #f2edd8; }
body.theme-dark .monthly-cell { background: #38472c; border-color: #50613f; color: #eae5d3; }
body.theme-dark .monthly-cell small { color: #b9b39e; }
body.theme-dark .monthly-events { border-color: #50613f; }
body.theme-dark .monthly-event-row { background: #38472c; border-top-color: #4b5b3c; color: #eae5d3; }
body.theme-dark .monthly-event-row span { color: #cfc9b2; }
body.theme-dark .monthly-note { background: #2e3a25; border-top-color: #4b5b3c; color: #b9b39e; }

body.theme-dark .dex-card { background: #2e3a25; color: #eae5d3; border-color: #4b5b3c; }
body.theme-dark .dex-carousel { background: linear-gradient(180deg,#38472c,#2c3922); }
body.theme-dark table.dex-table { background: #38472c; color: #eae5d3; }
body.theme-dark table.dex-table td { border-color: #4b5b3c; }
body.theme-dark table.dex-table th:first-child,
body.theme-dark table.dex-table td:first-child { border-right-color: #4b5b3c; }
body.theme-dark table.dex-table td:first-child { background: #38472c; }
body.theme-dark .dex-info p { color: #eae5d3; }
body.theme-dark .dex-icon { background: #38472c; border-color: rgba(255,255,255,.12); }
body.theme-dark .dex-icon-img { background: transparent; }

body.theme-dark .settings-card { background: #2e3a25; color: #eae5d3; }
body.theme-dark .settings-row label { color: #eae5d3; }
body.theme-dark .settings-sub { color: #b9b39e; }
body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea { background: #38472c; color: #eae5d3; border-color: #50613f; }
