/* Arcalink - 毎回ちがうラン (docs/specs/arcalink-run-variety.md): the star pick, the 秘奥 card (4th card of the pick) and its places in the
   result page and the 魔導書. Motion: transform and opacity only. Colour of 秘奥 = pale violet (--arc), apart from silver / gold / forbidden red. */
:root { --arc: #c9a8ff; --arc-hi: #f1e6ff; --arc-lo: #5b3fa8; --arc-bg: #150d2c; }

/* ---------- the star pick (#cards.stpick, built like the start-gem pick .sgem) */
#cards.stpick .cth p.stsub { margin: 2px 0 0; font-size: 12px; color: var(--ar-text-sub); opacity: 1; }
#cards.stpick .cth { display: block; text-align: center; } #cards.stpick .cth h2 { justify-content: center; white-space: nowrap; } #cards.stpick .cth h2::after { content: none !important; display: none; }
#cards.stpick .sgs.stg { padding-top: 28px; gap: clamp(8px, 2vh, 18px); justify-content: flex-start; }
.sg.st { min-height: clamp(104px, 18vh, 152px); gap: 12px; padding: 8px 12px 8px 8px; --fill: linear-gradient(90deg, #1a1738, var(--ar-pit) 70%); --ring: linear-gradient(180deg, var(--ar-brass-hi), var(--ar-brass-lo)); animation: stIn .42s ease-out both; }
.sg.st:nth-child(2) { animation-delay: .08s; } .sg.st:nth-child(3) { animation-delay: .16s; }
@keyframes stIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sg.st.sel { animation: none; --fill: linear-gradient(90deg, #332d6e, #1b1840 72%); --ring: linear-gradient(180deg, #fff6d0, var(--ar-brass-hi)); }
.sg.st .stw { width: 68px; height: 68px; flex: none; display: flex; filter: drop-shadow(0 0 6px rgba(240,207,133,.25)); } .sg.st .stw .ai { width: 100%; height: 100%; }
.sg.st .nm { font-size: 16px; letter-spacing: .06em; color: var(--ar-gold-hi); }
.sg.st .ds { font-size: 12px; line-height: 1.4; color: var(--ar-text); }
.sg .stf { display: flex; align-items: flex-start; gap: 5px; margin-top: 2px; font-size: 11px; line-height: 1.35; color: var(--ar-text-sub); } .sg .stf .dia { --dc: #c8765a; margin-top: 4px; width: 7px; height: 7px; }
@media (max-height: 640px) {
  .sg.st { min-height: 80px; padding: 6px 10px 6px 6px; gap: 10px; } .sg.st .stw { width: 54px; height: 54px; } .sg.st .nm { font-size: 15px; } .sg.st .ds { font-size: 11.5px; line-height: 1.32; } .sg .stf { font-size: 10.5px; }
  #cards.stpick .cth p.stsub { font-size: 11px; margin-top: 0; }
}

/* ---------- the 秘奥 card: the special 4th card of a pick (pale violet frame, nacre light) */
.cd.t3 { --bw: 5px; z-index: 1; background: linear-gradient(135deg, var(--arc-hi), #9b7be0 28%, #efe4ff 52%, var(--arc-lo) 78%, #d4c0ff); }
.cd.t3 .face { background: linear-gradient(90deg, #1c1238, var(--arc-bg) 45%, #251748); box-shadow: inset 0 0 0 1px #6a4cb8, inset 0 0 0 3px #120a26, inset 0 0 0 4px rgba(201,168,255,.75); }
.cd.t3 .face::after { content: ""; position: absolute; top: 0; bottom: 0; left: -14%; width: 10%; z-index: 2; background: linear-gradient(90deg, rgba(220,200,255,0), rgba(230,214,255,.15) 50%, rgba(220,200,255,0)); animation: band3 5s linear infinite; pointer-events: none; will-change: transform; }   /* a thin slanted streak (a tenth of the card), half as bright as before: the wide band read as a flat grey slab */
@keyframes band3 { 0% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(1400%) skewX(-20deg); } }
.cd.t3 .art { width: 104px; background: radial-gradient(circle at 46% 46%, rgba(201,168,255,.3), transparent 64%); border-right: 1px solid rgba(201,168,255,.28); }
.cd.t3 .art::before { content: ""; position: absolute; width: 112px; height: 112px; left: 50%; top: 50%; margin: -56px 0 0 -56px; background: repeating-conic-gradient(rgba(201,168,255,.34) 0 7.5deg, transparent 7.5deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 68%); mask-image: radial-gradient(circle, #000 18%, transparent 68%); animation: spin 40s linear infinite; will-change: transform; }   /* pale-violet rays behind the picture: the same make as the gold card's */
.cd.t3 .gl { width: 85px; height: 85px; z-index: 1; } .cd.t3 .gl .ai { animation: breathe 3.2s ease-in-out infinite; will-change: transform; }
.cd.t3 .tr { color: var(--arc); --dia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M5.5 0L11 5.5L5.5 11L0 5.5Z' fill='%23d9c2ff' stroke='%235b3fa8'/%3E%3C/svg%3E"); }
.cd.t3 .tr::before { width: 34px; background: var(--dia) no-repeat 0 0 / 11px 11px, var(--dia) no-repeat 11px 0 / 11px 11px, var(--dia) no-repeat 22px 0 / 11px 11px; }
.cd.t3 .nm { color: #fff; text-shadow: 0 1px 0 var(--arc-lo), 0 0 8px rgba(201,168,255,.45); } .cd.t3 .ds { opacity: 1; color: #e6dcf8; }
#cards .cd.t3.sel { scale: 1.05; background: linear-gradient(135deg, #fff, #c9a8ff 28%, #fff 52%, #8a6ad8 78%, #efe4ff); }
.cd.t3 .fit.mats { display: flex; align-items: center; gap: 5px; color: var(--arc-hi); opacity: 1; }
#cards .cd .fit.mats .fl { display: inline-flex; align-items: center; gap: 4px; } .fit.mats .fd.arc { width: 8px; height: 8px; background: var(--arc); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); display: inline-block; }
.fit.mats { flex-wrap: wrap; gap: 2px 6px; } .fit.mats .mi { display: inline-flex; align-items: center; gap: 4px; min-width: 0; } .fit.mats .mn { font-size: 11px; font-weight: 700; color: var(--arc-hi); white-space: nowrap; }
.fit.mats .mt { width: 28px; height: 28px; flex: none; display: inline-flex; padding: 1px; background: rgba(10,12,24,.7); border: 1px solid rgba(201,168,255,.5); } .fit.mats .mt .ai, .fit.mats .mt .gem, .fit.mats .mt > svg { width: 100%; height: 100%; }
.fit.mats .pl { font-weight: 800; opacity: .8; }
@media (max-width: 480px) {
  .cd.t3 .art { width: 78px; } .cd.t3 .gl { width: 67px; height: 67px; } .cd.t3 .art::before { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
  #cards .cd .tx > .fit.mats { display: flex; height: auto; min-height: 28px; line-height: 1.2; } #cards .cd .fit.mats .mt { width: 28px; height: 28px; vertical-align: middle; } .fit.mats .mn { font-size: 10.5px; }
  .cd.t3 .tr::before { width: 34px; }
}
.fxgc.arc { background: linear-gradient(90deg, transparent, rgba(190,160,255,.5) 30%, rgba(240,228,255,.95) 50%, rgba(190,160,255,.5) 70%, transparent); }
/* the award: a violet light rising behind the field */
.arcglow { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 55%, rgba(201,168,255,.55), rgba(120,80,210,.2) 45%, transparent 72%); will-change: opacity; }

/* ---------- the result page (取った秘術の並び) */
.pk.st { background: none; border: 0; padding: 0; } .eq .pk.st { width: 42px; height: 42px; }
.pk.t3 { border-color: var(--arc); background: var(--arc-bg); } .eq .pk.t3 { box-shadow: inset 0 0 0 1.5px var(--arc); background: var(--arc-bg); }      /* the same octagon as the other 秘術, in a violet line */
.bk-det.t3 { --ring: linear-gradient(180deg, var(--arc-hi), var(--arc-lo)); }
.mtl { display: block; margin-top: 4px; font-size: 11.5px; color: var(--arc-hi); } .mtl b { font-weight: 700; color: var(--ar-text-sub); margin-right: 6px; }

/* ---------- 魔導書: 星回り cells in the shelves and the 図鑑 */
.gc.st { --ring: linear-gradient(180deg, var(--ar-brass-hi), var(--ar-brass-lo)); } .gc.st .pic .ai { filter: drop-shadow(0 0 4px rgba(240,207,133,.25)); }
.gc.st .nm { white-space: normal; text-align: center; line-height: 1.25; }
.dx.o.got { background: linear-gradient(135deg, #1c1238, var(--ar-pit)); box-shadow: inset 0 0 0 1px rgba(201,168,255,.5); }
.dexd .big .ai.sti { filter: drop-shadow(0 0 4px rgba(240,207,133,.25)); }

/* ---------- four or five cards in one pick (流れ星の夜 and / or a 秘奥): every card is shorter, so the "fits the build" row goes (the card keeps its text) */
@media (max-height: 860px) {
  #cards.many { gap: 5px; } #cards.many .cdl { gap: 5px; }
  #cards.many .cd .tx > .fit:not(.mats) { display: none; }
  #cards.many .cd .tx { padding-top: 4px; padding-bottom: 4px; display: flex; flex-direction: column; justify-content: center; }
  #cards.many .cd .nm { font-size: 14px; } #cards.many .cd .ds, #cards.many .cd .ds.long { font-size: 10.5px; line-height: 1.25; }
  #cards.many .cd .rrs1, #cards.many .cd .rrs2 { display: none; }
  #cards.many .cd .art, #cards.many .cd.t1 .art, #cards.many .cd.t3 .art { width: 60px; } #cards.many .cd .gl, #cards.many .cd.t1 .gl, #cards.many .cd.t0 .gl, #cards.many .cd.t3 .gl { width: 44px; height: 44px; margin-top: 0; } #cards.many .cd.t3 .gl { width: 51px; height: 51px; }
  #cards.many .cd.t0 .art::before, #cards.many .cd.t1 .art::before, #cards.many .cd.t3 .art::before { width: 50px; height: 50px; margin: -25px 0 0 -25px; left: 50%; top: 50%; } #cards.many .cd.t1 .art::after { display: none; }
  #cards.many .cd .rr.rr { min-width: 44px; min-height: 36px; right: 6px; bottom: 4px; padding: 0 2px; } #cards.many .cd .rr svg.coin { display: none; }
  #cards.many .cd .tx > .fit.mats { height: auto; min-height: 26px; line-height: 1.2; margin-top: 0; } #cards.many .cd .fit.mats .mt { width: 26px; height: 26px; } #cards.many .cd .fit.mats .mn { font-size: 10px; }
  #cards.many .cd .tx > .tr { font-size: 9.5px; line-height: 11px; }
  #cards.many .cd:not(.t3) .tx { padding-right: 50px; } #cards.many .cd .tx > * + * { margin-top: 1px; } #cards.many .cd .nm { line-height: 1.15; }
}

/* ---------- the 秘奥 award label: a navy band behind the lettering (clear at both ends), so the second line reads on any field */
#label.band::before { content: ""; position: absolute; left: 0; right: 66px; margin-top: -16px; height: 132px; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(8,12,34,0), rgba(8,12,34,.84) 16%, rgba(8,12,34,.84) 80%, rgba(8,12,34,0)); -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent); }      /* stops short of the weapon strip on the right; soft at the top and bottom too */
#label.band .sub { color: #efe8ff; }
@media (max-width: 380px) { #cards .cd .fit.mats .fl > span { display: none; } #cards .cd .fit.mats { flex-wrap: wrap; gap: 2px 6px; } #cards .cd .fit.mats .pl { display: none; } }      /* (12-01) the two names do not fit one row at 320: the second material wraps below instead of running under the first's frame */      /* a 320 px card: the word 材料 gives way (the diamond stays) so both materials, with their names, stay on one row */
.dx.o.got.sel { box-shadow: inset 0 0 0 2px var(--ar-gold-hi, #f0cf85); }      /* the same gold frame as every other chosen cell */
#cards.forb.many .cdl { gap: 13px; }      /* the 禁呪 chain hangs from the card's top-left into the gap above: 8 px more room so it never covers the card above */
@media (max-height: 860px) { #cards.many .cd.t2 .art::after { top: -2px; width: 28px; height: 62px; left: 6px; } }      /* 4-5 cards: the chain stays inside its own card (it hung into the card above) */

/* ---------- fix round 5 */
#cards.many .cd.t2 { scale: 1; }      /* 4-5 cards: the forbidden card keeps its own box (the 6 % growth pushed its edge over the gold card above: the ochre band) and its chain stays inside it */
#cards.many .cd.t2 .art::after { top: -2px; width: 28px; height: 62px; left: 6px; }
.sg.st { min-height: 0; padding: 16px 12px 16px 8px; }
@media (max-height: 640px) { .sg.st { padding: 8px 10px 8px 6px; min-height: 80px; } }

/* fix round 6: the 禁呪 card on a short screen shows its three rank marks too; a smaller chain that does not cover the picture */
@media (max-height: 700px) { #cards .cd.t2 .tr::before { width: 52px; margin-right: 6px; background: var(--ring) no-repeat 0 0 / 14px 11px, var(--dia) no-repeat 16px 0 / 11px 11px, var(--dia) no-repeat 28px 0 / 11px 11px, var(--dia) no-repeat 40px 0 / 11px 11px; } }
@media (max-height: 860px) { #cards.many .cd.t2 .art::after { top: 0; left: 0; width: 20px; height: 44px; } }

/* ---------- (12-01) a pick that does not fit the screen scrolls instead of cutting a card's text: every card keeps a minimum height that holds its text, the list is as tall as its cards
   (a pick of 3 cards on a normal screen is unchanged: the cards are taller than the minimum), and the pick screen scrolls when the cards need more than the screen has */
#cards { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; } #cards::-webkit-scrollbar { display: none; }
#cards .cdl { min-height: auto; flex: 1 0 auto; }
#cards .cd { min-height: 96px; }      /* (play-screens.js fitCard raises it to the card's own text height) */
#cards .cdl > .cd.t2:last-child .pillar { bottom: -12px; }      /* (the glow below the last card is not scrollable space) */
@media (min-width: 360px) and (min-height: 621px) { #cards .cd:not(.t3) .tx > .ds { padding-right: 60px; } }      /* the 引き直す button sits in the bottom-right corner: a short card's text stops before it */
@media (max-height: 860px) { #cards.many .cd, #cards.many .cd.t2, #cards.many .cd.t3 { min-height: 80px; } }
@media (min-width: 360px) { #cards.forb:has(.opnote) .cdl { padding-top: 28px; } }      /* the 禁呪 chain hangs 28 px above its card: it covered the first characters of the first-time line */
@media (max-width: 359px), (max-height: 620px) { #cards .cd .tx > .fit:not(.mats) .rw1:nth-of-type(n+5), #cards .cd .tx > .fit:not(.mats):has(.num) .rw1:nth-of-type(n+4) { display: none; } }      /* (12-01 QA) three 18 px gem/element icons fit (火・雷・氷 lost its 氷); weapon icons with ×N counts are wider: still two */      /* the weapon pictures beside 「構成に合う」: two fit before the 引き直す button (the third ran under it) */
