/* =====================================================================
   /classes: class rework browser. Accent colour per class comes from --cc.
   ===================================================================== */
.cr-top { padding: 44px 0 0; }
.cr-title { max-width: 720px; }
.cr-title h1 { margin-bottom: .2em; }
.cr-title p { color: var(--text-2); }

/* Class and spec icons are square with a bevelled frame baked in: crop inside the frame for round badges. */
.cr-crest { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; line-height: 0; }
.cr-crest img { display: block; transform: scale(1.18); border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }

/* ---- class bar */
.cr-classbar { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin: 26px 0 0; }
.cr-classbtn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: .72rem; font-weight: 700;
  text-align: center; line-height: 1.2; transition: transform .2s, border-color .2s, background .2s, color .2s;
}
.cr-classbtn .cr-crest { width: 44px; height: 44px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc) 55%, #000); transition: box-shadow .25s, transform .25s; }
.cr-classbtn .cr-crest img { width: 44px; height: 44px; }
.cr-classbtn:hover { transform: translateY(-3px); color: #fff; border-color: color-mix(in srgb, var(--cc) 50%, var(--line)); }
.cr-classbtn:hover .cr-crest { box-shadow: 0 0 0 2px var(--cc); }
.cr-classbtn.is-active { color: var(--cc); border-color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, var(--panel)); }
.cr-classbtn.is-active .cr-crest { box-shadow: 0 0 0 2px var(--cc); }
@media (max-width: 960px) { .cr-classbar { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cr-classbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cr-classbtn span { font-size: .66rem; } }

/* ---- stage swap (class change) */
.cr-stage { overflow-x: clip; padding-top: 28px; transition: opacity .22s ease, transform .22s ease; }
.cr-stage.is-leaving { opacity: 0; transform: translateY(10px); }
.cr-stage.is-entering { animation: cr-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cr-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- class chooser (no class picked) */
.cr-choose { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .cr-choose { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cr-choose { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.cr-card {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel);
  animation: cr-rise .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.cr-card .fig { position: absolute; left: 50%; bottom: 44px; height: 78%; width: auto; max-width: 115%; object-fit: contain; transform: translateX(-50%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); }
.cr-card .cr-lbl { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: rgba(0, 0, 0, .7); }
.cr-card .cr-lbl .cr-crest { box-shadow: 0 0 0 1px var(--cc); }
.cr-card .cr-lbl b { color: var(--cc); font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.cr-card:hover { border-color: color-mix(in srgb, var(--cc) 60%, var(--line)); }
.cr-card:hover .fig { transform: translateX(-50%) scale(1.06); }
@keyframes cr-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- showcase: info + posed character */
.cr-show { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; min-height: 520px; }
@media (max-width: 860px) { .cr-show { grid-template-columns: 1fr; min-height: 0; } .cr-stagefig { order: -1; height: 380px !important; } }
.cr-kicker { display: flex; align-items: center; gap: 8px; color: var(--cc); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }
.cr-kicker .cr-crest { box-shadow: 0 0 0 1px var(--cc); }
.cr-specinfo h2 { font-size: clamp(2.6rem, 5.5vw, 4.2rem); margin: .1em 0 .15em; color: #fff; }
.cr-specinfo.is-active h2 { animation: cr-name .6s cubic-bezier(.2, .8, .2, 1) both; }
.cr-specinfo.is-active .cr-desc, .cr-specinfo.is-active .cr-stats { animation: cr-in .6s .08s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cr-name { from { opacity: 0; transform: translateX(-18px); letter-spacing: .06em; } to { opacity: 1; transform: none; } }
.cr-role .role { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text-2); }
.cr-role .r-tank { color: #7fb2ff; border-color: rgba(127, 178, 255, .4); }
.cr-role .r-healer { color: #86e34f; border-color: rgba(134, 227, 79, .4); }
.cr-role .r-dps { color: #ff8a73; border-color: rgba(255, 138, 115, .4); }
.cr-desc { color: var(--text-2); margin: 14px 0 0; max-width: 520px; }
.cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; max-width: 520px; }
.cr-stats .st { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.cr-stats b { display: block; font: 800 1.6rem/1.1 var(--body); font-variant-numeric: lining-nums tabular-nums; color: #fff; }
.cr-stats span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.cr-stats .new b { color: #6be86b; }
.cr-stats .changed b { color: var(--gold); }
.cr-stats .removed b { color: var(--danger); }
.cr-stats .talents b { color: var(--cc); }

.cr-specs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.cr-specbtn {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); font-weight: 700; font-size: .9rem; transition: all .2s;
}
.cr-specbtn .cr-crest { width: 40px; height: 40px; box-shadow: 0 0 0 2px var(--line-2); transition: box-shadow .2s, filter .2s; filter: saturate(.6); }
.cr-specbtn:hover { color: #fff; border-color: var(--line-2); }
.cr-specbtn:hover .cr-crest { filter: none; }
.cr-specbtn.is-active { color: #fff; border-color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, var(--panel)); }
.cr-specbtn.is-active .cr-crest { filter: none; box-shadow: 0 0 0 2px var(--cc); }

.cr-stagefig { position: relative; height: 560px; perspective: 1000px; }
.cr-fig { position: absolute; inset: 0 0 7% 0; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none;
  transform: translateX(40px) scale(.96); transition: opacity .45s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.cr-fig.is-active { opacity: 1; transform: none; }
/* Portrait + weapon layer: both images share one box and object-fit, so the weapon layer sits exactly on the portrait. */
.cr-figwrap { position: relative; width: 100%; height: 100%; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); transition: transform .25s ease-out;
  animation: cr-float 6s ease-in-out infinite; }
.cr-figwrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.cr-figwrap .base { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .65)); }
.cr-fig img.noart { position: static; width: 160px; height: auto; border-radius: 50%; align-self: center; }
@keyframes cr-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }

/* ---- per-spec sections */
.cr-spec.is-active { animation: cr-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.cr-section { margin-top: 44px; }
.cr-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.cr-head h3 { margin: 0; font-size: 1.7rem; }
.cr-hint { color: var(--muted); font-size: .85rem; margin: 10px 0 16px; }
.cr-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.cr-filters button { font: 700 .78rem var(--body); color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; transition: all .2s; }
.cr-filters button i { font-style: normal; color: var(--muted); margin-left: 3px; }
.cr-filters button:hover { color: #fff; }
.cr-filters button.is-active { color: #fff; border-color: var(--cc); background: color-mix(in srgb, var(--cc) 16%, var(--panel)); }

.cr-changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 800px) { .cr-changes { grid-template-columns: 1fr; } }
.cr-change {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel); overflow: hidden;
  animation: cr-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: min(calc(var(--i) * 30ms), 600ms);
  transition: border-color .2s, transform .2s;
}
.cr-change:hover { border-color: color-mix(in srgb, var(--k) 45%, var(--line)); transform: translateY(-2px); }
.cr-change.k-new { --k: #6be86b; }
.cr-change.k-changed { --k: var(--gold); }
.cr-change.k-removed { --k: var(--danger); }
.cr-change.is-hidden { display: none; }
.cr-ico { position: relative; flex: none; cursor: help; }
.cr-ico img { display: block; width: 44px; height: 44px; border-radius: 6px; border: 1px solid #000; box-shadow: 0 0 0 1px color-mix(in srgb, var(--k) 55%, transparent); }
.k-removed .cr-ico img { filter: grayscale(1) brightness(.7); }
.k-removed .cr-ico::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--danger); transform: rotate(-40deg); border-radius: 2px; }
.cr-change .body { min-width: 0; }
.cr-change h4 { margin: 0; font-family: var(--body); font-size: .98rem; font-weight: 800; color: #fff; }
.cr-change h4 span { cursor: help; }
.k-removed h4 span { text-decoration: line-through; text-decoration-color: rgba(255, 107, 94, .7); color: var(--text-2); }
.cr-change p { margin: 6px 0 0; color: var(--text-2); font-size: .88rem; line-height: 1.55; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tag { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; border: 1px solid; }
.tag.new { color: #6be86b; border-color: rgba(107, 232, 107, .35); background: rgba(107, 232, 107, .08); }
.tag.changed { color: var(--gold); border-color: rgba(214, 178, 106, .35); background: rgba(214, 178, 106, .08); }
.tag.removed { color: var(--danger); border-color: rgba(255, 107, 94, .35); background: rgba(255, 107, 94, .08); }
.tag.haste { color: #7fd6ff; border-color: rgba(127, 214, 255, .35); background: rgba(127, 214, 255, .08); cursor: help; }
.tag.before { color: var(--text-2); border-color: var(--line-2); cursor: help; }
.tag.before:hover { color: #fff; border-color: var(--text-2); }

.cr-traits { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.cr-traits h4 { margin: 0 0 10px; font: 800 .82rem var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.cr-traits h4 i { font-style: normal; color: var(--cc); margin-left: 4px; }
.cr-traits .row { gap: 6px; }
.cr-trait { cursor: help; line-height: 0; }
.cr-trait img { width: 36px; height: 36px; border-radius: 5px; border: 1px solid #000; box-shadow: 0 0 0 1px rgba(214, 178, 106, .35); transition: transform .15s, box-shadow .15s; }
.cr-trait:hover img { box-shadow: 0 0 0 1px var(--gold); }

/* ---- talent builder */
.cr-tools { display: flex; align-items: center; gap: 8px; }
.cr-count { color: var(--muted); font-weight: 700; margin-right: 6px; }
.cr-count b { color: var(--cc); font-size: 1.1rem; }
.cr-loadout { display: flex; gap: 8px; margin: 18px 0 8px; flex-wrap: wrap; }
.cr-loadout .slot { position: relative; width: 50px; height: 50px; border-radius: 7px; border: 1px dashed var(--line-2); background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.cr-loadout .slot em { font-style: normal; font-size: .72rem; color: var(--muted); font-weight: 700; }
.cr-loadout .slot img { position: absolute; inset: 0; width: 100%; height: 100%; animation: cr-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.cr-loadout .slot.filled { border: 1px solid var(--cc); }
@keyframes cr-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.cr-legend { display: flex; gap: 16px; font-size: .78rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.cr-legend .lg::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cr-legend .new::before { background: #6be86b; }
.cr-legend .changed::before { background: var(--gold); }
.cr-legend .same::before { background: var(--line-2); }
.cr-grid { display: grid; gap: 8px; }
.cr-tier { display: grid; grid-template-columns: 52px repeat(3, minmax(0, 1fr)); gap: 8px; }
.cr-tier .lvl { display: grid; place-items: center; border-radius: 7px; background: var(--panel-2); color: var(--muted); font-weight: 800; font-size: .85rem; }
.cr-tier.has-pick .lvl { color: var(--cc); }
.cr-tal {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; text-align: left; cursor: pointer;
  border-radius: 7px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: 700 .86rem/1.25 var(--body);
  transition: border-color .2s, background .2s, opacity .25s, filter .25s, transform .15s;
}
.cr-tal img { width: 36px; height: 36px; border-radius: 5px; flex: none; border: 1px solid #000; }
.cr-tal .nm { min-width: 0; overflow: hidden; }
.cr-tal .rep { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-tal .rep:hover { color: var(--text-2); }
.cr-tal .pip { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; }
.cr-tal.s-new .pip { background: #6be86b; }
.cr-tal.s-changed .pip { background: var(--gold); }
.cr-tal:hover { border-color: var(--line-2); background: var(--panel); }
.cr-tal:active { transform: scale(.98); }
.cr-tier.has-pick .cr-tal:not(.is-picked) { opacity: .42; filter: grayscale(.8); }
.cr-tier.has-pick .cr-tal:not(.is-picked):hover { opacity: .8; filter: none; }
.cr-tal.is-picked { border-color: var(--cc); color: #fff; background: color-mix(in srgb, var(--cc) 14%, var(--bg-2)); }
.cr-tal.is-picked img { box-shadow: 0 0 0 1px var(--cc); }
.cr-tal.flash { animation: cr-flash .5s ease-out; }
@keyframes cr-flash { from { border-color: #fff; } }
@media (max-width: 640px) {
  .cr-tier { grid-template-columns: 38px repeat(3, minmax(0, 1fr)); gap: 5px; }
  .cr-tal { flex-direction: column; text-align: center; padding: 8px 4px; font-size: .72rem; }
  .cr-tal .rep { white-space: normal; }
}
.cr-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; background: var(--panel-3); border: 1px solid var(--line-2); color: #fff;
  padding: 10px 18px; border-radius: 6px; font-weight: 700; font-size: .88rem; transition: all .3s; pointer-events: none; z-index: 60; }
.cr-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .cr-stage *, .cr-stage *::before, .cr-stage *::after, .cr-card { animation: none !important; transition: none !important; }
}
