/* Champ Rune — the League of Legends champion browser (js/champ-rune.js). Theme-aware like the
   other tool pages: tokens on :root, redefined under body.dark-theme. Gold + blue are Riot's
   accent pair; the dark page background is the app's own #0a1428. */
:root {
    --cr-bg: #f3f5f9;
    --cr-surface: #ffffff;
    --cr-ink: #0a1428;
    --cr-muted: #5b6478;
    --cr-gold: #c8aa6e;
    --cr-blue: #0ac8b9;
    --cr-line: #dde2ec;
    --cr-gold-soft: rgba(200, 170, 110, .18);
    --cr-blue-soft: rgba(10, 200, 185, .14);
    --cr-shadow: 0 10px 30px rgba(10, 20, 40, .10);
    --cr-nav: 72px;
}

body.dark-theme {
    --cr-bg: #0a1428;
    --cr-surface: #121f36;
    --cr-ink: #f0e6d2;
    --cr-muted: #a09b8c;
    --cr-line: #26344d;
    --cr-gold-soft: rgba(200, 170, 110, .22);
    --cr-blue-soft: rgba(10, 200, 185, .18);
    --cr-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, which silently kills any position: sticky inside. */
.cr-body, body.cr-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--cr-bg);
    color: var(--cr-ink);
    min-height: 100vh;
    overflow-x: clip;
}
.cr-main { padding-top: 100px; padding-bottom: 40px; }
.cr-main .container { max-width: 1240px; }
.cr-main a { color: var(--cr-blue); }
.cr-main a:hover { color: var(--cr-gold); }

/* ---- hero ---- */
.cr-hero { text-align: center; padding: 4px 0 14px; }
.cr-hero-icon { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: #0a1428; background: linear-gradient(135deg, #f0d49a, var(--cr-gold) 55%, #8a6b36); box-shadow: var(--cr-shadow); }
.cr-hero h1 { font-weight: 800; font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: -.02em; margin: 0 0 10px; }
.cr-lead { max-width: 760px; margin: 0 auto 8px; color: var(--cr-muted); font-size: 1rem; line-height: 1.6; }
.cr-lead strong { color: var(--cr-ink); }
.cr-lead-small { font-size: .9rem; }
.cr-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--cr-line); background: var(--cr-surface); color: var(--cr-muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.cr-badge svg, .cr-badge i { color: var(--cr-gold); }

/* ---- sticky toolbar: search, role chips, sort ---- */
.cr-toolbar {
    position: sticky; top: var(--cr-nav, 72px); z-index: 1020; /* under #mainNav (1050), over the cards */
    padding: 10px 0 8px; background: var(--cr-bg);
    border-bottom: 1px solid var(--cr-line);
    box-shadow: 0 8px 18px rgba(10, 20, 40, .06);
}
body.dark-theme .cr-toolbar { box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.cr-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cr-toolbar-row + .cr-toolbar-row { margin-top: 8px; }
.cr-search-wrap { position: relative; display: flex; align-items: center; gap: 10px; flex: 1 1 260px; min-width: 0; margin: 0; padding: 0 14px; border: 1px solid var(--cr-line); border-radius: 12px; background: var(--cr-surface); color: var(--cr-muted); }
.cr-search-wrap:focus-within { border-color: var(--cr-blue); box-shadow: 0 0 0 3px var(--cr-blue-soft); }
#cr-search { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--cr-ink); font-size: 1rem; outline: none; }
#cr-search::placeholder { color: var(--cr-muted); opacity: .8; }
#cr-search::-webkit-search-cancel-button { cursor: pointer; }
.cr-count { color: var(--cr-muted); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-chips, .cr-sorts { gap: 6px; }
.cr-tag, .cr-sort { min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--cr-line); background: var(--cr-surface); color: var(--cr-ink); font-size: .85rem; font-weight: 600; cursor: pointer; touch-action: manipulation; transition: background .12s, border-color .12s, color .12s; }
.cr-tag:hover, .cr-sort:hover { border-color: var(--cr-gold); }
.cr-tag:focus-visible, .cr-sort:focus-visible, .cr-card:focus-visible, .cr-lane:focus-visible, .cr-outlink:focus-visible, .cr-btn:focus-visible { outline: 2px solid var(--cr-blue); outline-offset: 2px; }
.cr-tag.is-active { background: var(--cr-gold); border-color: var(--cr-gold); color: #0a1428; }
.cr-sort.is-active { background: var(--cr-ink); border-color: var(--cr-ink); color: var(--cr-bg); }
body.dark-theme .cr-sort.is-active { background: var(--cr-blue); border-color: var(--cr-blue); color: #0a1428; }
.cr-sort-label { color: var(--cr-muted); font-size: .85rem; margin-right: 2px; }

/* ---- the roster grid ---- */
.cr-roster { padding: 16px 0 0; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cr-grid-msg, .cr-error { grid-column: 1 / -1; margin: 30px 0; text-align: center; color: var(--cr-muted); }
.cr-error { color: #dc3545; }
.cr-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 100%; min-width: 0; padding: 10px 8px 10px; margin: 0;
    border: 1px solid var(--cr-line); border-radius: 14px; background: var(--cr-surface); color: var(--cr-ink);
    font: inherit; text-align: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cr-card:hover { transform: translateY(-2px); border-color: var(--cr-gold); box-shadow: var(--cr-shadow); }
.cr-card.is-active { border-color: var(--cr-gold); box-shadow: 0 0 0 2px var(--cr-gold), 0 0 22px rgba(200, 170, 110, .65); }
.cr-portrait { width: 100%; max-width: 120px; aspect-ratio: 1 / 1; border-radius: 12px; object-fit: cover; background: #0a1428; border: 1px solid var(--cr-line); }
.cr-name { display: block; max-width: 100%; margin-top: 4px; font-weight: 700; font-size: .95rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-title { display: block; max-width: 100%; color: var(--cr-muted); font-size: .76rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-pips { display: flex; gap: 4px; margin-top: 4px; }
.cr-pip { width: 8px; height: 8px; border-radius: 50%; background: var(--cr-muted); }
.cr-pip-fighter { background: #e2653f; }
.cr-pip-tank { background: #6c8ca6; }
.cr-pip-mage { background: #7c5cff; }
.cr-pip-assassin { background: #c42b4f; }
.cr-pip-support { background: #2db384; }
.cr-pip-marksman { background: #e9b949; }
.cr-diff { display: flex; gap: 3px; margin-top: 2px; }
.cr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cr-line); }
.cr-dot.is-on { background: var(--cr-gold); }

@media (max-width: 767.98px) {
    .cr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .cr-card { padding: 8px 6px; border-radius: 12px; }
    .cr-name { font-size: .85rem; }
    .cr-title { font-size: .7rem; }
}
@media (max-width: 479.98px) {
    .cr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .cr-portrait { border-radius: 10px; }
}

/* ---- the champion sheet (Bootstrap modal) ---- */
#cr-modal .modal-content { background: var(--cr-surface); color: var(--cr-ink); border: 1px solid var(--cr-line); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
#cr-modal .modal-fullscreen-md-down .modal-content { border-radius: 18px; }
.cr-modal-head { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 7; max-height: 340px; min-height: 150px; background: #0a1428; overflow: hidden; }
.cr-splash { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: 1; transition: opacity .25s; }
.cr-splash.is-loading { opacity: .35; }
.cr-splash-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 40, .25) 0%, rgba(10, 20, 40, 0) 30%, var(--cr-surface) 100%); pointer-events: none; }
.cr-close { position: absolute; top: 12px; right: 12px; z-index: 4; width: 36px; height: 36px; padding: 0; border-radius: 50%; background-color: rgba(10, 20, 40, .6); background-size: 14px; opacity: 1; filter: invert(1) grayscale(100%) brightness(200%); }
body.dark-theme .cr-close { filter: invert(1) grayscale(100%) brightness(200%); }
.cr-nav { position: absolute; top: 38%; z-index: 4; width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 20, 40, .6); color: #fff; display: grid; place-items: center; font-size: 16px; cursor: pointer; transition: background .12s, transform .12s; -webkit-tap-highlight-color: transparent; }
.cr-nav:hover { background: var(--cr-gold); color: #0a1428; }
.cr-nav:active { transform: scale(.94); }
.cr-nav-prev { left: 12px; }
.cr-nav-next { right: 12px; }
.cr-modal-heading { position: absolute; left: 20px; right: 20px; bottom: 10px; z-index: 3; }
.cr-modal-name { margin: 0; font-size: clamp(1.5rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 1px 0 var(--cr-surface), 0 0 14px var(--cr-surface); }
.cr-modal-title { margin: 2px 0 6px; color: var(--cr-muted); font-size: 1rem; text-shadow: 0 1px 0 var(--cr-surface), 0 0 12px var(--cr-surface); }
.cr-modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--cr-line); background: var(--cr-surface); color: var(--cr-ink); font-size: .76rem; font-weight: 600; }
.cr-pill-tag { border-color: var(--cr-gold); background: var(--cr-gold-soft); }
.cr-pill-easy { color: #1e8f5e; }
.cr-pill-medium { color: #b37d12; }
.cr-pill-hard { color: #c42b4f; }
body.dark-theme .cr-pill-easy { color: #4ade80; }
body.dark-theme .cr-pill-medium { color: #fbbf24; }
body.dark-theme .cr-pill-hard { color: #fb7185; }

.cr-modal-body { padding: 18px 20px 24px; }
.cr-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 768px) {
    .cr-cols { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
    .cr-col-left { position: sticky; top: 0; }
}
.cr-h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cr-h3 svg, .cr-h3 i { color: var(--cr-gold); }
.cr-section + .cr-section, .cr-col-left .cr-h3 + .cr-help + .cr-lanes + .cr-h3 { margin-top: 20px; }
.cr-help { margin: 0 0 10px; color: var(--cr-muted); font-size: .86rem; line-height: 1.5; }
.cr-help-small { margin: 10px 0 0; font-size: .78rem; }

/* lanes: 5-up, every button opens u.gg for that lane */
.cr-lanes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cr-lane { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 2px; border-radius: 10px; border: 1px solid var(--cr-line); background: var(--cr-bg); color: var(--cr-ink) !important; text-decoration: none; font-size: .74rem; font-weight: 700; line-height: 1; transition: border-color .12s, background .12s, transform .12s; }
.cr-lane svg, .cr-lane i { font-size: 17px; color: var(--cr-blue); }
.cr-lane:hover { border-color: var(--cr-gold); background: var(--cr-gold-soft); transform: translateY(-1px); }
.cr-counters { display: grid; gap: 6px; }
.cr-outlink { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--cr-line); background: var(--cr-bg); color: var(--cr-ink) !important; font-weight: 700; font-size: .9rem; text-decoration: none; transition: border-color .12s, background .12s; }
.cr-outlink::after { content: "\2197"; color: var(--cr-blue); font-weight: 400; }
.cr-outlink:hover { border-color: var(--cr-gold); background: var(--cr-gold-soft); }

/* status + fallback */
.cr-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--cr-blue-soft); color: var(--cr-ink); font-size: .88rem; }
.cr-status:empty, .cr-status[hidden] { display: none; }
.cr-status.is-error { background: rgba(196, 43, 79, .12); }
.cr-btn { min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--cr-gold); background: var(--cr-gold); color: #0a1428; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.cr-btn:hover { filter: brightness(1.06); }

/* lore: clamped to ~4 lines until "Citește tot" */
.cr-lore-text { margin: 0; line-height: 1.6; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cr-lore.is-open .cr-lore-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.cr-lore-more { margin-top: 6px; padding: 2px 0; border: 0; background: none; color: var(--cr-blue); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.cr-lore-more:hover { color: var(--cr-gold); }
.cr-lore-more[hidden] { display: none; }

/* spells: passive + Q/W/E/R, 48px icons */
.cr-spells { display: grid; }
.cr-spell { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--cr-line); }
.cr-spell:first-child { border-top: 0; padding-top: 4px; }
.cr-spell-icon { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--cr-gold); background: #0a1428; object-fit: cover; }
.cr-spell-name { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1rem; font-weight: 800; }
.cr-key { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--cr-gold); color: #0a1428; font-size: .76rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.cr-key-p { background: var(--cr-blue); }
.cr-spell-desc { margin: 0; font-size: .9rem; line-height: 1.55; }
.cr-spell-desc b, .cr-spell-desc strong { color: var(--cr-gold); font-weight: 700; }
body.dark-theme .cr-spell-desc b, body.dark-theme .cr-spell-desc strong { color: #e7cf9b; }
.cr-spell-meta { margin: 4px 0 0; color: var(--cr-muted); font-size: .8rem; }
.cr-spell-meta span + span::before { content: " · "; }

/* tips */
.cr-tips { display: grid; gap: 16px; }
@media (min-width: 992px) { .cr-tips { grid-template-columns: 1fr 1fr; } }
.cr-tips:empty { display: none; }
.cr-tips h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .92rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cr-tips h4 svg, .cr-tips h4 i { color: var(--cr-gold); }
.cr-tips ul { margin: 0; padding-left: 18px; font-size: .9rem; line-height: 1.55; }
.cr-tips li + li { margin-top: 6px; }

/* ---- legal ---- */
.cr-legal { margin-top: 40px; padding: 18px 0 6px; border-top: 1px solid var(--cr-line); color: var(--cr-muted); font-size: .78rem; line-height: 1.55; }
.cr-legal p { margin: 0 0 8px; }
.cr-legal-links a { color: var(--cr-blue); text-decoration: none; font-weight: 600; }
.cr-legal-links a:hover { text-decoration: underline; }

/* ---- phone: 16px gutters, never a horizontal scroll ---- */
@media (max-width: 575.98px) {
    .cr-main { padding-top: 92px; }
    .cr-main .container { padding-left: 16px; padding-right: 16px; }
    .cr-toolbar { padding-top: 8px; }
    .cr-tag, .cr-sort { padding: 4px 10px; font-size: .8rem; min-height: 32px; }
    .cr-modal-body { padding: 14px 16px 24px; }
    /* phone: the heading stays clear of the ‹ › arrows (38px + 12px margin each side), and the header is
       tall enough for a long name, the title and a wrapped row of pills */
    .cr-modal-head { min-height: 200px; }
    .cr-modal-heading { left: 60px; right: 60px; }
    .cr-nav { width: 38px; height: 38px; top: 30%; }
    .cr-lane { min-height: 56px; font-size: .7rem; }
    .cr-pill { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cr-card, .cr-nav, .cr-lane, .cr-splash { transition: none; }
}
