/* 総合ページ（パロディの案）の「THE AGENTS」の章：乗せるとスカウターが出る
   番号は並び順で自動（先頭の代表が AGENT 00、次から 01・02…）。人が増えても書き直し不要。
   乗せると：写真が大きくなる・緑の走査線と照準が顔に合う・SCANNING… → IDENTIFIED ✓・
            コードネーム／特技／弱点／スコア（棒が伸びて数字が上がる）／現場力 が下からせり上がる。
   代表だけは現場力が上がりきった所で「計測不能」になり、スカウターが割れる（冗談） */

.ag-ami { counter-reset: ag -1; }
.shiro .ag-ami .ag { height: 580px; }
.ag { --scope: #7CFF6B; counter-increment: ag; cursor: crosshair; outline: none;
  transition: scale .6s var(--yawaraka), filter .5s ease, box-shadow .5s ease; }
.ag-ban::before { content: "AGENT " counter(ag, decimal-leading-zero); }
.ag-boss .ag-ban::after { content: "　／　BOSS"; }
.ag-e { transition: scale 1.2s var(--yawaraka), filter .6s ease; }

/* ── スカウターの層（ふだんは見えない） ── */
.ag-scope { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background:
    repeating-linear-gradient(180deg, rgba(124,255,107,.07) 0 1px, rgba(124,255,107,0) 1px 4px),
    radial-gradient(120% 90% at var(--kao-x, 50%) var(--kao-y, 26%), rgba(124,255,107,0) 30%, rgba(5,20,8,.55) 100%); }
.ag-scope::before { content: ""; position: absolute; inset: 0; background: rgba(124,255,107,.08); mix-blend-mode: screen; }
/* 上から下へ走る読み取りの線 */
.ag-scope::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 60px; opacity: 0;
  background: linear-gradient(180deg, rgba(124,255,107,0), rgba(124,255,107,.35) 85%, rgba(124,255,107,.95)); }

/* 照準（顔の位置 --kao に合わせる） */
.ag-shosen { position: absolute; left: var(--kao-x, 50%); top: var(--kao-y, 26%); width: 130px; height: 130px;
  margin: -65px 0 0 -65px; border-radius: 50%; border: 1.5px solid var(--scope); scale: 1.9; opacity: 0;
  box-shadow: 0 0 18px rgba(124,255,107,.45), inset 0 0 18px rgba(124,255,107,.25);
  transition: scale .7s var(--yawaraka) .1s, opacity .3s ease .1s; }
.ag-shosen::before { content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1.5px dashed rgba(124,255,107,.75); animation: ag-mawaru 6s linear infinite; }
.ag-shosen::after { content: ""; position: absolute; inset: -30px;
  background:
    linear-gradient(var(--scope), var(--scope)) 50% 0 / 1.5px 22px no-repeat,
    linear-gradient(var(--scope), var(--scope)) 50% 100% / 1.5px 22px no-repeat,
    linear-gradient(var(--scope), var(--scope)) 0 50% / 22px 1.5px no-repeat,
    linear-gradient(var(--scope), var(--scope)) 100% 50% / 22px 1.5px no-repeat; }
.ag-lock { position: absolute; left: calc(var(--kao-x, 50%) + 58px); top: calc(var(--kao-y, 26%) - 70px);
  font-size: 11px; letter-spacing: .2em; font-weight: 700; color: var(--scope); white-space: nowrap; opacity: 0;
  text-shadow: 0 0 8px rgba(124,255,107,.8); }
.ag-scan { position: absolute; left: 16px; top: 14px; display: grid; font-size: 12px; letter-spacing: .22em; font-weight: 700;
  color: #0B0B0D; background: var(--scope); padding: 1px 9px; line-height: 1.6; }
.ag-scan > span { grid-area: 1 / 1; white-space: nowrap; }
.ag-scan-2 { opacity: 0; }

/* 下からせり上がるプロフィール */
.ag-ji { width: 100%; box-sizing: border-box; }
.ag-ura { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--yawaraka); }
.ag-ura-naka { overflow: hidden; min-height: 0; }
.ag-ura-naka > * { opacity: 0; translate: 0 14px; transition: opacity .3s ease, translate .5s var(--yawaraka); }
.ag-code { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(124,255,107,.5); font-size: 12px; letter-spacing: .16em;
  font-weight: 700; color: var(--scope); }
.ag-pro { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12px; line-height: 1.55; }
.ag-pro dt { color: #0B0B0D; background: #FFD60A; font-weight: 700; padding: 0 6px; height: fit-content; margin-top: 1px; font-size: 11px; }
.ag-pro dd { margin: 0; color: #F0F0F4; }
.ag-score { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ag-score li { display: grid; grid-template-columns: 7.2em 1fr 2.2em; align-items: center; gap: 8px; font-size: 11px; line-height: 1.3; color: #D8D8DE; }
.ag-sk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-bou { height: 6px; background: rgba(124,255,107,.14); position: relative; overflow: hidden; }
.ag-bou i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(124,255,107,.55), var(--scope));
  box-shadow: 0 0 8px rgba(124,255,107,.7); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.ag-score b { font-weight: 700; font-size: 14px; color: var(--scope); text-align: right; }
.ag-pw { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed rgba(124,255,107,.45); }
.ag-pw span { font-size: 10.5px; letter-spacing: .12em; color: #A8E6A0; font-weight: 700; }
.ag-pw-su { font-weight: 400; font-size: 30px; line-height: 1; color: var(--scope); text-shadow: 0 0 12px rgba(124,255,107,.7); }
.ag-funou { font-family: "Zen Kaku Gothic New", sans-serif; font-weight: 900; font-size: 22px; color: #FF4D4D; text-shadow: 0 0 12px rgba(255,77,77,.7); }

/* ── 乗せた時（キーで選んだ時も同じ） ── */
.ag:is(:hover, :focus-visible) { scale: 1.05; z-index: 5;
  box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 2px var(--scope), 0 0 40px rgba(124,255,107,.3); }
.ag:is(:hover, :focus-visible) .ag-e { scale: 1.14; filter: brightness(1.05) contrast(1.08) saturate(.75); }
.ag:is(:hover, :focus-visible) .up { background: linear-gradient(180deg, rgba(5,5,7,0) 0%, rgba(5,5,7,.25) 30%, rgba(5,5,7,.86) 58%, rgba(5,5,7,.96) 100%); }
.ag:is(:hover, :focus-visible) .ag-scope { opacity: 1; }
.ag:is(:hover, :focus-visible) .ag-scope::after { animation: ag-hashiru 1.1s cubic-bezier(.4, 0, .2, 1) both; }
.ag:is(:hover, :focus-visible) .ag-shosen { scale: 1; opacity: 1; }
.ag:is(:hover, :focus-visible) .ag-lock { animation: ag-chika .5s steps(1) .75s both; }
.ag:is(:hover, :focus-visible) .ag-scan-1 { opacity: 0; transition: opacity 0s .9s; }
.ag:is(:hover, :focus-visible) .ag-scan-2 { opacity: 1; transition: opacity 0s .9s; }
.ag:is(:hover, :focus-visible) .ag-ura { grid-template-rows: 1fr; }
.ag:is(:hover, :focus-visible) .ag-ura-naka > * { opacity: 1; translate: 0 0; }
.ag:is(:hover, :focus-visible) .ag-ura-naka > :nth-child(1) { transition-delay: .15s; }
.ag:is(:hover, :focus-visible) .ag-ura-naka > :nth-child(2) { transition-delay: .22s; }
.ag:is(:hover, :focus-visible) .ag-ura-naka > :nth-child(3) { transition-delay: .29s; }
.ag:is(:hover, :focus-visible) .ag-ura-naka > :nth-child(4) { transition-delay: .36s; }
.ag:is(:hover, :focus-visible) .ag-bou i { width: var(--v); transition-delay: .35s; }
/* ほかの人は暗く */
.ag-ami:has(.ag:is(:hover, :focus-visible)) .ag:not(:hover):not(:focus-visible) { filter: brightness(.35) saturate(.3); scale: .97; }

/* 代表：計測不能でスカウターが割れる（人物.js が .wareta を付ける） */
.ag-boss.wareta .ag-scope { --scope: #FF4D4D; animation: ag-yureru .4s steps(2) 2; }
.ag-boss.wareta .ag-scope::before { background:
  linear-gradient(118deg, transparent 49.6%, rgba(255,255,255,.85) 49.8%, rgba(255,255,255,.85) 50.1%, transparent 50.3%) 0 0 / 100% 100% no-repeat,
  linear-gradient(64deg, transparent 49.6%, rgba(255,255,255,.7) 49.8%, rgba(255,255,255,.7) 50%, transparent 50.2%) 40% 20% / 70% 60% no-repeat,
  linear-gradient(160deg, transparent 49.6%, rgba(255,255,255,.6) 49.8%, rgba(255,255,255,.6) 50%, transparent 50.2%) 70% 30% / 50% 50% no-repeat,
  rgba(255,77,77,.12); mix-blend-mode: normal; }
.ag-boss.wareta .ag-scan { background: #FF4D4D; }
.ag-boss.wareta .ag-scan-2::after { content: "　ERROR"; }

@keyframes ag-mawaru { to { rotate: 360deg; } }
@keyframes ag-hashiru { 0% { opacity: 1; translate: 0 -100%; } 85% { opacity: 1; } 100% { opacity: 0; translate: 0 580px; } }
@keyframes ag-chika { 0% { opacity: 1; } 25% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: .2; } 100% { opacity: 1; } }
@keyframes ag-yureru { 0% { translate: 3px -2px; } 50% { translate: -3px 2px; } 100% { translate: 0 0; } }

/* 指で触る機械では、プロフィールをはじめから開いておく */
@media (hover: none) {
  .ag .ag-ura { grid-template-rows: 1fr; }
  .ag .ag-ura-naka > * { opacity: 1; translate: 0 0; }
  .ag .ag-bou i { width: var(--v); }
}
