/* LaneLens — dark esports app-shell dashboard (navy/gold palette) */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800&display=swap');

:root {
    --background: #07111f;      /* deep navy */
    --panel: #101d2d;           /* dark slate blue */
    --panel-light: #17283c;
    --gold: #c89b3c;
    --gold-light: #f0d58c;
    --text: #f4f4f4;            /* off-white */
    --muted-text: #a9b4c2;      /* muted blue-gray */
    --border: #30445e;
    --blue-team: #55c7ff;
    --red-team: #ff6b6b;
    --error: #ff7373;
    --easy: #4cd08d;
    --medium: #f0c04a;
    --hard: #ff6b6b;
    --card: rgba(7, 17, 31, 0.55);
    --card-border: rgba(48, 68, 94, 0.7);
}

* { box-sizing: border-box; }

/* Inline SVG icons inherit currentColor; parents set the size. */
.icon { width: 14px; height: 14px; display: block; }
.tile-glyph .icon { width: 18px; height: 18px; }
.extra-glyph .icon { width: 13px; height: 13px; }
.shard-dot .icon { width: 10px; height: 10px; margin: 0 auto; }
.rail-logo svg { width: 26px; height: 26px; }
.rail-icon svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    color: var(--text);
    background: radial-gradient(circle at top, #17304d, var(--background) 55%);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* ---------- App rail ---------- */

.rail {
    width: 58px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    padding: 18px 0;
    background: rgba(7, 17, 31, 0.85);
    border-right: 1px solid var(--border);
}

.rail-logo { color: var(--gold); font-size: 1.5rem; }

.rail-nav { display: grid; gap: 8px; }

.rail-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.rail-icon:hover { opacity: 1; background: rgba(200, 155, 60, 0.12); color: var(--gold-light); }

.rail-icon.active {
    color: var(--background);
    background: var(--gold);
    opacity: 1;
    box-shadow: 0 4px 14px rgba(200, 155, 60, 0.35);
}

/* ---------- Shell / topbar ---------- */

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 22px;
    background: rgba(7, 17, 31, 0.7);
    border-bottom: 1px solid var(--border);
}

/* Sticky only when the form fits on one row - a tall wrapped bar would
   cover half the dashboard on smaller screens. */
@media (min-width: 1150px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(6px);
    }
}

.brand {
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(200, 155, 60, 0.25);
    background: none;
    border: none;
    color: var(--text);
    padding: 0;
    cursor: pointer;
}

.brand:hover span { color: var(--gold-light); }

.brand span { color: var(--gold); }

/* ---------- Home / landing hero ---------- */

.home {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
    border: 1px solid rgba(200, 155, 60, 0.35);
    border-radius: 16px;
    background: linear-gradient(150deg, var(--panel-light), var(--panel));
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
}

.home-splash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    opacity: 0.28;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0.15) 85%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0.15) 85%);
}

.home-inner {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    padding: 56px 26px;
    width: 100%;
}

.home-emblem {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    color: var(--gold);
    background: rgba(7, 17, 31, 0.65);
    border: 1px solid rgba(200, 155, 60, 0.5);
    box-shadow: 0 0 26px rgba(200, 155, 60, 0.25);
}

.home-emblem svg { width: 34px; height: 34px; }

.home-title {
    margin: 0;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 4px 22px rgba(0, 0, 0, 0.7);
}

.home-title span { color: var(--gold); }

.home-tagline {
    margin: 0;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.82rem;
    font-weight: 600;
}

.home-desc {
    margin: 4px 0 0;
    max-width: 580px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.7;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.home-features {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.home-feature {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px;
    border-radius: 999px;
    background: rgba(7, 17, 31, 0.7);
    border: 1px solid var(--border);
    color: var(--muted-text);
    font-size: 0.8rem;
    font-weight: 600;
}

.home-feature svg { width: 14px; height: 14px; color: var(--gold); }

/* Status panels (loading / error / no game) shown above the hero search */
.hero-status { width: 100%; max-width: 660px; display: grid; gap: 12px; }

.hero-status .panel { margin-bottom: 0; text-align: left; }
.hero-status .no-game-panel { text-align: center; padding: 28px 22px; }
.hero-status .loading-panel { justify-content: center; }
.hero-status:empty { display: none; }

/* Search controls, enlarged and centered inside the hero */
.hero-search {
    display: grid;
    justify-items: center;
    gap: 14px;
    width: 100%;
    max-width: 660px;
    margin-top: 18px;
}

.hero-search .topbar-form {
    justify-content: center;
    background: rgba(7, 17, 31, 0.72);
    border: 1px solid rgba(200, 155, 60, 0.4);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.hero-search .topbar-form input,
.hero-search .topbar-form select {
    padding: 13px 14px;
    font-size: 0.98rem;
}

.hero-search .topbar-form input { max-width: none; }

.hero-search .btn-gold { padding: 13px 26px; font-size: 0.95rem; }

.hero-search .profile-area { justify-content: center; flex: 0 1 auto; }

.topbar-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 260px;
    flex-wrap: wrap;
}

/* On home the hero's prefilled Analyze button covers it - hide the
   redundant top-bar Find My Matchup there (chip + auto-detect remain). */
body.is-home #find-my-matchup { display: none; }

/* Saved-player area (replaces the form when a profile is remembered) */
.profile-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
    flex-wrap: wrap;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 14px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
}

.profile-chip #profile-name { color: var(--gold-light); font-weight: 700; }

.chip-btn {
    background: none;
    border: none;
    color: var(--muted-text);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 6px;
    border-radius: 6px;
}

.chip-btn:hover { color: var(--gold-light); background: rgba(200, 155, 60, 0.12); }

/* Discord account area (always in the top bar) */
.account-area { display: flex; align-items: center; margin-left: auto; }

.discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #5865f2;
    background: rgba(88, 101, 242, 0.12);
    color: #c9cfff;
    font-weight: 600;
    font-size: 0.85rem;
}

.discord-btn:hover { background: rgba(88, 101, 242, 0.25); }
.discord-btn svg { width: 18px; height: 18px; }

.account-menu-wrap { position: relative; }

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 6px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 999px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.account-chip:hover { border-color: var(--gold); }

.account-chip img { width: 24px; height: 24px; border-radius: 50%; display: block; }

.account-chip .account-name { color: var(--gold-light); font-weight: 700; }

.account-caret { display: grid; place-items: center; color: var(--muted-text); }
.account-caret svg { width: 13px; height: 13px; }

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    padding: 6px;
    display: grid;
    gap: 2px;
    background: linear-gradient(150deg, var(--panel-light), var(--panel));
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    z-index: 60;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    font-size: 0.87rem;
    text-align: left;
    cursor: pointer;
}

.account-menu-item:hover { background: rgba(200, 155, 60, 0.12); color: var(--gold-light); }

.account-menu-item svg { width: 15px; height: 15px; color: var(--muted-text); flex-shrink: 0; }
.account-menu-item:hover svg { color: var(--gold); }

/* ---------- Player settings ---------- */

.settings { display: flex; justify-content: center; padding-top: 20px; }

.settings-panel { width: 100%; max-width: 560px; display: grid; gap: 14px; }

.settings-desc { margin: 0; color: var(--muted-text); font-size: 0.9rem; line-height: 1.6; }

.settings-field { display: grid; gap: 6px; }

.settings-field label {
    color: var(--gold-light);
    font-weight: bold;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-field input, .settings-field select {
    width: 100%;
    padding: 12px 14px;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }

.settings-feedback { color: var(--easy); font-size: 0.88rem; font-weight: 600; }
.settings-feedback.is-error { color: var(--error); }

.settings-note {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--muted-text);
    font-size: 0.8rem;
}

.auto-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
}

.auto-btn.on { color: var(--gold-light); border-color: var(--gold); }

.watch-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-text);
    font-size: 0.78rem;
}

.watch-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue-team);
    box-shadow: 0 0 8px rgba(85, 199, 255, 0.7);
    animation: aiPulse 1.6s ease-in-out infinite;
}

.topbar-form input, .topbar-form select {
    padding: 9px 12px;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.88rem;
}

.topbar-form input { flex: 1 1 150px; max-width: 240px; }
.topbar-form .tag-input { flex: 0 1 84px; }
.topbar-form select { flex: 0 0 auto; }

input:focus, select:focus { outline: 2px solid var(--gold); border-color: transparent; }

button { font: inherit; cursor: pointer; border-radius: 8px; }

.btn-gold {
    padding: 9px 18px;
    color: var(--background);
    background: var(--gold);
    border: 0;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-gold:hover { background: var(--gold-light); }
.btn-gold:disabled, .btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
    padding: 9px 16px;
    color: var(--gold-light);
    background: transparent;
    border: 1px solid var(--gold);
    font-weight: bold;
    font-size: 0.85rem;
}

.btn-ghost:hover { background: rgba(200, 155, 60, 0.12); }
.btn-ghost.small { padding: 7px 12px; font-size: 0.8rem; }

.link-btn {
    background: none;
    border: none;
    color: var(--gold);
    font: inherit;
    text-decoration: underline;
    padding: 0;
}

/* ---------- Main ---------- */

main { padding: 18px 22px 34px; max-width: 1360px; width: 100%; margin: 0 auto; }

.tagline {
    margin: 0 0 16px;
    color: var(--muted-text);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.panel {
    background: linear-gradient(150deg, var(--panel-light), var(--panel));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    min-width: 0;
}

.panel h3 {
    margin: 0 0 14px;
    color: var(--gold-light);
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

/* ---------- Loading / errors ---------- */

.loading-panel { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-message { margin: 0; color: var(--gold-light); font-weight: bold; }

.error-panel { border-color: var(--error); margin-bottom: 16px; }
.error-panel h3 { color: var(--error); }
.error-panel p { margin: 0 0 6px; }
.error-hint { color: var(--muted-text); font-size: 0.9rem; }

/* ---------- No live game (calm state) ---------- */

.no-game-panel {
    text-align: center;
    padding: 44px 24px;
    margin-bottom: 16px;
    border-color: rgba(200, 155, 60, 0.35);
    background:
        radial-gradient(circle at top, rgba(200, 155, 60, 0.08), transparent 60%),
        linear-gradient(150deg, var(--panel-light), var(--panel));
}

.no-game-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: var(--gold);
    background: rgba(200, 155, 60, 0.1);
    border: 1px solid rgba(200, 155, 60, 0.4);
    margin-bottom: 14px;
}

.no-game-icon svg { width: 26px; height: 26px; }

.no-game-panel .no-game-title {
    margin: 0 0 8px;
    font-family: "Cinzel", "Times New Roman", serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-light);
}

.no-game-text {
    margin: 0 auto 6px;
    max-width: 480px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.no-game-hint { margin: 0; color: var(--muted-text); font-size: 0.85rem; }

/* ---------- Dashboard grid ---------- */

.dash {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    scroll-margin-top: 84px;
}

/* Staggered fade-up when the dashboard is revealed. */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.dash > * { animation: fadeUp 0.45s ease backwards; }
.dash > *:nth-child(2) { animation-delay: 0.06s; }
.dash > *:nth-child(3) { animation-delay: 0.12s; }
.dash > *:nth-child(4) { animation-delay: 0.18s; }
.dash > *:nth-child(5) { animation-delay: 0.24s; }
.dash > *:nth-child(6) { animation-delay: 0.3s; }
.dash > *:nth-child(7) { animation-delay: 0.36s; }
.dash > *:nth-child(8) { animation-delay: 0.42s; }

/* Hover lift for small cards. */
.tile, .extra-card, .tip-card, .flow-step, .featured-row {
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover, .extra-card:hover, .tip-card:hover, .flow-step:hover, .featured-row:hover {
    transform: translateY(-2px);
    border-color: rgba(200, 155, 60, 0.5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.main-card  { grid-column: span 8; }
.featured   { grid-column: span 4; }
.build      { grid-column: span 12; }
.tiles      { grid-column: span 12; }
.runes-card { grid-column: span 3; }
.teams      { grid-column: span 4; }
.extras     { grid-column: span 5; }

/* AI-updated and bottom-row panels have FIXED heights; long content scrolls
   inside them, so nothing on the page ever shifts when AI advice lands. */
.runes-card, .teams, .extras { height: 560px; }
.main-card, .featured { height: 640px; }

/* Build: height hugs its content (no blank space, no scrollbars); when AI
   content changes the height, the panel glides smoothly (see smoothUpdate). */
.build { display: flex; flex-direction: column; }

.build .build-flow { flex: 0 0 auto; align-content: start; }

.panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.panel-scroll::-webkit-scrollbar, .runes-body::-webkit-scrollbar,
.tips-stack::-webkit-scrollbar, .featured-rows::-webkit-scrollbar,
.tile-meta::-webkit-scrollbar { width: 5px; }

.panel-scroll::-webkit-scrollbar-thumb, .runes-body::-webkit-scrollbar-thumb,
.tips-stack::-webkit-scrollbar-thumb, .featured-rows::-webkit-scrollbar-thumb,
.tile-meta::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.panel-scroll::-webkit-scrollbar-track, .runes-body::-webkit-scrollbar-track,
.tips-stack::-webkit-scrollbar-track, .featured-rows::-webkit-scrollbar-track,
.tile-meta::-webkit-scrollbar-track { background: transparent; }

.teams { display: flex; flex-direction: column; }

@media (max-width: 1080px) {
    .runes-card, .teams { grid-column: span 6; }
    .main-card, .featured, .build, .extras { grid-column: span 12; }
}

@media (max-width: 700px) {
    .overview, .featured { grid-column: span 12; }
    .rail { display: none; }
}

/* ---------- Main card (overview + lane tips) ---------- */

.main-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }

/* Lane tips scroll inside the fixed-height card; the overview stays put.
   max-content rows: every mini card always shows ALL of its text - the
   list scrolls as a whole, never the cards themselves. */
.main-card .tips-stack {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    align-content: start;
    grid-auto-rows: max-content;
}

/* Low-opacity champion splash behind the overview area, fading out
   before the lane-tips text so it stays readable. */
.ov-splash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    opacity: 0.15;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 12%, transparent 55%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 12%, transparent 55%);
}

.main-card > *:not(.ov-splash) { position: relative; }

.main-card .sub-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Tips use two columns inside the wide card; headline spans both. */
.main-card .tips-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.main-card .tip-card.headline { grid-column: 1 / -1; }

@media (max-width: 700px) {
    .main-card .tips-stack { grid-template-columns: 1fr; }
}

.ov-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.ov-side { display: grid; gap: 10px; flex: 1; min-width: 200px; }
.ov-side .badges { margin-top: 0; }
.ov-side .override-area { margin-top: 0; }

.history-line {
    margin: 0;
    padding: 8px 12px;
    background: rgba(200, 155, 60, 0.08);
    border: 1px solid rgba(200, 155, 60, 0.3);
    border-radius: 8px;
    color: var(--gold-light);
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-strip { display: inline-flex; gap: 5px; align-items: center; }

.form-badge {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
}

.form-badge.form-w {
    background: var(--easy);
    color: #062818;
    box-shadow: 0 2px 8px rgba(76, 208, 141, 0.35);
}

.form-badge.form-l {
    background: var(--hard);
    color: #350c0c;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.form-badge.form-empty {
    width: 17px;
    height: 17px;
    border: 1px dashed rgba(169, 180, 194, 0.45);
    background: transparent;
}

.ov-champs { display: flex; align-items: center; gap: 14px; }

.ov-champ { display: grid; gap: 6px; justify-items: center; }

.ov-champ img {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: var(--background);
    border: 2px solid var(--gold);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(200, 155, 60, 0.22);
}

.ov-champ.enemy img {
    border-color: var(--red-team);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 107, 107, 0.18);
}

.ov-champ span { font-size: 0.92rem; font-weight: 700; letter-spacing: 0.3px; }
.ov-champ.you span { color: var(--gold-light); }
.ov-champ.enemy span { color: var(--red-team); }

.vs-mark {
    color: var(--gold);
    font-family: "Cinzel", "Times New Roman", serif;
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 1.35rem;
    text-shadow: 0 0 16px rgba(200, 155, 60, 0.5);
}

/* Crisp SVG difficulty dial */
.diff-ring {
    --ring-color: var(--medium);
    position: relative;
    width: 108px;
    height: 108px;
    flex-shrink: 0;
}

.diff-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }

.ring-track {
    fill: none;
    stroke: rgba(48, 68, 94, 0.55);
    stroke-width: 6;
}

.ring-fill {
    fill: none;
    stroke: var(--ring-color);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 263.9;
    stroke-dashoffset: 263.9;
    filter: drop-shadow(0 0 5px var(--ring-color));
    transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.diff-ring.difficulty-easy   { --ring-color: var(--easy); }
.diff-ring.difficulty-easy .ring-fill   { stroke-dashoffset: 176.8; }  /* 33% */
.diff-ring.difficulty-medium { --ring-color: var(--medium); }
.diff-ring.difficulty-medium .ring-fill { stroke-dashoffset: 89.7; }   /* 66% */
.diff-ring.difficulty-hard   { --ring-color: var(--hard); }
.diff-ring.difficulty-hard .ring-fill   { stroke-dashoffset: 13.2; }   /* 95% */

.diff-text-wrap {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 1px;
    text-align: center;
}

.diff-value { font-size: 1.02rem; font-weight: 800; color: var(--ring-color); }
.diff-label { font-size: 0.56rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted-text); }

.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.badge {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--border);
    color: var(--muted-text);
    background: rgba(7, 17, 31, 0.8);
}

.badge.confidence { color: var(--blue-team); border-color: var(--blue-team); }
.badge.lane { color: var(--gold-light); border-color: var(--gold); }

.override-area { color: var(--muted-text); font-size: 0.82rem; display: grid; gap: 8px; margin-top: 14px; }
.override-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.override-controls select {
    width: auto;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ---------- Featured game-plan card ---------- */

.featured {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(200, 155, 60, 0.22), transparent 55%),
        linear-gradient(150deg, #2a2415, var(--panel));
    border-color: rgba(200, 155, 60, 0.55);
}

.featured h3 { color: var(--gold); }
.featured h3, .extras h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Sharp blue ring on panels while the AI is refining their content:
   a crisp 1px outline plus a tight halo, pulsing in intensity. */
@keyframes aiGlow {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(85, 199, 255, 0.4),
            0 0 6px rgba(85, 199, 255, 0.22),
            0 10px 26px rgba(0, 0, 0, 0.28);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(85, 199, 255, 0.85),
            0 0 12px rgba(85, 199, 255, 0.45),
            0 10px 26px rgba(0, 0, 0, 0.28);
    }
}

.ai-glow {
    border-color: rgba(85, 199, 255, 0.7);
    animation: aiGlow 1.6s ease-in-out infinite;
}

/* Fresh AI content fades in softly instead of popping. */
@keyframes contentIn {
    from { opacity: 0.35; }
    to { opacity: 1; }
}

.ai-refresh { animation: contentIn 0.4s ease; }

/* Background AI enhancement status */
.ai-status {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted-text);
    text-transform: none;
}

.ai-status.thinking {
    color: var(--blue-team);
    border-color: rgba(85, 199, 255, 0.4);
    animation: aiPulse 1.4s ease-in-out infinite;
}

.ai-status.done {
    color: var(--easy);
    border-color: rgba(76, 208, 141, 0.4);
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Rows share the card's full height so the column has no dead space;
   longer AI content scrolls inside the fixed-height card. max-content
   floor: a row never clips its own text. */
.featured-rows {
    display: grid;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    grid-auto-rows: minmax(max-content, 1fr);
}

.featured-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(7, 17, 31, 0.55);
    border: 1px solid rgba(200, 155, 60, 0.22);
    border-radius: 10px;
}

.featured-row .glyph {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(200, 155, 60, 0.16);
    color: var(--gold);
    font-size: 0.8rem;
}

.featured-row .fr-text { min-width: 0; }

.featured-row .fr-label {
    display: block;
    color: var(--gold-light);
    font-size: 0.64rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.1px;
}

.featured-row p { margin: 0; font-size: 0.85rem; }

.featured-row.headline { border-color: rgba(200, 155, 60, 0.5); }
.featured-row.headline p { font-size: 0.92rem; font-weight: 600; color: var(--gold-light); }

/* ---------- Runes card (rune-page style trees) ---------- */

.runes-card { display: flex; flex-direction: column; position: relative; overflow: hidden; }

.runes-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 22px;
    padding-right: 6px;
}

/* Oversized keystone icon as a faint background, like the client's rune page art. */
.runes-bg {
    position: absolute;
    right: -55px;
    bottom: -55px;
    width: 250px;
    height: 250px;
    opacity: 0.07;
    pointer-events: none;
    filter: saturate(1.3);
}

.runes-card > *:not(.runes-bg), .runes-body > *:not(.runes-bg) { position: relative; }

.rune-tree { position: relative; display: grid; gap: 10px; }

/* Vertical connector line through the rune icons, like the client. */
.rune-tree::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 34px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(to bottom, var(--border), transparent);
}

.rune-tree.shards::before { display: none; }

.tree-head {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.tree-head img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--background);
    border: 1px solid var(--border);
    padding: 2px;
}

.tree-name {
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.6px;
}

.rune-row { display: flex; align-items: center; gap: 12px; position: relative; }

.rune-row img {
    border-radius: 50%;
    background: var(--background);
    border: 1px solid var(--border);
    margin-left: 7px;
    flex-shrink: 0;
}

.rune-row.keystone img {
    margin-left: 0;
    border: 2px solid var(--gold);
    box-shadow: 0 0 16px rgba(200, 155, 60, 0.45);
}

.rune-row-meta { display: grid; gap: 1px; min-width: 0; }

.rune-row-name { font-size: 0.84rem; font-weight: 600; }
.rune-row.keystone .rune-row-name { font-size: 0.95rem; font-weight: 700; color: var(--gold-light); }

.rune-row-desc {
    color: var(--muted-text);
    font-size: 0.7rem;
    line-height: 1.4;
}

.rune-row.shard { gap: 10px; }

.shard-dot {
    width: 28px;
    margin-left: 7px;
    color: var(--gold);
    flex-shrink: 0;
}

.rune-row.shard .rune-row-name { font-size: 0.78rem; font-weight: 500; color: var(--muted-text); }

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    background: rgba(7, 17, 31, 0.8);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--muted-text);
}

.option-chip { padding: 2px 8px 2px 2px; }
.option-chip img { width: 20px; height: 20px; border-radius: 50%; display: block; }

.runes-empty { color: var(--muted-text); font-size: 0.85rem; }

.runes-note {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.72rem;
    font-style: italic;
    line-height: 1.5;
}

/* ---------- Stat tiles ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.tile {
    display: flex;
    gap: 12px;
    align-items: stretch;
    height: 100px;
    padding: 14px 16px;
    background: linear-gradient(150deg, var(--panel-light), var(--panel));
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    min-width: 0;
}

.tile .tile-glyph { align-self: center; }

.tile-meta {
    overflow-y: auto;
    padding-right: 4px;
    align-self: center;
    max-height: 100%;
}

.tile-glyph {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.05rem;
}

.tile-glyph.g-gold  { background: rgba(200, 155, 60, 0.16); color: var(--gold); }
.tile-glyph.g-green { background: rgba(76, 208, 141, 0.14); color: var(--easy); }
.tile-glyph.g-red   { background: rgba(255, 107, 107, 0.14); color: var(--hard); }
.tile-glyph.g-blue  { background: rgba(85, 199, 255, 0.14); color: var(--blue-team); }

.tile-meta { min-width: 0; }

.tile-meta .tile-label {
    display: block;
    color: var(--muted-text);
    font-size: 0.64rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tile-meta p { margin: 0; font-size: 0.83rem; font-weight: 600; }

/* ---------- Build flow ---------- */

.build-flow {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 6px;
}

.flow-step {
    flex: 1 1 130px;
    min-width: 120px;
    display: grid;
    gap: 6px;
    align-content: start;
    justify-items: center;
    text-align: center;
    padding: 10px 8px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.flow-icons { display: flex; gap: 6px; }

.slot-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--gold);
    background: var(--background);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slot-icon img { width: 100%; height: 100%; display: block; }
.slot-icon.empty { border-style: dashed; border-color: var(--border); color: var(--muted-text); }

.slot-label {
    display: block;
    color: var(--gold);
    font-size: 0.62rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.1px;
}

.flow-name { font-size: 0.78rem; font-weight: 600; line-height: 1.25; }

.flow-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid rgba(48, 68, 94, 0.5);
    width: 100%;
}

.flow-options .or { color: var(--muted-text); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; }
.flow-options .option-chip { font-size: 0.64rem; padding: 1px 7px 1px 2px; }
.flow-options .option-chip img { width: 16px; height: 16px; }

.flow-arrow {
    align-self: center;
    color: var(--gold);
    opacity: 0.85;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 6px rgba(200, 155, 60, 0.35));
}

.flow-arrow svg { width: 26px; height: 14px; display: block; }

@media (max-width: 900px) {
    .flow-arrow { display: none; }
    .flow-step { flex-basis: 160px; }
}

.build-direction { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.build-direction .slot-label { color: var(--gold-light); margin-bottom: 3px; }
.build-direction p { margin: 0; font-size: 0.88rem; color: var(--muted-text); }

/* ---------- Lane tips stack ---------- */

.tips { border-color: rgba(200, 155, 60, 0.45); }

.tips-stack { display: grid; gap: 8px; }

.tip-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 11px 14px;
    overflow: hidden;
}

.tip-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent 70%);
}

.tip-card.headline {
    border-color: rgba(200, 155, 60, 0.5);
    background:
        radial-gradient(circle at top left, rgba(200, 155, 60, 0.12), transparent 55%),
        var(--card);
}

.tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

.tip-glyph {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: var(--gold);
    font-size: 0.78rem;
}

.tip-card h4 {
    margin: 0;
    color: var(--gold-light);
    font-size: 0.68rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.tip-card p { margin: 0; font-size: 0.86rem; }

/* ---------- Extra info ---------- */

.extras { display: flex; flex-direction: column; }

.extra-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(min-content, 1fr);
    gap: 10px;
}

@media (max-width: 560px) { .extra-grid { grid-template-columns: 1fr; } }

.extra-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 14px;
}

.extra-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }

.extra-glyph {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 0.7rem;
}

.extra-glyph.g-gold  { background: rgba(200, 155, 60, 0.16); color: var(--gold); }
.extra-glyph.g-green { background: rgba(76, 208, 141, 0.14); color: var(--easy); }
.extra-glyph.g-red   { background: rgba(255, 107, 107, 0.14); color: var(--hard); }
.extra-glyph.g-blue  { background: rgba(85, 199, 255, 0.14); color: var(--blue-team); }

.extra-card h4 {
    margin: 0;
    color: var(--gold);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.extra-card p { margin: 0; font-size: 0.84rem; }
.extra-card ul { margin: 0; padding-left: 16px; font-size: 0.82rem; display: grid; gap: 4px; }
.extra-card ul li::marker { color: var(--gold); }

.extra-card.span-all {
    grid-column: 1 / -1;
    border-color: rgba(200, 155, 60, 0.45);
    background:
        radial-gradient(circle at top right, rgba(200, 155, 60, 0.1), transparent 55%),
        var(--card);
}

.source-note { margin: 12px 0 0; color: var(--muted-text); font-size: 0.76rem; }

/* ---------- Teams ---------- */

.teams-grid { display: grid; gap: 14px; }

.team-card h4 {
    margin: 0 0 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.team-card.blue h4 { color: var(--blue-team); }
.team-card.red h4 { color: var(--red-team); }

.team-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.team-card li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.team-card li img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--background);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.team-card li .lane-tag {
    margin-left: auto;
    color: var(--muted-text);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-card li.is-player { background: rgba(200, 155, 60, 0.1); border-color: rgba(200, 155, 60, 0.5); }
.team-card li.is-player img { border-color: var(--gold); }
.team-card li.is-player .champ-name { color: var(--gold-light); font-weight: bold; }

.team-card li.is-opponent { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.45); }
.team-card li.is-opponent img { border-color: var(--red-team); }
.team-card li.is-opponent .champ-name { color: var(--red-team); font-weight: bold; }

.team-notes { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }

.team-notes li { position: relative; padding-left: 16px; color: var(--muted-text); font-size: 0.83rem; }
.team-notes li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }

/* ---------- Footer ---------- */

footer { margin-top: 26px; text-align: center; }
footer p { color: var(--muted-text); font-size: 0.72rem; }
