/* League Matchup Toolkit - shared styles
   Minimalist dark theme: everything visible at once, muted accent, no clutter. */

:root {
  --bg: #14161c;
  --bg-panel: #1b1e27;
  --bg-panel-raised: #22252f;
  --border: #2c303c;
  --text: #e7e9ee;
  --text-dim: #9aa0ac;
  --accent: #4c8dff;
  --accent-dim: #2f5fb0;
  --good: #4caf7d;
  --warn: #d9a441;
  --bad: #d9534f;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}

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

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 21;
}

/* Sticky sub-bar for the notes page's live enemy ability reference - sits
   directly under the topnav (which is 52px tall) and stays put while the
   rest of the page scrolls underneath it. */
.ability-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 32px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 20;
  overflow-x: auto;
}

.ability-bar-champ {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 13px;
  white-space: nowrap;
}

.ability-bar-chips {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ability-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: help;
  flex-shrink: 0;
}

.ability-chip img { width: 30px; height: 30px; border-radius: 6px; }

.ability-chip .ability-cd {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.placeholder-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

/* Miniaturized rune page selector */
.rune-section { margin-bottom: 14px; }
.rune-section:last-child { margin-bottom: 0; }

.rune-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.rune-hint { font-size: 12px; margin: 4px 0 0; }

.rune-tree-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.rune-tree-icon {
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 50%;
  background: var(--bg-panel-raised);
  cursor: pointer;
  filter: grayscale(0.7) brightness(0.6);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.rune-tree-icon:hover { filter: grayscale(0.2) brightness(0.9); }
.rune-tree-icon.selected { filter: none; box-shadow: 0 0 0 2px var(--accent); }

.rune-slot-row { display: flex; gap: 8px; margin-bottom: 8px; }
.rune-slot-row:last-child { margin-bottom: 0; }

.rune-icon {
  border-radius: 50%;
  background: #0e0f14;
  cursor: pointer;
  filter: grayscale(0.85) brightness(0.5);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.rune-icon:hover { filter: grayscale(0.3) brightness(0.85); }
.rune-icon.selected { filter: none; box-shadow: 0 0 0 2px var(--good), 0 0 6px var(--good); }
.rune-icon.lg { width: 36px; height: 36px; padding: 3px; }
.rune-icon.md { width: 28px; height: 28px; padding: 2px; }
.rune-icon.sm { width: 24px; height: 24px; padding: 2px; }

.rune-secondary-body { display: flex; gap: 12px; align-items: flex-start; }
.rune-secondary-runes { display: flex; flex-direction: column; }

.rune-shards { display: flex; flex-direction: column; padding-left: 10px; border-left: 1px solid var(--border); }
.rune-shards-label { margin-bottom: 4px; }
.rune-shard-row { gap: 5px; }

.rune-shard-icon {
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 50%;
  background: #0e0f14;
  cursor: pointer;
  filter: grayscale(0.85) brightness(0.55);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.rune-shard-icon:hover { filter: grayscale(0.3) brightness(0.9); }
.rune-shard-icon.selected { filter: none; box-shadow: 0 0 0 2px var(--warn); }

.rune-notes-field { margin-top: 12px; margin-bottom: 0; }
.rune-notes-textarea { height: 50px; }

.topnav .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.topnav nav {
  display: flex;
  gap: 16px;
}

.topnav nav a {
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: var(--radius);
}

.topnav nav a.active,
.topnav nav a:hover {
  color: var(--text);
  background: var(--bg-panel-raised);
  text-decoration: none;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Pages that should use the full 1920px-class viewport instead of being
   capped and centered - the sidebar stays fixed-width and pins left, the
   main content stretches to fill whatever width remains. */
.page-wide {
  max-width: none;
  margin: 0;
  padding: 24px 32px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--text); }
p.subtle, .subtle { color: var(--text-dim); }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.notes-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}

.notes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.notes-main {
  min-width: 0;
}

.notes-main .note-editable {
  height: 220px;
}

@media (max-width: 900px) {
  .notes-layout { grid-template-columns: 1fr; }
}

.card-link {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s ease;
}
.card-link:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
}
.card-link h2 { color: var(--accent); }

label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

select, input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 14px;
}

textarea { resize: vertical; min-height: 90px; }

/* Matchup Notes fields - contenteditable divs (not <textarea>, so live hover
   tooltips can render inline) styled to look and behave the same: fixed
   height with a drag-to-resize handle and internal scroll, like a textarea. */
.note-editable {
  width: 100%;
  height: 90px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow: auto;
  resize: vertical;
  cursor: text;
}
.note-editable:focus { outline: none; border-color: var(--accent-dim); }
.note-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
}

.field { margin-bottom: 14px; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: var(--accent-dim); }
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.secondary:hover { background: var(--bg-panel-raised); }
button.danger { background: var(--bad); }
button.danger:hover { background: #b8443f; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; }

.icon-sm { width: 20px; height: 20px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.icon-md { width: 32px; height: 32px; border-radius: 6px; vertical-align: middle; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg-panel-raised);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }

/* Tooltip engine */
.tt-hover { border-bottom: 1px dotted var(--text-dim); cursor: help; }

/* Nested keyword links found inside a tooltip's own body text - a distinct
   underline color hints these open another (nested) tooltip. */
.tt-nested { border-bottom-style: dotted; border-bottom-color: var(--accent-dim); }
/* "(scaling)" chips standing in for ability numbers Data Dragon doesn't expose. */
.tt-scaling { color: var(--text-dim); font-style: italic; border-bottom-color: var(--text-dim); }

/* Light markdown rendering in the note editors. Syntax characters (**, *, `,
   #, >, -) stay visible by design - see note-editor.js - so these only ever
   add styling, never hide/replace text. */
.md-bold { font-weight: 700; }
.md-italic { font-style: italic; }
.md-strike { text-decoration: line-through; opacity: 0.75; }
.md-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.9em;
}
.md-heading { font-weight: 700; }
.md-h1 { font-size: 1.25em; }
.md-h2 { font-size: 1.12em; }
.md-h3 { font-size: 1.04em; }
.md-quote { color: var(--text-dim); font-style: italic; }
.md-list-marker { font-weight: 700; color: var(--accent); }

.lgt-tooltip-box {
  position: fixed;
  max-width: 320px;
  background: #0e0f14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  z-index: 1000;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lgt-tooltip-box .tt-title { font-weight: 700; margin-bottom: 4px; color: var(--accent); }

/* Gained once a tooltip has been hover-held for HOLD_MS - the visual cue that
   its nested keywords are now hoverable. */
.lgt-tooltip-box.locked {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 24px rgba(0,0,0,0.6);
  padding: 9px 11px; /* compensate for the thicker border so content doesn't shift */
}

/* Small bar that follows the cursor while holding over a tooltip, filling up
   as it counts down to "unlocked". */
.lgt-hold-indicator {
  position: fixed;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  pointer-events: none;
  z-index: 2000;
  display: none;
}
.lgt-hold-indicator-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

/* Passphrase lock screen */
.lock-screen {
  max-width: 420px;
  margin: 80px auto;
  text-align: center;
}
.lock-screen .panel { text-align: left; }

.stat-modifiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.result-line:last-child { border-bottom: none; }

.defender-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}
.defender-block .remove-defender {
  position: absolute;
  top: 8px;
  right: 8px;
}

.matchup-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.matchup-list-item:hover { color: var(--accent); }

.badge-saved {
  color: var(--good);
  font-size: 11px;
}

/* Icon picker (replaces native <select> so champions/items show icons) */
.icon-picker { position: relative; width: 100%; }
.icon-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.icon-picker-trigger:hover { border-color: var(--accent-dim); }
.icon-picker-trigger .trigger-content { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.icon-picker-trigger .chevron { color: var(--text-dim); }
.icon-picker-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0e0f14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 8px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}
.icon-picker-panel[hidden] { display: none; }
.icon-picker-search { margin-bottom: 6px; }
.icon-picker-list { overflow-y: auto; }
.icon-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.icon-picker-row:hover { background: var(--bg-panel-raised); }
.icon-picker-row.selected { background: var(--accent-dim); color: #fff; }
.icon-picker-row img { width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; }
.icon-picker-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px 2px 2px;
  font-size: 12px;
}
.icon-picker-chip img { width: 16px; height: 16px; border-radius: 3px; }

/* Custom Tooltips management page */
.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.tooltip-row:last-child { border-bottom: none; }
.tooltip-row-main { min-width: 0; }
.tooltip-def-preview { margin: 4px 0 0; font-size: 12.5px; }
.tooltip-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- site footer: analytics disclosure + local-data escape hatch ---------- */
.site-footer {
  margin-top: 48px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.site-footer .linklike {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  width: auto;
}
.site-footer .linklike:hover { color: var(--text); }
