/* ==========================================================================
 * tarot-reading / assets/css/tarot-reading.css
 * --------------------------------------------------------------------------
 * 모든 선택자는 .trr- 접두사로 스코프되어 테마 CSS 와 충돌하지 않는다.
 * 외부 폰트/CDN 을 쓰지 않으므로 시스템 폰트 스택만 사용한다.
 * ========================================================================== */

/* ------------------------------- 토큰 ---------------------------------- */
.trr-app {
  --trr-bg: #0b0918;
  --trr-bg-2: #120e28;
  --trr-panel: rgba(255, 255, 255, 0.045);
  --trr-panel-2: rgba(255, 255, 255, 0.075);
  --trr-line: rgba(190, 170, 255, 0.16);
  --trr-line-strong: rgba(190, 170, 255, 0.34);
  --trr-text: #ece9fb;
  --trr-dim: #a9a2c9;
  --trr-mute: #7d769c;
  --trr-gold: #e8c37a;
  --trr-violet: #b79bff;
  --trr-rose: #ff9ec4;
  --trr-ok: #7ee2b8;
  --trr-warn: #ffb86b;
  --trr-radius: 16px;
  --trr-radius-sm: 10px;
  --trr-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);

  box-sizing: border-box;
  color: var(--trr-text);
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(129, 88, 255, 0.20), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(255, 132, 178, 0.13), transparent 58%),
    radial-gradient(760px 640px at 50% 108%, rgba(74, 118, 255, 0.12), transparent 60%),
    linear-gradient(175deg, var(--trr-bg), var(--trr-bg-2) 55%, #0a0814);
  border-radius: calc(var(--trr-radius) + 6px);
  padding: 0;
  margin: 0 auto;
  max-width: 1120px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

.trr-app *,
.trr-app *::before,
.trr-app *::after { box-sizing: border-box; }

.trr-app button { font: inherit; color: inherit; }

.trr-app h1, .trr-app h2, .trr-app h3, .trr-app h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--trr-text);
}

.trr-app p { margin: 0; }
.trr-app ul { margin: 0; padding: 0; list-style: none; }

/* 별가루 배경 */
.trr-stars {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 32% 62%, #d9ccff, transparent),
    radial-gradient(1.6px 1.6px at 68% 28%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 82% 74%, #ffe9c4, transparent),
    radial-gradient(1.3px 1.3px at 47% 8%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 91% 44%, #d9ccff, transparent),
    radial-gradient(1.5px 1.5px at 6% 82%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 58% 88%, #ffe9c4, transparent);
  animation: trr-twinkle 7s ease-in-out infinite alternate;
}
@keyframes trr-twinkle { from { opacity: .32; } to { opacity: .68; } }

.trr-wrap { position: relative; z-index: 1; padding: 22px; }

/* ------------------------------ 헤더 ---------------------------------- */
.trr-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--trr-line);
}
.trr-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trr-brand__mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(232, 195, 122, .28), rgba(183, 155, 255, .14));
  border: 1px solid var(--trr-line-strong);
  color: var(--trr-gold); font-size: 19px; line-height: 1;
  box-shadow: inset 0 0 18px rgba(232, 195, 122, .12);
}
.trr-brand__title { font-size: 18px; font-weight: 650; letter-spacing: 0.01em; }
.trr-brand__sub { font-size: 12px; color: var(--trr-mute); letter-spacing: 0.02em; }

.trr-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------ 버튼 ---------------------------------- */
.trr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--trr-line-strong);
  background: var(--trr-panel);
  color: var(--trr-text);
  font-size: 13.5px; font-weight: 550; letter-spacing: .01em;
  cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.trr-btn:hover { background: var(--trr-panel-2); border-color: rgba(200, 180, 255, .5); }
.trr-btn:active { transform: translateY(1px); }
.trr-btn:focus-visible { outline: 2px solid var(--trr-gold); outline-offset: 2px; }
.trr-btn[disabled] { opacity: .42; cursor: not-allowed; }

.trr-btn--primary {
  background: linear-gradient(135deg, #8f6dff, #b79bff 45%, #e8c37a 130%);
  border-color: transparent; color: #14101f; font-weight: 700;
  box-shadow: 0 10px 26px rgba(143, 109, 255, .32);
}
.trr-btn--primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, #9a7bff, #c3aaff 45%, #f0cf8c 130%); }
.trr-btn--ghost { background: transparent; }
.trr-btn--sm { padding: 7px 12px; font-size: 12.5px; }
.trr-btn--block { width: 100%; }

/* ------------------------------ 스텝바 -------------------------------- */
.trr-steps {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px; font-size: 12px; color: var(--trr-mute);
}
.trr-steps__item { display: flex; align-items: center; gap: 6px; }
.trr-steps__dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--trr-line-strong);
  font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.trr-steps__item.is-active { color: var(--trr-gold); }
.trr-steps__item.is-active .trr-steps__dot {
  background: rgba(232, 195, 122, .16); border-color: var(--trr-gold); color: var(--trr-gold);
}
.trr-steps__item.is-done .trr-steps__dot {
  background: rgba(126, 226, 184, .16); border-color: rgba(126,226,184,.5); color: var(--trr-ok);
}
.trr-steps__sep { width: 14px; height: 1px; background: var(--trr-line-strong); }

/* ------------------------------ 패널 ---------------------------------- */
.trr-panel {
  background: var(--trr-panel);
  border: 1px solid var(--trr-line);
  border-radius: var(--trr-radius);
  padding: 20px;
  backdrop-filter: blur(6px);
}
.trr-panel + .trr-panel { margin-top: 14px; }

.trr-section-title {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 15px; font-weight: 650; margin-bottom: 12px;
}
.trr-section-title small { font-size: 12px; color: var(--trr-mute); font-weight: 400; }
.trr-section-title::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--trr-gold), var(--trr-violet));
  flex: 0 0 3px;
}

/* --------------------------- 선택 카드 그리드 --------------------------- */
.trr-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }

.trr-choice {
  position: relative; text-align: left;
  padding: 14px 14px 13px; border-radius: var(--trr-radius-sm);
  border: 1px solid var(--trr-line);
  background: rgba(255, 255, 255, .028);
  cursor: pointer; transition: border-color .16s, background .16s, transform .16s;
  display: flex; flex-direction: column; gap: 5px; min-height: 92px;
}
.trr-choice:hover { border-color: var(--trr-line-strong); background: rgba(255,255,255,.055); transform: translateY(-1px); }
.trr-choice.is-on {
  border-color: rgba(232, 195, 122, .72);
  background: linear-gradient(150deg, rgba(232,195,122,.14), rgba(183,155,255,.10));
  box-shadow: 0 0 0 1px rgba(232,195,122,.24) inset, 0 8px 22px rgba(0,0,0,.28);
}
.trr-choice__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trr-choice__icon { font-size: 15px; color: var(--trr-gold); line-height: 1; }
.trr-choice__name { font-size: 14px; font-weight: 620; }
.trr-choice__desc { font-size: 11.5px; color: var(--trr-mute); line-height: 1.5; }
.trr-choice__meta { font-size: 11px; color: var(--trr-dim); }
.trr-choice__check {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--trr-line-strong);
  display: grid; place-items: center; font-size: 10px; color: transparent;
  flex: 0 0 16px;
}
.trr-choice.is-on .trr-choice__check {
  background: var(--trr-gold); border-color: var(--trr-gold); color: #17121f; font-weight: 800;
}

/* ------------------------------ 입력 ---------------------------------- */
.trr-field { margin-bottom: 14px; }
.trr-field:last-child { margin-bottom: 0; }
.trr-label {
  display: block; font-size: 12px; color: var(--trr-dim);
  margin-bottom: 6px; letter-spacing: .01em;
}
.trr-input, .trr-textarea {
  width: 100%; padding: 11px 13px;
  border-radius: var(--trr-radius-sm);
  border: 1px solid var(--trr-line);
  background: rgba(8, 6, 18, .55);
  color: var(--trr-text); font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s;
  font-family: inherit;
}
.trr-input::placeholder, .trr-textarea::placeholder { color: #635c80; }
.trr-input:focus, .trr-textarea:focus {
  outline: none; border-color: rgba(232, 195, 122, .58);
  box-shadow: 0 0 0 3px rgba(232, 195, 122, .12);
}
.trr-textarea { min-height: 66px; resize: vertical; line-height: 1.6; }
.trr-hint { font-size: 11.5px; color: var(--trr-mute); margin-top: 6px; line-height: 1.55; }
.trr-hint strong { color: var(--trr-ok); font-weight: 600; }

/* 선택지 A/B 2열 */
.trr-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 스위치 */
.trr-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--trr-dim); }
.trr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.trr-switch__track {
  width: 38px; height: 21px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid var(--trr-line-strong);
  position: relative; transition: background .18s, border-color .18s; flex: 0 0 38px;
}
.trr-switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--trr-dim); transition: transform .18s, background .18s;
}
.trr-switch input:checked + .trr-switch__track { background: rgba(183,155,255,.35); border-color: rgba(183,155,255,.7); }
.trr-switch input:checked + .trr-switch__track::after { transform: translateX(17px); background: var(--trr-gold); }
.trr-switch input:focus-visible + .trr-switch__track { outline: 2px solid var(--trr-gold); outline-offset: 2px; }

/* ------------------------------ 스프레드 ------------------------------- */
.trr-spread-row { display: flex; gap: 10px; flex-wrap: wrap; }
.trr-chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--trr-line); background: transparent;
  font-size: 12.5px; color: var(--trr-dim); cursor: pointer;
  transition: all .16s;
}
.trr-chip:hover { color: var(--trr-text); border-color: var(--trr-line-strong); }
.trr-chip.is-on {
  background: rgba(183,155,255,.16); border-color: rgba(183,155,255,.62);
  color: #e6dcff; font-weight: 600;
}

/* ------------------------------ 카드 무대 ------------------------------ */
.trr-stage {
  position: relative; padding: 18px 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.trr-stage__hint { font-size: 12.5px; color: var(--trr-dim); text-align: center; min-height: 20px; }
.trr-stage__hint b { color: var(--trr-gold); font-weight: 650; }

/* 펼친 덱 (선택 전) */
.trr-fan {
  display: flex; justify-content: center; align-items: flex-end;
  flex-wrap: wrap; gap: 6px; width: 100%; padding: 6px 0 2px;
}
.trr-fan__card {
  --w: 62px;
  width: var(--w); aspect-ratio: 200 / 300;
  border-radius: 7px; border: 1px solid rgba(190,170,255,.34);
  background: linear-gradient(160deg, #1b1440, #120e2c 55%, #251a52);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  box-shadow: 0 8px 18px rgba(0,0,0,.4);
  padding: 0;
}
.trr-fan__card:hover, .trr-fan__card:focus-visible {
  transform: translateY(-10px) scale(1.04);
  border-color: var(--trr-gold);
  box-shadow: 0 14px 30px rgba(232,195,122,.24);
  z-index: 3;
}
.trr-fan__card.is-picked { transform: translateY(-14px); border-color: var(--trr-gold); box-shadow: 0 0 0 2px rgba(232,195,122,.5); }
.trr-fan__card svg { display: block; width: 100%; height: 100%; }
.trr-fan__card:nth-child(3n) { transform: translateY(-4px); }
.trr-fan__card:nth-child(3n):hover { transform: translateY(-14px) scale(1.04); }

/* 슬롯 (뽑은 카드 자리) */
.trr-slots {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; width: 100%;
}
.trr-slot { width: 128px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.trr-slot__label {
  font-size: 11px; color: var(--trr-mute); text-align: center; letter-spacing: .02em;
  min-height: 26px; display: flex; align-items: center; justify-content: center;
}
.trr-slot__frame {
  width: 100%; aspect-ratio: 200 / 300; border-radius: 10px;
  border: 1px dashed rgba(190,170,255,.34);
  display: grid; place-items: center;
  color: rgba(190,170,255,.4); font-size: 20px;
  background: rgba(255,255,255,.02);
}

/* 카드 자체 */
.trr-card {
  width: 128px; aspect-ratio: 200 / 300;
  perspective: 900px; position: relative;
  border: 0; background: none; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.trr-card__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.32,.72,.24,1);
  border-radius: 10px;
}
.trr-card.is-flipped .trr-card__inner { transform: rotateY(180deg); }
.trr-card__face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.trr-card__face svg { display: block; width: 100%; height: 100%; }
.trr-card__back { transform: rotateY(0deg); }
.trr-card__front { transform: rotateY(180deg); }
.trr-card__front.is-rev svg { transform: rotate(180deg); }
.trr-card.is-static { cursor: default; }

.trr-card__revflag {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  font-size: 9px; padding: 2px 6px; border-radius: 999px;
  background: rgba(20,14,36,.85); border: 1px solid rgba(255,158,196,.55);
  color: var(--trr-rose); letter-spacing: .04em; font-weight: 600;
}

/* 결과 카드 리스트 */
.trr-results { display: flex; flex-direction: column; gap: 12px; }
.trr-rcard {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px;
  padding: 14px; border-radius: var(--trr-radius-sm);
  border: 1px solid var(--trr-line);
  background: linear-gradient(150deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  animation: trr-rise .42s ease both;
}
@keyframes trr-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.trr-rcard__art { border-radius: 8px; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.trr-rcard__art svg { display: block; width: 100%; height: auto; }
.trr-rcard__art.is-rev svg { transform: rotate(180deg); }
.trr-rcard__pos {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--trr-gold); margin-bottom: 3px; font-weight: 600;
}
.trr-rcard__name { font-size: 15px; font-weight: 650; margin-bottom: 5px; }
.trr-rcard__name span { font-size: 11.5px; color: var(--trr-mute); font-weight: 400; margin-left: 6px; }
.trr-rcard__kw { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.trr-kw {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: rgba(183,155,255,.14); border: 1px solid rgba(183,155,255,.28);
  color: #d8ccff;
}
.trr-rcard__text { font-size: 13px; color: #d6d0ea; line-height: 1.72; }
.trr-rcard__lens {
  font-size: 11.5px; color: var(--trr-mute); margin-top: 7px;
  padding-left: 9px; border-left: 2px solid var(--trr-line-strong); line-height: 1.6;
}

/* ------------------------------ 요약 ---------------------------------- */
.trr-summary {
  border-radius: var(--trr-radius);
  border: 1px solid rgba(232,195,122,.3);
  background: linear-gradient(150deg, rgba(232,195,122,.09), rgba(183,155,255,.07));
  padding: 18px;
}
.trr-tone {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.trr-tone__pill {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid currentColor;
}
.trr-tone--bright { color: #ffe08a; }
.trr-tone--warm { color: #9ff0c6; }
.trr-tone--neutral { color: #b6c2ff; }
.trr-tone--cool { color: #9fd8ff; }
.trr-tone--heavy { color: #ffb0c4; }
.trr-tone__label { font-size: 14px; font-weight: 620; }
.trr-summary p { font-size: 13px; color: #d2cce8; line-height: 1.78; margin-bottom: 9px; }
.trr-summary p:last-child { margin-bottom: 0; }

/* 조합 배지 */
.trr-combos { display: flex; flex-direction: column; gap: 8px; }
.trr-combo {
  padding: 11px 13px; border-radius: var(--trr-radius-sm);
  border: 1px solid rgba(183,155,255,.3);
  background: rgba(183,155,255,.075);
  font-size: 12.5px; color: #ddd5f5; line-height: 1.66;
}
.trr-combo b { color: #efe9ff; display: block; margin-bottom: 3px; font-size: 12.5px; }

/* 슈트 분포 */
.trr-balance { display: flex; flex-direction: column; gap: 9px; }
.trr-bar { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; font-size: 11.5px; }
.trr-bar__name { color: var(--trr-dim); }
.trr-bar__track { height: 7px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.trr-bar__fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.trr-bar__n { text-align: right; color: var(--trr-mute); font-variant-numeric: tabular-nums; }
.trr-ball { background: linear-gradient(90deg, #8f6dff, #b79bff); }
.trr-bwands { background: linear-gradient(90deg, #ff9a4d, #ffce7a); }
.trr-bcups { background: linear-gradient(90deg, #4db8ff, #86e6ff); }
.trr-bswords { background: linear-gradient(90deg, #7f93ff, #b7c4ff); }
.trr-bpentacles { background: linear-gradient(90deg, #3fbf87, #8ff0bd); }

/* 조언 */
.trr-advice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 16px; border-radius: var(--trr-radius-sm);
  border: 1px solid rgba(126,226,184,.32);
  background: rgba(126,226,184,.075);
}
.trr-advice__icon { color: var(--trr-ok); font-size: 17px; line-height: 1.35; flex: 0 0 auto; }
.trr-advice__label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--trr-ok); font-weight: 700; margin-bottom: 3px; }
.trr-advice__text { font-size: 13.5px; color: #dff6ec; line-height: 1.7; }

/* 푸터 액션 */
.trr-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.trr-actions .trr-btn--primary { flex: 1 1 200px; }

/* ------------------------------ 기록 ---------------------------------- */
.trr-journal { display: flex; flex-direction: column; gap: 10px; }
.trr-jitem {
  border: 1px solid var(--trr-line); border-radius: var(--trr-radius-sm);
  background: rgba(255,255,255,.03); overflow: hidden;
}
.trr-jitem__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; cursor: pointer;
}
.trr-jitem__q { font-size: 13px; font-weight: 600; flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.trr-jitem__meta { font-size: 11px; color: var(--trr-mute); white-space: nowrap; }
.trr-jitem__body { padding: 0 14px 14px; display: none; }
.trr-jitem.is-open .trr-jitem__body { display: block; }
.trr-jitem__cards { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.trr-mini {
  width: 44px; border-radius: 5px; overflow: hidden;
  border: 1px solid rgba(190,170,255,.24);
}
.trr-mini svg { display: block; width: 100%; height: auto; }
.trr-mini.is-rev svg { transform: rotate(180deg); }

.trr-empty {
  text-align: center; padding: 34px 16px; color: var(--trr-mute); font-size: 13px;
}
.trr-empty__icon { font-size: 26px; opacity: .5; display: block; margin-bottom: 8px; }

/* 도감 */
.trr-deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; }
.trr-dcard {
  border-radius: 8px; overflow: hidden; border: 1px solid var(--trr-line);
  background: none; padding: 0; cursor: pointer; position: relative;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.trr-dcard:hover { transform: translateY(-3px); border-color: var(--trr-line-strong); box-shadow: 0 10px 22px rgba(0,0,0,.4); }
.trr-dcard svg { display: block; width: 100%; height: auto; }
.trr-dcard__nm {
  font-size: 9.5px; color: var(--trr-dim); padding: 4px 3px; text-align: center;
  background: rgba(0,0,0,.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 모달 */
.trr-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(6, 4, 14, .82);
  backdrop-filter: blur(4px);
  animation: trr-fade .2s ease both;
}
@keyframes trr-fade { from { opacity: 0; } to { opacity: 1; } }
.trr-modal[hidden] { display: none; }
.trr-modal__box {
  background: linear-gradient(165deg, #171129, #0e0a1e);
  border: 1px solid var(--trr-line-strong); border-radius: var(--trr-radius);
  max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 20px; box-shadow: var(--trr-shadow);
  animation: trr-pop .24s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes trr-pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.trr-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.trr-modal__art { width: 120px; margin: 0 auto 14px; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.trr-modal__art svg { display: block; width: 100%; height: auto; }
.trr-modal__body { font-size: 12.5px; color: #cfc8e6; line-height: 1.72; }
.trr-modal__row { margin-bottom: 9px; }
.trr-modal__row b { color: var(--trr-gold); font-size: 11px; letter-spacing: .06em; display: block; margin-bottom: 2px; text-transform: uppercase; }
.trr-x {
  background: none; border: 1px solid var(--trr-line); color: var(--trr-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: 0 0 30px;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.trr-x:hover { color: var(--trr-text); border-color: var(--trr-line-strong); }

/* 토스트 */
.trr-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: rgba(23, 17, 41, .97); border: 1px solid rgba(126,226,184,.45);
  color: #e8f7f1; font-size: 12.5px; padding: 10px 18px; border-radius: 999px;
  z-index: 100000; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; max-width: 88vw; text-align: center;
}
.trr-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.trr-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ------------------------------ 반응형 -------------------------------- */
@media (max-width: 720px) {
  .trr-wrap { padding: 15px; }
  .trr-brand__title { font-size: 16px; }
  .trr-panel { padding: 15px; }
  .trr-choices { grid-template-columns: 1fr 1fr; gap: 8px; }
  .trr-choice { min-height: 84px; padding: 11px; }
  .trr-choice__name { font-size: 13px; }
  .trr-choice__desc { font-size: 10.5px; }
  .trr-fan { gap: 4px; }
  .trr-fan__card { --w: 48px; }
  .trr-slot { width: 92px; }
  .trr-card { width: 92px; }
  .trr-rcard { grid-template-columns: 70px 1fr; gap: 11px; padding: 12px; }
  .trr-rcard__name { font-size: 14px; }
  .trr-rcard__text { font-size: 12.5px; }
  .trr-deckgrid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
  .trr-bar { grid-template-columns: 78px 1fr 34px; }
  .trr-actions .trr-btn { flex: 1 1 100%; }
}

@media (max-width: 420px) {
  .trr-choices { grid-template-columns: 1fr; }
  .trr-slot { width: 78px; }
  .trr-card { width: 78px; }
  .trr-slot__label { font-size: 10px; }
  .trr-fan__card { --w: 40px; }
  .trr-ab { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .trr-app *, .trr-app *::before, .trr-app *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .trr-stars { animation: none; }
}
