/* =============================================================================
 * TEAM FORGE — Forge XI Role Avatar detail template (WEB PHASE 1F)
 * Reusable premium role profile for all 20 roles. Builds on forge-xi.css tokens
 * (--fx-*) and reuses its .fx-visual* placeholder classes. All selectors .rd-scoped.
 * Optional sections are rendered only when public-safe data exists (JS hides them),
 * so the template stays balanced with just a portrait placeholder.
 * ========================================================================== */

.rd-main { max-width: var(--fx-maxw); margin: 0 auto; padding: 0 20px; }
@media (min-width: 1441px) { .rd-main { max-width: 1240px; } }

.rd-back { display: inline-block; margin: 22px 0 4px; color: var(--fx-muted); text-decoration: none; font-size: 0.9rem; }
.rd-back:hover { color: var(--fx-gold); }
.rd-back:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 2px; }

.rd-section { padding: clamp(30px, 5vw, 56px) 0; border-top: 1px solid var(--fx-line-soft); }
.rd-eyebrow { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.26em; font-size: 0.74rem; color: var(--fx-gold); margin: 0 0 12px; }
.rd-h2 { font-family: var(--fx-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--fx-ink); margin: 0 0 14px; line-height: 1.12; }
.rd-copy { color: var(--fx-muted); font-size: 1rem; line-height: 1.62; max-width: 66ch; margin: 0 0 10px; }

/* ------------------------------ A. hero ---------------------------------- */
.rd-hero { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; padding: 8px 0 clamp(28px, 4vw, 44px); }
.rd-hero .fx-visual { border: 1px solid var(--fx-line-soft); border-radius: var(--fx-radius); }
.rd-hero-body { align-self: center; }
.rd-fam { color: var(--fx-gold); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; margin: 0 0 10px; }
.rd-ana { display: inline-block; margin: 0 0 12px; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fx-gold-dim); border: 1px solid var(--fx-line-soft); border-radius: 999px; padding: 2px 9px; }
.rd-h1 { font-family: var(--fx-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.02; font-size: clamp(2rem, 5vw, 3.2rem); color: var(--fx-ink); margin: 0 0 12px; }
.rd-role-sub { color: var(--fx-muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; margin: 0 0 14px; }
.rd-understanding { font-size: 1.1rem; line-height: 1.5; color: var(--fx-ink); margin: 0 0 12px; max-width: 60ch; }
/* Approved character story — editorial, generous line-height, readable measure. */
.rd-story { color: var(--fx-muted); font-size: 1.04rem; line-height: 1.78; max-width: 68ch; margin: 0; }
.rd-fcard-role { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fx-gold-dim); margin: 0 0 2px; }
.rd-zone { color: var(--fx-muted); font-size: 0.92rem; margin: 0 0 20px; }
.rd-zone b { color: var(--fx-ink); font-weight: 600; }
.rd-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.rd-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.86rem; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--fx-gold); background: var(--fx-gold); color: #10100c; transition: transform .14s, box-shadow .14s, background .2s, color .2s; }
.rd-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(212,175,55,0.45); }
.rd-btn-ghost { background: transparent; color: var(--fx-ink); border-color: var(--fx-line); }
.rd-btn-ghost:hover { border-color: var(--fx-gold); color: var(--fx-gold); }
.rd-btn:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 3px; }

/* ---------------------- C. tactical contribution ------------------------- */
.rd-contrib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.rd-contrib .col { background: var(--fx-panel); border: 1px solid var(--fx-line-soft); border-radius: var(--fx-radius); padding: 18px; }
.rd-contrib .col h3 { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; color: var(--fx-gold); margin: 0 0 8px; }
.rd-contrib .col ul { margin: 0; padding-left: 18px; color: var(--fx-muted); line-height: 1.55; font-size: 0.9rem; }

/* ---------------------------- E. visual system --------------------------- */
.rd-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.rd-visual-slot .fx-visual { border: 1px solid var(--fx-line-soft); border-radius: var(--fx-radius); }
.rd-visual-slot .cap { margin-top: 8px; font-size: 0.76rem; color: var(--fx-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ------------------------ F/G. item + manifestation ---------------------- */
.rd-panel { background: var(--fx-panel); border: 1px solid var(--fx-line-soft); border-radius: var(--fx-radius); padding: clamp(20px, 3vw, 30px); }
.rd-panel .name { font-family: var(--fx-font-display); font-size: 1.15rem; color: var(--fx-gold); margin: 0 0 8px; }
.rd-hublink { color: var(--fx-gold); text-decoration: none; font-size: 0.9rem; }
.rd-hublink:hover { text-decoration: underline; }

/* -------------------------- H. family navigation ------------------------- */
.rd-family-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.rd-family-link { color: var(--fx-gold); text-decoration: none; font-size: 0.85rem; }
.rd-family-link:hover { text-decoration: underline; }
.rd-family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.rd-fcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--fx-panel); border: 1px solid var(--fx-line-soft); border-radius: var(--fx-radius); overflow: hidden; transition: transform .15s, border-color .15s; }
.rd-fcard:hover { transform: translateY(-3px); border-color: var(--fx-line); }
.rd-fcard:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 2px; }
.rd-fcard-body { padding: 11px 12px 14px; }
.rd-fcard-name { font-family: var(--fx-font-display); font-size: 0.98rem; color: var(--fx-ink); margin: 0 0 3px; }
.rd-fcard-line { font-size: 0.78rem; color: var(--fx-muted); line-height: 1.4; margin: 0; }

/* ------------------------------ I. closing ------------------------------- */
.rd-closing { text-align: center; padding: clamp(40px, 6vw, 76px) 0; }
.rd-closing .rd-cta { justify-content: center; }
.rd-tertiary { margin-top: 18px; }
.rd-tertiary a { color: var(--fx-muted); text-decoration: none; font-size: 0.88rem; }
.rd-tertiary a:hover { color: var(--fx-gold); }

/* ----------------------------- not found --------------------------------- */
.rd-notfound { padding: clamp(60px, 10vw, 120px) 0; max-width: 560px; }
.rd-notfound h1 { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.03em; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--fx-ink); margin: 0 0 12px; }

/* ------------------------------ responsive ------------------------------- */
@media (max-width: 720px) {
  .rd-hero { grid-template-columns: 1fr; }
  .rd-hero .fx-visual { max-width: 300px; }
  .rd-contrib { grid-template-columns: 1fr; }
  .rd-cta { }
}
@media (prefers-reduced-motion: reduce) { .rd-btn, .rd-fcard { transition: none; } }

/* ============================ FLIP DOSSIER (Faz 5) ======================== *
 * Central flip card (front = Z1 identity + tactical block with forgeFront3;
 * back = forgeFull5 + natural-zone mini pitch + synergies + collections).
 * Position micro-accent: GK amber / DF blue / MF green / W-FW red. Background
 * stays the site dark theme; accent is a restrained highlight only. */
[data-position="GK"]  { --pos: #e0a836; }
[data-position="DF"]  { --pos: #4a90d9; }
[data-position="MF"]  { --pos: #3fb37f; }
[data-position="WFW"] { --pos: #e5534b; }

.rd-cardwrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: clamp(18px, 4vw, 40px) 0 clamp(8px, 2vw, 20px); }
.rd-card { perspective: 1600px; width: min(360px, 88vw); }
.rd-card-inner { display: grid; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rd-card[data-face="back"] .rd-card-inner { transform: rotateY(180deg); }
.rd-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--fx-line);
  background: linear-gradient(180deg, #0d1424 0%, #0a0e18 100%); display: flex; flex-direction: column; }
.rd-face-back { transform: rotateY(180deg); }

/* ---- FRONT: Z1 identity ---- */
/* Başlık iki sütun: sol kimlik bloğu, sağ üstte pozisyon + taktik etkiler. */
.rd-cf-z1 { position: relative; padding: 16px 16px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: start; }
.rd-cf-z1-l { min-width: 0; }
.rd-cf-z1-r { display: grid; justify-items: end; gap: 8px; }
.rd-pos { font-family: var(--fx-font-display); font-weight: 700;
  font-size: 0.58rem; letter-spacing: 0.1em; color: #10100c; background: var(--pos, var(--fx-gold)); border-radius: 999px; padding: 2px 9px; }
.rd-cf-eyebrow { display: block; font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.26em; font-size: 0.62rem; color: var(--fx-gold); }
.rd-cf-name { font-family: var(--fx-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.5rem; line-height: 1.02; color: var(--fx-ink); margin: 3px 0 0; }
.rd-cf-wide { display: inline-block; margin-top: 7px; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fx-muted); border: 1px solid var(--fx-line-soft); border-radius: 999px; padding: 2px 9px; }
.rd-cf-z1::after { content: ""; grid-column: 1 / -1; display: block; height: 2px; margin-top: 12px; background: linear-gradient(90deg, var(--pos, var(--fx-gold-dim)), transparent 80%); }

/* ---- FRONT: scene (image or faceted SVG placeholder) ---- */
/* Görsel alanı DİKEY. Master 2:3'tür; çerçeve ALTTAN 1/4 kırpar -> görünen oran 8:9.
   (Genişlik W iken çerçeve 1.125W, görselin ölçeklenmiş boyu 1.5W => %75'i görünür.)
   object-position üstte olduğu için kesilen kısım DAİMA alt çeyrektir. */
.rd-cf-scene { position: relative; aspect-ratio: 8 / 9; margin: 12px 16px 0; border-radius: 10px; overflow: hidden; background: #0a0e18; border: 1px solid var(--fx-line-soft); }
.rd-cf-scene img, .rd-cf-scene svg, .rd-cf-scene video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- FRONT: user line + effects + trait + forgeFront3 ---- */
.rd-cf-userline { margin: 12px 16px 18px; color: var(--fx-ink); font-size: 0.9rem; line-height: 1.4; font-style: italic; }
.rd-cf-effects { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; justify-items: end; }   /* başlığın SAĞ ÜST sütununda */
.rd-cf-effects li { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 0.7rem;
  color: var(--fx-muted); line-height: 1.3; text-align: right; }
.rd-cf-effects svg { width: 10px; height: 10px; color: var(--fx-gold); flex: none; }
.rd-cf-trait { margin: 10px 0 0; }   /* başlık bloğunun içinde: sol üst, pozisyonun altında */
.rd-trait-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.64rem; color: var(--fx-gold); border: 1px solid var(--fx-gold-dim); border-radius: 999px; padding: 4px 12px; }
.rd-trait-badge b { color: var(--fx-ink); font-weight: 600; white-space: nowrap; }
/* Etiket ve değer kendi içinde BÖLÜNMEZ; dar ekranda yalnız aralarından satır atlar. */
.rd-trait-label { white-space: nowrap; }
.rd-forge { margin: 14px 16px 18px; display: grid; gap: 7px; }
.rd-forge-row { display: grid; grid-template-columns: 62px 1fr 20px; align-items: center; gap: 9px; }
.rd-forge-ax { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.56rem; color: var(--fx-muted); }
.rd-forge-bar { height: 6px; border-radius: 999px; background: var(--fx-line-soft); overflow: hidden; }
.rd-forge-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c9a227, var(--fx-gold)); }
.rd-forge-val { font-size: 0.72rem; color: var(--fx-ink); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- BACK ---- */
.rd-cb-id { padding: 16px 16px 0; }
.rd-cb-eyebrow { display: block; font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.58rem; color: var(--fx-gold); }
.rd-cb-name { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.1rem; color: var(--fx-ink); margin: 2px 0 0; }
.rd-cb-id::after { content: ""; display: block; height: 1px; margin-top: 12px; background: var(--fx-line-soft); }
.rd-cb-sec { padding: 0 16px; margin-top: 14px; }
.rd-cb-sec:last-child { margin-bottom: 18px; }
.rd-cb-label { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.56rem; color: var(--fx-muted); margin: 0 0 7px; }
.rd-pitch { position: relative; width: 100%; max-width: 138px; margin: 0 auto; }
.rd-pitch svg { width: 100%; height: auto; display: block; }
.rd-pl { fill: none; stroke: var(--fx-gold-dim); stroke-width: 0.6; opacity: 0.4; }
.rd-zone-band { fill: var(--pos, var(--fx-gold)); opacity: 0.24; }
.rd-zone-label { text-align: center; font-size: 0.68rem; color: var(--fx-ink); margin: 7px 0 0; }
.rd-syn { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-syn-chip { display: flex; flex-direction: column; gap: 1px; text-decoration: none; background: rgba(255,255,255,0.03); border: 1px solid var(--fx-line-soft); border-radius: 8px; padding: 5px 9px; }
.rd-syn-chip:hover { border-color: var(--fx-line); }
.rd-syn-chip:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 2px; }
.rd-syn-eb { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.5rem; color: var(--fx-gold); }
.rd-syn-nm { font-family: var(--fx-font-display); text-transform: uppercase; font-size: 0.72rem; color: var(--fx-ink); line-height: 1.05; }
.rd-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-col-chip { font-family: var(--fx-font-display); font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fx-muted); border: 1px solid var(--fx-line-soft); border-radius: 999px; padding: 3px 10px; }

/* ---- flip control ---- */
.rd-flip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; color: var(--fx-ink); background: transparent; border: 1px solid var(--fx-line); border-radius: 10px; padding: 11px 22px; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.rd-flip:hover { border-color: var(--fx-gold); color: var(--fx-gold); }
.rd-flip:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 3px; }
.rd-flip svg { width: 14px; height: 14px; }

/* ---- systems + first-xi note ---- */
.rd-systems { display: grid; gap: 10px; }
.rd-system-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; background: var(--fx-panel); border: 1px solid var(--fx-line-soft); border-radius: 12px; padding: 14px 16px; color: var(--fx-ink); transition: border-color 0.14s; }
.rd-system-link:hover { border-color: var(--fx-line); }
.rd-system-link:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 2px; }
.rd-system-link .go { color: var(--fx-gold); font-family: var(--fx-font-display); }
.rd-system-link b { color: var(--fx-gold); font-weight: 600; }
.rd-origin-note { margin-top: 18px; display: inline-flex; gap: 6px; align-items: center; color: var(--fx-muted); text-decoration: none; font-size: 0.9rem; border-left: 2px solid var(--fx-gold-dim); padding-left: 12px; }
.rd-origin-note:hover b { color: var(--fx-ink); }
.rd-origin-note b { color: var(--fx-gold); }

/* ---- reduced motion: fade instead of 3D flip ---- */
@media (prefers-reduced-motion: reduce) {
  .rd-card-inner { transition: none; transform: none !important; }
  .rd-face { backface-visibility: visible; -webkit-backface-visibility: visible; transition: opacity 0.2s ease; }
  .rd-face-back { transform: none; }
  .rd-card[data-face="front"] .rd-face-back { opacity: 0; pointer-events: none; }
  .rd-card[data-face="back"] .rd-face-front { opacity: 0; pointer-events: none; }
}

/* ---- Faz 7B-ek: tekil rol kartı satışı (İKİNCİL CTA) ---- */
.rd-single { border-top: 1px solid var(--fx-line-soft); }
.rd-single-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.rd-single-select { background: var(--fx-panel-2); border: 1px solid var(--fx-line-soft); color: var(--fx-ink);
  border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 0.9rem; }
.rd-single-select:focus { outline: none; border-color: var(--fx-gold); }
.rd-single-col { font-family: var(--fx-font-display); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.82rem; color: var(--fx-muted); border: 1px solid var(--fx-line-soft); border-radius: 999px; padding: 7px 14px; }
.rd-single-price { font-family: var(--fx-font-display); font-size: 1.15rem; color: var(--fx-gold); font-variant-numeric: tabular-nums; }
.rd-single-add { background: transparent; color: var(--fx-ink); border-color: var(--fx-line); cursor: pointer; }
.rd-single-add:hover { border-color: var(--fx-gold); color: var(--fx-gold); }

/* Faz 9: opsiyonel rol videosu (9:16). Alan boşken bu bölüm HİÇ oluşturulmaz. */
.rd-video-frame { max-width: 340px; margin: 0 auto; border: 1px solid var(--fx-line); border-radius: 14px;
  overflow: hidden; background: #000; }
.rd-video-el { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }

/* Faz 9: kart sanatı — dosya varsa yüklenince belirir, yoksa DOM'dan çıkar (placeholder kalır).
   Bozuk görsel parlaması olmaması için opacity:0 başlar. */
.rd-cf-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* Üstten hizalı: çerçeve alttan 1/4 kırptığı için görselin üst 3/4'ü görünür. */
  object-position: 50% 0%;
  opacity: 0; transition: opacity .35s ease; }
.rd-cf-art.is-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .rd-cf-art { transition: none; } }

/* ---- Faz 10: koleksiyon kartı vitrini ---- */
.rd-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.rd-cardfig { margin: 0; opacity: 0; transition: opacity .3s ease; }
.rd-cardfig.is-ready { opacity: 1; }
.rd-cardtilt { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 12px; perspective: 900px; }
.rd-cardimg { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--fx-line-soft);
  box-shadow: 0 14px 34px -18px rgba(0,0,0,0.8);
  /* Hafif 3B eğim — SAF CSS. Pointer takibi / gyro YOK. */
  transform: rotateX(0deg) rotateY(0deg) translateZ(0); transform-origin: 50% 60%;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease; }
.rd-cardtilt:hover .rd-cardimg, .rd-cardtilt:focus-visible .rd-cardimg {
  transform: rotateX(6deg) rotateY(-9deg) scale(1.03);
  box-shadow: 0 26px 52px -20px rgba(0,0,0,0.9), 0 0 26px -12px rgba(212,175,55,0.45); }
.rd-cardtilt:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 4px; }
.rd-cardcap { margin-top: 8px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fx-muted); }

.rd-lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(4,6,12,0.92);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.rd-lightbox-img { max-width: min(92vw, 620px); max-height: 88vh; border-radius: 14px;
  border: 1px solid var(--fx-line); box-shadow: 0 30px 70px -24px #000; }
.rd-lightbox-close { position: absolute; top: 16px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--fx-line); background: rgba(12,14,22,0.9); color: var(--fx-ink); font-size: 1.4rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  /* Hareket azaltmada kart DÜZ kalır: eğim ve ölçek yok. */
  .rd-cardimg { transition: none; }
  .rd-cardtilt:hover .rd-cardimg, .rd-cardtilt:focus-visible .rd-cardimg { transform: none; }
}
