/* League Classic — deliberately "classic" forum styling: dense, table-driven,
   high-contrast, early-2010s community-site vibe. Hand-rolled, no framework. */

/* Site-wide scale, applied like a browser zoom so every px value (fonts,
   icons, gaps, borders) grows together in proportion rather than drifting
   out of sync the way one-off size bumps do. Adjust this single number to
   retune the whole site. */
html { zoom: 1.3; }

:root {
    /* Navy + gold + parchment: the Hextech chrome stays, but content panels
       lean warm — the yellowed-page, hand-painted-portrait feel of the old
       leagueoflegends.com UI, not the cool clinical gray we had before. */
    --page: #101a2d;        /* deep navy page background, slightly softened */
    --page-edge: #0a1420;   /* darker navy for the outer gutter */
    --panel: #f4ecd6;       /* warm parchment content panels */
    --ink: #2a2115;
    --muted: #7a6a4c;
    --line: #ddcfa4;
    --brand: #14568c;       /* link blue */
    --brand-dark: #0a2647;  /* navy */
    --gold: #ffd98a;        /* Hextech gold — text, borders, backgrounds, accents */
    --gold-dark: #a8863f;   /* darker shade for hover/depth on gold buttons */
    --accent: #c8aa6e;      /* gold accent */
    --header: #010a13;      /* near-black navy */
    --catbar: #0a2647;      /* navy category bars */
    --row-alt: #ece0bd;     /* alternating-row parchment, a shade deeper than panel */
}

* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; }

body {
    margin: 0;
    background: var(--page);
    /* Default text is light because most page-level content sits on navy. */
    color: #c6d2e0;
    font: 15px/1.6 Verdana, Geneva, Tahoma, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-wrap {
    max-width: 1320px; margin: 0 auto; padding: 16px;
    background: var(--page);
    box-shadow: 0 0 40px rgba(0,0,0,.35);
}

/* Light content panels keep dark, readable text. */
.forum-table, .guide-view, .guide-form .panel, .champ-tile,
.spell-opt, .empty, .markdown-help, .filter-box { color: var(--ink); }

/* Page-level headings/intros sit on navy — keep them light. */
h1, h2 { color: #e6ecf3; }
.guide-view h1, .guide-view h2, .guide-form .panel h2 { color: var(--ink); }

/* Header / masthead */
.site-header { border: 1px solid var(--brand-dark); border-bottom: 2px solid var(--gold); background: var(--header); }
.masthead {
    display: flex; align-items: center; gap: 18px;
    background: var(--header);
    padding: 16px 22px;
    color: #cdd9e6;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 62px; width: auto; display: block; }
.logo:hover { text-decoration: none; }
.site-title {
    font: bold 30px/1 "Trebuchet MS", Verdana, sans-serif;
    color: var(--gold); letter-spacing: .5px; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
@media (max-width: 600px) { .site-title { font-size: 20px; white-space: normal; } }

.user-nav { list-style: none; display: flex; gap: 12px; margin: 0 0 0 auto; padding: 0; }
.user-nav a { color: #cfe0f0; }
.linklike { background: none; border: 0; color: #cfe0f0; cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }
.logout-form { display: inline; }

.mainnav {
    display: flex; gap: 2px;
    background: var(--brand-dark);
    padding: 0 8px;
}
.mainnav a {
    color: var(--gold); padding: 11px 18px; font-weight: bold; font-size: 13px;
    text-transform: uppercase; letter-spacing: .5px;
}
.mainnav a:hover { background: var(--gold); color: var(--brand-dark); text-decoration: none; }

/* Content */
.content { margin-top: 16px; min-height: 60vh; }
h1 { font-size: 27px; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 22px 0 10px; }

/* Forum-style tables */
.forum-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); background: var(--panel); margin-bottom: 16px; }
.forum-table caption,
.cat-header {
    text-align: left;
    background: var(--catbar);
    color: var(--gold); font-weight: bold; font-size: 13px;
    padding: 7px 10px;
    border: 1px solid #000;
    border-left: 3px solid var(--gold);
}
.forum-table th {
    background: #d9e2ec; color: var(--brand-dark);
    text-align: left; padding: 8px 14px; font-size: 12px; text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}
.forum-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.forum-table tr:nth-child(even) td { background: var(--row-alt); }
.board-name { font-size: 16px; font-weight: bold; }
.board-desc { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat { color: var(--muted); white-space: nowrap; text-align: center; width: 104px; }

/* .muted appears mostly as page intros on navy — keep it a light steel-blue. */
.muted { color: #93a6bd; }
.empty { padding: 16px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); }

.site-footer {
    margin-top: 18px; padding: 12px; text-align: center;
    color: #7f93ab; font-size: 11px;
    border-top: 1px solid var(--brand-dark);
}
.site-footer a { color: var(--gold); }
.site-footer p { margin: 4px 0; }
.disclaimer { max-width: 780px; margin: 6px auto 0 !important; color: #63758c; font-size: 10px; line-height: 1.5; }

/* Basic form styling for the Identity pages */
.form-narrow { max-width: 420px; }
input[type=text], input[type=email], input[type=password], textarea {
    width: 100%; padding: 6px 8px; border: 1px solid var(--line); font: inherit; margin-bottom: 8px;
}
button.btn, input[type=submit] {
    background: var(--brand); color: #fff; border: 1px solid var(--brand-dark);
    padding: 7px 16px; font-weight: bold; cursor: pointer;
}
button.btn:hover { background: var(--brand-dark); }

/* ============================ Guides ============================ */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-primary {
    background: var(--gold); color: var(--brand-dark); border: 1px solid var(--gold-dark);
    padding: 8px 16px; font-weight: bold; cursor: pointer; text-decoration: none;
    display: inline-block; font-size: 13px;
}
.btn-primary:hover { background: #d8bd88; color: var(--brand-dark); text-decoration: none; }
.btn-plain {
    background: #e2e9f1; color: var(--brand-dark); border: 1px solid var(--line);
    padding: 8px 16px; font-weight: bold; cursor: pointer; text-decoration: none;
    display: inline-block; font-size: 13px;
}
.btn-plain:hover { background: #d3ddea; text-decoration: none; }

/* Champion picker */
.filter-box { max-width: 360px; margin: 10px 0 16px; }
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.champ-tile {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 5px; background: var(--panel); border: 1px solid var(--line);
    text-align: center; font-size: 12px; color: var(--ink); position: relative;
}
.champ-tile:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43,93,139,.25); text-decoration: none; }
.champ-tile img { width: 76px; height: 76px; display: block; }
.champ-tile.disabled { opacity: .45; cursor: default; }
.champ-tile.disabled:hover { border-color: var(--line); box-shadow: none; }
.champ-tile .soon {
    position: absolute; top: 4px; right: 4px; background: #555; color: #fff;
    font-size: 9px; padding: 1px 4px; font-style: normal; text-transform: uppercase;
}

.champ-icon-sm { width: 28px; height: 28px; vertical-align: middle; }
.champ-icon-md { width: 40px; height: 40px; vertical-align: middle; }
.champ-icon-lg { width: 72px; height: 72px; border: 2px solid var(--brand-dark); }
.champ-cell { display: flex; align-items: center; gap: 8px; }

/* Editor form */
.guide-form .panel {
    background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; margin: 14px 0;
}
.guide-form .panel h2 { margin: 0 0 10px; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.guide-form .panel h2 small { color: var(--muted); font-weight: normal; }
.field { margin: 10px 0; }
.field label { display: block; font-weight: bold; margin-bottom: 4px; }
.compose-title { display: flex; align-items: center; gap: 10px; }
.compose-title span { color: var(--gold); }
.validation-summary { color: #a5341c; }
.validation-summary ul { margin: 6px 0; }
.hint { color: var(--muted); font-size: 11px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 16px 0; }

/* Summoner spell palette */
.spell-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.spell-opt {
    display: flex; flex-direction: column; align-items: center; gap: 3px; width: 74px;
    background: #f3f6fa; border: 1px solid var(--line); padding: 6px 4px; cursor: pointer; font-size: 10px;
}
.spell-opt img { width: 40px; height: 40px; }
.spell-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(193,70,43,.35); background: #fff; }

/* Ability overview bar */
.ability-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ability-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eef2f7; border: 1px solid var(--line); padding: 3px 8px 3px 3px; font-size: 12px;
}
.ability-chip img { width: 30px; height: 30px; display: block; }
.ability-name { color: var(--ink); }
.slot-key {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; font-size: 10px; font-weight: bold; color: #fff; border-radius: 2px;
}
.slot-P { background: #718096; } .slot-Q { background: #2b6cb0; }
.slot-W { background: #2f855a; } .slot-E { background: #b7791f; } .slot-R { background: #c1462b; }

/* Skill grid */
.skill-table { border-collapse: collapse; margin-top: 6px; }
.skill-table th { background: #d9e2ec; color: var(--brand-dark); font-size: 10px; padding: 2px 5px; text-align: center; border: 1px solid var(--line); }
.skill-table td { border: 1px solid var(--line); padding: 0; }
.ab-label { padding: 2px 4px !important; white-space: nowrap; }
.ab-label img { width: 22px; height: 22px; vertical-align: middle; margin-right: 3px; }
.ab-label .slot-key { vertical-align: middle; }
.ab-Q { color: #2b6cb0; } .ab-W { color: #2f855a; } .ab-E { color: #b7791f; } .ab-R { color: #c1462b; }
.skill-cell {
    width: 24px; height: 22px; display: block; background: #fff; border: 0; cursor: pointer; padding: 0;
}
.skill-cell:hover:not(.locked):not([disabled]) { background: #e6eef7; }
.skill-cell.locked, .skill-cell[disabled] { background: repeating-linear-gradient(45deg,#eee,#eee 3px,#e3e3e3 3px,#e3e3e3 6px); cursor: default; }
.skill-cell.on { background: var(--brand); }
tr .ab-Q + td .skill-cell.on, .ab-Q ~ td .skill-cell.on { }
.skill-table.read-only .skill-cell { cursor: default; }

/* Build order */
.build-strip {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 52px;
    background: #f3f6fa; border: 1px dashed var(--line); padding: 8px; margin-bottom: 12px;
}
.build-empty { color: var(--muted); font-size: 12px; }
.build-chip, .build-item { position: relative; display: inline-flex; }
.build-chip { background: none; border: 1px solid var(--line); padding: 2px; cursor: pointer; }
.build-chip img, .build-item img { width: 40px; height: 40px; display: block; }
.build-chip .ord, .build-item .ord {
    position: absolute; top: -6px; left: -6px; background: var(--brand-dark); color: #fff;
    font-size: 9px; width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.build-chip .x { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 10px; width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.item-palette { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.item-group h3 { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.item-row { display: flex; flex-wrap: wrap; gap: 4px; }
.item-opt {
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
    width: 76px; padding: 5px 3px; background: var(--panel); border: 1px solid var(--line);
    cursor: pointer; text-align: center;
}
.item-opt:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(193,70,43,.2); }
.item-opt img { width: 34px; height: 34px; display: block; }
.item-opt-name { font-size: 10px; line-height: 1.15; color: var(--muted); }

/* Hover description panel (items + spells) */
.hover-desc {
    /* absolute, not fixed: CSS zoom on the root breaks fixed-position elements'
       containing block, so a fixed tooltip ends up far from the cursor. Absolute
       (offset by scrollX/Y in JS) stays in the same zoomed coordinate space as
       the clientX/Y math that positions it. */
    position: absolute; z-index: 1000; max-width: 300px; pointer-events: none;
    background: #0a1a2e; color: #e6ecf3; border: 1px solid var(--gold);
    padding: 9px 11px; font-size: 12px; line-height: 1.5; box-shadow: 0 6px 18px rgba(0,0,0,.55);
}
.hd-name { font-weight: bold; color: var(--gold); margin-bottom: 4px; }
.hd-none { color: #93a6bd; font-style: italic; }

/* Live markdown preview */
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .editor-split { grid-template-columns: 1fr; } }
.editor-split textarea { width: 100%; }
.md-preview-wrap { border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.md-preview-label {
    background: #d9e2ec; color: var(--brand-dark); font-size: 11px; text-transform: uppercase;
    letter-spacing: .5px; padding: 5px 10px; font-weight: bold; border-bottom: 1px solid var(--line);
}
.md-preview { padding: 12px 14px; color: var(--ink); overflow-y: auto; min-height: 220px; }
.md-preview:empty::before { content: "Start typing to see a preview…"; color: var(--muted); font-style: italic; }

/* ============================ Runes ============================ */
.rune-summary {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px;
    background: #f3f6fa; border: 1px dashed var(--line); padding: 8px; margin-bottom: 12px;
}
.rune-chip {
    display: inline-flex; align-items: center; gap: 4px; background: var(--panel);
    border: 1px solid var(--line); border-left: 4px solid var(--line); padding: 3px 6px 3px 4px; font-size: 12px;
}
.rune-chip img { width: 26px; height: 26px; }
.rune-chip .rc-name { color: var(--ink); }
.rc-step, .rc-x {
    border: 1px solid var(--line); background: #e2e9f1; color: var(--brand-dark);
    width: 18px; height: 18px; line-height: 1; cursor: pointer; font-weight: bold; padding: 0;
}
.rc-x { background: #f6e5e1; color: #a5341c; margin-left: 2px; }
.rc-count { min-width: 14px; text-align: center; font-weight: bold; }
.rune-palette { max-height: 230px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.rune-group h3 { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; }
.rune-row { display: flex; flex-wrap: wrap; gap: 4px; }
.rune-opt {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 78px;
    padding: 4px 3px; background: var(--panel); border: 1px solid var(--line); cursor: pointer;
    text-align: center; font-size: 10px; color: var(--ink);
}
.rune-opt:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43,93,139,.2); }
.rune-opt img { width: 30px; height: 30px; }

/* slot color accents (classic rune colors) */
.slot-mark { border-left-color: #c0392b !important; }
.slot-seal { border-left-color: #c9a227 !important; }
.slot-glyph { border-left-color: #2b6cb0 !important; }
.slot-quintessence { border-left-color: #8e44ad !important; }

/* rune display on guide view */
.rune-show { display: flex; flex-wrap: wrap; gap: 8px; }
.rune-badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
    background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); padding: 3px 8px 3px 5px;
}
.rune-badge img { width: 26px; height: 26px; }
.rb-count { font-weight: bold; color: var(--brand-dark); }

/* ============================ Masteries ============================ */
.mastery-summary { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 13px; }
.mastery-summary b { font-size: 15px; }
.ms-off b { color: #c0392b; } .ms-def b { color: #2f855a; } .ms-uti b { color: #2b6cb0; }
.ms-rem { color: var(--muted); }

.mastery-trees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 780px) { .mastery-trees { grid-template-columns: 1fr; } }
.mastery-tree { background: var(--panel); border: 1px solid var(--line); }
.mt-head { padding: 6px 10px; font-weight: bold; color: #fff; display: flex; justify-content: space-between; }
.mt-head b { color: #fff; }
.mt-head-offense { background: #a5341c; }
.mt-head-defense { background: #2f6a4a; }
.mt-head-utility { background: #2b5d8b; }
.mt-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 52px; gap: 4px; padding: 8px;
}
.mastery-node {
    position: relative; display: flex; align-items: center; justify-content: center;
    background: #e9eef4; border: 2px solid var(--line); padding: 0; cursor: pointer;
}
.mastery-node img { width: 38px; height: 38px; filter: grayscale(70%) brightness(.85); }
.mastery-node.filled img, .mastery-node:hover img { filter: none; }
.mastery-node.filled { border-color: var(--gold); background: #fff8e8; }
.mastery-node.maxed { border-color: #c9a227; box-shadow: 0 0 0 1px #c9a227 inset; }
.mastery-node.locked { opacity: .5; cursor: not-allowed; }
.mastery-node.dim img { filter: grayscale(85%) brightness(.8); opacity: .55; }
.mn-pts {
    position: absolute; bottom: -2px; right: -2px; background: var(--brand-dark); color: #fff;
    font-size: 9px; font-weight: bold; padding: 0 3px; line-height: 1.4;
}
.mastery-node.filled .mn-pts { background: var(--gold-dark); }
.mastery-trees.read-only .mastery-node { cursor: default; }
.mastery-tally { font-size: 13px; color: var(--muted); font-weight: normal; }

/* ============================ Reports / Moderation ============================ */
.report-link { display: inline-block; margin-top: 8px; font-size: 11px; color: var(--muted); }
.report-link:hover { color: var(--gold); }
.report-form { max-width: 520px; }
.report-form select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); font: inherit; margin-bottom: 8px; }
.nav-mod { color: var(--gold) !important; }
.nav-mod:hover { background: var(--accent) !important; color: #fff !important; }

.markdown-help { background: #fbfaf0; border: 1px solid #e3dfb8; padding: 8px 10px; font-size: 11px; margin-bottom: 8px; }
.markdown-help code { background: #efedd8; padding: 1px 4px; }

/* Guide view */
.guide-view { background: var(--panel); border: 1px solid var(--line); padding: 16px 20px; }
.guide-header {
    position: relative; overflow: hidden;
    display: flex; gap: 16px; align-items: center;
    margin: -16px -20px 16px; padding: 22px 20px;
    border-bottom: 3px solid var(--gold);
}
.guide-header > * { position: relative; z-index: 1; }
.guide-bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center 25%; }
.guide-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8,16,30,.9) 0%, rgba(8,16,30,.68) 60%, rgba(8,16,30,.5) 100%);
}
.guide-header h1 { margin: 0; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.guide-header .champ-icon-lg { border-color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.guide-meta { color: #cdd9e6; font-size: 12px; margin-top: 4px; }
.guide-header .vote-widget {
    background: rgba(8,16,30,.55); border: 1px solid var(--gold); padding: 4px 8px;
}
.guide-header .vote-score { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.badge-draft { background: #999; color: #fff; padding: 1px 6px; font-size: 10px; text-transform: uppercase; }
.loadout { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 12px; }
.loadout-block { margin-bottom: 12px; }
.loadout-block h3 { font-size: 12px; text-transform: uppercase; color: var(--brand-dark); margin: 0 0 6px; }
.spell-show { display: flex; gap: 10px; }
.spell-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.spell-badge img { width: 32px; height: 32px; }
.build-show { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-body { line-height: 1.65; margin-top: 14px; }
.guide-body h1, .guide-body h2, .guide-body h3 { border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.guide-body img { max-width: 100%; }
.guide-body table { border-collapse: collapse; }
.guide-body td, .guide-body th { border: 1px solid var(--line); padding: 4px 8px; }

/* ============================ Champion Codex ============================ */
.champ-title { color: var(--gold); font-size: 13px; font-style: italic; margin-top: 2px; }
.champ-blurb { color: var(--ink); font-size: 15px; line-height: 1.7; border-left: 3px solid var(--gold); padding: 2px 0 2px 14px; margin: 4px 0 16px; }
.lore-block { line-height: 1.75; margin-top: 6px; }
.lore-block h3 { font-size: 12px; text-transform: uppercase; color: var(--brand-dark); margin: 0 0 8px; }
.lore-block p { margin: 0 0 12px; }
.lore-quote {
    font-style: italic; color: var(--brand-dark); border-left: 3px solid var(--line);
    padding-left: 12px; margin: 16px 0 !important;
}

/* ============================ Reference (Items/Runes/Masteries/Spells) ============================ */
.ref-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gold); margin-bottom: 16px; }
.ref-tabs a {
    padding: 7px 14px; font-size: 13px; font-weight: bold; color: #9fb2c8;
    background: #0e2038; border: 1px solid var(--line); border-bottom: none;
}
.ref-tabs a:hover { color: #fff; text-decoration: none; }
.ref-tabs a.active { color: var(--brand-dark); background: var(--panel); }

.item-group { margin-bottom: 18px; }
.mastery-node.ref img { filter: none; }
.mastery-node.ref { cursor: default; }

/* My Guides + owner actions */
.flash { background: #eaf6ec; border: 1px solid #b7ddbc; color: #216e2b; padding: 8px 12px; margin-bottom: 12px; }
.actions { white-space: nowrap; }
/* display:contents (not inline) — a <form> wrapping just a button otherwise
   generates its own oversized inline box in table cells / flex rows, taller
   than the button itself and overflowing into whatever sits above it. */
.actions form, .owner-actions form { display: contents; }
.owner-actions { margin-left: auto; display: flex; gap: 6px; align-items: flex-start; }
.mini-btn {
    display: inline-block; font-size: 11px; font-weight: bold; padding: 3px 9px; cursor: pointer;
    background: #e2e9f1; color: var(--brand-dark); border: 1px solid var(--line); text-decoration: none;
}
.mini-btn:hover { background: #d3ddea; text-decoration: none; }
.mini-btn.danger { background: #f6e5e1; color: #a5341c; border-color: #e6c3ba; }
.mini-btn.danger:hover { background: #efd2ca; }
.status-Published { color: #216e2b; font-weight: bold; }
.status-Draft { color: #97701c; font-weight: bold; }
.status-Archived { color: var(--muted); }

/* ============================ Home page ============================ */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #0a2647 0%, #0e2f52 100%);
    border: 1px solid #0a1a2e; border-top: 3px solid var(--gold);
    padding: 34px 38px; margin-bottom: 20px;
}
.hero > * { position: relative; z-index: 1; }
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background-size: cover; background-position: center 22%;
}
/* Darken toward the left so the welcome text stays readable over the splash. */
.hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8,16,30,.96) 0%, rgba(8,16,30,.82) 42%, rgba(8,16,30,.45) 100%);
}
.hero h1 { color: var(--gold); font-size: 30px; margin: 0 0 10px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.hero-lede { color: #d5e0ec; font-size: 16px; max-width: 900px; margin: 0 0 18px; line-height: 1.7; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta .btn-primary, .hero-cta .btn-plain { padding: 11px 22px; font-size: 14px; }

.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .home-grid { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--gold); margin-bottom: 12px; }
.section-head h2 { margin: 0 0 6px; color: #e6ecf3; }
.see-all { color: var(--gold); font-size: 12px; font-weight: bold; }

.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.guide-card {
    display: flex; gap: 12px; align-items: center; background: var(--panel);
    border: 1px solid var(--line); border-left: 3px solid var(--brand); padding: 12px; color: var(--ink);
}
.guide-card:hover { border-left-color: var(--gold); box-shadow: 0 2px 6px rgba(0,0,0,.25); text-decoration: none; }
.guide-card img { width: 56px; height: 56px; flex-shrink: 0; }
.gc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gc-title { font-weight: bold; font-size: 15px; color: var(--brand-dark); }
.gc-meta { color: var(--muted); font-size: 12px; }

.thread-feed { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); }
.thread-feed li { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.thread-feed li:last-child { border-bottom: 0; }
.thread-feed a { font-weight: bold; display: block; }
.tf-meta { color: var(--muted); font-size: 11px; }

/* ============================ Forum threads ============================ */

/* Rotating classic backdrop (old map, old golems, old Nexus crystals) behind the
   forum header — kept dim and desaturated so it reads as texture, not a hero image. */
.forum-banner {
    position: relative; overflow: hidden; margin-bottom: 18px;
    border-bottom: 2px solid var(--gold); min-height: 139px; display: flex; align-items: center;
}
.forum-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; filter: saturate(.75); }
.forum-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(8,16,30,.55) 0%, rgba(8,16,30,.93) 100%);
}
.forum-banner .page-head { position: relative; z-index: 1; padding: 20px 4px; width: 100%; }

.crumbs { color: #9fb2c8; font-size: 13px; margin-bottom: 12px; }
.crumbs a { color: var(--gold); }
.pin, .lock { margin-right: 4px; }

/* Flat (Reddit-style) thread list */
.thread-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.thread-row {
    display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:nth-child(even) { background: var(--row-alt); }
.thread-row.pinned { background: #fbf6e6; border-left: 3px solid var(--gold); }
.tr-main { min-width: 0; }
.tr-title { font-size: 16px; font-weight: bold; }
.tr-preview { color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.tr-meta {
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
    color: var(--muted); font-size: 11px; white-space: nowrap; text-align: right;
}
.tr-author { font-weight: bold; color: var(--brand-dark); }

.posts { margin-bottom: 18px; }
.post { display: grid; grid-template-columns: 180px 1fr; background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; }
@media (max-width: 640px) { .post { grid-template-columns: 1fr; } }
.post-author { background: #eef2f7; border-right: 1px solid var(--line); padding: 12px 14px; }
.pa-name { display: block; font-weight: bold; color: var(--brand-dark); font-size: 15px; }
.pa-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.post-body { padding: 14px 16px; color: var(--ink); line-height: 1.65; }
.post-body p:first-child { margin-top: 0; }
.reply-box textarea { width: 100%; }
.comments-box { margin-top: 22px; border-top: 3px solid var(--gold); padding-top: 14px; }

.vote-widget { display: flex; align-items: center; gap: 4px; }
.post-author .vote-widget { margin-top: 8px; }
.vote-widget form { display: contents; }
.vote-btn {
    width: 22px; height: 20px; padding: 0; line-height: 1; font-size: 11px;
    background: #e2e9f1; color: var(--brand-dark); border: 1px solid var(--line); cursor: pointer;
}
.vote-btn:hover { background: #d3ddea; }
.vote-btn.voted-up { background: var(--brand); color: #fff; border-color: var(--brand-dark); }
.vote-btn.voted-down { background: var(--accent); color: #fff; border-color: var(--gold-dark); }
.vote-score { min-width: 22px; text-align: center; font-weight: bold; color: var(--brand-dark); font-size: 13px; }

/* ============================ Content pages ============================ */
.content-page {
    background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold);
    padding: 24px 32px; max-width: 860px; margin: 0 auto; color: var(--ink);
}
.content-page h1 { color: var(--brand-dark); }
.content-page h2 { color: var(--brand-dark); margin-top: 24px; }
.content-page a { color: var(--brand); }
.content-page em { color: var(--muted); }

/* ============================ Auth pages (Identity UI) ============================ */
/* The default Identity UI uses Bootstrap classes; without Bootstrap loaded we
   style the real elements (col-lg-*, form-floating, form-label, etc.) directly. */
main .row { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
main [class*="col-"] { flex: 1 1 320px; min-width: 260px; }
main .col-lg-6, main .col-md-6 { flex: 1 1 420px; max-width: 560px; }
main .col-lg-4, main .col-md-4 { flex: 0 1 320px; color: #9fb2c8; }

/* Local-account form is a light panel. */
main form[method=post] {
    background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold);
    padding: 22px 24px; color: var(--ink);
}
main form[method=post] h2 { color: var(--brand-dark); font-size: 17px; margin: 0 0 4px; }
main form[method=post] hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0 18px; }
main form[method=post] p { margin: 8px 0; }
/* External-logins column heading sits on the navy page. */
main .col-lg-4 h3, main .col-lg-4 h4 { color: #e6ecf3; font-size: 15px; }

/* Floating labels degrade to label-above-input without Bootstrap. */
.form-floating { display: flex; flex-direction: column-reverse; margin-bottom: 14px; }
.form-floating .form-label, .form-floating > label {
    display: block; font-weight: bold; margin-bottom: 4px; color: var(--ink);
}
.form-control {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); font: inherit;
    background: #fffbef; color: var(--ink);
}
.form-control:focus { outline: 2px solid rgba(43,93,139,.4); border-color: var(--brand); }

/* Remember-me checkbox row. */
.checkbox, .form-check { margin: 10px 0 16px; color: var(--ink); }
.checkbox .form-label, .form-check .form-label, .checkbox label, .form-check label {
    display: inline-flex; align-items: center; gap: 7px; font-weight: normal; margin: 0; color: var(--ink);
}
.form-check-input { width: 16px; height: 16px; }

.btn.btn-primary, .w-100.btn, button.btn-lg, a.btn {
    background: var(--gold); color: var(--brand-dark); border: 1px solid var(--gold-dark);
    padding: 10px 18px; font-weight: bold; cursor: pointer; text-decoration: none;
    display: inline-block; font-size: 14px;
}
.btn.btn-primary:hover, .w-100.btn:hover, a.btn:hover { background: #d8bd88; text-decoration: none; }
.w-100 { width: 100%; }
.text-danger { color: #a5341c; font-size: 12px; }
main form[method=post] a, main .row a { color: var(--brand); }

/* Our own auth/profile cards (register, account) */
.auth-card {
    max-width: 460px; margin: 0 auto; background: var(--panel);
    border: 1px solid var(--line); border-top: 3px solid var(--gold);
    padding: 22px 26px; color: var(--ink);
}
.auth-card .field label { color: var(--ink); font-weight: bold; display: block; margin-bottom: 4px; }
.auth-card input[disabled] { background: var(--row-alt); color: var(--muted); }
.field-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* Identity Manage pages' side nav, now rendered inside our layout. */
.nav-pills, .list-group { list-style: none; padding: 0; margin: 0 0 16px; }
.nav-pills .nav-link, .list-group-item {
    display: block; padding: 7px 12px; color: var(--gold);
    border-bottom: 1px solid var(--brand-dark);
}
.nav-pills .nav-link.active { background: var(--brand-dark); }

/* ============================ Mobile ============================ */
/* Nothing should ever force the whole page to scroll sideways — a hard
   backstop even if some component's intrinsic width slips past the
   breakpoint fixes below. */
body { overflow-x: hidden; }

/* ============================ Site Stats ============================ */

.stats-grid { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-tile {
    flex: 1 1 160px; background: var(--panel); border: 1px solid var(--line);
    border-top: 3px solid var(--gold); padding: 14px 16px; color: var(--ink);
}
.stat-tile-value { font: bold 28px/1 "Trebuchet MS", Verdana, sans-serif; color: var(--brand-dark); }
.stat-tile-label { color: var(--muted); font-size: 12px; text-transform: uppercase; margin-top: 4px; }

.stats-chart {
    display: flex; align-items: flex-end; gap: 4px; height: 140px;
    background: var(--panel); border: 1px solid var(--line); padding: 12px 12px 8px;
    margin-bottom: 18px;
}
.stats-bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.stats-bar { width: 100%; max-width: 26px; background: var(--brand); min-height: 2px; }
.stats-bar-label { color: var(--muted); font-size: 10px; margin-top: 4px; white-space: nowrap; }

@media (max-width: 640px) {
    /* The site-wide zoom (see top of file) is great on desktop but eats
       mobile's already-scarce width on every single element; dial it back
       so nothing needs 30% more room than the screen actually has. */
    html { zoom: 1; }

    /* 7-8 links in one non-wrapping flex row is the single biggest overflow
       source on every page at phone widths — let it wrap instead. */
    .mainnav { flex-wrap: wrap; }
    .mainnav a { padding: 8px 10px; }

    /* Listing tables: drop the secondary columns (Author/Updated/Status/
       Reports-count — anything marked .stat that isn't the row's action
       buttons) so Champion + title/content fit comfortably without needing
       to scroll. .stat.actions (Edit/Delete/Dismiss buttons) stays, since
       those are the whole point of e.g. the My Guides / Moderation pages. */
    .forum-table .stat:not(.actions) { display: none; }
    .forum-table { overflow-x: auto; }

    /* The per-level skill-order grid has no non-essential columns to drop
       (every column is a real game level) — let it scroll independently
       instead of blowing out the whole page. */
    .skill-table { display: block; overflow-x: auto; }
    .skill-table thead, .skill-table tbody { display: table; width: 100%; }

    /* 14 bar-chart columns are too cramped at phone widths for the day
       labels; drop them and let the tooltip (title attr) carry the date. */
    .stats-bar-label { display: none; }
}

