/* Einhasad Wiki — provador 3D do catálogo + ficha de status. Usa as cores do tema quando ele define --gold/--ink/--line
 * (template3), senão a paleta própria (fundo quase preto, ouro e creme). */
.ew3d {
  --c3-gold: var(--gold-bright, #efbd4d);
  --c3-gold-2: var(--gold, #d6a85e);
  --c3-gold-soft: var(--line, rgba(232, 180, 69, .18));
  --c3-gold-line: var(--line-strong, rgba(232, 180, 69, .32));
  --c3-text: var(--ink, #fff0d9);
  --c3-muted: var(--ink-dim, #c6a786);
  --c3-dim: var(--ink-faint, #8f7559);
  --c3-card: linear-gradient(155deg, rgba(30, 14, 8, .86), rgba(10, 7, 6, .96));
  --c3-panel: rgba(20, 10, 6, .6);
  --c3-ember: var(--ember-bright, #e07a3f);
  color: var(--c3-text); font-family: 'EB Garamond', Georgia, serif; font-size: 17px; line-height: 1.5; text-align: left;
}
.ew3d *, .ew3d *::before, .ew3d *::after { box-sizing: border-box; }
.ew3d [hidden] { display: none !important; }
.ew3d :focus-visible { outline: 2px solid var(--c3-gold); outline-offset: 2px; }

.ewHead { margin: 0 0 24px; }
.ewEyebrow { font: 600 12px/1.2 'Cinzel', serif; letter-spacing: .22em; color: var(--c3-gold-2); text-transform: uppercase; }
.ewHead h1 { margin: 10px 0 8px; font: 700 clamp(30px, 4.2vw, 46px)/1.05 'Cinzel', serif; color: var(--c3-gold); text-transform: uppercase; letter-spacing: .01em; }
.ewHead p { margin: 0; color: var(--c3-muted); max-width: 72ch; }

/* ---- layout (igual ao catálogo do site) ---- */
.cat3d-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.cat3d-stage { position: sticky; top: 96px; display: grid; gap: 12px; }
.cat3d-view {
  position: relative; height: min(68vh, 620px); min-height: 420px;
  border: 1px solid var(--c3-gold-soft); border-radius: 4px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #2a160b 0%, #120905 55%, #070403 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 220, 160, .03);
}
.cat3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.cat3d-canvas:active { cursor: grabbing; }
.cat3d-hud { position: absolute; inset: 14px 14px auto 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.cat3d-hud > * { pointer-events: auto; }
.cat3d-hud-title { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px; border-radius: 3px; background: rgba(8, 5, 3, .7); border: 1px solid var(--c3-gold-soft); backdrop-filter: blur(6px); }
.cat3d-hud-title img { width: 32px; height: 32px; border-radius: 2px; border: 1px solid var(--c3-gold-line); }
.cat3d-hud-title strong { display: block; font: 700 15px/1.2 'Cinzel', serif; color: var(--c3-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.cat3d-hud-title span { display: block; margin-top: 3px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c3-muted); }
.cat3d-hud-title:has(strong:empty) { display: none; }
.cat3d-modes { display: inline-flex; padding: 3px; border-radius: 3px; background: rgba(8, 5, 3, .75); border: 1px solid var(--c3-gold-soft); }
.cat3d-modes button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 2px; background: transparent; color: var(--c3-muted); font: 600 14px/1 'EB Garamond', serif; cursor: pointer; white-space: nowrap; min-height: 34px; }
.cat3d-modes button svg { width: 15px; height: 15px; }
.cat3d-modes button.is-active { background: linear-gradient(180deg, var(--c3-gold), var(--c3-gold-2)); color: #1a0f05; }
.cat3d-modes button:disabled { opacity: .4; cursor: not-allowed; }
.cat3d-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 99px; background: rgba(8, 5, 3, .6); color: var(--c3-dim); font-size: 13px; white-space: nowrap; pointer-events: none; }
.cat3d-hint-ground { bottom: 42px; color: var(--c3-muted); white-space: normal; text-align: center; max-width: 90%; }
.cat3d-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--c3-muted); font-size: 14px; background: rgba(7, 4, 3, .35); pointer-events: none; }
.cat3d-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(239, 189, 77, .2); border-top-color: var(--c3-gold); animation: ew3d-gira .9s linear infinite; }
@keyframes ew3d-gira { to { transform: rotate(360deg); } }
.cat3d-nowebgl { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; text-align: center; color: var(--c3-muted); }

.cat3d-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cat3d-race { display: inline-flex; align-items: center; gap: 8px; }
.cat3d-race span { font: 600 12px 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: var(--c3-gold-2); }
.cat3d-race select {
  min-height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--c3-gold-line); border-radius: 2px;
  background: #0d0805 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d6a85e' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--c3-text); font: 16px 'EB Garamond', serif; appearance: none; cursor: pointer;
}
.cat3d-race select:disabled { opacity: .45; cursor: not-allowed; }
.cat3d-anims { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; }
.cat3d-anims button { min-height: 36px; padding: 0 13px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(30, 14, 8, .7); color: var(--c3-muted); font: 15px 'EB Garamond', serif; cursor: pointer; transition: border-color .15s, color .15s; }
.cat3d-anims button:hover { border-color: var(--c3-gold-line); color: var(--c3-text); }
.cat3d-anims button.is-active { border-color: var(--c3-gold-2); color: var(--c3-gold); background: rgba(214, 168, 94, .1); }
.ew3dReset { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid var(--c3-gold-line); border-radius: 2px; background: transparent; color: var(--c3-gold); font: 600 13px 'Cinzel', serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.ew3dReset:hover { background: rgba(214, 168, 94, .08); }
.ew3dReset svg { width: 15px; height: 15px; }
.cat3d-equipped { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; }
.cat3d-equipped-label { font: 600 12px 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: var(--c3-dim); }
.cat3d-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat3d-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px 3px 10px; border-radius: 2px; border: 1px solid var(--c3-gold-soft); background: var(--c3-panel); color: var(--c3-text); font-size: 14px; }
.cat3d-chip small { color: var(--c3-dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.cat3d-chip button { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 2px; background: rgba(214, 168, 94, .12); color: var(--c3-gold); cursor: pointer; }
.cat3d-chip button:hover { background: rgba(168, 84, 74, .3); color: #f1c1b8; }
.cat3d-chip button svg { width: 12px; height: 12px; }

/* ---- lista ---- */
.cat3d-browser { display: grid; gap: 14px; min-width: 0; }
.cat3d-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--c3-gold-line) transparent; }
.cat3d-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; min-height: 40px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: var(--c3-panel); color: var(--c3-muted); font: 600 13px 'Cinzel', serif; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
.cat3d-tab em { font: 600 12px 'EB Garamond', serif; font-style: normal; padding: 1px 7px; border-radius: 99px; background: rgba(214, 168, 94, .12); color: var(--c3-gold); }
.cat3d-tab.is-active { border-color: var(--c3-gold-2); color: var(--c3-text); background: linear-gradient(155deg, rgba(60, 28, 10, .9), rgba(20, 10, 6, .95)); }
.cat3d-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--c3-gold-line); border-radius: 2px; background: rgba(8, 5, 3, .85); }
.cat3d-search svg { width: 16px; height: 16px; color: var(--c3-dim); flex: 0 0 auto; }
.cat3d-search input { flex: 1; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--c3-text); font: 16px 'EB Garamond', serif; }
.cat3d-search:focus-within { border-color: var(--c3-gold-2); }
.cat3d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 0; padding: 2px 4px 2px 0; list-style: none; max-height: 430px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--c3-gold-line) transparent; }
.cat3d-grid li { margin: 0; }
.cat3d-card { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 10px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: var(--c3-card); color: var(--c3-text); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.cat3d-card:hover { border-color: var(--c3-gold-line); transform: translateY(-1px); }
.cat3d-card.is-active { border-color: var(--c3-gold-2); box-shadow: 0 0 0 1px rgba(214, 168, 94, .35), 0 10px 26px rgba(214, 160, 40, .12); }
.cat3d-card.is-equipped:not(.is-active) { border-color: rgba(156, 175, 110, .55); }
.cat3d-card-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 2px; border: 1px solid var(--c3-gold-line); background: linear-gradient(160deg, #2b1a0d, #0c0705); overflow: hidden; }
.cat3d-card-icon img { width: 32px; height: 32px; }
.cat3d-card-text { display: grid; gap: 3px; min-width: 0; }
.cat3d-card-text strong { font-size: 15px; line-height: 1.2; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat3d-card-text > span { display: flex; align-items: center; gap: 6px; min-height: 16px; }
.cat3d-grade { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 2px; color: #1a0f05; background: linear-gradient(180deg, var(--c3-gold), var(--c3-gold-2)); }
.cat3d-card-text small { font-size: 13px; color: var(--c3-dim); }
.cat3d-empty { margin: 0; padding: 18px; text-align: center; color: var(--c3-muted); border: 1px dashed var(--c3-gold-soft); }

/* ---- ficha de status ---- */
.cat3d-detail { padding: 16px 18px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: var(--c3-card); display: grid; gap: 12px; }
.ewTop { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ewIcon { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--c3-gold-line); border-radius: 2px; background: #000; }
.ewTop h3 { margin: 0; font: 700 18px/1.2 'Cinzel', serif; color: var(--c3-gold); text-transform: none; letter-spacing: .01em; overflow-wrap: anywhere; }
.ewMeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.ewTag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c3-muted); border: 1px solid var(--c3-gold-soft); padding: 3px 7px; border-radius: 2px; white-space: nowrap; }
.ewTag.ewGrade { color: #1a0f05; background: var(--c3-gold-2); border-color: var(--c3-gold-2); font-weight: 700; }
.ewTag.ewPvp { color: var(--c3-ember); border-color: rgba(224, 122, 63, .45); }
.ewStats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.ewStats div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--c3-gold-soft); padding: 4px 0; min-width: 0; }
.ewStats dt { color: var(--c3-muted); font-size: 15px; }
.ewStats dd { margin: 0; color: var(--c3-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ewNote { color: var(--c3-dim); font-style: italic; font-size: 15px; margin: 0; }
.ewSet { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--c3-gold-soft); }
.ewSet > h4, .ewSub { margin: 0; font: 600 13px/1.2 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: var(--c3-gold-2); }
.ewPieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ewPiece { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(0, 0, 0, .2); min-width: 0; }
.ewPiece .ewIcon { width: 32px; height: 32px; flex-basis: 32px; }
.ewPiece b { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--c3-text); overflow-wrap: anywhere; }
.ewPiece small { display: block; color: var(--c3-dim); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.ewPiece .ewStats { grid-template-columns: 1fr; margin-top: 3px; }
.ewBonus { display: grid; gap: 10px; }
.ewBonus h5 { margin: 0 0 3px; font: 600 12px 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: var(--c3-muted); }
.ewChips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ewChips span { border: 1px solid var(--c3-gold-line); color: var(--c3-text); font-size: 14px; padding: 2px 9px; border-radius: 2px; }

@media (max-width: 1080px) {
  .cat3d-layout { grid-template-columns: 1fr; }
  .cat3d-stage { position: static; }
  .cat3d-view { height: 62vh; min-height: 360px; }
  .cat3d-grid { max-height: 420px; }
}
@media (max-width: 640px) {
  .cat3d-view { height: 58vh; min-height: 330px; }
  .cat3d-hud { inset: 8px 8px auto 8px; gap: 6px; }
  .cat3d-hud-title { padding: 5px 8px; gap: 7px; }
  .cat3d-hud-title img { width: 24px; height: 24px; }
  .cat3d-hud-title strong { font-size: 13px; max-width: 16ch; }
  .cat3d-hud-title span { font-size: 11px; }
  .cat3d-modes button { padding: 6px 8px; font-size: 13px; }
  .cat3d-modes button svg { display: none; }
  .cat3d-grid { grid-template-columns: 1fr; }
  .ewStats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .cat3d-spinner { animation-duration: 3s; } .cat3d-card { transition: none; } }

/* ---- receitas, estagios Dynasty ate o PvP e Attribute Alchemy (fichas) ---- */
.ewRec, .ewStages, .ewAlq { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--c3-gold-soft); }
.ewRec > h4, .ewStages > h4, .ewAlq > h4 { margin: 0; font: 600 13px/1.2 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: var(--c3-gold-2); }
.ewRecItem { border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(0, 0, 0, .2); }
.ewRecItem > summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; color: var(--c3-text); }
.ewRecItem > summary::-webkit-details-marker { display: none; }
.ewRecItem > summary::after { content: '+'; margin-left: auto; color: var(--c3-gold-2); font: 600 18px/1 'Cinzel', serif; }
.ewRecItem[open] > summary::after { content: '−'; }
.ewRecItem > summary .ewIcon { width: 32px; height: 32px; flex-basis: 32px; }
.ewRecItem > summary b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.ewRecItem > :not(summary) { margin: 0 10px 10px; }
.ewRecipe { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(0, 0, 0, .25); }
.ewRecHead { display: flex; gap: 10px; align-items: center; }
.ewRecHead .ewIcon { width: 32px; height: 32px; flex-basis: 32px; }
.ewRecHead b { display: block; color: var(--c3-gold); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.ewRecHead small { display: block; color: var(--c3-muted); font-size: 13.5px; }
.ewMats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; }
.ewMats li { display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 14.5px; color: var(--c3-text); }
.ewMats li .ewIcon { width: 24px; height: 24px; flex-basis: 24px; }
.ewMats li span { min-width: 0; overflow-wrap: anywhere; }
.ewMats li b { color: var(--c3-gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.ewMats li.ewFalta span { color: var(--c3-dim); }
.ewMats li.ewFalta em { display: block; font-size: 12px; color: var(--c3-ember); font-style: normal; letter-spacing: .02em; }
.ewIconVazio { display: inline-block; }
.ewStages ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: none; }
.ewStage { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--c3-gold-soft); border-left: 3px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(0, 0, 0, .18); }
.ewStage.ewAgora { border-color: var(--c3-gold-line); border-left-color: var(--c3-gold); background: rgba(214, 168, 94, .07); }
.ewStageHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ewStageHead b { font: 600 15px/1.2 'Cinzel', serif; color: var(--c3-text); }
.ewStageN { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--c3-gold-line); color: var(--c3-gold); font: 700 13px/1 'Cinzel', serif; }
.ewTag.ewHere { color: #1a0f05; background: var(--c3-gold); border-color: var(--c3-gold); }
.ewStageCols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.ewStageCol { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ewStageCol > small { color: var(--c3-dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.ewPvpCol > small { color: var(--c3-ember); }
.ewAlqItem { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; background: rgba(0, 0, 0, .2); }
.ewAlqTop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ewAlqTop .ewIcon { width: 32px; height: 32px; flex-basis: 32px; }
.ewAlqTop b { color: var(--c3-gold); font-weight: 600; font-size: 15px; }
.ewAlqCustos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; }
.ewAlqCustos small, .ewBands > small { display: block; margin-bottom: 4px; color: var(--c3-dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.ewBands { display: grid; gap: 4px; }
.ewBand { position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 5px 8px; border: 1px solid var(--c3-gold-soft); border-radius: 2px; overflow: hidden; font-size: 14.5px; }
.ewBand > * { position: relative; }
.ewBandBar { position: absolute !important; left: 0; top: 0; bottom: 0; opacity: .22; }
.ewBand b { font-weight: 600; }
.ewBand em { font-style: normal; color: var(--c3-text); font-variant-numeric: tabular-nums; }
.ewBand span:last-child { color: var(--c3-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ewBand-green b { color: #7ee05a; } .ewBand-green .ewBandBar { background: #4caf32; }
.ewBand-blue b { color: #6cb6ff; } .ewBand-blue .ewBandBar { background: #2f7fd6; }
.ewBand-purple b { color: #c08cff; } .ewBand-purple .ewBandBar { background: #8a4fd6; }
.ewBand-red b { color: #ff7a6b; } .ewBand-red .ewBandBar { background: #d6453a; }
.ewStageCol .ewStats, .ewStageCol .ewBonus .ewStats { grid-template-columns: 1fr; }
