/* Arcalink - 寄り道 (D) and 敵の兆し (E) screens (docs/specs/arcalink-run-variety.md). The pick is drawn into #cards (class dtpick, built on the star pick's
   .stpick / .sg.st look in arca-variety.css), the result plate and the 兆し plate sit on the stage. Motion: transform and opacity only. */

/* ---------- the detour pick */
#cards.dtpick .cth { position: relative; }
#cards.dtpick .cth h2 { gap: 10px; }
.dtg { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: var(--ar-text-sub); } .dtg .hi { width: 16px; height: 16px; display: inline-flex; } .dtg .num { font-size: 15px; color: var(--ar-coin); min-width: 0; }
.sg.st.dt { min-height: clamp(92px, 14vh, 118px); }
.sg.st.dt .stw { width: 72px; height: 72px; filter: drop-shadow(0 0 6px rgba(240,207,133,.2)); }
.sg.st.dt .nm { font-size: 16px; }
.sg.st.dt .ds { font-size: 12.5px; line-height: 1.45; }
.sg.st.dt .stf .dia { --dc: #c8765a; }
.sg.st.dt .stf { color: #e9b9a6; }
.sg.st.dt.no { opacity: .6; }
.sg.st.dt.gm .gem { width: 60px; height: 60px; flex: none; }
.sg.st.dt .stf.pr { align-items: center; gap: 10px; color: var(--ar-text-sub); } .sg.st.dt .stf.pr .price { font-size: 15px; } .sg.st.dt .stf.pr .price .num { font-size: 16px; min-width: 0; } .sg.st.dt .stf.pr.short .price { color: var(--ar-danger); } .sg.st.dt .stf.pr i { font-style: normal; font-size: 11px; color: var(--ar-danger); }
.sg.st.dt.gw .wi { width: 56px; height: 56px; flex: none; display: flex; padding: 4px; background: var(--ar-pit); border: 1.5px solid var(--ar-steel-lo); } .sg.st.dt.gw .wi .ai { width: 100%; height: 100%; }
.dtleave { flex: none; display: flex; justify-content: center; margin-top: 2px; } .dtleave .btn { min-height: 44px; font-size: 14px; width: 100%; }
/* the 鍛えの炉: a grid of gems */
.dtgrid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; padding: 6px 2px; touch-action: pan-y; }
.dtg3 { appearance: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 8px; color: var(--ar-text); cursor: pointer; --fr: var(--ar-fr-m); --fill: var(--ar-pit); --ring: color-mix(in srgb, var(--ar-brass) 55%, var(--ar-ink)); transition: transform 120ms; }
.dtg3 .gem { width: 52px; height: 52px; display: block; } .dtg3 .nm { font-size: 13px; font-weight: 800; } .dtg3 .up { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ar-text-sub); } .dtg3 .up .num { font-size: 14px; min-width: 0; } .dtg3 .up .to { color: var(--ar-up); }
.dtg3 .up .ar { width: 14px; height: 10px; background: var(--ar-up); clip-path: polygon(0 35%, 55% 35%, 55% 0, 100% 50%, 55% 100%, 55% 65%, 0 65%); }
.dtg3.sel { transform: scale(1.03); --ring: linear-gradient(180deg, #fff6d0, var(--ar-brass-hi)); --fill: linear-gradient(180deg, #332d6e, #1b1840); }
@media (max-height: 640px) { .sg.st.dt { min-height: 78px; } .sg.st.dt .stw { width: 58px; height: 58px; } .sg.st.dt .nm { font-size: 15px; } .sg.st.dt .ds { font-size: 12px; line-height: 1.38; } .dtg { margin-top: 0; } }
@media (max-width: 359px) { .sg.st.dt .stw { width: 56px; height: 56px; } .sg.st.dt { gap: 9px; padding-right: 9px; } .sg.st.dt .ds { font-size: 11.5px; } .dtgrid { gap: 6px; } }

/* ---------- the result plate (after a detour): icon, name, one line. It sits over the preparation and takes no touches */
.dtres { position: absolute; left: 8px; top: calc(env(safe-area-inset-top) + 104px); z-index: 9; width: min(340px, calc(100% - 84px));   /* (clear of the weapon rail on the right) */ box-sizing: border-box; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; opacity: 0; transform: translateY(-10px); --fr: var(--ar-fr-m); --fill: rgba(11,15,32,.94); --ring: linear-gradient(180deg, var(--ar-brass-hi), var(--ar-brass-lo)); transition: opacity .35s ease-out, transform .35s ease-out; will-change: transform, opacity; }
.dtres.on { opacity: 1; transform: none; }
.dtres .pi { width: 52px; height: 52px; flex: none; display: flex; } .dtres .pi .ai { width: 100%; height: 100%; }
.dtres .pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .dtres .pn { font-size: 14px; letter-spacing: .08em; color: var(--ar-gold-hi); } .dtres .pl { font-size: 12.5px; line-height: 1.4; color: var(--ar-text); } .dtres .pl b { color: var(--ar-mana-x); } .dtres .pl .num { font-size: 14px; min-width: 0; color: inherit; }
.dtres.win { --ring: linear-gradient(180deg, #fff6d0, var(--ar-brass-hi)); --fill: rgba(40,30,8,.95); } .dtres.win .pi { animation: dtPop .5s ease-out both; }
.dtres.lose { --ring: linear-gradient(180deg, #ffb0a0, #7a2a1e); --fill: rgba(30,10,14,.95); }
.dtres.wait .pi { animation: dtWait 1.1s ease-in-out infinite; }
@keyframes dtPop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes dtWait { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- the 敵の兆し plate: preparation = the next wave's omens (icon + name + one line + the gold line); combat = the emblems only */
.omplate { position: absolute; left: 8px; top: calc(env(safe-area-inset-top) + 84px); z-index: 4; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: min(196px, calc(100% - 100px)); box-sizing: border-box; padding: 6px 9px 7px 8px; --fr: var(--ar-fr-m); --fill: rgba(8,11,22,.88); --ring: linear-gradient(180deg, #f0c08a, #8a3a2a 60%, #6e4f24); min-height: 0; }
#depthChip:not(.hide) ~ .omplate { top: calc(env(safe-area-inset-top) + 122px); }
.omplate.hide { display: none; }
.omplate .omh .omx { margin-left: auto; font-style: normal; font-size: 9px; color: var(--ar-text-sub); letter-spacing: 0; }
.omplate .omh { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #ffb7a8; } .omplate .omh .dia { --dc: #c8483a; width: 7px; height: 7px; }
.omr, .omc { display: flex; align-items: center; gap: 7px; }
.omi-w { width: 30px; height: 30px; flex: none; display: flex; } .omi-w .ai { width: 100%; height: 100%; }
.omt { display: flex; flex-direction: column; min-width: 0; } .omt b { font-size: 12.5px; line-height: 1.25; color: var(--ar-text); } .omt span { font-size: 11px; line-height: 1.3; color: var(--ar-text-sub); }
.omg { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ar-coin); border-top: 1px solid rgba(255,255,255,.1); padding-top: 3px; } .omg .hi { width: 14px; height: 14px; display: inline-flex; flex: none; }
.omc { border-top: 1px solid rgba(255,255,255,.1); padding-top: 3px; } .omc b { color: #e3b8ff; }
.omplate.fight { flex-direction: row; gap: 4px; width: auto; padding: 4px 6px; --fr: var(--ar-fr-s); --fill: rgba(8,11,22,.7); pointer-events: none; }
.omplate.fight .omi-w.s { width: 26px; height: 26px; }
@media (max-width: 359px) { .omplate { width: min(200px, calc(100% - 90px)); } .omt span { font-size: 10.5px; } }

/* ---------- 呪われた宝: the relic pick says what it costs (always shown, also on 320 px: it may wrap to 2 lines) */
#relic .rcurse { margin: 5px auto 0; max-width: 420px; padding: 4px 10px; font-size: 12px; line-height: 1.4; color: #ffd2c4; background: rgba(120,24,24,.4); border: 1px solid #8a3328; border-left: 3px solid #e0584a; text-align: left; }
#relic .rcurse b { color: #ff9c86; } #relic .rcurse b:first-child { margin-right: 6px; }      /* (12-01 QA) only the title gets the gap: 「+15%  になります」 had one too */

.dtres .k, .omt .k { display: inline-block; }
.dtres .pl { word-break: keep-all; }
/* the pick: a denser backdrop (old notices never show through), the sub line stays on short screens, the go button holds its place */
#cards.dtpick > .cbg { background: rgba(6,8,18,.99); }
#cards.dtpick .cth p.stsub { display: block; font-size: 11.5px; line-height: 1.35; }
#cards.dtpick .cgo:not(.on) { opacity: .38; }
#cards.dtpick .cth h2 { flex-wrap: wrap; justify-content: center; }
.tomecap { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--ar-text-sub); }
/* the cursed pick keeps the weapon row and the small weapon icon on short / narrow screens too */
#relic:has(.rcurse) .rc .rfit { display: block; } #relic:has(.rcurse) .rc .rk .wi { display: inline-flex; }

.omplate .omg2 { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; letter-spacing: 0; color: var(--ar-coin); } .omplate .omg2 .hi { width: 12px; height: 12px; display: inline-flex; } .omplate .omg2 + .omx { margin-left: 6px; }
.omplate.cmp { gap: 1px; padding: 5px 9px 5px 8px; } .omplate.cmp .omi-w { width: 24px; height: 24px; } .omplate.cmp .omr, .omplate.cmp .omc { gap: 6px; } .omplate.cmp .omt b { font-size: 12px; }


.omt b small { margin-left: 6px; font-size: 10.5px; font-weight: 600; color: var(--ar-text-sub); }
.dtres.win::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 14px 2px rgba(255,236,160,.5); }

/* battle chip: beside the weapon rail, clear of the towers at the top left */
.omplate.fight { left: auto; right: 64px; top: calc(env(safe-area-inset-top) + 90px); }
.omplate.fight .omi-w.s { width: 24px; height: 24px; }
/* 320: the relic cards do not stretch (less empty space above and below the text) */
@media (max-width: 359px) { .rc { max-height: 150px; } }
/* (12-01 QA) the result plate steps aside while the player has a sheet open (it covered the sheet title 「精霊の祠 Lv1」 / 「弓の塔 Lv4」) */
#stage:has(#sheet.on) .dtres { opacity: 0; }
/* (12-01 QA) and while a pick screen (#cards: the forge / tome step, a card pick) is up: the plate covered its first row */
body.incards .dtres { opacity: 0; }
