:root {
  --bg: #14110d;
  --panel: #1f1a13;
  --panel-2: #29221a;
  --line: #4a3d28;
  --text: #ece3d0;
  --muted: #a89a7e;
  --gold: #f0c85a;
  --gold-dim: #b8923a;
  --alliance: #3b6fd4;
  --horde: #c0392b;
  --danger: #d0574a;
  --ok: #58b36a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@font-face {
  font-family: "Warcraft";
  src: url("assets/fonts/warcraft.ttf") format("truetype");
  font-display: swap;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }

.hero { position: relative; padding: 48px 0 18px; text-align: center; background: radial-gradient(900px 320px at 50% 0, #3a2412 0%, var(--bg) 100%); }
.eyebrow { color: var(--gold-dim); text-transform: uppercase; letter-spacing: .15em; font-size: .8rem; margin: 0 0 6px; }
h1, h2, h3, h4, legend { font-family: "Warcraft", Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: .03em; }
h1 { margin: 0; line-height: 1; }
.logo { display: block; width: min(250px, 62vw); height: auto; margin: 8px auto 4px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.55)); }
.lead { max-width: 560px; margin: 16px auto 20px; color: #d4c9b1; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: .9rem; color: var(--gold); }
.jump { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--gold-dim);
  background: var(--panel-2); color: var(--gold); font: inherit; font-weight: 600;
}
.btn:hover { background: #352b1e; }
.btn.primary { background: linear-gradient(#f0c85a, #c99a2e); color: #2a1c05; border-color: #f0c85a; }
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(#f0c85a, #c99a2e); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: default; }
.btn[hidden], [hidden] { display: none !important; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin: 20px 0; }
h2 { margin: 0 0 8px; color: var(--gold); font-size: 1.7rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; flex: 1 1 200px; }
.field span { font-size: .9rem; color: #d4c9b1; }
.field em, .group-label em { color: var(--muted); font-style: normal; font-size: .8rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 14px; }
input, select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: #120f0a; border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

fieldset.char { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 16px; margin: 0 0 16px; background: var(--panel-2); min-width: 0; }
legend { color: var(--gold); padding: 0 8px; font-size: 1.05rem; }
.group-label { margin: 6px 0 8px; font-size: .9rem; color: #d4c9b1; font-weight: 600; }

.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; min-width: 64px; border-radius: 8px; cursor: pointer;
  background: rgba(0,0,0,.25); border: 2px solid transparent; color: var(--text); font: inherit; font-size: .75rem;
}
.pick:hover:not(:disabled) { border-color: var(--gold-dim); }
.pick.on { border-color: var(--gold); background: rgba(240,200,90,.12); }
.pick:disabled { opacity: .28; cursor: not-allowed; }
.picks.classes, .picks.rulesets { display: grid; gap: 6px; }
.picks.classes { grid-template-columns: repeat(9, minmax(0, 52px)); }
.picks.rulesets { grid-template-columns: repeat(4, minmax(0, 68px)); gap: 10px; }
.opt { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; }
.opt .lbl { text-align: center; font-size: .78rem; line-height: 1.15; color: #d4c9b1; }
.opt .lbl small { display: block; font-size: .62rem; color: var(--muted); }
.opt.off .lbl { opacity: .45; }
.opt .pick { width: 100%; aspect-ratio: 1; min-width: 0; padding: 0; overflow: hidden; }
.picks.classes, .picks.rulesets { margin-bottom: 14px; }
.opt .pick .sprite { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }

.sprite { display: inline-block; flex: none; background-repeat: no-repeat; border-radius: 6px; border: 1px solid rgba(0,0,0,.6); }
.sprite.ph { background: #000; }
.sprite.inline { vertical-align: middle; border-radius: 4px; }

.secondary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.tick { display: flex; gap: 6px; align-items: center; font-size: .9rem; }
.tick input { width: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.error { color: var(--danger); font-weight: 600; margin: 14px 0 0; }
.notice { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--gold-dim); background: rgba(240,200,90,.08); margin: 12px 0; }
.notice.success { border-color: var(--ok); background: rgba(88,179,106,.1); }
.linkbox { display: flex; gap: 8px; margin: 8px 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: #d4c9b1; flex: 1 1 130px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); border-left-width: 4px; }
.card.alliance { border-left-color: var(--alliance); }
.card.horde { border-left-color: var(--horde); }
.card .portrait { border-radius: 8px; }
.card h3 { margin: 0; font-size: 1.1rem; color: var(--gold); }
.card p { margin: 2px 0; }
.card .sub { font-size: .9rem; }
.card .owner { font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; margin: 2px 4px 2px 0; border-radius: 999px; background: #120f0a; border: 1px solid var(--line); font-size: .78rem; }
.tag.dim { color: var(--muted); }
.tag.warn { border-color: var(--danger); color: var(--danger); }

.classcount { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 12px 0; }
.cc { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.cc .sprite { grid-row: span 2; }
.cc b { color: var(--gold); font-size: 1.05rem; line-height: 1; }
.cc span:last-child { font-size: .7rem; color: var(--muted); }
.cc.zero { opacity: .45; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 12px 16px 40px; }

@media (max-width: 560px) {
  fieldset.char { padding: 12px 8px 14px; }
  .picks.classes { gap: 3px; }
  .picks.classes .opt .lbl { display: none; }
  .picks.rulesets { gap: 6px; }
  .picks.rulesets .lbl { font-size: .68rem; }
  .panel { padding: 18px 14px; }
}
.picked { color: var(--gold); }

.factions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.fsum { border-radius: var(--radius); padding: 12px; min-width: 0; }
.fsum h3 { margin: 0 0 4px; font-size: 1.3rem; letter-spacing: .06em; }
.fsum.alliance { background: linear-gradient(#152444, #101a30); border: 1px solid #2c4a8a; }
.fsum.alliance h3 { color: #8fb1f2; }
.fsum.horde { background: linear-gradient(#3d1613, #2a0f0d); border: 1px solid #7d2a22; }
.fsum.horde h3 { color: #ee8a7d; }
.fsum .classcount { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.fsum .cc { background: rgba(0,0,0,.25); }
@media (max-width: 700px) {
  .factions { grid-template-columns: 1fr; }
}

.profcount { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.pc { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pc b { color: var(--gold); font-size: 1.05rem; line-height: 1; }
.pc span { font-size: .75rem; color: #d4c9b1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc.zero { opacity: .45; }
.profcount.sec .pc { background: transparent; }

.topbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.hero-body { padding-top: 8px; }
.btn.ghost { background: rgba(0,0,0,.35); }
.lang { display: inline-flex; border: 1px solid var(--gold-dim); border-radius: 8px; overflow: hidden; }
.lang button { padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; border: 0; background: rgba(0,0,0,.35); color: var(--muted); }
.lang button + button { border-left: 1px solid var(--gold-dim); }
.lang button[aria-pressed="true"] { background: var(--gold); color: #2a1c05; }

.race-group { border-radius: 8px; padding: 8px 10px 4px; margin-bottom: 10px; }
.race-group h4 { margin: 0 0 6px; font-size: 1rem; letter-spacing: .08em; }
.race-group.alliance { background: linear-gradient(#152444, #101a30); border: 1px solid #2c4a8a; }
.race-group.alliance h4 { color: #8fb1f2; }
.race-group.horde { background: linear-gradient(#3d1613, #2a0f0d); border: 1px solid #7d2a22; }
.race-group.horde h4 { color: #ee8a7d; }
.picks.races-row { display: grid; grid-template-columns: repeat(5, minmax(0, 76px)); gap: 10px; margin-bottom: 8px; }
.picks.genders { display: grid; grid-template-columns: repeat(2, minmax(0, 46px)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) {
  .picks.races-row { gap: 6px; }
  .race-group { padding: 8px 6px 2px; }
  .opt .lbl { font-size: .68rem; }
}

textarea { width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: #120f0a; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
dialog.overlay { width: min(520px, calc(100vw - 32px)); padding: 22px 20px; border: 1px solid var(--gold-dim); border-radius: var(--radius); background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog.overlay::backdrop { background: rgba(0,0,0,.65); }

.foot-logo { display: block; width: 150px; height: auto; margin: 0 auto 10px; opacity: .55; }

.fb-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.fb-icon { flex: none; }
.badge { position: absolute; top: -10px; right: -10px; min-width: 22px; height: 22px; padding: 0 5px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; border: 2px solid var(--bg); box-sizing: border-box; }
.tag .sprite.inline { width: 16px; height: 16px; vertical-align: -3px; }

.playing-label { margin: 6px 0 8px; color: var(--muted); font-size: .9rem; }
.chip.faction-alliance { border-color: #2c4a8a; background: linear-gradient(#152444, #101a30); color: #8fb1f2; }

.race-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.race-groups .race-group { margin-bottom: 0; min-width: 0; }
@media (max-width: 760px) {
  .race-groups { grid-template-columns: 1fr; }
}

/* ---------- Spelgrupper ---------- */
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { margin: 0; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.gcard { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); border-top-width: 4px; }
.gcard.alliance { border-top-color: var(--alliance); }
.gcard.horde { border-top-color: var(--horde); }
.gcard.any { border-top-color: var(--gold-dim); }
.gcard header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.gcard h3 { margin: 0; font-size: 1.15rem; color: var(--gold); }
.fchip { flex: none; padding: 1px 10px; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); }
.fchip.alliance { border-color: #2c4a8a; color: #8fb1f2; background: #101a30; }
.fchip.horde { border-color: #7d2a22; color: #ee8a7d; background: #2a0f0d; }
.fchip.any { color: var(--gold); }
.gcard p { margin: 0; }
.gmeta .tag { margin: 0 4px 4px 0; }
.gplay { font-size: .85rem; color: var(--muted); }
.gdesc { white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; color: #d4c9b1; }
.glooking { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; }
.glooking b { color: var(--muted); font-weight: 600; margin-right: 2px; }
.lk .sprite { vertical-align: middle; }
.gcard footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--danger); }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--gold-dim); border-radius: 8px; overflow: hidden; align-self: flex-start; margin-bottom: 12px; }
.field .seg { margin-bottom: 0; }
.seg button { padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; border: 0; background: #120f0a; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--gold-dim); }
.seg button[aria-pressed="true"] { background: var(--gold); color: #2a1c05; font-weight: 700; }
.chipbtn { padding: 6px 14px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; border: 1px solid var(--line); background: #120f0a; color: var(--text); }
.chipbtn[aria-pressed="true"] { border-color: var(--gold); background: rgba(240,200,90,.15); color: var(--gold); }
.field.narrow { flex: 0 1 130px; }

.badge-inline { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }

.reqs { margin: 12px 0 18px; }
.reqs h3 { margin: 0 0 8px; color: var(--gold); }
.req { padding: 12px; margin-bottom: 10px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); }
.req.pending { border-color: var(--gold-dim); }
.req.declined { opacity: .6; }
.req header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.reqchars { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.reqchars li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.reqcontact { margin: 6px 0; padding: 6px 10px; border-radius: 6px; background: rgba(88,179,106,.12); border: 1px solid var(--ok); }
.req .actions { margin-top: 8px; }

.apchars { display: grid; gap: 6px; margin-bottom: 12px; }
.apchar { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.apchar.off { opacity: .5; }
.apchar em { font-style: normal; color: var(--muted); font-size: .8rem; }
#applyDialog, #reportDialog { max-height: calc(100vh - 32px); overflow: auto; }

/* ---------- Flikar ---------- */
.hero .lead { margin: 10px auto 14px; font-size: .95rem; }
.hero .chips { margin-bottom: 8px; }
.hero .playing-label { margin: 2px 0 6px; }
.tabs { position: sticky; top: 0; z-index: 20; background: rgba(20,17,13,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 6px; padding-top: 8px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.tab.active { color: #2a1c05; background: linear-gradient(#f0c85a, #c99a2e); border-color: #f0c85a; }
.tab[hidden] { display: none; }
.tab .badge-inline { box-shadow: 0 0 0 2px rgba(20,17,13,.9); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }
.hero .jump { gap: 8px; }
.hero .jump .btn { padding: 8px 14px; font-size: .9rem; }

.filter-bar { margin: 12px 0 8px; }
