/* エクストラステージ「氷の異変」（js/extra.js が作る画面）。toy.css のあとに読む */

/* タイトルの入口（ストーリーのすぐ下）。ストーリーを全部クリアするまでは出さない */
.extra-entry {
  display: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px;
  color: #fff; border-color: #8f7ae0;
  background: linear-gradient(160deg, #6b5bd6, #3a3f9e 70%, #2c2f7a);
  box-shadow: 0 6px 0 #25286a, 0 10px 18px #2c2f7a33;
}
.extra-entry:active:not(:disabled) { box-shadow: 0 2px 0 #25286a; }
.extra-entry-name { display: inline-flex; align-items: center; }
.extra-entry-kicker, .extra-kicker {
  display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .14em;
  padding: 2px 10px; border-radius: 999px; background: linear-gradient(180deg, #ffe08f, #f0b02b); color: #6b4300;
}
.extra-entry-kicker { font-size: 10px; padding: 1px 8px; }

/* 共通 */
.extra-panel .extra-kicker { margin: 0 0 8px; }
.extra-panel .panel-title { margin-bottom: 8px; }
.extra-lead { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: var(--ink); }
.extra-rules {
  list-style: none; margin: 0 0 12px; padding: 10px 14px; text-align: left;
  border-radius: 16px; background: #eef6fd; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.extra-rules li { position: relative; padding-left: 14px; line-height: 1.6; }
.extra-rules li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #8f7ae0; }
.extra-best { margin: 0 0 14px; font-size: 14px; font-weight: 900; color: #4b4fa8; }
.extra-best.new { color: var(--pink-dark); animation: extraPop .5s ease-out; }

/* 次の相手 */
.extra-win { display: none; margin: 0 0 4px; font-size: 22px; font-weight: 900; color: var(--pink-dark); animation: extraPop .45s ease-out; }
.extra-floor { margin: 0 0 6px; font-size: 15px; font-weight: 900; color: #4b4fa8; letter-spacing: .06em; }
.extra-opp { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; }
.extra-opp-card { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.extra-face { width: 104px; height: 104px; display: block; }
.extra-opp-card b { font-size: 18px; font-weight: 900; color: var(--ink); line-height: 1.2; }
.extra-opp-card small { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); }
.extra-opp-card.boss b { color: #c2410c; }
.extra-opp-card em { margin-top: 2px; font-style: normal; font-size: 11px; font-weight: 900; color: #a14a12; background: #fff1e0; border: 1px solid #f3c99b; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.extra-opp.many { gap: 2px; }
.extra-opp.many .extra-face { width: 64px; height: 64px; }
.extra-opp.many .extra-opp-card b { font-size: 14px; }
.extra-opp.many .extra-opp-card small { display: none; }
.extra-opp.many .extra-and { font-size: 14px; }
.extra-and { font-size: 18px; font-weight: 900; color: var(--ink-soft); }
.extra-opp:has(.extra-and) .extra-face { width: 84px; height: 84px; }
.extra-newmod {
  display: none; margin: 2px auto 8px; padding: 4px 14px; width: max-content; max-width: 100%;
  border-radius: 999px; background: linear-gradient(180deg, #8f7ae0, #5a4fc2); color: #fff;
  font-size: 13px; font-weight: 900; animation: extraPop .5s ease-out;
}
.extra-skills { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.extra-skills li { display: flex; align-items: baseline; gap: 8px; padding: 5px 12px; border-radius: 12px; background: #eef7ff; border: 1px solid #cfe5f6; font-size: 12px; }
.extra-skills li b { flex-shrink: 0; font-weight: 900; color: #1f5f93; }
.extra-skills li span { font-weight: 700; color: var(--ink-soft); }
.extra-skills li.new { background: #fff8e6; border-color: #f3cf7a; box-shadow: inset 4px 0 0 #f0a020; }
.extra-skills li.new b { color: #9a5a00; }
.extra-mods-head { margin: 4px 0 6px; font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.extra-mods { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.extra-mods li {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 12px;
  border-radius: 12px; background: #f1effc; border: 1px solid #ddd6f7; font-size: 12.5px;
}
.extra-mods li b { flex-shrink: 0; font-weight: 900; color: #4b3fb0; }
.extra-mods li span { font-weight: 700; color: var(--ink-soft); }
.extra-mods li.new { background: #fff1f7; border-color: #f4a8c7; box-shadow: inset 4px 0 0 var(--pink); }
.extra-mods li.new b { color: var(--pink-dark); }
.extra-mods li.none { justify-content: center; background: #f4f8fc; border-color: #e1ecf5; color: var(--ink-soft); font-weight: 700; }
.extra-mods.small li { padding: 4px 10px; font-size: 11.5px; }

/* 記録 */
.extra-record { margin: 0 0 4px; font-size: 28px; font-weight: 900; color: #3a3f9e; }
#screen-extra-over .result-peng { margin-top: 4px; }

/* 手動の広告（ボタンから十分はなす＝押しまちがい防止） */
.extra-ad { display: none; margin-top: 26px; padding-top: 10px; border-top: 1px dashed #d5e3ee; min-height: 60px; }
.extra-ad-label { margin: 0 0 4px; font-size: 10.5px; font-weight: 700; color: #8aa1b4; text-align: left; }

/* 異変「霧」: 相手の陣地（盤面の上半分）に重ねる canvas（js/extra.js がフラクタルノイズで描く 48×36 を引き伸ばす）。
   盤面の canvas(2) と HUD(5) のあいだ。押せない */
#extra-fog { position: fixed; z-index: 3; display: none; pointer-events: none; image-rendering: auto; }
#extra-fog.show { display: block; }

/* 異変「完全凍結」: リング全体が凍りついた照り（見た目だけ）。斜めの光がゆっくり流れる */
#extra-glaze { position: fixed; z-index: 3; display: none; overflow: hidden; pointer-events: none; border-radius: 6px;
  background: linear-gradient(160deg, rgba(200,236,255,.28), rgba(150,210,245,.14) 45%, rgba(210,240,255,.26));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), inset 0 0 40px rgba(140,205,245,.35); }
#extra-glaze.show { display: block; }
#extra-glaze i { position: absolute; inset: -40% -60%;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0) 0 90px, rgba(255,255,255,.35) 110px, rgba(255,255,255,0) 150px, rgba(255,255,255,0) 260px);
  animation: extraGlaze 7s linear infinite; }
@keyframes extraGlaze { from { transform: translateX(-12%); } to { transform: translateX(12%); } }

/* 異変「嵐」: 盤面全体に風の筋。予兆（warn）はうっすら・吹いている間（gust）ははっきり。向き＝--wind-a */
#extra-wind { position: fixed; z-index: 3; display: none; overflow: hidden; pointer-events: none; }
#extra-wind.show { display: block; }
#extra-wind i {
  position: absolute; left: 50%; top: 50%; width: 260%; height: 260%;
  transform: translate(-50%, -50%) rotate(var(--wind-a, 0deg));
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 70px, rgba(255,255,255,.75) 110px, rgba(255,255,255,0) 150px);
  -webkit-mask-image: repeating-linear-gradient(0deg, #000 0 2px, transparent 2px 26px);
  mask-image: repeating-linear-gradient(0deg, #000 0 2px, transparent 2px 26px);
  opacity: 0; transition: opacity .35s;
}
#extra-wind.warn i { opacity: .35; animation: extraWind .6s linear infinite; }
#extra-wind.gust i { opacity: .85; animation: extraWind .22s linear infinite; }
@keyframes extraWind { from { background-position: 0 0; } to { background-position: 150px 0; } }

@keyframes extraPop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #extra-wind i, #extra-glaze i, .extra-win, .extra-newmod, .extra-best.new { animation: none; } }
@media (max-height: 640px) {
  .extra-face { width: 80px; height: 80px; }
  .extra-opp:has(.extra-and) .extra-face { width: 66px; height: 66px; }
  .extra-rules { font-size: 12px; }
}

/* 伝説（第25戦）・制覇の画面 */
.extra-mods li.legend { background: linear-gradient(110deg, #fff6dc, #fff); border-color: #f0c35a; box-shadow: inset 4px 0 0 #e0a21a; }
.extra-mods li.legend b { color: #9a5a00; }
.extra-opp-card.legend em { white-space: normal; text-align: center; }
.extra-clear .extra-record { color: #b7791f; }
.extra-clear .extra-lead { margin-top: 4px; }

/* 無敵モード（テスト用・?god=1）の札とボタン */
.extra-god { display: none; margin-top: 14px; padding: 8px 10px; border-radius: 12px; border: 2px dashed #f0a020; background: #fff8e6; }
.extra-god p { margin: 0 0 6px; font-size: 12px; font-weight: 900; color: #9a5a00; }
.extra-god .btn { margin: 2px 4px; }

/* 氷の分身のカード（顔を氷っぽく） */
.extra-opp-card.icy .extra-face { filter: saturate(.25) brightness(1.18) drop-shadow(0 0 6px #9fd8ff); opacity: .85; }
.extra-opp-card.icy b { color: #2a7fb8; }

/* スキルのレベルアップ（ストーリーのスキル習得 #skill-got と同じ見た目） */
#extra-lvpop {
  position: fixed; inset: 0; z-index: 25;
  display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(20, 45, 70, .45);
}
#extra-lvpop.show { display: flex; animation: skillGotIn .28s ease-out; }

/* 新しい異変の知らせ（試合の始め・カウントダウンの前） */
#extra-intro {
  position: fixed; inset: 0; z-index: 12; pointer-events: none;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .25s;
}
#extra-intro.show { opacity: 1; }
.extra-intro-card {
  width: min(360px, 100%); padding: 16px 18px 18px; text-align: center;
  border-radius: 22px; background: linear-gradient(180deg, rgba(40,46,120,.94), rgba(28,32,92,.94));
  border: 2px solid #8f7ae0; box-shadow: 0 10px 30px rgba(20,25,70,.45);
  transform: scale(.9); transition: transform .3s cubic-bezier(.2,1.4,.4,1);
}
#extra-intro.show .extra-intro-card { transform: scale(1); }
.extra-intro-kicker { margin: 0 auto 6px; width: max-content; padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .1em; color: #6b4300; background: linear-gradient(180deg, #ffe08f, #f0b02b); }
.extra-intro-name { margin: 0 0 6px; font-size: 30px; font-weight: 900; color: #fff; letter-spacing: .06em; text-shadow: 0 2px 0 #1a1f5e; }
.extra-intro-desc { margin: 0; font-size: 14px; font-weight: 800; color: #dfe6ff; line-height: 1.55; }
#extra-intro.legend .extra-intro-card { background: linear-gradient(180deg, rgba(120,80,10,.95), rgba(70,40,5,.95)); border-color: #f0c35a; }
