/* ===== tokens ===== */
:root {
  --bg: #0b0e11;
  --bg-2: #10151a;
  --panel: #141a20;
  --panel-2: #1a2129;
  --line: #2a333d;
  --line-2: #3a4652;
  --text: #e6ebef;
  --text-2: #9aa7b3;
  --text-3: #66717c;
  --accent: #9fd6e0;
  --accent-2: #4fb3c4;
  --danger: #d65a5a;

  --r6: #ffcf4d;
  --r6-hi: #fffbe6;
  --r6-lo: #8a5a0c;
  --r5: #a8862a;
  --r4: #4f8fd6;
  --r3: #d9dde2;

  --cut: 9%;
  --font-latin: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-jp: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: var(--accent); }

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(79,179,196,0.10), transparent 60%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 48px 100%;
  mask-image: linear-gradient(#000 60%, transparent);
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
}

.app {
  position: relative; z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}

/* ===== header ===== */
.header { margin-bottom: 18px; }
.header__meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-latin); font-weight: 600; letter-spacing: 0.22em;
  font-size: 11px; color: var(--text-3);
}
.header__line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.title {
  margin: 8px 0 4px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: 0.02em;
}
.title__sub { display: block; font-size: 24px; color: var(--accent); }
.lead { margin: 0; color: var(--text-2); font-size: 13px; }
.lead--sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* ===== panels ===== */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 14px;
  position: relative;
}
.panel::before {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--accent-2), transparent 70%);
  opacity: 0.6;
}
.panel__label {
  font-family: var(--font-latin); font-weight: 700; letter-spacing: 0.2em;
  font-size: 11px; color: var(--text-2);
}

/* modes */
.mode-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mode-note { display: none; font-size: 10px; color: var(--text-3); opacity: 0.85; letter-spacing: 0.02em; }
.app:not([data-state="idle"]) .mode-note { display: inline; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.mode {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 2px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: border-color .15s, background .15s, opacity .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.mode__name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.mode__sub { font-family: var(--font-latin); font-size: 10px; letter-spacing: 0.15em; color: var(--text-3); font-weight: 600; }
.mode[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(159,214,224,0.18), rgba(159,214,224,0.06));
  box-shadow: inset 0 0 0 1px rgba(159,214,224,0.25);
}
.mode[aria-checked="true"] .mode__sub { color: var(--accent); }
/* per-mode colors (selected state) */
.mode[data-mode="easy"] { --mc: #6fd38a; --mc-bg: rgba(111,211,138,0.14); }
.mode[data-mode="normal"] { --mc: var(--accent); --mc-bg: rgba(159,214,224,0.14); }
.mode[data-mode="monster"] { --mc: #ff6b6b; --mc-bg: rgba(255,107,107,0.14); }
.mode[data-mode="musou"] { --mc: var(--r6); --mc-bg: rgba(255,207,77,0.14); }
.mode[aria-checked="true"] {
  border-color: var(--mc);
  background: linear-gradient(180deg, var(--mc-bg), rgba(0,0,0,0));
  box-shadow: inset 0 0 0 1px var(--mc-bg);
}
.mode[aria-checked="true"] .mode__name { color: var(--mc); }
.mode[aria-checked="true"] .mode__sub { color: var(--mc); opacity: 0.85; }
.mode[data-mode="musou"][aria-checked="true"] .mode__name { text-shadow: 0 0 8px rgba(255,207,77,0.5); }
.mode:active { transform: translateY(1px); }
.app:not([data-state="idle"]) .mode { cursor: default; pointer-events: none; }
.app:not([data-state="idle"]) .mode[aria-checked="false"] { opacity: 0.3; }
.mode-desc {
  margin-top: 8px; font-size: 12px; color: var(--text-3);
  font-family: var(--font-latin); font-weight: 600; letter-spacing: 0.06em;
  min-height: 18px;
}

/* guarantee toggle */
.guarantee { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.guarantee__label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg__btn {
  background: var(--panel-2); border: 0; padding: 5px 14px; font-size: 12px; font-weight: 700; color: var(--text-3);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.seg__btn + .seg__btn { border-left: 1px solid var(--line); }
.seg__btn[aria-checked="true"] { background: rgba(159,214,224,0.16); color: var(--accent); }
.app:not([data-state="idle"]) .seg__btn { pointer-events: none; }
.app:not([data-state="idle"]) .seg__btn[aria-checked="false"] { opacity: 0.35; }
.guarantee__desc { font-size: 11px; color: var(--text-3); margin-top: 6px; min-height: 16px; }

/* ===== squad grid ===== */
.squad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.squad-count { color: var(--accent); margin-left: 6px; }
.squad-actions { display: none; }
.app[data-state="reveal"] .squad-actions { display: block; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 12px;
}
@media (min-width: 420px) { .grid { gap: 12px; } }

.hint { margin: 10px 0 0; font-size: 12px; color: var(--text-3); text-align: center; min-height: 18px; }

/* ----- slot / card ----- */
.slot {
  position: relative;
  aspect-ratio: 5 / 6.6;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}
.card {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  cursor: default;
}
.slot.is-flippable .card { cursor: pointer; }
.slot.is-flipped .card { transform: rotateY(180deg); animation: flip .7s cubic-bezier(.3,.6,.25,1) both; }
.slot.was-flipped:not(.is-flipped) .card { animation: unflip .5s cubic-bezier(.3,.6,.25,1) both; }
@keyframes flip {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(90deg) scale(1.12) translateZ(40px); }
  100% { transform: rotateY(180deg) scale(1); }
}
@keyframes unflip {
  0%   { transform: rotateY(180deg) scale(1); }
  50%  { transform: rotateY(90deg) scale(1.08); }
  100% { transform: rotateY(0deg) scale(1); }
}
.face {
  position: absolute; inset: 0;
  clip-path: polygon(0 var(--cut), 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  overflow: hidden;
}
.face--front { transform: rotateY(180deg); }
/* visibility swap at the flip midpoint (does not rely on backface-visibility, which Chrome ignores with clip-path) */
.face--front { visibility: hidden; transition: visibility 0s linear .35s; }
.face--back { visibility: visible; transition: visibility 0s linear .35s; }
.slot.was-flipped:not(.is-flipped) .face--front { transition-delay: .25s; }
.slot.was-flipped:not(.is-flipped) .face--back { transition-delay: .25s; }
.slot.is-flipped .face--front { visibility: visible; }
.slot.is-flipped .face--back { visibility: hidden; }

/* empty slot: shape reference only (parallelogram, plus mark, diagonal cut line) */
.face--empty {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.05), transparent 45%),
    linear-gradient(180deg, #1c242c, #12181e);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.face--empty::before { /* diagonal band */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 58%, rgba(0,0,0,0.45) 58.4%, rgba(0,0,0,0.45) 68%, transparent 68.4%);
}
.face--empty::after { /* plus mark */
  content: ""; position: absolute; left: 50%; top: 50%; width: 34%; height: 34%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#c8d0d6, #c8d0d6) center / 100% 3px no-repeat,
    linear-gradient(#c8d0d6, #c8d0d6) center / 3px 100% no-repeat;
  opacity: 0.55;
}
.face--empty .slot-num {
  position: absolute; left: 6px; top: 12%;
  font-family: var(--font-latin); font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--text-3);
}

/* card back: the whole surface takes the rarity color, with a dark pattern overlay */
.face--back {
  background: var(--frame, linear-gradient(180deg, #232c36, #141a20));
}
.face--back .back-inner {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.10) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.38));
}
.face--back .back-inner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 56%, rgba(0,0,0,0.28) 56.4%, rgba(0,0,0,0.28) 60%, transparent 60.4%);
}
.face--back .back-inner::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
  transform: translate(-50%,-50%);
  border: 1.5px solid rgba(255,255,255,0.55);
  clip-path: polygon(0 12%, 100% 0, 100% 88%, 0 100%);
}
.face--back .back-num {
  position: absolute; right: 6px; bottom: 12%;
  font-family: var(--font-latin); font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: #fff; opacity: 0.85; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.slot[data-rarity="3"] .face--back .back-inner::after,
.slot[data-rarity="2"] .face--back .back-inner::after,
.slot[data-rarity="1"] .face--back .back-inner::after { border-color: rgba(0,0,0,0.45); }
.slot[data-rarity="3"] .face--back .back-num,
.slot[data-rarity="2"] .face--back .back-num,
.slot[data-rarity="1"] .face--back .back-num { color: #1b2128; text-shadow: none; }

/* card front: frame by rarity */
.face--front {
  padding: 3px;
  background: var(--frame, var(--r3));
}
.face--front .inner {
  position: absolute; inset: 3px;
  background: #0f1418;
  clip-path: polygon(0 var(--cut), 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  overflow: hidden;
}
.face--front .art {
  position: absolute; left: 0; right: 0; top: 0;
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #0f1418;
}
.face--front .art.is-hidden { display: none; }
.face--front .name-fallback {
  position: absolute; left: 4px; right: 4px; top: 16%; bottom: 30%;
  display: none; align-items: center; justify-content: center; text-align: center;
  font-size: 10px; line-height: 1.3; font-weight: 700; color: var(--text);
  word-break: break-all;
}
.face--front.no-art .name-fallback { display: flex; }
.face--front .strip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(180deg, rgba(15,20,24,0) 0%, rgba(15,20,24,0.9) 40%, #0f1418 100%);
}
.face--front .cls {
  position: absolute; right: 5px; bottom: calc(var(--cut) + 5px);
  width: 28%; aspect-ratio: 1; min-width: 18px;
  display: flex; align-items: center; justify-content: center;
}
.face--front .cls img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.face--front .cls .cls-txt {
  display: none; width: 100%; height: 100%; border: 1.5px solid #e6ebef; border-radius: 2px;
  font-size: 11px; font-weight: 700; align-items: center; justify-content: center; background: rgba(0,0,0,0.5);
}
.face--front .cls.no-icon img { display: none; }
.face--front .cls.no-icon .cls-txt { display: flex; }

.slot[data-rarity="6"] .face--front,
.slot[data-rarity="6"] .face--back {
  --frame: linear-gradient(120deg, var(--r6-lo) 0%, var(--r6) 20%, var(--r6-hi) 38%, var(--r6) 50%, var(--r6-hi) 62%, var(--r6) 80%, var(--r6-lo) 100%);
  background-size: 300% 300%;
  animation: shimmer 2.2s linear infinite;
}
.slot[data-rarity="6"] .face--front { padding: 6px; }
.slot[data-rarity="6"] .face--front .inner { inset: 6px; }
.slot[data-rarity="6"] { animation: glow6 1.4s ease-in-out infinite; }
@keyframes glow6 {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,205,80,0.7)); }
  50%      { filter: drop-shadow(0 0 16px rgba(255,225,120,1)); }
}
/* light sweep across the whole card face */
.slot[data-rarity="6"] .face--front .inner::after {
  content: ""; position: absolute; inset: -40% -60%; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,250,220,0.0) 44%, rgba(255,250,220,0.55) 50%, rgba(255,250,220,0.0) 56%, transparent 60%);
  animation: sweep6 2.4s ease-in-out infinite;
}
@keyframes sweep6 {
  0%   { transform: translateX(-45%); }
  60%, 100% { transform: translateX(45%); }
}
.slot[data-rarity="6"] .face--front .strip {
  background: linear-gradient(180deg, rgba(15,20,24,0) 0%, rgba(120,85,10,0.55) 45%, rgba(60,42,6,0.95) 100%);
}
.slot[data-rarity="6"] .face--back .back-inner {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.08) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.25));
}
.slot[data-rarity="5"] { --frame: var(--r5); }
.slot[data-rarity="4"] { --frame: var(--r4); }
.slot[data-rarity="3"],
.slot[data-rarity="2"],
.slot[data-rarity="1"] { --frame: var(--r3); }
@keyframes shimmer {
  0% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* reroll select mode */
.app[data-state="reroll"] .slot .card { cursor: pointer; }
.app[data-state="reroll"] .slot:not(.is-selected) .card { opacity: 0.55; }
.slot .check {
  position: absolute; right: 4px; top: 4px; z-index: 2;
  transform: scale(0.6);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #0b0e11;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; line-height: 1;
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.slot.is-selected .check { opacity: 1; transform: scale(1); }
.app[data-state="reroll"] .slot.is-selected { filter: drop-shadow(0 0 6px rgba(159,214,224,0.6)); }

/* ===== actions ===== */
.actions { margin: 4px 0 8px; padding: 6px 0; }
/* only the initial 引く button sticks to the bottom so it is reachable without scrolling */
.app[data-state="idle"] .actions {
  position: sticky; bottom: 0; z-index: 10;
  margin: 0 -16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11,14,17,0), rgba(11,14,17,0.92) 30%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.actions__row { display: none; gap: 10px; justify-content: center; }
.actions__row > .btn { flex: 1; max-width: 240px; }
.app[data-state="reveal"] .actions { display: none; }
.app[data-state="idle"] .actions__row[data-for="idle"],
.app[data-state="result"] .actions__row[data-for="result"],
.app[data-state="reroll"] .actions__row[data-for="reroll"] { display: flex; }
.again { display: none; justify-content: center; margin: 6px 0 26px; }
.app[data-state="result"] .again, .app[data-state="reroll"] .again { display: flex; }
.again .btn { min-width: 200px; }

.btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--text);
  font-weight: 700; font-size: 15px; letter-spacing: 0.06em;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: default; pointer-events: none; }
.btn--primary {
  background: linear-gradient(180deg, #2b7f90, #1d5966);
  border-color: var(--accent-2);
  color: #eefbff;
}
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--lg { padding: 16px 24px; font-size: 18px; letter-spacing: 0.2em; }
.btn.is-busy { opacity: 0.6; pointer-events: none; }

/* ===== info (collapsed by default) ===== */
.panel--info { margin-top: 6px; }
.info { border-top: 1px solid var(--line); }
.info:first-of-type { margin-top: 10px; }
.info summary {
  list-style: none; cursor: pointer; padding: 11px 26px 11px 0; position: relative;
  font-size: 14px; font-weight: 700; color: var(--text-2);
  -webkit-tap-highlight-color: transparent;
}
.info summary::-webkit-details-marker { display: none; }
.info summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.info[open] summary { color: var(--text); }
.info[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.info__body { padding: 0 0 14px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.info__body p { margin: 0 0 10px; }
.info__body ol, .info__body ul { margin: 0 0 10px; padding-left: 1.4em; }
.info__body li { margin-bottom: 4px; }
.info__body strong { color: var(--text); font-weight: 700; }
.table-wrap { overflow-x: auto; margin: 0 0 10px; }
.info__table { border-collapse: collapse; width: 100%; font-size: 12px; font-family: var(--font-latin); }
.info__table th, .info__table td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; white-space: nowrap; }
.info__table th { color: var(--text-3); font-weight: 600; letter-spacing: 0.05em; }
.info__table td:first-child { font-family: var(--font-jp); font-weight: 700; color: var(--text); }
.faq dt { font-weight: 700; color: var(--text); margin-top: 8px; }
.faq dd { margin: 2px 0 6px; }

/* ===== footer ===== */
.footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.7;
}
.footer__legal { margin: 0 0 10px; }
.footer__credit { margin: 0; color: var(--text-2); }
.footer__links { margin: 6px 0 0; font-size: 11px; }
.footer__studio { font-family: var(--font-latin); font-weight: 700; letter-spacing: 0.08em; font-size: 13px; color: var(--text); }
.footer__sep { margin: 0 8px; color: var(--line-2); }
.footer__link { color: var(--accent); text-decoration: none; }
.footer__link:hover { text-decoration: underline; }

/* ===== share modal ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
@media (min-width: 560px) { .modal { align-items: center; } }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal__box {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px 6px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}
@media (min-width: 560px) { .modal__box { border-radius: 6px; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal__close { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--text-2); cursor: pointer; padding: 4px 8px; }
.share-preview { background: #000; border: 1px solid var(--line); min-height: 120px; display: flex; align-items: center; justify-content: center; }
.share-preview img { width: 100%; height: auto; display: block; }
.share-preview .spinner { color: var(--text-3); font-family: var(--font-latin); letter-spacing: 0.2em; font-size: 12px; padding: 30px; }
.share-text {
  width: 100%; margin-top: 10px; resize: none;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 3px;
  font: inherit; font-size: 13px; padding: 8px;
}
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.share-btns .btn { padding: 11px 8px; font-size: 14px; }
.share-btns .btn--primary { grid-column: 1 / -1; }
.share-note { margin: 10px 0 0; font-size: 11px; color: var(--text-3); }

/* ===== operator detail (long press) ===== */
.modal--detail { align-items: center; z-index: 60; }
.modal--detail .modal__backdrop { background: rgba(5,7,9,0.93); }
.detail {
  position: relative; width: min(100%, 520px); max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
}
.detail__close { position: absolute; right: 8px; top: 6px; z-index: 2; color: var(--text); }
.detail__art {
  width: 100%; height: min(70vh, 640px); display: flex; align-items: center; justify-content: center;
}
.detail__art img, .detail__art canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.7)); animation: detailIn .25s ease-out; }
.detail__art .spinner { color: var(--text-3); font-family: var(--font-latin); letter-spacing: 0.2em; font-size: 12px; }
@keyframes detailIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.detail__info { margin-top: 10px; text-align: center; }
.detail__rarity { font-size: 14px; letter-spacing: 0.1em; color: var(--r3); }
.detail__rarity[data-rarity="6"] { color: var(--r6); text-shadow: 0 0 8px rgba(255,205,80,0.7); }
.detail__rarity[data-rarity="5"] { color: var(--r5); }
.detail__rarity[data-rarity="4"] { color: var(--r4); }
.detail__name { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 2px; }
.detail__cls { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.slot { touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.app[data-state="result"] .slot .card { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .slot[data-rarity="6"] .face, .slot[data-rarity="6"] .face--front .inner::after { animation: none; }
  .slot[data-rarity="6"] { animation: none; filter: drop-shadow(0 0 10px rgba(255,210,90,0.9)); }
}
