/* Yrken: guildens hantverkare. Färger och typsnitt kommer från tokens.css. */
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text-body); font: 400 15px/1.5 var(--font-body); font-synthesis: none;
  background: radial-gradient(ellipse 80% 50% at 50% 0, rgba(217, 169, 63, .06), transparent 70%), var(--bg); }
a { color: var(--gold-300); }
img { display: block; }
[hidden] { display: none !important; }

/* Menyn: samma som på de andra sidorna */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px clamp(16px, 4vw, 40px); }
.topbar__brand { display: flex; align-items: center; gap: 10px; flex: none; text-decoration: none; font: 700 17px/1 var(--font-display); letter-spacing: .14em; color: var(--text-primary); text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.topbar__brand img { width: 30px; height: 30px; }
.topbar nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { font: 600 14px/1 var(--font-body); text-decoration: none; color: var(--text-primary); opacity: .75; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.topbar nav a:hover, .topbar nav a[aria-current] { opacity: 1; }
.topbar nav a[aria-current] { color: var(--gold-300); }
.topbar .nav-home { position: relative; margin-right: 22px; }
.topbar .nav-home::after { content: ""; position: absolute; right: -23px; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: var(--line-strong); }

/* Heron: kort, det är ett verktyg */
.hero { position: relative; isolation: isolate; display: grid; justify-items: center; text-align: center; padding: 120px 16px 0; overflow: hidden; }
.hero__art { position: absolute; inset: 0; z-index: -1; background: url("img/hero.webp") center 38% / cover; filter: saturate(1.05) brightness(.6);
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 45%, transparent 100%); }
.hero__art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 55% 50% at 50% 45%, rgba(4, 7, 15, .45), transparent 75%); }
.hero__meta { margin: 0 0 14px; font: 400 13px/1 var(--font-label); letter-spacing: var(--cap); text-transform: uppercase; color: var(--text-primary); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.hero__meta b { color: var(--gold-300); font-weight: 400; }
.hero h1 { margin: 0; font: 700 var(--fs-d1)/1 var(--font-display); letter-spacing: .03em; text-transform: uppercase; color: var(--bone-50); filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .7)); }
.hero h1 em { font-style: normal; color: var(--gold-300); }
.hero__lead { margin: 14px 0 0; font: 400 20px/1.3 var(--font-ui); color: var(--bone-50); text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }

.search { position: relative; display: block; width: min(640px, 100%); margin: 40px 0 0; }
.search svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: var(--ash-300); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 56px; padding: 0 18px 0 50px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none;
  background: rgba(18, 27, 48, .92); color: var(--bone-50); font: 400 17px/1 var(--font-body); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.search input::placeholder { color: var(--stone-400); }
.search input:focus { border-color: var(--act-rim); box-shadow: 0 0 0 3px rgba(18, 134, 163, .3), 0 10px 40px rgba(0, 0, 0, .5); }

.browse { width: min(1080px, 100%); margin: 0 auto; padding: 28px 16px 40px; }

/* Yrkesknapparna: vald = primär knapp */
.profs { position: relative; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.prof { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: rgba(244, 237, 228, .03); color: var(--bone-50); font: 400 15px/1 var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s; }
.prof:hover { border-color: rgba(212, 187, 146, .5); }
.prof img { width: 26px; height: 26px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .6); }
.prof--all { padding-left: 14px; }
.prof[aria-selected="true"] { background: linear-gradient(180deg, var(--act-500), var(--act-600)); border-color: var(--act-rim); color: var(--act-ink); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 10px; padding: 0 4px; }
.bar__count { margin: 0; font: 400 15px/1.3 var(--font-ui); color: var(--text-muted); }
.bar__count b { font: 600 15px/1 var(--font-num); color: var(--bone-50); }

/* Karaktärsvyn */
.who-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.who-head h2 { margin: 0; font: 400 20px/1.2 var(--font-ui); }
.who-head .skills { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--text-muted); }
.who-head .skills b { font: 600 14px/1 var(--font-num); color: var(--bone-50); }
.who-head .back { margin-left: auto; font: 400 14px/1 var(--font-ui); color: var(--text-muted); background: none; border: 0; cursor: pointer; padding: 0; }
.who-head .back:hover { color: var(--bone-50); }

/* Listan */
.list { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.list:empty { display: none; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(220px, 300px); gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }

/* Ikonen med kvalitetsram, som i spelet */
.ico { position: relative; width: 44px; height: 44px; border-radius: 4px; border: 1px solid var(--q, #9d9d9d); background: var(--obsidian-800) center / cover; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), 0 0 12px -4px var(--q, transparent); }
.ico b { position: absolute; right: 2px; bottom: 0; font: 700 12px/1.2 var(--font-num); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000; }
.q0 { --q: #9d9d9d; } .q1 { --q: #ffffff; } .q2 { --q: #1eff00; } .q3 { --q: #0070dd; } .q4 { --q: #a335ee; } .q5 { --q: #ff8000; }
.qt { color: var(--q); }

.what h3 { margin: 0; font: 400 17px/1.25 var(--font-ui); -webkit-text-stroke: .2px currentColor; }
.what .meta { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); }
.what .meta span + span::before { content: " · "; color: var(--stone-400); }
.mats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ash-200); }
.mats li { display: inline-flex; align-items: center; gap: 6px; }
.mats .ico { width: 22px; height: 22px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7); }
.mats .n { font: 600 13px/1 var(--font-num); color: var(--bone-50); }

.crafters { display: grid; align-content: start; gap: 2px; margin: 0; padding: 0; list-style: none; }
.crafters li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 2px 0; }
.crafter { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 15px/1.3 var(--font-ui); text-decoration: none; color: var(--c); cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.crafter:hover { text-decoration: underline; text-underline-offset: 3px; }
.crafters .all { justify-self: start; margin-top: 4px; padding: 0; border: 0; background: none; font: 400 14px/1 var(--font-ui); color: var(--text-muted); cursor: pointer; }
.crafters .all:hover { color: var(--bone-50); }

.empty { padding: 40px 20px; text-align: center; font: 400 17px/1.5 var(--font-ui); color: var(--text-muted); }
.empty a { color: var(--gold-300); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border-radius: 4px; font: 400 15px/1 var(--font-ui); cursor: pointer; }
.btn--ghost { background: rgba(244, 237, 228, .03); border: 1px solid var(--line-strong); color: var(--bone-50); }
.btn--ghost:hover { border-color: rgba(212, 187, 146, .5); }
.btn--act { background: linear-gradient(180deg, var(--act-500), var(--act-600)); border: 1px solid var(--act-rim); color: var(--act-ink); }
.btn--act:hover { filter: brightness(1.12); }
.btn--sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn--xs { height: 24px; padding: 0 8px; font: 600 12px/1 var(--font-body); color: var(--ash-300); }
.btn--xs:hover { color: var(--bone-50); }

/* Lägg i listan */
.add { margin: 12px 0 0; padding: 0; border: 0; background: none; font: 400 14px/1 var(--font-ui); color: var(--ash-300); cursor: pointer; }
.add:hover { color: var(--bone-50); }
.add.is-in { color: #6fc3d9; }
.add.is-in b { font: 600 13px/1 var(--font-num); }

/* Tooltip: som spelets */
.tip { position: fixed; z-index: 60; max-width: 320px; padding: 9px 11px; border: 1px solid rgba(200, 200, 215, .45); border-radius: 5px; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 20, 44, .97), rgba(5, 8, 20, .97)); box-shadow: 0 8px 30px rgba(0, 0, 0, .6); font: 400 13px/1.45 var(--font-body); color: #fff; }
.tip b { display: block; margin-bottom: 2px; font: 400 15px/1.3 var(--font-ui); -webkit-text-stroke: .2px currentColor; }
.tip p { margin: 0; display: flex; justify-content: space-between; gap: 18px; }
.tip .g { color: #1eff00; }   /* spelets egen färg för Equip och Use */
.tip .y { color: #ffd100; }
.tip .mute { color: var(--ash-300); }
[data-tip] { cursor: help; }

/* Knappen till listan */
.list-btn { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: 4px;
  background: linear-gradient(180deg, var(--act-500), var(--act-600)); border: 1px solid var(--act-rim); color: var(--act-ink); font: 400 16px/1 var(--font-ui); cursor: pointer; box-shadow: 0 8px 28px rgba(0, 0, 0, .55); }
.list-btn b { font: 700 14px/1 var(--font-num); }

/* Listan */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100%); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sheet__head h2 { margin: 0; font: 700 20px/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; color: var(--bone-50); }
.sheet__head em, .sub em { font-style: normal; color: var(--gold-300); }
.sheet__close { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 4px; background: none; color: var(--bone-50); font-size: 22px; line-height: 1; cursor: pointer; }
.sheet__body { flex: 1; overflow-y: auto; padding: 8px 20px 24px; }
.sub { margin: 26px 0 10px; font: 600 17px/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; color: var(--bone-50); }
.wants, .whom { margin: 0; padding: 0; list-style: none; }
.wants li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wants .ico { width: 32px; height: 32px; }
.wants .name { font: 400 15px/1.25 var(--font-ui); }
.step { display: inline-flex; align-items: center; gap: 2px; }
.step button { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--obsidian-800); color: var(--bone-50); font: 600 16px/1 var(--font-body); cursor: pointer; }
.step b { min-width: 26px; text-align: center; font: 600 14px/1 var(--font-num); color: var(--bone-50); }
.whom li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.who-row .crafter { cursor: default; font-size: 16px; }
.who-row .crafter:hover { text-decoration: none; }
.whom .for { margin: 4px 0 0; font-size: 13px; color: var(--ash-200); }
.whom .alts { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.whom .alts .crafter { display: inline; font-size: 13px; }
.mats--sheet { display: grid; gap: 6px; margin: 0; }
.sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.linkish { padding: 0; border: 0; background: none; font: 400 14px/1 var(--font-ui); color: var(--text-muted); cursor: pointer; }
.linkish:hover { color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 84px; z-index: 70; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--obsidian-850); color: var(--bone-50); font: 400 14px/1.4 var(--font-body); user-select: all; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.more { display: flex; margin: 18px auto 0; }

.foot { padding: 30px 16px 50px; text-align: center; font-size: 14px; color: var(--text-muted); border-top: 1px solid var(--line); }
.foot p { margin: 6px 0; }
.hint { border-bottom: 1px dotted var(--stone-400); cursor: help; }

@media (max-width: 720px) {
  .list-btn { right: 16px; bottom: 16px; }
  .sheet { top: auto; width: 100%; max-height: 88vh; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 12px 12px 0 0; }
  .topbar nav { gap: 16px; } .topbar .nav-home { margin-right: 16px; } .topbar .nav-home::after { right: -16.5px; }
  .topbar__brand span { display: none; }
  .hero { padding-top: 96px; }
  .hero__lead { font-size: 17px; }
  .search { margin-top: 28px; }
  .profs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .prof { flex: none; }
  .bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .row { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
  .row .ico:not(.mats .ico) { width: 40px; height: 40px; }
  .crafters { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
  }
@media (max-width: 420px) { .topbar__brand { font-size: 0; gap: 0; } }
