/* Yu-Gi-Oh! theme: a duel at midnight. Deep indigo surfaces, gold edges like
   an ancient relic, Cinzel titles over Outfit text, and the colours of the
   card frames. Everything here is original; no publisher artwork or logos. */
:root {
  --bg: #0e0718;
  --bg2: #1c1030;
  --ink: #f6efe0;
  --muted: #bdb3cf;
  --surface: rgba(24, 14, 42, 0.84);
  --toggle-bg: rgba(24, 14, 42, 0.76);
  --surface-solid: #1a0f2e;
  --edge: rgba(232, 193, 90, 0.3);
  --line: rgba(246, 239, 224, 0.1);
  --accent: #e8c15a;
  --accent-2: #d04aa0;
  --accent-ink: #1c1004;
  --display: "Cinzel", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --shadow: 0 22px 50px rgba(4, 1, 10, 0.65);
  --shadow-soft: 0 10px 26px rgba(4, 1, 10, 0.45);
  --veil: radial-gradient(120% 90% at 50% 30%, rgba(14, 7, 24, 0.05), rgba(14, 7, 24, 0.55) 70%, rgba(14, 7, 24, 0.9));
  --gilt: linear-gradient(135deg, #7a4f10, #f6dc8c 30%, #c08a24 50%, #fbe7a8 70%, #7a4f10);
  --card-back: radial-gradient(ellipse 30% 18% at 50% 50%, #e8c15a 0 30%, transparent 32%), radial-gradient(circle at 50% 50%, #2a0f4a 0 40%, #6a2a0a 41% 45%, #1a0f2e 46%);
  color-scheme: dark;
}
body { font-size: 17.5px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; }
h4 { font-weight: 700; }
h1 { text-shadow: 0 2px 22px rgba(4, 1, 10, 0.75); }
.kicker, .focus-kicker, .meta-row dt, .fact-grid dt, .zone-label, .field span, .search-group, .switcher-head { letter-spacing: 0.16em; }
.btn, .chip-btn, .topnav a, .tabs button, .scope-toggle a, .crumbs a { font-weight: 600; }
.scene { background: radial-gradient(100% 70% at 50% 0%, #3a1a5a, #0e0718 70%); }

/* Gilded frames */
.set-hero, .focus-panel, .toolbar, .prose-block, .htp-win, .htp-type, .phase, .sources, .card-modal, .enc-card, .quick, .showcase-card {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, rgba(246, 220, 140, 0.6), rgba(122, 79, 16, 0.28) 35%, rgba(208, 74, 160, 0.22) 65%, rgba(246, 220, 140, 0.6)) border-box;
}
.card-modal { background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--gilt) border-box; border: 1.5px solid transparent; }
.set-hero, .prose-block, .focus-panel { position: relative; }
.set-hero::before, .focus-panel::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(232, 193, 90, 0.16); border-radius: calc(var(--r-lg) - 6px); pointer-events: none; }
.btn-primary { background: var(--gilt); color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 8px 24px rgba(232, 193, 90, 0.28); }
.btn-ghost, .chip-btn, .search-toggle, .switcher-btn { background: rgba(24, 14, 42, 0.86); border-color: rgba(232, 193, 90, 0.4); }
.brand-game { background: transparent; color: var(--accent); border: 1px solid rgba(232, 193, 90, 0.5); font-family: var(--display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; }
.topbar { background: linear-gradient(180deg, rgba(14, 7, 24, 0.88), rgba(14, 7, 24, 0.35)); }
.topbar.is-scrolled { background: rgba(14, 7, 24, 0.92); box-shadow: 0 1px 0 rgba(232, 193, 90, 0.25); }
.tabs button[aria-selected="true"], .scope-toggle a[aria-selected="true"], .mode-switch a[aria-current] { background: var(--gilt); color: var(--accent-ink); }
.tl-headline { font-family: var(--display); letter-spacing: 0; }
.footer { background: rgba(8, 3, 14, 0.96); }

/* Attributes, levels and stats */
.yg-stats-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; }
.yg-attr { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; background: color-mix(in srgb, var(--ac, #888) 22%, transparent); border: 1px solid color-mix(in srgb, var(--ac, #888) 60%, transparent); }
.yg-attr i { width: 1.4em; height: 1.4em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ac) 40%, #fff), var(--ac) 60%, color-mix(in srgb, var(--ac) 50%, #000)); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.attr-dark { --ac: #8a4fd0; } .attr-light { --ac: #f4d35e; } .attr-earth { --ac: #a0784a; } .attr-water { --ac: #3a8fe0; } .attr-fire { --ac: #e8502e; } .attr-wind { --ac: #4fc38a; } .attr-divine { --ac: #f0b429; }
.yg-level { display: inline-flex; align-items: center; gap: 6px; color: #f6a82a; letter-spacing: -0.05em; font-size: 0.95rem; text-shadow: 0 0 6px rgba(246, 168, 42, 0.5); }
.yg-level.is-rank { color: #f6dc8c; }
.yg-level b { letter-spacing: 0; font-size: 0.8rem; color: var(--muted); text-shadow: none; }
.yg-stat { display: inline-flex; gap: 5px; align-items: center; padding: 2px 10px; border-radius: 8px; font-size: 0.9rem; background: rgba(246, 239, 224, 0.07); border: 1px solid var(--line); }
.yg-stat b { font-family: var(--display); font-size: 0.92rem; }
.yg-ban { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: #a0202a; color: #fff; }
.yg-typeline { margin: 0 0 6px; font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.yg-text { padding: 12px 16px; margin: 8px 0; border-radius: 12px; background: rgba(246, 239, 224, 0.06); border: 1px solid rgba(232, 193, 90, 0.2); }
.yg-text p { margin: 0 0 6px; }
.yg-text h4 { margin: 0 0 6px; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: #5ad0c0; }
.yg-pend { border-color: rgba(31, 160, 140, 0.5); background: rgba(31, 160, 140, 0.08); }
.enc-links .chip { text-decoration: none; }
.enc-links .chip:hover, .set-stories .chip:hover { border-color: var(--accent); color: var(--accent); }
.set-stories { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; font-size: 0.92rem; }
.set-stories .chip { text-decoration: none; }

/* Card tiles: the effect is an aura around the card so the image stays untouched */
.card-tile { background: rgba(20, 10, 36, 0.9); border-color: rgba(232, 193, 90, 0.22); }
.card-tile .card-img { aspect-ratio: 421 / 614; border-radius: 2.5% / 1.7%; background: #0a0412; }
.card-tile::after { top: calc(var(--pad) - 6px); left: calc(var(--pad) - 6px); right: calc(var(--pad) - 6px); z-index: 0; border-radius: 12px; filter: blur(3px); }
.card-tile.is-lit::after { opacity: 0.95; }
.card-tile .card-img { z-index: 1; }
.card-tile.is-lit { border-color: color-mix(in srgb, var(--tc) 60%, #e8c15a); }
.card-tile.is-lit::before { opacity: calc(0.16 + var(--far, 0) * 0.16); }
.is-lit[data-foil]::before { opacity: calc(0.14 + var(--far, 0) * 0.14); }
.cm-card .card-img { aspect-ratio: 421 / 614; overflow: visible; }
.cm-card .card-img::after { inset: -14px; z-index: -1; border-radius: 20px; filter: blur(6px); opacity: 0.85; }
.cm-card .card-img img { border-radius: 2.5% / 1.7%; position: relative; z-index: 1; object-fit: contain; }
.cm-card .card-img::before { z-index: 2; border-radius: 2.5% / 1.7%; }
.cm-stage { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%), radial-gradient(120% 100% at 50% 0%, #3a1a5a, #0e0718); }
.printing-card img { aspect-ratio: 421 / 614; object-fit: contain; }

/* Timeline plaques: the set's showiest card in a gilded frame with an original eye-and-triangle badge */
.yg-pack { width: 230px; }
.plaque { position: relative; display: grid; grid-template-rows: 160px auto auto; justify-items: center; gap: 6px; padding: 12px 12px 14px; border-radius: 14px; text-align: center; background: linear-gradient(#1c1030, #0e0718) padding-box, var(--gilt) border-box; border: 2px solid transparent; box-shadow: var(--shadow); }
.plaque-art { width: 100%; height: 160px; border-radius: 8px; overflow: hidden; background: #2a1648; box-shadow: inset 0 0 0 1px rgba(246, 220, 140, 0.3); }
.plaque-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transform: scale(1.3); transform-origin: 50% 22%; }
.plaque .plaque-icon { margin-top: -38px; width: 62px; height: 62px; display: grid; place-items: center; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.yg-emblem { width: 100%; height: 100%; display: block; }
.plaque-name { font-family: var(--display); font-size: 0.9rem; line-height: 1.2; min-height: 2.4em; display: grid; place-items: center; }
.plaque-year { font-style: normal; color: var(--accent); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; }
.is-upcoming .plaque { filter: saturate(0.75); }
.is-upcoming .plaque-year { color: var(--accent-2); }
.yg-chapter { background: linear-gradient(#1c1030, #0e0718) padding-box, var(--gilt) border-box; border: 2px solid transparent; width: 200px; }
.yg-chapter .chapter-year { font-size: 2.4rem; font-family: var(--display); font-weight: 700; color: transparent; background: var(--gilt); -webkit-background-clip: text; background-clip: text; }
.yg-chapter strong { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.yg-chapter em { font-size: 0.92rem; color: var(--ink); }
.skel-pack { width: 70px; height: 62px; background: var(--gilt); clip-path: polygon(50% 0, 100% 100%, 0 100%); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Set page hero */
.yg-plaque { position: relative; display: grid; justify-items: center; gap: 8px; }
.yg-plaque .plaque-art { height: auto; aspect-ratio: 421 / 614; max-width: 280px; border-radius: 10px; border: 2px solid transparent; background: linear-gradient(#0e0718, #0e0718) padding-box, var(--gilt) border-box; }
.yg-plaque .plaque-art img { transform: none; object-position: 50% 50%; animation: none; filter: none; max-height: none; }
.yg-plaque .plaque-icon { margin-top: -48px; width: 86px; height: 86px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6)); animation: none; }
.yg-plaque .plaque-credit { text-align: center; }
.yg-set .set-hero { grid-template-columns: minmax(200px, 300px) 1fr; }
@media (max-width: 640px) { .yg-set .set-hero { grid-template-columns: minmax(0, 1fr); } .yg-plaque .plaque-art { width: min(100%, 260px); } .scope-toggle a { font-size: min(0.86rem, 2.9vw); } }

/* Battle: each monster's art in a gilded diamond */
.yg-battle .bt-fig { border-radius: 14px; overflow: hidden; border: 3px solid transparent; background: linear-gradient(#0e0718, #0e0718) padding-box, var(--gilt) border-box; box-shadow: 0 0 30px color-mix(in srgb, var(--fc) 50%, transparent); aspect-ratio: 1; }
.yg-battle .bt-fig img { object-fit: cover; animation: none; filter: none; width: 100%; height: 100%; }
.yg-battle.battle { height: clamp(260px, 30vw, 340px); }
.yg-battle .bt-fig { width: clamp(100px, 14vw, 170px); }
.yg-battle .bt-arena { align-items: center; }
.battle { background: radial-gradient(120% 90% at 50% 120%, rgba(208, 74, 160, 0.22), transparent 60%), rgba(20, 10, 36, 0.82); }

/* Encyclopedia */
.enc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.enc-tabs a { text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(232, 193, 90, 0.4); font-weight: 600; font-size: 0.9rem; }
.enc-tabs a[aria-current] { background: var(--gilt); color: var(--accent-ink); }
.enc-sec { margin-top: 34px; }
.yg-enc strong { font-family: var(--display); font-size: 0.95rem; }
.yg-enc .enc-art { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #2a1648; margin-bottom: 8px; }
.yg-enc .enc-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.yg-enc:hover .enc-art img { transform: scale(1.08); }
.entry-hero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 28px; align-items: center; margin-bottom: 8px; }
.entry-art { margin: 0; }
.yg-entry-art img { width: 100%; aspect-ratio: 421 / 614; object-fit: contain; border-radius: 10px; border: 2px solid transparent; background: linear-gradient(#0e0718, #0e0718) padding-box, var(--gilt) border-box; }
[data-entry-grid] .card-tile[hidden] { display: none; }
.yg-prints-h { font-size: 1.15rem; margin: 26px 0 8px; }
.yg-prints { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.yg-prints span { color: var(--muted); font-size: 0.9rem; }

/* World & How to Play */
.yg-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fr-c { display: grid; justify-items: start; gap: 4px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--fc); transition: transform 0.3s var(--ease); }
.fr-c:hover { transform: translateY(-4px); }
.fr-c span { color: var(--muted); font-size: 0.95rem; }
.fr-chip { width: 44px; height: 30px; border-radius: 4px; background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 70%, #fff), var(--fc) 55%, color-mix(in srgb, var(--fc) 55%, #000)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2); }
.fr-normal { --fc: #c9a35e; } .fr-effect { --fc: #d0702e; } .fr-ritual { --fc: #5a86d0; } .fr-fusion { --fc: #9a5cc0; } .fr-synchro { --fc: #e4e4ec; } .fr-xyz { --fc: #3a3a46; } .fr-link { --fc: #2f6cc0; } .fr-spell { --fc: #1fa08c; } .fr-trap { --fc: #c0408a; }
.fr-pendulum { --fc: #d0702e; }
.fr-pendulum .fr-chip { background: linear-gradient(180deg, #d0702e 50%, #1fa08c 50%); }
.fr-xyz { box-shadow: inset 0 3px 0 #8a8a9a; }
.yg-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.yg-board figcaption { grid-column: 1 / -1; }
.yg-row { display: flex; gap: 8px; margin: 8px 0; }
.yg-row i { width: 38px; aspect-ratio: 421 / 614; border-radius: 4px; border: 1px dashed rgba(232, 193, 90, 0.4); }
.yg-row i.on { border: 0; background: linear-gradient(160deg, #d0702e, #6a2a0a); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.yg-row i.def { transform: rotate(90deg) scale(0.9); }
.yg-row i.set { border: 0; background: var(--card-back); background-color: #1a0f2e; }
.yg-row.st i.on { background: linear-gradient(160deg, #1fa08c, #0a3a34); }
.yg-row.two { justify-content: center; }
.yg-row.piles i.field { border: 0; background: linear-gradient(160deg, #1fa08c, #0a3a34); }
.yg-row.piles i.gy { border: 0; background: linear-gradient(160deg, #5a4a6a, #2a2236); }
.yg-row.piles i.deck { border: 0; background: var(--card-back); background-color: #1a0f2e; box-shadow: 2px 2px 0 #2a1648, 4px 4px 0 #2a1648; }
.yg-row.piles i.xdeck { border: 0; background: linear-gradient(160deg, #9a5cc0, #2a0f4a); box-shadow: 2px 2px 0 #2a1648; }
.yg-turn { grid-template-columns: repeat(6, 1fr); }
.yg-world { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 26px; }
@media (max-width: 980px) { .yg-turn { grid-template-columns: 1fr 1fr; } .entry-hero { grid-template-columns: 1fr; } .yg-board { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .yg-turn { grid-template-columns: 1fr; } }
