/* GAME-DATA COMPONENTS (owner: wiki UX) — lib/cards.mjs: medallions, the
   augment mini card + grid, set card, boss card, the wiki tiles. Loaded by
   every page that shows them (wiki, homepage), after base.css. */

/* ---- medallions ------------------------------------------------------ */
.medal { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, .95) 11%, transparent 12%),
    radial-gradient(circle, var(--paper) 0, var(--paper) 60%, var(--rc) 60%, var(--rc) 74%, color-mix(in srgb, var(--rc) 70%, #000) 74%);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.medal img { width: 56%; height: 56%; }
.medal.big { width: 136px; height: 136px; border-width: 4px; box-shadow: 4px 4px 0 var(--ink); }
.smedal { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; border-radius: 50%; border: 2px solid var(--ink); color: var(--ink); }

/* ---- augment mini card (grids) --------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 14px; }
.grid.plain { list-style: none; padding: 0; margin: 0; }
.grid.plain li, .chain li { position: relative; }
.ac { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink) !important;
  background: linear-gradient(180deg, #fff 0, #fff 2px, var(--paper) 2px); border: 3px solid var(--ink); box-shadow: 4px 4px 0 #000;
  padding: 9px 12px 9px 10px; min-height: 76px; border-inline-start: 7px solid var(--rc); transition: transform .08s, box-shadow .08s; }
.ac:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.ac.fruit { box-shadow: 4px 4px 0 #000, inset 0 0 0 2px #dc2626; }
.ac-t { display: flex; flex-direction: column; min-width: 0; }
.ac-n { font: 900 .95rem/1.12 var(--heavy); text-transform: uppercase; letter-spacing: .01em; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.ac-m { font: 600 .72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #57534a; margin-top: 4px; }
.ac-m b { color: color-mix(in srgb, var(--rc) 75%, #000); }
.ac-set { position: absolute; inset-inline-end: -9px; top: -9px; font-size: 12px; z-index: 2; }
.ac-set .smedal { box-shadow: 1px 1px 0 var(--ink); }
.num { position: absolute; z-index: 2; inset-inline-start: -8px; top: -10px; font: 900 .75rem/1 var(--heavy); background: var(--accent); color: var(--ink); border: 2px solid var(--ink); padding: 3px 6px; }

/* ---- sets ------------------------------------------------------------ */
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.setcard { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sc) 22%, var(--paper)) 0, var(--paper) 46%); border: 3px solid var(--ink); box-shadow: var(--sh); padding: 14px 16px; border-inline-start: 8px solid var(--sc); }
.setcard:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #000; }
.sc-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-n { font: 400 1.6rem/1 var(--display); letter-spacing: .03em; }
.sc-p { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-p img { width: 26px; height: 26px; padding: 3px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rc); }
.sc-r { font: 600 .82rem/1.25 var(--ui); color: #4b463b; }

/* ---- bosses ---------------------------------------------------------- */
.bossgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.bosscard { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--paper); min-height: 150px; padding: 12px 16px;
  background: radial-gradient(circle at 22% 50%, color-mix(in srgb, var(--ac) 38%, transparent) 0, transparent 60%), #10131f;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 #000, inset 0 0 0 2px color-mix(in srgb, var(--ac) 45%, transparent); }
.bosscard:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #000, inset 0 0 0 2px var(--ac); }
.bosscard img { height: 128px; width: auto; filter: drop-shadow(3px 3px 0 #000); }
.bc-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bc-n { font: 400 1.7rem/1 var(--display); letter-spacing: .03em; color: var(--paper); -webkit-text-stroke: 1px var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.bc-q { font: 700 .82rem/1.25 var(--mono); color: var(--ac); text-transform: uppercase; }
.lvl { display: inline-block; width: max-content; font: 900 .68rem/1 var(--heavy); letter-spacing: .12em; text-transform: uppercase; background: var(--ac, var(--accent)); color: var(--ink); border: 2px solid var(--ink); padding: 4px 7px; }
.lvl.fin { background: var(--danger); color: #fff; margin-inline-start: 6px; }

/* ---- wiki tiles ------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 26px 0; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; min-height: 150px; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 7px 7px 0 #000; overflow: hidden; }
.tile:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 #000; }
.tile-n { font: 400 3.6rem/.9 var(--display); color: var(--accent); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.tile-l { font: 900 1.05rem/1.1 var(--heavy); text-transform: uppercase; letter-spacing: .06em; }
.tile-i { display: flex; gap: 6px; margin-top: auto; align-items: center; }
.tile-i .medal { width: 40px; height: 40px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
.tile-i img[height="48"] { height: 48px; width: auto; }
.t-aug { border-top: 10px solid #facc15; }
.t-set { border-top: 10px solid #a78bfa; }
.t-boss { border-top: 10px solid #ef4444; }

/* Arabic / Thai: no monospace (see base.css) */
:lang(ar) .ac-m, :lang(ar) .bc-q, :lang(th) .ac-m, :lang(th) .bc-q { font-family: var(--ui); }

/* ---- motion: rarity glow on hover / focus, filter pop (wiki.js) -------- */
/* --ease-pop / --dur-fast: design tokens if base.css defines them, local fallbacks otherwise */
.ac, .setcard, .bosscard, .tile, .bchip, .af { transition: transform var(--dur-fast, .14s) var(--ease-pop, cubic-bezier(.2, .9, .3, 1.25)), box-shadow var(--dur-fast, .14s) ease-out; }
.ac:hover, .ac:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000, 0 0 0 2px var(--rc), 0 0 22px 2px var(--mk); }
.ac:focus-visible, .bchip:focus-visible, .setcard:focus-visible, .bosscard:focus-visible, .tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ac.r4::after { content: ""; position: absolute; inset: -3px; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 246, 201, .55) 46%, transparent 60%) -120% 0 / 250% 100% no-repeat; }
.ac.r4:hover::after { opacity: 1; animation: shine .9s ease-out; }
@keyframes shine { to { background-position: 160% 0; } }
.ac.pop { animation: pop .26s var(--ease-pop, cubic-bezier(.2, .9, .3, 1.25)); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.ac.self { box-shadow: 4px 4px 0 #000, 0 0 0 3px var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .ac, .setcard, .bosscard, .tile, .bchip, .af { transition: none; }
  .ac:hover, .setcard:hover, .bosscard:hover, .tile:hover, .bchip:hover { transform: none; }
  .ac.r4:hover::after, .ac.pop { animation: none; }
}

/* ---- boss chip (augment pages, boss pages) ----------------------------- */
.bchips { display: flex; flex-wrap: wrap; gap: 10px; }
.bchip { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 6px 14px 6px 8px; text-decoration: none; color: var(--paper);
  background: radial-gradient(circle at 20% 50%, color-mix(in srgb, var(--ac) 34%, transparent) 0, transparent 70%), #10131f;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 #000, inset 0 0 0 2px color-mix(in srgb, var(--ac) 40%, transparent); }
.bchip:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000, inset 0 0 0 2px var(--ac), 0 0 18px color-mix(in srgb, var(--ac) 45%, transparent); }
.bchip img { height: 52px; width: auto; filter: drop-shadow(2px 2px 0 #000); }
.bchip > span { display: flex; flex-direction: column; gap: 4px; }
.bchip b { font: 400 1.25rem/1 var(--display); letter-spacing: .03em; }
.bchip .lvl { font-size: .6rem; }
.bchip.cur { box-shadow: 4px 4px 0 #000, 0 0 0 3px var(--accent); }

/* ---- augment with its full card text (boss "always brings", set reward) */
.afgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.af { position: relative; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-top: 7px solid var(--rc); box-shadow: 5px 5px 0 #000; }
.af:hover { box-shadow: 5px 5px 0 #000, 0 0 0 2px var(--rc), 0 0 24px 2px var(--mk); }
.af.fruit { box-shadow: 5px 5px 0 #000, inset 0 0 0 2px #dc2626; }
.af-h { display: flex; align-items: center; gap: 12px; padding: 10px 12px 8px; text-decoration: none; color: var(--ink) !important; position: relative; }
.af-h .medal { width: 50px; height: 50px; }
.af-t { display: flex; flex-direction: column; min-width: 0; }
.af-n { font: 900 1.02rem/1.12 var(--heavy); text-transform: uppercase; overflow-wrap: anywhere; }
.af-h:hover .af-n { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--rc); }
.af-d { padding: 4px 14px 12px; font: 400 .92rem/1.48 var(--mono); color: #2b2b2b; flex: 1; }
.af-d b { color: var(--ink); font-weight: 900; }
.af-d b.hl { background: linear-gradient(180deg, transparent 58%, var(--mk) 58%, var(--mk) 92%, transparent 92%); }
.af-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 7px 12px; border-top: 2px dashed rgba(13, 13, 13, .25); background: var(--paper2); }
.af .ac-set { inset-inline-end: 8px; top: 8px; }
.also { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 700 .74rem/1 var(--ui); color: #4b463b; }
.also a { font: 900 .66rem/1 var(--heavy); text-decoration: none; color: var(--ink); background: var(--ac); border: 2px solid var(--ink); padding: 3px 5px; }
.also a:hover { background: var(--ink); color: var(--ac); }

/* ---- rarity spread bar ------------------------------------------------- */
.rbar { display: inline-flex; width: 120px; height: 14px; border: 2px solid var(--ink); background: var(--ink); gap: 2px; vertical-align: middle; box-shadow: 2px 2px 0 rgba(0, 0, 0, .5); }
.rbar i { display: block; background: var(--rc); min-width: 4px; }

:lang(ar) .af-d, :lang(th) .af-d { font-family: var(--ui); font-size: 1rem; }
