/* ═══════════════════════════════════════════════════════════════
   GACHAS (gachas.php list: gl-*) + GACHA DETAIL (gacha.php: gc-*)
   Builds on css/character.css (the cd-* tokens, panels, buttons, tabs,
   .it-* items, .tb-lcard / .md-thumb frames). Static: hover / focus
   feedback only, no loaders or intro animations.
   ═══════════════════════════════════════════════════════════════ */

/* ── Unit thumb (.gu): framed character / memory icon, frames drawn by CSS so the
      long lists stay light (one <img> per unit). c = card, m = memory, r1-4 rarity,
      a1-5 card attribute, pu = featured. ─────────────────────────────── */
.gu {
    position: relative;
    display: block;
    flex: none;
    width: 40px;
    aspect-ratio: 1;
    isolation: isolate;
    background: center / 100% 100% no-repeat;
    text-decoration: none;
}
.gu img { position: relative; display: block; width: 100%; height: 100%; }
.gu::after, .gu.c::before {
    content: '';
    position: absolute;
    background: center / 100% 100% no-repeat;
    pointer-events: none;
}
.gu::after { inset: 0; z-index: 1; }
.gu.c::before { left: 5.3%; top: 71.6%; width: 23%; height: 23%; z-index: 2; background-size: contain; }
.gu.c.r1 { background-image: url('/assets/chara_bg_frame/chara_bg_101.webp'); }
.gu.c.r2 { background-image: url('/assets/chara_bg_frame/chara_bg_102.webp'); }
.gu.c.r3 { background-image: url('/assets/chara_bg_frame/chara_bg_103.webp'); }
.gu.c.r4 { background-image: url('/assets/chara_bg_frame/chara_bg_104.webp'); }
.gu.c.r1::after { background-image: url('/assets/chara_bg_frame/chara_frame_101.webp'); }
.gu.c.r2::after { background-image: url('/assets/chara_bg_frame/chara_frame_102.webp'); }
.gu.c.r3::after { background-image: url('/assets/chara_bg_frame/chara_frame_103.webp'); }
.gu.c.r4::after { background-image: url('/assets/chara_bg_frame/chara_frame_104.webp'); }
.gu.a1::before { background-image: url('/assets/type/card_attribute_01.webp'); }
.gu.a2::before { background-image: url('/assets/type/card_attribute_02.webp'); }
.gu.a3::before { background-image: url('/assets/type/card_attribute_03.webp'); }
.gu.a4::before { background-image: url('/assets/type/card_attribute_04.webp'); }
.gu.a5::before { background-image: url('/assets/type/card_attribute_05.webp'); }
.gu.m img {
    position: absolute;
    inset: 2.5%;
    width: 95%;
    height: 95%;
    -webkit-mask: url('/assets/mem_icons/card_memoryicon_mask.webp') center / 100% 100% no-repeat;
    mask: url('/assets/mem_icons/card_memoryicon_mask.webp') center / 100% 100% no-repeat;
}
.gu.m.r1::after { background-image: url('/assets/memory_frames/memory_frame_101.webp'); }
.gu.m.r2::after { background-image: url('/assets/memory_frames/memory_frame_102.webp'); }
.gu.m.r3::after { background-image: url('/assets/memory_frames/memory_frame_103.webp'); }
.gu.m.r4::after { background-image: url('/assets/memory_frames/memory_frame_104.webp'); }
.gu.pu { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 6px; }   /* inside the cell: same spacing as the rest */
a.gu { transition: transform 0.2s; }
a.gu:hover { transform: scale(1.08); z-index: 1; }
a.gu:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ── Shared tags (list cards + detail hero) ────────────────────── */
.gl-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.3px;
    text-decoration: none;
    white-space: nowrap;
}
.cd-jp .gl-tag { letter-spacing: 0; }
.gl-tc { --tc: #7fb4ec; color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); }
.gl-tc-event { --tc: #f9a26c; }
.gl-tc-special { --tc: #cf8bf0; }
.gl-tc-fest { --tc: #f57f8c; }
.gl-tc-stepup { --tc: #e8d26a; }
.gl-tc-anniversary { --tc: #f58cbd; }
.gl-tc-custom { --tc: #82b2f5; }
.gl-tc-ticket { --tc: #73e278; }
a.gl-tc:hover { background: color-mix(in srgb, var(--tc) 28%, transparent); color: #fff; }
.gl-tjp { color: #ff9b9b; background: rgba(232, 65, 60, 0.16); }
.gl-tfree { color: var(--up); background: rgba(121, 255, 128, 0.1); }
.gl-tur { color: var(--gold); background: rgba(255, 213, 83, 0.12); }

/* ═══════════════════════════ LIST ═══════════════════════════════ */
.gl { display: grid; gap: 18px; align-content: start; }
.gl > * { min-width: 0; }
.gl-head { margin-top: 6px; }
.gl-h1 { display: inline-block; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.gl-lead { margin: 14px 0 0; color: var(--text-2); font-size: 0.92rem; }

.gl-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); }
.gl-n { margin-left: 2px; font-size: 0.72rem; font-weight: 500; opacity: 0.75; font-variant-numeric: tabular-nums; }

.gl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.gl-input, .gl-select {
    min-width: 0;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(10, 22, 40, 0.72);
    color: var(--text);
    font: 500 0.9rem/1.2 var(--font-body);
}
.gl-input { flex: 1 1 220px; }
.gl-input::placeholder { color: var(--text-3); }
.gl-select {
    padding-right: 32px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%239fb2d3'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
.gl-select option { background: var(--navy-mid); color: var(--text); }
.gl-input:focus-visible, .gl-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.gl-switch { font-size: 0.84rem; }
.gl-count { margin: 12px 0 0; color: var(--text-3); font-size: 0.82rem; }

.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.gl-card { min-width: 0; }
.gl-card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.gl-card > a:hover { transform: translateY(-2px); border-color: var(--acc2); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.gl-card > a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gl-ban { display: block; aspect-ratio: 284 / 124; background: rgba(0, 0, 0, 0.3); }
.gl-ban img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gl-ban-tk, .gc-hero-tk {
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse at 50% 60%, rgba(87, 221, 92, 0.22), transparent 65%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px),
        linear-gradient(160deg, #1a3a2e, #0d1f2c);
}
.gl-ban-tk img { width: auto; height: 76%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.gl-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.gl-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.gl-card > a:hover .gl-name { color: var(--acc2); }
.gl-date { color: var(--text-2); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.gl-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.gl-picks { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 4px; }
.gl-more { margin-left: 2px; color: var(--text-3); font-size: 0.76rem; font-weight: 600; }
.gl-empty { margin: 0; color: var(--text-2); text-align: center; }

/* ═══════════════════════════ DETAIL ═════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────── */
.gc-hero {
    display: grid;
    gap: 16px 24px;
    margin: 6px 0 22px;
    padding: 14px;
    border: 2px solid var(--acc);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--acc) 32%, transparent), transparent 60%),
        linear-gradient(160deg, var(--navy-light), var(--navy));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.gc-hero > * { min-width: 0; }
.gc-hero-art {
    justify-self: center;
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.gc-hero-key .gc-hero-art { max-width: 640px; }
.gc-hero-art img { display: block; width: 100%; height: auto; }
.gc-hero-tk { aspect-ratio: 284 / 124; }
.gc-hero-tk img { width: auto; height: 78%; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
@media (min-width: 760px) {
    .gc-hero { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: center; padding: 20px; }
    .gc-hero-key { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
.gc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gc-tags > li { display: flex; }   /* the linked category tag sits in a plain <li>: no text baseline, so every tag gets the same box */
.gc-name {
    margin: 10px 0 6px;
    color: #fff;
    font: 400 clamp(1.35rem, 4vw, 2rem)/1.2 var(--font-display);
    letter-spacing: 0.4px;
    text-shadow: 0 3px 0 var(--acc), 0 6px 18px rgba(0, 0, 0, 0.5);
    overflow-wrap: anywhere;
}
.cd-jp .gc-name { font-size: clamp(1.2rem, 3.6vw, 1.75rem); letter-spacing: 0; }
.gc-period { margin: 0; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.gc-jst { display: inline-block; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--text-3); font-size: 0.7rem; font-weight: 700; vertical-align: 1px; }
.gc-hero-note { margin: 8px 0 0; color: var(--text-3); font-size: 0.82rem; }
.gc-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gc-hero-actions .cd-btn { max-width: 100%; white-space: normal; }

/* ── Recruit info: description, buttons, steps ─────────────────── */
.gc-desc {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-left: 3px solid var(--acc2);
    border-radius: 0 8px 8px 0;
    background: rgba(0, 0, 0, 0.22);
    color: #d6def0;
    overflow-wrap: anywhere;
}
.gx-red { color: #ff7070; font-weight: 700; }
.gx-yel { color: #ffe14d; font-weight: 700; }
.gx-pink { color: #ff6fb1; font-weight: 700; }
.gc-empty { margin: 0; padding: 10px 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: var(--text-2); font-size: 0.9rem; }

.gc-btns { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gc-btn {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}
.gc-btn-n {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--acc);
    color: var(--acc-ink);
    font: 400 1.05rem/1 var(--font-display);
    white-space: nowrap;
}
.gc-costs, .gc-step-cost, .gc-bonus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.gc-costs .it, .gc-step-cost .it, .gc-bonus .it { max-width: 100%; }
.gc-or { color: var(--text-3); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.gc-guar { grid-column: 2; margin: 0; color: var(--gold); font-size: 0.8rem; font-weight: 600; }
.gc-guar::before { content: '★ '; }
.gc-bonus { margin: 12px 0 0; }
.gc-k { color: var(--text-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.cd-jp .gc-k, .cd-jp .gc-or { letter-spacing: 0; }

.gc-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .gc-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .gc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gc-step {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
}
.gc-step:last-child { border-color: color-mix(in srgb, var(--acc2) 55%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 24%, transparent), rgba(255, 255, 255, 0.03) 60%); }
.gc-step-no { margin: 0; color: var(--gold); font: 400 1.2rem/1 var(--font-display); }
.gc-step-no img { display: block; width: auto; height: 30px; }
.gc-step-title { margin: 0; font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.gc-step-cost { margin: 0; }
.gc-step .gc-guar { grid-column: auto; }
.gc-step .gc-bonus { margin: 0; }
.gc-step-note summary { color: var(--text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.gc-step-note summary:hover { color: var(--text); }
.gc-notes { display: grid; gap: 6px; margin: 0; padding-left: 1.2em; color: var(--text-2); font-size: 0.86rem; overflow-wrap: anywhere; }
.gc-step-note .gc-notes { margin-top: 6px; font-size: 0.78rem; }

/* ── Hot Picks / Lineup ────────────────────────────────────────── */
.gc-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 150px)); gap: 14px 12px; margin: 0; padding: 0; list-style: none; }
.gc-pick { display: grid; gap: 5px; color: var(--text); text-decoration: none; }
.gc-pick .tb-lcard, .gc-mem-box { width: 100%; transition: transform 0.2s; }
.gc-pick:hover .tb-lcard, .gc-pick:hover .gc-mem-box { transform: translateY(-3px); }
.gc-pick:hover .gc-pick-n { color: var(--acc2); }
.gc-pick:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.gc-mem-box { display: grid; place-items: center; aspect-ratio: 190 / 240; }
.gc-mem-box .md-thumb { width: 94%; }
.gc-pick-n {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-2);
    font-size: 0.74rem;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.gc-pick-r { justify-self: center; padding: 0 8px; border-radius: 999px; background: rgba(255, 213, 83, 0.14); color: var(--gold); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Unit / goods groups (picks > 12, all drops, exchange) ─────── */
.gc-ugroup + .gc-ugroup { margin-top: 14px; }
.gc-ugroup-h { margin: 0 0 8px; font-size: 0.9rem; font-weight: 600; }
summary.gc-ugroup-h { display: list-item; cursor: pointer; }
summary.gc-ugroup-h:hover { color: #fff; }
details.gc-ugroup:not([open]) > .gc-ugroup-h { margin-bottom: 0; }
.gc-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 576px) { .gc-units { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); } }
.gc-units .gu { width: 100%; }
.gc-each { color: var(--text-3); font-size: 0.76rem; font-weight: 500; }
.gc-warn {
    margin: 0 0 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 213, 83, 0.25);
    border-radius: 8px;
    background: rgba(255, 213, 83, 0.07);
    color: #f1e3ae;
    font-size: 0.82rem;
}

/* ── Drop rates ────────────────────────────────────────────────── */
.gc-rgroup + .gc-rgroup { margin-top: 18px; }
.gc-h3 { margin: 0 0 4px; color: #fff; font: 700 0.95rem/1.3 var(--font-body); }
.gc-h3 small { color: var(--text-3); font-size: 0.76rem; font-weight: 500; }
.gc-rtable { margin-top: 0; }
.gc-rtable th, .gc-rtable td { white-space: nowrap; }
.gc-rtable thead th:first-child, .gc-rtable th[scope="row"] { text-align: left; }
.gc-rtable tbody th[scope="row"] { white-space: normal; }
.gc-rtable tbody td:nth-child(2) { text-align: center; }
.gc-rtable td small { color: var(--text-3); font-size: 0.75rem; }
.gc-rtable tfoot th, .gc-rtable tfoot td { font-weight: 600; color: var(--text-2); }
.gc-pu-row { background: rgba(255, 213, 83, 0.05); }
.gc-pu { display: inline-block; padding: 0 6px; border-radius: 999px; background: rgba(255, 213, 83, 0.16); color: var(--gold); font-size: 0.66rem; font-weight: 700; white-space: nowrap; vertical-align: 1px; }
.gc-r {
    display: inline-block;
    min-width: 2.3em;
    padding: 0 6px;
    border-radius: 4px;
    color: #0a1628;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.6;
    text-align: center;
}
.gc-r4 { background: linear-gradient(90deg, #ffd553, #ff9de2 55%, #8fd3ff); }
.gc-r3 { background: #ffd553; }
.gc-r2 { background: #c3cede; }
.gc-r1 { background: #c09a73; }
@media (max-width: 379px) {
    .gc-rtable th, .gc-rtable td { padding: 5px 4px; }
    .gc-rtable thead th { white-space: normal; }   /* JP headers (レアリティ / 1体あたり) fit at 320px */
}

/* ── Recruit Exchange ──────────────────────────────────────────── */
.gc-goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 8px; margin: 0; padding: 0; list-style: none; }
.gc-good { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.gc-good .it-tile .it-ic { width: 60px; }
.gc-good-n {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-2);
    font-size: 0.7rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.gc-good-p { color: var(--text-2); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.gc-good-p b { color: var(--gold); }
.gc-good-m { color: var(--text-3); font-size: 0.68rem; }

/* ── Related (sidebar) ─────────────────────────────────────────── */
#related .cd-sub-h:first-of-type { margin-top: 0; }
.gc-rels { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gc-rel {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.gc-rel:hover { border-color: var(--acc2); background: rgba(0, 0, 0, 0.3); }
.gc-rel:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gc-rel img { display: block; width: 100%; height: auto; aspect-ratio: 284 / 124; object-fit: cover; border-radius: 6px; }
.gc-rel-txt { display: grid; gap: 2px; min-width: 0; }
.gc-rel-txt:only-child { grid-column: 1 / -1; padding: 2px 4px; }
.gc-rel-k { color: var(--text-3); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.cd-jp .gc-rel-k { letter-spacing: 0; }
.gc-rel-t {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.gc-rel:hover .gc-rel-t { color: var(--acc2); }
.gc-rel-d { color: var(--text-3); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.gc-rels-sm .gc-rel { grid-template-columns: 92px minmax(0, 1fr); }
.gc-back { margin: 0; text-align: center; }
.cd-facts a { color: var(--acc2); }

@media (prefers-reduced-motion: reduce) {
    .gl-card > a, a.gu, .gc-pick .tb-lcard, .gc-mem-box { transition: none; }
}
.gc .cd-note a { color: var(--acc2); }
.gc .cd-note a:hover { color: #fff; }
