/* Recommended Stats guide page (/recommended-stats-guide): the data explorer that used to live
   on GitHub Pages, in the site's colours. Loaded by that page only. .rsg-card and .rsg-pill are
   renamed from the old page's .card and .pill, which the site already uses for something else. */
.rsg {
  --haste: #f2c14e;
  --crit: #ff6f6f;
  --mastery: #a77bff;
  --versatility: #3fd0ae;
  --violet-2: #c4b5fd;
  --radius-sm: 10px;
}
/* The old page set these globally; the site doesn't. */
:where(.rsg button, .rsg select) { font: inherit; color: inherit; }
.talents-card select option { background: var(--panel); color: var(--text); }
.rsg-section { padding: clamp(28px, 5vw, 48px) 0 clamp(72px, 10vw, 110px); }
.rsg-head { text-align: center; max-width: 720px; margin: 0 auto 32px; display: grid; gap: 12px; justify-items: center; }
.rsg-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.rsg-head p { color: var(--dim); margin: 0; }
.rsg-head .fine { margin: 0; }
.rsg-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.explorer { padding-top: 40px !important; padding-bottom: 96px !important; }
.class-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px;
  max-width: 1180px; margin: 0 auto;
}
@media (min-width: 1100px) { .class-grid { grid-template-columns: repeat(13, minmax(0, 1fr)); } }
.class-btn {
  --c: var(--y);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 6px 10px; border-radius: 14px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--dim); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.2;
  transition: transform .15s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.class-btn img { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .6); filter: saturate(.7) brightness(.85); transition: filter .2s ease; }
.class-btn:hover { transform: translateY(-2px); color: var(--text); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.class-btn:hover img { filter: none; }
.class-btn[aria-selected="true"] {
  color: var(--c); border-color: var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel));
  box-shadow: 0 10px 30px -14px var(--c);
}
.class-btn[aria-selected="true"] img { filter: none; box-shadow: 0 0 0 2px var(--c); }

.spec-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 22px 0 30px; min-height: 42px; }
.spec-btn {
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--dim); font-weight: 600; font-size: 14px;
  transition: all .15s ease;
}
.spec-btn:hover { color: var(--text); border-color: var(--class, var(--y)); }
.spec-btn[aria-selected="true"] { background: var(--class, var(--y)); border-color: var(--class, var(--y)); color: #121214; }

.spec-panel { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.spec-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 18px; border-radius: var(--radius);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--class, var(--y)) 22%, transparent), transparent 55%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--class, var(--y)) 40%, var(--line));
}
.spec-banner-icon { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--class, var(--y)); box-shadow: 0 0 24px -4px var(--class, var(--y)); }
.spec-banner-text { flex: 1; min-width: 200px; }
.spec-banner h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--class, var(--y)); }
.spec-banner p { margin: 4px 0 0; color: var(--dim); font-size: 14px; }

.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.segmented button {
  border: 0; background: transparent; cursor: pointer; padding: 9px 20px; border-radius: 9px;
  color: var(--dim); font-weight: 600; font-size: 14px; transition: all .15s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--panel-2); color: var(--y-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.rsg-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.rsg-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--dim); background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.rsg-pill.warn { color: #fbbf24; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); }
.fine { color: var(--faint); font-size: 12.5px; margin: 14px 0 0; }

/* Stat bars */
.stat-bars { display: grid; gap: 18px; }
.stat-row { --sc: var(--y); }
.stat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stat-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-name::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sc); box-shadow: 0 0 10px var(--sc); }
.stat-val { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--sc); font-variant-numeric: tabular-nums; }
.stat-val small { font-family: var(--font-body); font-size: 12px; color: var(--faint); font-weight: 500; margin-left: 6px; }
.track { position: relative; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.track .fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sc) 45%, transparent), var(--sc));
  width: 0; transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.track .band {
  position: absolute; top: 0; bottom: 0; border-radius: 999px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sc) 35%, transparent) 0 4px, color-mix(in srgb, var(--sc) 18%, transparent) 4px 8px);
  transition: left .7s ease, width .7s ease;
}
.track .tick { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px var(--sc); transition: left .7s cubic-bezier(.2, .8, .2, 1); }

.priority { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.priority-label { color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.prio { padding: 5px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent); }
.prio-sep { color: var(--faint); font-weight: 700; }

/* Talents */
.talents-card select {
  font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 8px 34px 8px 12px; font-size: 14px; max-width: 100%; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23ffd21f' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.scope-note { color: var(--dim); font-size: 13.5px; margin: -6px 0 16px; min-height: 1.2em; }
.builds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.build {
  position: relative; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
}
.build:first-child { border-color: rgba(255, 210, 31, .55); background: linear-gradient(180deg, rgba(255, 210, 31, .08), rgba(255, 210, 31, .02)); }
.build-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.build-rank { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-strong); font-weight: 700; font-size: 13px; color: var(--dim); }
.build:first-child .build-rank { background: var(--y); color: #121214; border-color: var(--y); }
.build-share { flex: 1; font-size: 13.5px; color: var(--dim); }
.build-share strong { color: var(--text); }
.build-meter { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin-bottom: 10px; overflow: hidden; }
.build-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--y)); border-radius: 4px; }
.build-code {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px;
}
.build-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong);
  transition: all .15s ease;
}
.mini-btn:hover { border-color: var(--y); color: var(--y-2); text-decoration: none; }
.mini-btn.primary { background: var(--y); border-color: var(--y); color: #121214; }
.mini-btn.primary:hover { filter: brightness(1.08); color: #121214; }
.mini-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* BiS */
.legend { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; }
.ring-mini { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--y) 0 70%, rgba(255, 255, 255, .1) 0); }
.bis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.slot {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
  transition: border-color .2s ease, background .2s ease;
}
.slot:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .04); }
.slot-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.new-tag { padding: 1px 7px; border-radius: 6px; font-size: 10.5px; letter-spacing: .06em; color: #121214; background: #4ade80; }
.slot-item { min-width: 0; font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.slot-item a { color: var(--text); }
.slot-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--dim); font-size: 12.5px; }
.slot-meta .chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: rgba(155, 92, 255, .1); border: 1px solid rgba(155, 92, 255, .25); color: var(--violet-2); }
.slot-meta .chip a { color: var(--violet-2); }
.slot-alt { grid-column: 1 / -1; color: var(--faint); font-size: 12.5px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.slot-alt a { color: var(--dim); }
.ring {
  grid-row: 2 / span 2; grid-column: 2;
  --p: 0; width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(var(--y) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel); }
.ring span { position: relative; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-empty { color: var(--faint); font-style: italic; }

/* Wowhead iconized links */
.slot-item a[data-wh-icon-added] { display: inline; }
.slot-item .iconmedium { vertical-align: middle; margin-right: 6px; }

.loading { text-align: center; color: var(--faint); }
.error { text-align: center; color: #fca5a5; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 12px; background: var(--y); color: #121214; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s ease; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .bis-grid { grid-template-columns: minmax(0, 1fr); }
  .class-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .card-head select { width: 100%; }
  .rsg-card { padding: 18px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
}
