/* はつめいロボバトルDX — online.css：オンライン対戦（js/online.js・2026-12-03）
   青焼きの地（.mn-bp）に白い札のカード。ui.css の後に読む。
   決めごと：押せる所は 44px 以上・主操作は 56px 以上。左だけ太い色線は使わない。押下に合わせて光らせない。
   重なり：メニュー（〜46）・ガレージ（〜60）より上、読み込み（300）・切り替え演出（1000）・横向き案内より下 */

/* フリーバトルのカード */
.free-card--online { --tile: #b2f2bb; }

/* ---------- 画面の土台 ---------- */
.ol {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb, 0px);
  z-index: 90;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(10px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  color: #fff;
  font-weight: 800;
}
/* 画面いっぱいの不透明な地なので、見切れのフェード（scroll-fade）は付けない（下のタイトルが透けるため） */
#ol[data-sf-y], #ol[data-sf-x] { -webkit-mask-image: none; mask-image: none; }
.ol[hidden], .ol-dlg[hidden], .ol-wait[hidden], .ol-rebuild[hidden] { display: none !important; }
.ol-col { width: min(100%, 520px); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.ol-head { margin-bottom: 2px; }
.ol-head .scr-title { flex: 0 1 auto; min-width: 0; }

/* ---------- 札（カード） ---------- */
.ol-card {
  background: #fffdf6;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ol-center { align-items: center; text-align: center; }
.ol-center-t { text-align: center; }
.ol-h { margin: 0; font-size: 18px; font-weight: 900; line-height: 1.35; }
.ol-lead { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.7; }
.ol-note { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.6; color: inherit; }
.ol-card .ol-note { color: #5c5647; }
.ol-col > .ol-note { color: #dbe6ff; }
.ol-list { margin: 0; padding: 0 0 0 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 800; line-height: 1.65; }
.ol-parent { margin: 0; padding: 8px 10px; border-radius: 10px; background: #fff3bf; border: 2px solid var(--ink); font-size: 14px; font-weight: 900; line-height: 1.5; }
.ol-warn { margin: 0; font-size: 14px; font-weight: 900; line-height: 1.5; color: #c92a2a; }
.ol-status { margin: 0; min-height: 1.6em; font-size: 14px; font-weight: 800; line-height: 1.6; color: #dbe6ff; text-align: center; }
.ol-tag { margin: 0; align-self: flex-start; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink); background: #fff3bf; color: var(--ink); font-size: 14px; font-weight: 900; line-height: 1.5; }
.is-wait { animation: olBlink 1.6s ease-in-out infinite; }
@keyframes olBlink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- ボタン ---------- */
.ol-btn {
  font-family: inherit;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.ol-btn--main { background: #ff6b2b; color: #fff; }
.ol-btn--sub { background: #fff; color: var(--ink); }
.ol-btn--big { min-height: 60px; font-size: 19px; }
.ol-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ol-btn:disabled { background: #c5cde3; color: #5d6789; box-shadow: 0 4px 0 #5d6789; border-color: #5d6789; cursor: default; }
.ol-link {
  font-family: inherit;
  align-self: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  touch-action: manipulation;
}
.ol-check { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-size: 16px; font-weight: 900; color: #fff; cursor: pointer; }
.ol-check input { width: 26px; height: 26px; accent-color: #ff6b2b; margin: 0; }

/* ---------- ルームのコード ---------- */
.ol-code {
  margin: 0;
  font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: .14em;
  padding-left: .14em;
  color: var(--ink);
}
.ol-url { width: 100%; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--ink); font: inherit; font-size: 14px; color: var(--ink); background: #fff; }
.ol-join { display: flex; gap: 8px; }
.ol-code-in {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.ol-join .ol-btn { flex: 0 0 auto; min-width: 88px; }

/* ---------- ルール（選ぶ札） ---------- */
.ol-seg-wrap { display: flex; flex-direction: column; gap: 6px; }
.ol-seg-label { margin: 0; font-size: 14px; font-weight: 900; color: #5c5647; }
.ol-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
/* ステージ（6つ）は「ナイトスタジアム」が1行に入るよう2列 */
.ol-seg:has(> :nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ol-seg-btn {
  font-family: inherit;
  min-height: 48px;
  padding: 4px 6px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  touch-action: manipulation;
}
.ol-seg-btn b { font-size: 15px; font-weight: 900; line-height: 1.3; }
.ol-seg-btn small { font-size: 12px; font-weight: 800; line-height: 1.3; color: #5c5647; }
.ol-seg-btn.is-on { background: #ffd426; box-shadow: inset 0 0 0 2px var(--ink); }
.ol-seg-btn:disabled { cursor: default; }
.ol-seg-btn:disabled:not(.is-on) { background: #eef1f8; color: #5d6789; border-color: #8b9bc8; }
.ol-start { display: flex; flex-direction: column; gap: 8px; }
.ol-start .ol-note { color: #dbe6ff; }

/* ---------- ロボの札 ---------- */
.ol-bots { display: grid; gap: 8px; }
.ol-bot {
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  text-align: left;
}
button.ol-bot { cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 var(--ink); }
button.ol-bot:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ol-bot.is-sel { background: #fff3bf; box-shadow: 0 3px 0 var(--ink), inset 0 0 0 3px #ff6b2b; }
.ol-bot.is-ng { background: #e9ecf4; color: #5d6789; border-style: dashed; box-shadow: none; }
.ol-bot.is-ng .ol-bot-face { opacity: .45; filter: grayscale(.8); }
.ol-bot-face { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; }
.ol-face { display: block; width: 48px; height: 48px; }
.ol-bot-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ol-bot-name { font-size: 16px; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.ol-bot-txt small { font-size: 13px; font-weight: 800; line-height: 1.4; color: #5c5647; }
.ol-bot-slot:empty { display: none; }
.ol-bot .ol-bot-why { color: #c92a2a; font-weight: 900; }

/* ---------- 何本目・顔合わせ ---------- */
.ol-round {
  margin: 0;
  align-self: center;
  padding: 4px 16px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #ffd426;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
  box-shadow: 0 3px 0 var(--ink);
}
.ol-reveal { min-height: 100%; justify-content: center; padding: 24px 0; }
.ol-rv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  color: var(--ink);
  animation: olPop .42s ease-out both;
}
.ol-rv--foe { background: #ffe3e3; }
.ol-rv--me { background: #e7f5ff; animation-delay: .18s; }
.ol-rv .ol-bot-face, .ol-rv .ol-face { width: 72px; height: 72px; flex-basis: 72px; }
.ol-rv b { font-size: 20px; font-weight: 900; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.ol-rv small { font-size: 14px; font-weight: 900; color: #5c5647; }
.ol-vs {
  margin: 0;
  text-align: center;
  font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: #ffd426;
  text-shadow: 0 3px 0 var(--ink);
  animation: olPop .42s .1s ease-out both;
}
@keyframes olPop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
.ol-reveal .ol-note { color: #dbe6ff; }

/* ---------- 重ねる窓（ぬけますか・しくみと注意） ---------- */
.ol-dlg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb, 0px);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(10, 16, 36, .62);
  animation: p4Fade .18s ease-out;
}
.ol-dlg-box {
  width: min(100%, 420px);
  max-height: 100%;
  overflow-y: auto;
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #fff;
}
.ol-dlg-box--wide { width: min(100%, 520px); }
.ol-dlg-title { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.4; text-align: center; }
.ol-dlg-text { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.7; text-align: center; color: #e6edff; }
.ol-dlg-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ol-dlg-btns .ol-btn { flex: 1 1 140px; }

/* ---------- 試合中の小さな知らせ ---------- */
.ol-wait {
  position: fixed;
  left: 50%;
  top: calc(max(10px, env(safe-area-inset-top)) + 96px);
  transform: translateX(-50%);
  z-index: 56;
  padding: 6px 16px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #fff3bf;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  animation: olBlink 1.6s ease-in-out infinite;
}
.ol-rebuild {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tb, 0px) + max(10px, env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  z-index: 80;
  width: min(calc(100% - 32px), 460px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #fff3bf;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  box-shadow: 0 4px 0 var(--ink);
  pointer-events: none; /* 知らせだけ。下のガレージの操作をさまたげない */
}
.ol-rebuild > span { flex: 1; min-width: 0; }
.ol-rebuild .ol-btn { flex: 0 0 auto; min-height: 48px; padding: 0 14px; font-size: 15px; }

/* ---------- 結果の画面（もう一戦・つぎの試合へ・ぬける） ---------- */
#battle-result.is-online .result-actions > :not(.ol-res) { display: none !important; }
#battle-result.is-online .res-hint,
#battle-result.is-online .result-hint,
#battle-result.is-online .res-rewards,
#battle-result.is-online .result-rewards,
#battle-result.is-online .res-bp,
#battle-result.is-online .result-bp { display: none !important; }
.ol-res { display: flex; flex-direction: column; gap: 8px; }
.ol-res-main:disabled { background: #c5cde3; color: #5d6789; border-color: #5d6789; box-shadow: 0 3px 0 #5d6789; cursor: default; }
.ol-res-note { margin: 0; min-height: 1.5em; font-size: 14px; font-weight: 900; line-height: 1.5; text-align: center; color: #5c5647; }
.ol-res-note:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .is-wait, .ol-wait, .ol-rv, .ol-vs { animation: none; }
}
