/* lol.css - League randomizers: /lol (Ultimate Bravery) + /lol/team (Team Comp) */

/* ===== full-bleed shell + themed backdrop ===== uses .ghub-ambient for the
   centred, full-content-width wrapper (see gamers.css). */
.lol-shell {
    /* set per-load to a random theme backdrop (see LolBackgrounds.cs). Unset (e.g.
       the light theme) falls back to the CSS-only backdrop. */
    --lol-bg-img: none;
}

/* inset:-36px bleeds under .content's padding to the real edges */
.lol-bg {
    position: absolute;
    inset: -36px;
    z-index: -1;
    overflow: hidden;
    background: var(--content-bg, #08070f);
}

/* the chosen wallpaper, blurred so it reads as atmosphere; the scale hides the
   blurred edges. Filter is painted once, not per frame. */
.lol-bg-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--lol-bg-img, none) center / cover no-repeat;
    filter: blur(7px) brightness(0.55) saturate(1.05);
    transform: scale(1.1);
}

/* scrim for legibility + per-theme accent glow (top/bottom) + vignette */
.lol-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(1100px 560px at 50% -80px, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%),
        radial-gradient(1100px 560px at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 74%),
        linear-gradient(180deg, rgba(8, 7, 12, 0.62) 0%, rgba(8, 7, 12, 0.42) 38%, rgba(8, 7, 12, 0.78) 100%);
}

.lol-page {
    position: relative;
    width: 100%;
    max-width: 1180px;
    padding: 6px 4px 52px;
    box-sizing: border-box;
}

/* ===== topbar: back (left) + share/copy (right) ===== */
.lol-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.lol-actions { display: inline-flex; gap: 8px; }

.lol-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    font-size: 1.05rem;
    border-radius: 11px;
    border: 1px solid var(--surface-border);
    background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.lol-icon-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    color: var(--accent-text, #fff);
}

/* ===== head ===== uses the site-wide .page-title */
.lol-head { text-align: center; }
.lol-head .page-title { margin: 6px 0 12px !important; }

.lol-sub {
    margin: 0 auto 20px;
    max-width: 560px;
    color: var(--text-muted, #8b8794);
    font-size: 0.95rem;
    line-height: 1.5;
}

.lol-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.lol-mode {
    display: inline-flex;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface-solid) 50%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.lol-mode-btn {
    background: transparent;
    color: var(--text-muted, #8b8794);
    border: 0;
    padding: 9px 20px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: color 0.15s ease, background 0.15s ease;
}

.lol-mode-btn.active {
    background: color-mix(in srgb, var(--accent) 85%, #000);
    color: #fff;
}

.lol-roll {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 26px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-soft, var(--accent)), var(--accent));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 16%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lol-roll:hover { transform: translateY(-1px); }
.lol-roll:disabled { opacity: 0.6; cursor: default; transform: none; }

.lol-error,
.lol-empty {
    text-align: center;
    color: var(--text-muted, #8b8794);
    padding: 60px 0;
    font-size: 1.05rem;
}

/* ===== board ===== */
.lol-board {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    animation: lol-rise 0.4s ease-out backwards;
}

@keyframes lol-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ===== champion hero ===== */
.lol-champ {
    position: relative;
    min-height: 300px;
    border-radius: 18px;
    overflow: hidden;
    background-size: cover;
    background-position: center 20%;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--surface-border));
    box-shadow: var(--surface-shadow);
    display: flex;
    align-items: flex-end;
}

/* readability scrim: dark from the left (behind the text) and bottom */
.lol-champ::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 7, 12, 0.92) 0%, rgba(8, 7, 12, 0.5) 46%, transparent 78%),
        linear-gradient(0deg, rgba(8, 7, 12, 0.8) 0%, transparent 55%);
}

.lol-champ-info {
    position: relative;
    z-index: 1;
    padding: 24px 26px;
    color: #fff;
    max-width: 75%;
}

.lol-role {
    display: inline-block;
    background: color-mix(in srgb, var(--accent) 82%, #000);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.lol-champ-name {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.02;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.lol-champ-title {
    display: block;
    margin-top: 5px;
    color: #e6d6ff;
    font-style: italic;
    font-size: 1.02rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.lol-tags { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }

.lol-tag {
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    padding: 3px 10px;
    font-size: 0.76rem;
}

.lol-champ-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

/* cursedness pill, pinned bottom-right of the hero */
.lol-cursed {
    position: absolute;
    z-index: 2;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    background: rgba(8, 7, 12, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 7px 14px;
}

.lol-cursed-label { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.lol-cursed-bar { width: 90px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.lol-cursed-bar span { display: block; height: 100%; background: #6ee06e; }
.lol-cursed-score { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.85rem; }
.lol-cursed-mid .lol-cursed-bar span { background: #e8c84a; }
.lol-cursed-high .lol-cursed-bar span { background: #f08a3c; }
.lol-cursed-max .lol-cursed-bar span { background: #e0556e; }

/* ===== cards ===== glassy, theme-tinted (mirrors the gamers hub surfaces) */
.lol-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.lol-card {
    background: linear-gradient(155deg,
        color-mix(in srgb, var(--accent) 8%, color-mix(in srgb, var(--surface-solid) 70%, transparent)) 0%,
        color-mix(in srgb, var(--surface-solid) 80%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--surface-border));
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lol-card-wide { grid-column: 1 / -1; }

.lol-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary, #fff);
    margin-bottom: 14px;
}

.lol-card-head > span:first-child { flex: 1; display: inline-flex; align-items: center; gap: 9px; }

/* small rotated accent gem before each card title */
.lol-card-head > span:first-child::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.lol-mini {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: color-mix(in srgb, var(--surface-solid) 40%, transparent);
    color: var(--text-muted, #8b8794);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lol-mini:hover { color: var(--text-primary, #fff); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.lol-mini.active { background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff; border-color: var(--accent); }
.lol-mini:disabled { opacity: 0.5; cursor: default; }

.lol-spells { display: flex; flex-wrap: wrap; gap: 14px; }
/* build: a left-to-right build-order path, tiles linked by arrows */
.lol-items { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.lol-items .lol-item { width: 84px; }
.lol-items .lol-item img { width: 64px; height: 64px; }
.lol-item-arrow {
    align-self: flex-start;
    margin-top: 22px;
    color: color-mix(in srgb, var(--accent) 65%, var(--text-muted, #8b8794));
    font-size: 1.15rem;
}

.lol-spell, .lol-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 62px;
    text-align: center;
}

.lol-spell img, .lol-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--surface-border));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.lol-spell span, .lol-item span { font-size: 0.7rem; color: var(--text-muted, #8b8794); line-height: 1.15; }

.lol-skills { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.lol-skill {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-weight: 800;
    color: #fff;
    background: color-mix(in srgb, var(--accent) 22%, var(--surface-solid));
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}

.lol-skill-r { background: #c9a227; border-color: #e2c14d; color: #1a1206; }
.lol-skill-sep { color: var(--text-muted, #8b8794); font-size: 0.8rem; }

/* runes like the post-game screen: the two trees on the left, the stat shards as
   a labelled list pushed to the right, the whole row spread across the card. */
.lol-runes {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px 40px;
}
.lol-rune-tree-name { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; color: var(--text-primary, #fff); }
.lol-rune-tree-name img { width: 26px; height: 26px; }
.lol-rune-row { display: flex; align-items: center; gap: 12px; }
.lol-rune {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--surface-border));
}
.lol-keystone { width: 56px; height: 56px; }

.lol-shards { display: flex; flex-direction: column; gap: 11px; }
.lol-shard-row { display: flex; align-items: center; gap: 10px; }
.lol-shard { width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); }
.lol-shard-row span { font-size: 0.82rem; font-weight: 600; color: var(--text-muted, #8b8794); white-space: nowrap; }

@media (max-width: 720px) {
    .lol-cards { grid-template-columns: 1fr; }
    .lol-champ-info { max-width: 100%; }
    .lol-champ-name { font-size: 1.9rem; }
    .lol-cursed { position: static; margin: 0 18px 18px; align-self: flex-start; }
}

/* ===== team comp roller (/lol/team) ===== a lobby grid of 5 champ-select cards.
   reuses .lol-mini / .lol-role / .lol-roll. */
.team-lobby {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 20px;
    animation: lol-rise 0.4s ease-out backwards;
}

.team-slot {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 11px;
    padding: 16px 14px 14px;
    border-radius: 16px;
    background: linear-gradient(155deg,
        color-mix(in srgb, var(--accent) 8%, color-mix(in srgb, var(--surface-solid) 70%, transparent)) 0%,
        color-mix(in srgb, var(--surface-solid) 80%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--surface-border));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    /* champ-select side accent */
    border-top: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
}

/* result-champion ambience behind the card (like the hub's LoL splash). The
   champion loading art is dimmed + scrimmed so the icon and text stay readable. */
.team-slot-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center 14%;
    opacity: 0.5;
}

.team-slot-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 7, 12, 0.45) 0%, rgba(8, 7, 12, 0.2) 32%, rgba(8, 7, 12, 0.92) 100%);
}

.team-slot > *:not(.team-slot-art) { position: relative; z-index: 1; }
.team-slot .team-champ-name { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75); }
.team-slot .team-champ-title { color: #e6d6ff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75); }

.team-role {
    margin-bottom: 0;
    min-width: 70px;
}

.team-champ { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.team-square {
    width: 92px;
    height: 92px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--surface-border));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.team-square-empty {
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-muted, #8b8794);
    background: color-mix(in srgb, var(--surface-solid) 50%, transparent);
}

.team-champ-text { min-height: 40px; }
.team-champ-name { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary, #fff); }
.team-champ-title { display: block; font-size: 0.74rem; color: var(--text-muted, #8b8794); font-style: italic; }

.team-name {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    text-align: center;
    background: color-mix(in srgb, var(--surface-solid) 45%, transparent);
    color: var(--text-primary, #fff);
    border: 1px solid var(--surface-border);
    border-radius: 9px;
    font: inherit;
    font-size: 0.86rem;
}

.team-name::placeholder { color: var(--text-muted, #8b8794); }
.team-name:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.team-actions { display: flex; gap: 8px; }

/* ===== hud-hidden: tuck the panels away to admire the wallpaper =====
   only the eye toggle stays. Opacity fades (composite-friendly); the background
   blur is snapped, not transitioned, to stay smooth on weak devices. */
.lol-head,
.lol-board,
.team-lobby,
.pick-grid,
.pick-notice { transition: opacity 0.3s ease; }
.lol-bg::before { transition: opacity 0.3s ease; }

.lol-shell.hud-hidden .lol-head,
.lol-shell.hud-hidden .lol-board,
.lol-shell.hud-hidden .team-lobby,
.lol-shell.hud-hidden .pick-grid,
.lol-shell.hud-hidden .pick-notice {
    opacity: 0;
    pointer-events: none;
}

/* reveal the wallpaper as sharply as the asset allows: no blur, native scale */
.lol-shell.hud-hidden .lol-bg-photo {
    filter: brightness(0.96) saturate(1.06);
    transform: none;
}

.lol-shell.hud-hidden .lol-bg::before { opacity: 0.22; }

/* keep the eye exactly put - hide its neighbours without collapsing their boxes */
.lol-shell.hud-hidden .lol-topbar .hub-back,
.lol-shell.hud-hidden .lol-actions .lol-icon-btn:not(.lol-eye) { visibility: hidden; }

/* ===== modular picker (/lol/picker) ===== independent dice tiles */
.pick-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px auto 0;
    max-width: 560px;
    padding: 12px 18px;
    border-radius: 12px;
    color: var(--text-primary, #fff);
    background: color-mix(in srgb, var(--accent) 14%, color-mix(in srgb, var(--surface-solid) 70%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--surface-border));
    font-size: 0.92rem;
    animation: lol-rise 0.3s ease-out backwards;
}

.pick-notice i { font-size: 1.1rem; color: var(--accent-text, #fff); }

.pick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 22px;
    animation: lol-rise 0.4s ease-out backwards;
}

.pick-tile {
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg,
        color-mix(in srgb, var(--accent) 8%, color-mix(in srgb, var(--surface-solid) 70%, transparent)) 0%,
        color-mix(in srgb, var(--surface-solid) 80%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--surface-border));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pick-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 10px;
}

.pick-tile-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary, #fff);
}

.pick-tile-body {
    position: relative;
    flex: 1;
    min-height: 220px;
    display: flex;
}

/* splash-backed tiles (champion, skin) */
.pick-splash {
    align-items: flex-end;
    background-size: cover;
    background-position: center 22%;
}

.pick-splash::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(8, 7, 12, 0.9) 0%, rgba(8, 7, 12, 0.25) 55%, transparent 100%);
}

.pick-splash-info {
    position: relative;
    z-index: 1;
    padding: 18px 18px;
    color: #fff;
    width: 100%;
}

/* centred tiles (item, mode) */
.pick-center {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 18px;
    text-align: center;
}

.pick-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.pick-meta {
    display: block;
    margin-top: 3px;
    color: #d9ccf0;
    font-size: 0.9rem;
    font-style: italic;
}

.pick-gold { font-style: normal; color: #f0c95a; font-weight: 600; }

.pick-item-icon {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--surface-border));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.pick-mode-name { font-size: 1.7rem; }

.pick-format {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 82%, #000);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.pick-empty { margin: auto; color: var(--text-muted, #8b8794); font-size: 0.95rem; }

@media (max-width: 620px) {
    .pick-grid { grid-template-columns: 1fr; }
}
