/* =========================================================
   ElsElysion – forum theme (DESIGN REFERENCE)
   Modelled on an Invision-Community-style forum (Elsrift).
   Port these tokens/components into the theme of whichever
   forum software you install (Invision, XenForo, phpBB, ...).
   ========================================================= */

:root {
  --f-bg: #0b101c;
  --f-bar: #141b2b;          /* top bar, cards */
  --f-sub: #1a2337;          /* breadcrumb bar, dropdowns */
  --f-card: #141b2b;
  --f-line: #222c42;
  --f-line-strong: #2c3854;
  --f-hover: #172036;
  --f-pill: #252f47;
  --f-pill-hover: #1e283d;
  --f-text: #e6ecf5;
  --f-muted: #8d9ab0;
  --f-soft: #a9b6c9;
  --f-accent: #35c6dc;       /* buttons, forum icon tiles */
  --f-accent-light: #7fe3f0;
  --f-unread: #4fd2e6;
  --f-points: #3ddc84;
  --f-gold: #e8cf86;
  /* Member group colours (used for usernames everywhere) */
  --role-dev: #e8c46a;       /* Developers */
  --role-mod: #b39dff;       /* Moderators */
  --role-art: #f08bb4;       /* Artists */
  --role-member: #6cb6ff;    /* Members */
  --font-display: "Exo 2", system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.ef-body { min-height: 100vh; background: var(--f-bg); color: var(--f-text); font-family: var(--font-body); }
a { color: var(--role-member); }
a:hover { color: #b3d9ff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.role-dev { color: var(--role-dev) !important; }
.role-mod { color: var(--role-mod) !important; }
.role-art { color: var(--role-art) !important; }
.role-member { color: var(--role-member) !important; }

/* ---------- Top bar ---------- */
.ef-header { position: relative; z-index: 30; background: var(--f-bar); border-bottom: 1px solid var(--f-line); }
.ef-header__inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.ef-header__logo { flex: 0 0 auto; display: block; }
.ef-header__logo img { display: block; width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--f-gold); box-shadow: 0 0 0 3px rgba(79, 210, 230, .2); }
.ef-nav { flex: 1 1 420px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ef-header__user { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin-left: auto; }

.ef-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border: 0; border-radius: 4px;
  background: none; color: #fff;
  font: 700 12px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.ef-nav-link:hover { background: var(--f-pill-hover); color: var(--f-accent-light); }
.ef-nav-link.is-active { background: var(--f-pill); }
.ef-nav-link svg { transition: transform .2s; }
.ef-nav-link[aria-expanded="true"] { background: var(--f-pill-hover); color: var(--f-accent-light); }
.ef-nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.ef-nav-link:focus-visible,
.ef-btn:focus-visible,
.ef-ghost:focus-visible { outline: 2px solid var(--f-accent-light); outline-offset: 2px; }

.ef-ghost { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 4px; color: var(--f-text); font: 600 13px/1 var(--font-body); text-decoration: none; }
.ef-ghost:hover { background: var(--f-pill-hover); color: #fff; }
.ef-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 4px;
  background: var(--f-accent); color: #061420;
  font: 700 13px/1 var(--font-body); text-decoration: none; white-space: nowrap;
}
.ef-btn:hover { background: var(--f-accent-light); color: #061420; }
.ef-btn--sm { min-height: 40px; }

/* ---------- Dropdown menus (Browse / ElsElysion / Elsword) ---------- */
.ef-dd { position: relative; }
.ef-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  width: 220px; max-width: calc(100vw - 32px);
  padding: 8px; border: 1px solid var(--f-line-strong); border-radius: 8px;
  background: var(--f-sub); box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}
.ef-menu[hidden] { display: none; }
.ef-menu--wide { width: 232px; }
.ef-menu__list { list-style: none; margin: 0; padding: 0; }
.ef-menu__item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 10px; border-radius: 4px;
  color: #dfe6f1; font: 500 14px/1.2 var(--font-body); text-decoration: none;
}
.ef-menu__item:hover { background: var(--f-pill); color: #fff; }
.ef-menu__item:focus-visible { outline: 2px solid var(--f-accent-light); outline-offset: -2px; }
.ef-menu__item--head { font-weight: 700; color: #fff; }
.ef-menu__item svg { flex: 0 0 auto; color: var(--f-accent-light); }
.ef-menu__ext { margin-left: auto; color: var(--f-muted) !important; }

/* ---------- Sky banner (uses sky.css) ---------- */
.ef-banner { position: relative; height: 170px; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--f-line); }
.ef-banner .ee-sky__img { inset: -6%; background-position: center 42%; }
.ef-banner .ee-cloud--far { top: -70px; }
.ef-banner .ee-cloud--near { bottom: -200px; }
.ef-banner__logo { display: block; width: 124px; height: 124px; border-radius: 20px; border: 2px solid var(--f-gold); box-shadow: 0 0 0 4px rgba(79, 210, 230, .3), 0 10px 30px rgba(16, 32, 80, .45); }

/* ---------- Breadcrumb + search bar ---------- */
.ef-subbar { background: var(--f-sub); border-bottom: 1px solid var(--f-line); }
.ef-subbar__inner { max-width: 1180px; margin: 0 auto; padding: 6px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.ef-crumbs { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; font: 600 13px var(--font-body); }
.ef-crumbs__sep { display: inline-flex; color: var(--f-muted); }
.ef-crumbs [aria-current="page"] { color: #fff; }
.ef-crumb { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: #fff; text-decoration: none; }
.ef-crumb:hover { color: var(--f-accent-light); }
.ef-search { position: relative; flex: 0 1 260px; min-width: 200px; margin: 0; }
.ef-search svg { position: absolute; left: 12px; top: 12px; color: #c3cede; }
.ef-search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid var(--f-line-strong); border-radius: 4px;
  background: #232d44; color: #fff; font: 400 13px var(--font-body);
}
.ef-search input::placeholder { color: #9aa7bc; }
.ef-search input:focus { outline: 2px solid var(--f-unread); outline-offset: 1px; }

/* ---------- Page layout ---------- */
.ef-main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 8px; }
.ef-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.ef-page-title { margin: 0; font: 700 28px/1.2 var(--font-display); color: #fff; }
.ef-card { background: var(--f-card); border: 1px solid var(--f-line); border-radius: 6px; margin-bottom: 18px; overflow: hidden; }
.ef-card__title { margin: 0; padding: 18px 20px; font: 600 17px/1.2 var(--font-body); color: #fff; }
.ef-card__title--line { border-bottom: 1px solid var(--f-line); }
.ef-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--f-line); }
.ef-card__head h2 { margin: 0; font: 600 15px/1.2 var(--font-body); }
.ef-card__head a { color: #fff; font: 600 13px var(--font-body); text-decoration: none; }
.ef-card--pad { padding: 20px; }

.ef-avatar {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--av, #4a5a78); color: #fff; font-weight: 600; line-height: 1;
}
.ef-avatar--sm { width: 34px; height: 34px; font-size: 15px; }
.ef-avatar--md { width: 36px; height: 36px; font-size: 15px; }
.ef-avatar--lg { width: 80px; height: 80px; font-size: 34px; }
.ef-user { text-decoration: none; }
.ef-user:hover { text-decoration: underline; }

/* ---------- Forum index rows ---------- */
.ef-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 20px; border-top: 1px solid var(--f-line); transition: background .15s; }
.ef-row:hover { background: var(--f-hover); }
.ef-row__main { flex: 1 1 320px; min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.ef-tile { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 6px; background: var(--f-accent); color: #061420; display: inline-flex; align-items: center; justify-content: center; }
.ef-row__text { flex: 1 1 auto; min-width: 0; padding-top: 5px; }
.ef-row__name { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 15px/1.3 var(--font-body); }
.ef-row__name a { color: #fff; text-decoration: none; }
.ef-row__name a:hover { color: var(--f-accent-light); text-decoration: underline; }
.ef-unread { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--f-unread); }
.ef-subforums { list-style: none; margin: 12px 0 0; padding: 0 0 0 2px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ef-subforums a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; color: #dfe6f1; font: 600 13px/1.2 var(--font-body); text-decoration: none; }
.ef-subforums a:hover { color: var(--f-accent-light); }
.ef-row__stats { flex: 0 0 80px; text-align: center; line-height: 1.25; }
.ef-row__count { display: block; font-size: 16px; color: var(--f-text); }
.ef-row__label { display: block; font-size: 12px; color: var(--f-muted); }
.ef-row__last { flex: 0 1 320px; min-width: 240px; display: flex; align-items: center; gap: 12px; }
.ef-row__last > div { min-width: 0; font-size: 13px; line-height: 1.45; }
.ef-row__topic { display: block; color: #fff; font-weight: 700; text-decoration: none; }
.ef-row__topic:hover { color: var(--f-accent-light); }
.ef-row__meta { color: var(--f-muted); }

.ef-online-list { margin: 0; padding: 18px 20px 20px; font-size: 13px; line-height: 1.8; color: var(--f-muted); }

/* ---------- People grids (Staff Directory, Online Users) ---------- */
.ef-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ef-people--wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ef-person { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 10px 12px; box-shadow: 1px 0 0 var(--f-line), 0 1px 0 var(--f-line); text-align: center; }
.ef-person__name { margin-top: 4px; font: 600 15px/1.3 var(--font-body); }
.ef-person__time { font-size: 12px; color: var(--f-muted); padding-bottom: 10px; }
.ef-msg { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: 4px; color: #c3cede; font: 500 13px var(--font-body); text-decoration: none; }
.ef-msg:hover { background: var(--f-pill-hover); color: #fff; }

/* ---------- Leaderboard ---------- */
.ef-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; border-bottom: 1px solid var(--f-line); }
.ef-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 68px; border: 0; border-radius: 4px; background: none;
  color: var(--f-soft); font: 500 13px/1.2 var(--font-body); cursor: pointer;
}
.ef-tab:hover { background: var(--f-sub); color: #fff; }
.ef-tab[aria-selected="true"] { background: #2a3550; color: #fff; font-weight: 700; }
.ef-tab:focus-visible { outline: 2px solid var(--f-accent-light); outline-offset: -2px; }
.ef-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; padding: 4px 14px; border-bottom: 1px solid var(--f-line); }
.ef-filter {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px;
  border: 0; border-radius: 4px; background: none; color: var(--f-soft);
  font: 600 11px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.ef-filter:hover { background: var(--f-sub); color: #fff; }
.ef-filter:focus-visible { outline: 2px solid var(--f-accent-light); }

.ef-mcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ef-mcard { display: flex; flex-direction: column; gap: 12px; padding: 12px; box-shadow: 1px 0 0 var(--f-line), 0 1px 0 var(--f-line); }
.ef-mcard__cover { height: 125px; border-radius: 4px; background-color: #a9bde8; background-repeat: no-repeat; }
/* Placeholder covers cut from the background/logo – replace with each member's profile cover */
.ef-cover--1 { background-image: url("../img/background.jpg"); background-size: 200%; background-position: 20% 40%; }
.ef-cover--2 { background-image: url("../img/logo.jpg"); background-size: 140%; background-position: 50% 30%; }
.ef-cover--3 { background-image: url("../img/background.jpg"); background-size: 260%; background-position: 85% 20%; }
.ef-cover--4 { background-image: url("../img/background.jpg"); background-size: 160%; background-position: 50% 80%; }
.ef-mcard__who { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.ef-mcard__name { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.ef-mcard__name a { display: block; font: 600 15px/1.3 var(--font-body); }
.ef-mcard__name span { font-size: 12px; }
.ef-mcard__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 0; border-top: 1px solid var(--f-line); text-align: center; line-height: 1.3; }
.ef-points { display: inline-flex; align-items: center; gap: 6px; font: 600 16px var(--font-body); color: var(--f-points); }
.ef-points-label { display: block; font-size: 12px; color: var(--f-points); }
.ef-mcard__num { display: block; font: 600 16px var(--font-body); color: #fff; }
.ef-mcard__label { display: block; font-size: 12px; color: var(--f-muted); }
.ef-follow, .ef-find { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 4px; font: 600 13px/1 var(--font-body); text-decoration: none; }
.ef-follow { background: #232d44; color: var(--f-text); }
.ef-follow:hover { background: var(--f-line-strong); color: #fff; }
.ef-find { background: var(--f-accent); color: #061420; }
.ef-find:hover { background: var(--f-accent-light); color: #061420; }
.ef-follow:focus-visible, .ef-find:focus-visible { outline: 2px solid var(--f-accent-light); outline-offset: 2px; }

.ef-medal { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #2a1e04; }
.ef-medal--sm { width: 30px; height: 30px; }
.ef-medal--1 { background: #e8b93a; }
.ef-medal--2 { background: #c7cfdb; }
.ef-medal--3 { background: #d08a4a; }

.ef-popular__head { padding: 40px 22px 6px; border-top: 1px solid var(--f-line); }
.ef-popular__head h2 { margin: 0; font: 700 26px/1.2 var(--font-display); color: #fff; }
.ef-popular__head p { margin: 6px 0 0; font-size: 13px; color: var(--f-muted); }
.ef-popular { list-style: none; margin: 18px 0 0; padding: 0; }
.ef-popular > li { display: flex; gap: 14px; padding: 20px 22px; border-top: 1px solid var(--f-line); }
.ef-popular__body { flex: 1 1 auto; min-width: 0; }
.ef-popular__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ef-popular__top h3 { margin: 0; font: 700 15px/1.35 var(--font-body); }
.ef-popular__top h3 a { color: #fff; text-decoration: none; }
.ef-popular__top h3 a:hover { color: var(--f-accent-light); }
.ef-popular__score { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--f-soft); }
.ef-popular__meta { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--f-soft); }
.ef-popular__meta strong { color: #fff; }
.ef-popular__excerpt { margin: 12px 0 0; font-size: 13px; line-height: 1.6; color: #dfe6f1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ef-popular__time { margin: 12px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--f-muted); }
.ef-section-title { margin: 0; padding: 22px 22px 18px; border-bottom: 1px solid var(--f-line); font: 700 20px/1.2 var(--font-display); color: #fff; }

.ef-past { list-style: none; margin: 0; padding: 0; }
.ef-past > li { padding: 20px 22px; border-bottom: 1px solid var(--f-line); }
.ef-past h2 { margin: 0 0 14px; font: 600 15px/1.3 var(--font-body); color: #fff; }
.ef-past__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ef-past__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #182033; border: 1px solid var(--f-line); border-radius: 6px; }
.ef-past__name { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.ef-past__name a { display: block; font: 600 14px/1.3 var(--font-body); }
.ef-past__name span { font-size: 12px; }
.ef-past__pts { flex: 0 0 auto; font: 600 14px var(--font-body); color: var(--f-points); white-space: nowrap; }

/* ---------- Footer ---------- */
.ef-footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 28px; }
.ef-footer__links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.ef-footer__links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--f-text); font: 600 13px var(--font-body); text-decoration: none; }
.ef-footer__links a:hover { color: var(--f-accent-light); }
.ef-footer__legal { margin: 14px 0 0; text-align: center; font-size: 12px; line-height: 1.6; color: #8391a8; }

/* ---------- Phone ---------- */
@media (max-width: 700px) {
  .ef-nav { justify-content: flex-start; order: 3; flex-basis: 100%; }
  .ef-banner { height: 130px; }
  .ef-banner__logo { width: 88px; height: 88px; }
  .ef-row__last { min-width: 0; flex-basis: 100%; }
  .ef-row__stats { text-align: left; }
  .ef-past__grid { grid-template-columns: minmax(0, 1fr); }
}
