* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* hidden 属性で出し入れするものが、この下の display 指定に負けないようにする。
   ブラウザ既定の [hidden]{display:none} は #picker{display:flex} のような
   ID セレクタに常に負けるので、閉じたつもりが閉じない。 */
[hidden] {
  display: none !important;
}

/*
   遊び方は日英どちらも HTML に置いてある（クローラに拾わせるため）。
   JS が走る前は両方見えてしまうので、head のインラインスクリプトが付ける
   html.lang-xx で、要らないほうを先に伏せる。
*/
html.lang-en [data-guide="ja"],
html.lang-ja [data-guide="en"] {
  display: none;
}

/* 演出の長さの倍率。戦闘速度に合わせて main.js が書き換える。
   ここを固定にしていたら、待ち時間だけが2倍になって演出は同じ長さのまま重なり、
   ×0.5 と ×1 が「2倍以上」に感じる状態になっていた。 */
:root { --fx: 1; }

body {
  background: #0b0a10;
  color: #d6d3e0;
  font-family: "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 60px;
}

/* --- Sticky ヘッダー --- */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 10, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.apps-link {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s;
  flex-shrink: 0;
}

.apps-link:hover { color: rgba(255, 255, 255, 0.7); }

.header-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #e8c65c, #c9a227);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(201, 162, 39, 0.4));
}

.title-area {
  text-align: center;
  margin-bottom: 16px;
}

.page-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #efeaf5;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.78rem;
  color: #8a83a0;
  margin-top: 5px;
}

/* --- ステージ --- */
/* 全画面固定にはしない。ページの一部として普通にスクロールする箱に収める。 */
#stage {
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(180deg, #14121c 0%, #100e18 100%);
  border: 1px solid #241f33;
  border-radius: 14px;
  padding: 18px;
}

/* カードが縦長になったので、横に広げすぎないよう幅を絞って中央に置く。
   1200px いっぱいに伸ばすと、カードの左右に余白ばかりが溜まる。 */
#arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

/* 権能名を大きく出す。ここが出ると「何かすごいことが起きた」と伝わる */
#fx-banner,
#team-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* 権能名がいちばん上。canvas（6）にも数字（8）にも隠れない */
  z-index: 9;
}

.fx-banner-text {
  --el: #e8c65c;
  font-size: clamp(1.3rem, 5.2vw, 2.7rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.6);
  paint-order: stroke fill;
  text-shadow: 0 0 14px var(--el), 0 0 34px var(--el), 0 0 70px var(--el), 0 4px 14px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  animation: bannerIn calc(0.85s * var(--fx)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bannerIn {
  0% { opacity: 0; transform: scale(0.55) skewX(-14deg); }
  18% { opacity: 1; transform: scale(1.12) skewX(-14deg); }
  30% { transform: scale(1) skewX(-14deg); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.06) skewX(-14deg); }
}

/* アリーナ全体を属性色で染める */
#arena .arena-flash,
#team-arena .arena-flash {
  position: absolute;
  inset: -14px;
  border-radius: 18px;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at center, var(--el), transparent 70%);
  animation: arenaFlash calc(0.55s * var(--fx)) ease-out forwards;
}

@keyframes arenaFlash {
  0% { opacity: 0.55; }
  100% { opacity: 0; }
}

/* 着弾の輪。太く、二重・三重に広がる */
.fx-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 5px solid var(--el);
  box-shadow: 0 0 22px var(--el), inset 0 0 18px var(--el);
  pointer-events: none;
  animation: burst calc(0.6s * var(--fx)) cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes burst {
  0% { opacity: 1; transform: scale(0.25); border-width: 8px; }
  60% { opacity: 0.55; }
  100% { opacity: 0; transform: scale(14); border-width: 1px; }
}

/* 炸裂の白光 */
.fx-flare {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, var(--el) 42%, transparent 72%);
  animation: flare calc(0.42s * var(--fx)) ease-out forwards;
}

@keyframes flare {
  0% { opacity: 1; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(7); }
}

/* 火花。中心から放射状に散る */
.fx-spark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 999px;
  background: var(--el);
  box-shadow: 0 0 10px var(--el);
  pointer-events: none;
  animation: spark calc(0.55s * var(--fx)) cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
}

@keyframes spark {
  0% { opacity: 1; transform: translate(0, 0) scale(1.4); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

/* 打撃の線 */
.fx-slash {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 130%;
  height: 5px;
  margin-left: -65%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff 30%, var(--el) 50%, #fff 70%, transparent);
  box-shadow: 0 0 20px var(--el);
  animation: slash calc(0.34s * var(--fx)) ease-out forwards;
}

@keyframes slash {
  0% { opacity: 0; transform: rotate(-22deg) scaleX(0); }
  22% { opacity: 1; transform: rotate(-22deg) scaleX(1); }
  100% { opacity: 0; transform: rotate(-22deg) scaleX(1.1); }
}

/* 画面全体の閃光。切り札のときだけ */
#screen-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: radial-gradient(ellipse at center, var(--el, #fff), transparent 72%);
  animation: screenFlash calc(0.55s * var(--fx)) ease-out forwards;
}

@keyframes screenFlash {
  0% { opacity: 0.62; }
  25% { opacity: 0.35; }
  100% { opacity: 0; }
}

/* 絵を主役にする。カード全体がイラストで、名前は下から重ねる */
.slot {
  --el: rgba(255, 255, 255, 0.2);
  position: relative;
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.3s;
}

.slot:hover { border-color: rgba(201, 162, 39, 0.5); }

.slot.filled {
  border-style: solid;
  border-color: color-mix(in srgb, var(--el) 55%, transparent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5),
    inset 0 0 60px color-mix(in srgb, var(--el) 12%, transparent);
}

.slot.filled:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55),
    0 0 26px color-mix(in srgb, var(--el) 35%, transparent);
}

.slot.winner {
  border-color: #e8c65c;
  box-shadow: 0 0 38px rgba(232, 198, 92, 0.38), 0 8px 26px rgba(0, 0, 0, 0.5);
}

.slot.loser { opacity: 0.55; }
.slot.loser .slot-art { filter: grayscale(0.9) brightness(0.7); }

.slot-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.35s, transform 0.35s;
}

.slot.filled:hover .slot-art { transform: scale(1.03); }

/* 未選択 */
.slot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.slot-empty-mark {
  font-size: 2.4rem;
  line-height: 1;
  color: #4a4459;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-empty-text {
  font-size: 0.74rem;
  color: #6b6382;
}

.slot-rank {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 4px 12px 4px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #17130a;
  background: linear-gradient(90deg, #e8c65c, #c9a227);
  border-radius: 13px 0 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 名前まわり。絵の上に重ねるので、下から黒を効かせて可読性を確保する */
.slot-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 34px 8px 12px;
  background: linear-gradient(to top,
    rgba(8, 6, 12, 0.95) 22%,
    rgba(8, 6, 12, 0.72) 52%,
    transparent 100%);
}

/* --- 戦闘演出 --- */
.fighter.lunge { animation: lunge calc(0.34s * var(--fx)) ease; }

/* 殴られた側ものけぞる。攻める側だけ動かすと、当たった感じが出ない */
.fighter.recoil { animation: recoil calc(0.3s * var(--fx)) cubic-bezier(0.2, 0.9, 0.3, 1); }
.fighter[data-side="a"].recoil { animation-name: recoilRev; }
.fighter.recoil.hard { animation: recoilHard calc(0.44s * var(--fx)) cubic-bezier(0.2, 0.9, 0.3, 1); }
.fighter[data-side="a"].recoil.hard { animation-name: recoilHardRev; }

@keyframes recoil {
  0% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(16px, -5px) rotate(2.2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes recoilRev {
  0% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(-16px, -5px) rotate(-2.2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes recoilHard {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  14% { transform: translate(36px, -13px) rotate(5deg) scale(0.955); }
  46% { transform: translate(-7px, 3px) rotate(-1.6deg) scale(1.012); }
  100% { transform: translate(0, 0) rotate(0) scale(1); }
}

@keyframes recoilHardRev {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  14% { transform: translate(-36px, -13px) rotate(-5deg) scale(0.955); }
  46% { transform: translate(7px, 3px) rotate(1.6deg) scale(1.012); }
  100% { transform: translate(0, 0) rotate(0) scale(1); }
}

/* 被弾の瞬間、絵を白く飛ばす */
.fighter.impact .slot-art { animation: impactFlash calc(0.22s * var(--fx)) ease-out; }

@keyframes impactFlash {
  0% { filter: brightness(3.2) contrast(1.4) saturate(0.3); }
  100% { filter: none; }
}

.fighter[data-side="b"].lunge { animation-name: lungeRev; }

@keyframes lunge {
  0% { transform: translateX(0); }
  35% { transform: translateX(16px) scale(1.03); }
  100% { transform: translateX(0); }
}

@keyframes lungeRev {
  0% { transform: translateX(0); }
  35% { transform: translateX(-16px) scale(1.03); }
  100% { transform: translateX(0); }
}

.fighter.skill-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, var(--el), transparent 68%);
  animation: flash calc(0.5s * var(--fx)) ease forwards;
  pointer-events: none;
}

@keyframes flash {
  0% { opacity: 0.72; }
  100% { opacity: 0; }
}

#arena.shake,
#team-arena.shake { animation: shake calc(0.24s * var(--fx)) ease; }

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 5px) rotate(-0.5deg); }
  32% { transform: translate(10px, -6px) rotate(0.6deg); }
  50% { transform: translate(-7px, -4px) rotate(-0.4deg); }
  68% { transform: translate(6px, 4px) rotate(0.3deg); }
  85% { transform: translate(-3px, -2px); }
}

/* 切り札・逆転はステージごと揺らす */
#stage.quake { animation: quake calc(0.5s * var(--fx)) ease-out; }

@keyframes quake {
  0%, 100% { transform: translate(0, 0) scale(1); }
  8% { transform: translate(-16px, 9px) scale(1.012); }
  20% { transform: translate(18px, -11px) scale(1.012); }
  34% { transform: translate(-14px, -8px) scale(1.008); }
  48% { transform: translate(12px, 8px) scale(1.006); }
  64% { transform: translate(-8px, -5px); }
  80% { transform: translate(5px, 3px); }
}

/* 名前板（z-index 2）やフラッシュ（4）より上に出さないと数字が隠れる */
.fx-layer {
  position: absolute;
  inset: 0;
  /* canvas（6）より上。数字が光の下に潜ると読めない */
  z-index: 8;
  pointer-events: none;
}

.fx-pop {
  position: absolute;
  top: 40%;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.85);
  paint-order: stroke fill;
  text-shadow: 0 0 14px currentColor, 0 3px 10px rgba(0, 0, 0, 0.95);
  animation: pop calc(0.9s * var(--fx)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

.fx-hit { color: #fca5a5; }
.fx-crit { color: #fde047; font-size: 2.6rem; }
.fx-skill { color: #f0abfc; font-size: 2.2rem; }
.fx-ultimate { color: #fde047; font-size: 3.2rem; }
.fx-instakill { color: #f87171; font-size: 1.5rem; }
.fx-negate { color: #7dd3fc; font-size: 1.1rem; }
.fx-shield { color: #7dd3fc; font-size: 1.1rem; }
.fx-revive { color: #86efac; font-size: 1.2rem; }
.fx-heal { color: #4ade80; font-size: 1.3rem; }
.fx-cleanse { color: #86efac; font-size: 1rem; }
.fx-poison { color: #a3e635; font-size: 1.2rem; }
.fx-stun { color: #fbbf24; font-size: 1.15rem; }
.fx-doom { color: #f0a5f0; font-size: 1.6rem; }
.fx-counter { color: #fb923c; font-size: 1.3rem; }
.fx-berserk { color: #f87171; font-size: 1.15rem; }
.fx-endure { color: #fcd34d; font-size: 1.15rem; }
.fx-timestop { color: #c084fc; font-size: 1.2rem; }
.fx-whiff { color: #78716c; font-size: 1.05rem; }
.fx-sunder { color: #fb923c; font-size: 1.3rem; }
.fx-fortify { color: #7dd3fc; font-size: 1.05rem; }
.fx-evade { color: #5eead4; font-size: 1.05rem; }
.fx-frenzy { color: #f87171; font-size: 1.15rem; }
.fx-laststand { color: #fde047; font-size: 3rem; }
.fx-miss { color: #9ca3af; font-size: 1rem; }

@keyframes pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.5); }
  18% { opacity: 1; transform: translateY(-6px) scale(1.35); }
  32% { transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-54px) scale(0.95); }
}

/* 権能が出たときは、突進を大きく踏み込ませる */
.fighter.lunge.big { animation: lungeBig calc(0.42s * var(--fx)) cubic-bezier(0.3, 1.4, 0.5, 1); }
.fighter[data-side="b"].lunge.big { animation-name: lungeBigRev; }

@keyframes lungeBig {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(30px) scale(1.09); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes lungeBigRev {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(-30px) scale(1.09); }
  100% { transform: translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .slot.recoil,
  .slot.recoil.hard,
  .slot.impact .slot-art,
  #stage.quake,
  .fx-flare,
  .fx-spark,
  .fx-slash,
  #screen-flash,
  .fighter.lunge,
  .fighter.lunge.big,
  #arena.shake,
  #team-arena.shake,
  .fx-burst,
  #arena .arena-flash,
  #team-arena .arena-flash,
  .fx-banner-text,
  .fighter.skill-flash::after { animation: none; }
  .fx-banner-text { opacity: 1; }
  .fx-pop { animation: popStill calc(0.9s * var(--fx)) ease-out forwards; }
  @keyframes popStill {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
  }
}

.slot-name {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  word-break: break-word;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  line-height: 1.25;
}

.slot-meta {
  font-size: 0.72rem;
  color: #b8b1c9;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.slot-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.tag {
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #b8b1c9;
}

.tag.el { border-color: rgba(201, 162, 39, 0.4); color: #e8c65c; }

#versus {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
}

.vs-mark {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #6b6382;
}

#affinity-note {
  font-size: 0.72rem;
  color: #c9a227;
  text-align: center;
  line-height: 1.4;
  margin-top: 10px;
  min-height: 1.2em;
}

/* --- HP バー --- */
#hp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.hp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #a49dbb;
  margin-bottom: 4px;
}

.hp-num { font-variant-numeric: tabular-nums; }

.hp-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  transition: width calc(0.28s * var(--fx)) ease;
}

.hp-fill.mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.hp-fill.low { background: linear-gradient(90deg, #f87171, #ef4444); }

/* --- 勝敗予想 --- */
#predict-row,
#team-predict {
  margin-top: 16px;
  text-align: center;
}

#predict-question,
.predict-question {
  font-size: 0.92rem;
  font-weight: 700;
  color: #efeaf5;
  margin-bottom: 10px;
}

#predict-buttons,
#team-predict-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.predict-btn {
  --el: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--el) 50%, transparent);
  background: color-mix(in srgb, var(--el) 10%, rgba(255, 255, 255, 0.03));
  color: #f2eefa;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}

.predict-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--el) 35%, transparent);
}

.predict-btn img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

#predict-record {
  font-size: 0.74rem;
  color: #8a83a0;
  margin-top: 9px;
}

#predict-verdict,
#team-verdict {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 6px;
}

#predict-verdict.hit,
#team-verdict.hit { color: #4ade80; }
#predict-verdict.miss,
#team-verdict.miss { color: #fb7185; }

/* --- 操作 --- */
#action-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

#action-row button,
#result-actions button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #ddd8ea;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

#action-row button:hover:not(:disabled),
#result-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
}

#action-row button:active:not(:disabled) { transform: translateY(1px); }

#btn-fight {
  background: linear-gradient(90deg, #c9a227, #a8821a) !important;
  border-color: #d8b53c !important;
  color: #17130a !important;
  min-width: 168px;
}

#btn-fight:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- 戦闘速度 --- */
#speed-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.speed-label {
  font-size: 0.72rem;
  color: #8a83a0;
  margin-right: 2px;
}

.speed-btn {
  font: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #a49dbb;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.speed-btn:hover { background: rgba(255, 255, 255, 0.06); }

#btn-sound {
  font: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.4);
  background: rgba(94, 234, 212, 0.12);
  color: #5eead4;
  cursor: pointer;
  margin-left: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#btn-sound.off {
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #6b6382;
}

.speed-btn.active {
  background: rgba(201, 162, 39, 0.16);
  border-color: rgba(201, 162, 39, 0.55);
  color: #e8c65c;
}

/* --- 戦闘ログ --- */
.battle-log {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #a49dbb;
  padding: 0 2px;
}

.battle-log:empty { display: none; }

.log-line {
  padding: 2px 0;
  animation: logIn 0.22s ease;
  border-left: 2px solid transparent;
  padding-left: 8px;
}

.log-line.side-a { border-left-color: rgba(96, 165, 250, 0.55); }
.log-line.side-b { border-left-color: rgba(248, 113, 113, 0.55); }
.log-line.t-hit { color: #b8b1c9; }
.log-line.t-skill { color: #e8c65c; }
.log-line.t-ultimate {
  color: #fde047;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.12), transparent);
}
.log-line.t-instakill,
.log-line.t-revive,
.log-line.t-doom { color: #f0a5f0; font-weight: 700; }
.log-line.t-negate,
.log-line.t-shield { color: #7dd3fc; }
.log-line.t-poison { color: #a3e635; }
.log-line.t-stun { color: #fbbf24; }
.log-line.t-heal,
.log-line.t-cleanse { color: #86efac; }
.log-line.t-counter,
.log-line.t-reflect { color: #fb923c; }
.log-line.t-berserk { color: #f87171; font-weight: 700; }
.log-line.t-endure { color: #fcd34d; font-weight: 700; }
.log-line.t-timestop { color: #c084fc; font-weight: 700; }
.log-line.t-whiff { color: #78716c; }
.log-line.t-sunder { color: #fb923c; }
.log-line.t-fortify { color: #7dd3fc; }
.log-line.t-evade { color: #5eead4; }
.log-line.t-frenzy { color: #f87171; font-weight: 700; }
.log-line.t-laststand {
  color: #fde047;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.14), transparent);
}
.log-line.t-start,
.log-line.t-note { color: #6b6382; font-style: italic; border-left-color: transparent; }
.log-line.t-end { color: #f2eefa; font-weight: 700; border-left-color: transparent; }
/* チーム戦。1体落ちるのは決着ではないが、区切りとして目に留まってほしい */
.log-line.t-ko { color: #fb7185; font-weight: 700; }

/* 範囲・多段。1行で複数に当たるので、単体攻撃と見分けがつくようにする */
.log-line.t-sweep,
.log-line.t-volley,
.log-line.t-chain { color: #fbbf24; }

.log-line.t-cataclysm {
  color: #fda4af;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(253, 164, 175, 0.6);
}
.log-line.t-miss { color: #6b6382; }

@keyframes logIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- 結果 --- */
#result,
#team-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #241f33;
  text-align: center;
}

#result-headline,
#team-headline {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e8c65c;
  margin-bottom: 4px;
}

#result-detail,
#team-detail {
  font-size: 0.78rem;
  color: #8a83a0;
  margin-bottom: 12px;
}

#result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

#rate-box { margin-top: 14px; }

#rate-bar {
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, #ef4444, #ef4444);
  display: flex;
}

#rate-fill {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  transition: width 0.5s ease;
}

#rate-text {
  font-size: 0.8rem;
  color: #ddd8ea;
  margin-top: 7px;
  font-weight: 700;
}

#result-links,
#team-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.article-link {
  font-size: 0.76rem;
  color: #c9a227;
  text-decoration: none;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 999px;
  padding: 6px 13px;
  transition: background 0.15s;
}

.article-link:hover { background: rgba(201, 162, 39, 0.12); }

/* --- 詳細カード --- */
#detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

#detail-row:empty { display: none; }

.detail-card {
  background: #14121c;
  border: 1px solid #241f33;
  border-radius: 12px;
  padding: 14px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-portrait {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.detail-title { font-size: 0.92rem; font-weight: 700; color: #f2eefa; }
.detail-sub { font-size: 0.7rem; color: #8a83a0; }

.stat-row {
  display: grid;
  grid-template-columns: 34px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #a49dbb;
  margin-bottom: 5px;
}

.stat-track {
  display: block;
  height: 9px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* span のままだと inline 扱いで width も height も効かず、
   バーが一度も塗られない。ここは必ず block にする。 */
.stat-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--c2) 45%, transparent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 項目ごとに色を変えて、どれが伸びている神なのか一目で分かるようにする */
.stat-row[data-stat="hp"] .stat-fill { --c1: #16a34a; --c2: #4ade80; }
.stat-row[data-stat="atk"] .stat-fill { --c1: #dc2626; --c2: #fb7185; }
.stat-row[data-stat="def"] .stat-fill { --c1: #2563eb; --c2: #60a5fa; }
.stat-row[data-stat="spd"] .stat-fill { --c1: #ca8a04; --c2: #fde047; }
.stat-row[data-stat="aut"] .stat-fill { --c1: #7c3aed; --c2: #c084fc; }

.stat-label { color: #a49dbb; }
.stat-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #e7e3f0;
}

.stat-divider {
  height: 1px;
  background: #241f33;
  margin: 9px 0;
}

.stat-row.is-power .stat-fill {
  --c1: #a8821a;
  --c2: #f0d878;
}

.stat-row.is-power .stat-label,
.stat-row.is-power .stat-num { color: #e8c65c; }

.detail-skills {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #241f33;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.detail-skill {
  font-size: 0.73rem;
  line-height: 1.5;
  padding-left: 8px;
  border-left: 2px solid #2c2640;
}

.detail-skill.is-signature { border-left-color: #c9a227; }
.detail-skill b { color: #b8b1c9; }
.detail-skill.is-signature b { color: #e8c65c; }

.skill-src {
  font-size: 0.63rem;
  color: #6b6382;
  margin-left: 6px;
  border: 1px solid #2c2640;
  border-radius: 999px;
  padding: 1px 6px;
}

.skill-desc {
  display: block;
  color: #8a83a0;
  margin-top: 2px;
}

/* --- 神を選ぶモーダル --- */
#picker {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 4, 9, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#picker-panel {
  width: min(560px, 100%);
  max-height: 86svh;
  display: flex;
  flex-direction: column;
  background: #14121c;
  border: 1px solid #2c2640;
  border-radius: 16px 16px 0 0;
  padding: 14px;
}

#picker-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

#picker-search {
  flex: 1;
  font: inherit;
  font-size: 0.86rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2c2640;
  background: #0e0c14;
  color: #ddd8ea;
}

#picker-search:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.6);
}

#picker-close {
  font: inherit;
  font-size: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #2c2640;
  background: #0e0c14;
  color: #a49dbb;
  cursor: pointer;
  flex-shrink: 0;
}

#picker-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}

.filter-chip {
  font: inherit;
  font-size: 0.72rem;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #2c2640;
  background: transparent;
  color: #a49dbb;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-chip.active {
  background: rgba(201, 162, 39, 0.16);
  border-color: rgba(201, 162, 39, 0.5);
  color: #e8c65c;
}

#picker-list {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border: none;
  border-bottom: 1px solid #1c1828;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pick-row:hover { background: rgba(255, 255, 255, 0.05); }
.pick-row:disabled { opacity: 0.35; cursor: not-allowed; }

.pick-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.pick-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: #c9a227;
  width: 34px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.pick-name { font-size: 0.86rem; font-weight: 700; color: #f2eefa; flex: 1; min-width: 0; }
.pick-meta { font-size: 0.68rem; color: #8a83a0; flex-shrink: 0; }

.pick-empty {
  padding: 26px 10px;
  text-align: center;
  color: #6b6382;
  font-size: 0.8rem;
}

/* --- ガイドセクション --- */
#guide-section {
  margin-top: 16px;
  background: #14121c;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #241f33;
}

#guide-section h2 {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: #efeaf5;
}

.guide-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* 4列は横に並べきれない幅がある。200px を切ったら折り返す */
.guide-col { flex: 1 1 200px; min-width: 0; }

.guide-col h4 {
  font-size: 0.8rem;
  color: #e8c65c;
  margin-bottom: 6px;
}

.guide-col ul {
  list-style: none;
  font-size: 0.73rem;
  color: #8a83a0;
  line-height: 1.6;
}

.guide-col li {
  margin-bottom: 4px;
  padding-left: 8px;
  position: relative;
}

.guide-col li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: #5b5470;
}

.guide-col li b { color: #d6d3e0; }

/* --- ブログカード --- */
.blog-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  margin: 24px 0 8px;
}

.blog-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.blog-card-thumb {
  width: 80px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.blog-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.blog-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-card-desc {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-card-url { font-size: 0.7rem; color: rgba(201, 162, 39, 0.7); }
.blog-card-arrow { font-size: 1rem; color: #9ca3af; flex-shrink: 0; }

/* --- 関連アプリ --- */
.related-apps { margin-top: 24px; }

.related-apps-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a83a0;
  margin-bottom: 12px;
}

.related-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.related-app-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.related-app-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.related-app-icon { font-size: 1.5rem; flex-shrink: 0; }
.related-app-info { flex: 1; min-width: 0; }
.related-app-name { font-size: 0.85rem; font-weight: 700; color: #fff; }
.related-app-desc { font-size: 0.7rem; color: #9ca3af; }
.related-app-arrow { font-size: 0.9rem; color: #9ca3af; flex-shrink: 0; }

/* --- 広告セクション --- */
#ad-section {
  margin-top: 16px;
  background: #14121c;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #241f33;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- フッター --- */
#site-footer {
  margin-top: 24px;
  padding: 16px 0 8px;
  text-align: center;
  border-top: 1px solid #241f33;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-link {
  color: #a49dbb;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-link:hover { color: #e8c65c; }
.footer-sep { color: #2c2640; font-size: 0.7rem; }

.footer-refs {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.footer-refs a { color: inherit; text-decoration: underline; }
.footer-refs a:hover { color: rgba(255, 255, 255, 0.75); }

.footer-copy { font-size: 0.7rem; color: #5b5470; }

/* --- 狭い画面 --- */
@media (max-width: 720px) {
  #app { padding: 14px; padding-top: 56px; }

  /* 縦積みにすると向かい合っている感じが消えるので、狭くても左右に並べたまま
     カードだけ縮める。320px 幅でも収まる。 */
  #arena { gap: 6px; }

  #versus { min-width: 34px; }
  .vs-mark { font-size: 1.05rem; }
  #affinity-note { font-size: 0.68rem; }

  .slot-rank { font-size: 0.66rem; padding: 3px 9px 3px 7px; }
  .slot-info { padding: 26px 5px 9px; gap: 4px; }
  .slot-name { font-size: 0.92rem; }
  .slot-meta { font-size: 0.64rem; }
  .slot-tags { gap: 3px; }
  .tag { font-size: 0.58rem; padding: 1px 5px; }
  .slot-empty-mark { width: 46px; height: 46px; font-size: 1.7rem; }
  .slot-empty-text { font-size: 0.66rem; padding: 0 6px; text-align: center; }
  .fx-pop { font-size: 1.15rem; }
  .fx-crit { font-size: 1.4rem; }
  .fx-skill { font-size: 1.3rem; }

  #detail-row { grid-template-columns: 1fr; }
  .guide-content { flex-direction: column; gap: 12px; }
  #action-row button { flex: 1 1 auto; }
  #btn-fight { flex-basis: 100%; }
  .battle-log { max-height: 200px; }
}

/* ================= モード切り替え ================= */
#mode-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.mode-tab {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #8a83a0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mode-tab:hover { background: rgba(255, 255, 255, 0.07); }

.mode-tab.active {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.22), rgba(201, 162, 39, 0.1));
  border-color: rgba(201, 162, 39, 0.6);
  color: #e8c65c;
}

/* ================= トーナメント ================= */
#tournament {
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(180deg, #14121c 0%, #100e18 100%);
  border: 1px solid #241f33;
  border-radius: 14px;
  padding: 18px;
}

#tour-setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.tour-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.tour-label {
  font-size: 0.74rem;
  color: #8a83a0;
  min-width: 48px;
}

.tour-opt {
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #a49dbb;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tour-opt:hover { background: rgba(255, 255, 255, 0.06); }

.tour-opt.active {
  background: rgba(201, 162, 39, 0.16);
  border-color: rgba(201, 162, 39, 0.55);
  color: #e8c65c;
}

#tour-faction {
  font: inherit;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #2c2640;
  background: #0e0c14;
  color: #ddd8ea;
}

#btn-tour-start,
#tour-actions button {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 11px 26px;
  border-radius: 12px;
  border: 1px solid #d8b53c;
  background: linear-gradient(90deg, #c9a227, #a8821a);
  color: #17130a;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.1s, box-shadow 0.2s;
}

#btn-tour-start:hover,
#tour-actions button:hover { box-shadow: 0 0 22px rgba(201, 162, 39, 0.4); }
#btn-tour-start:active { transform: translateY(1px); }
#btn-tour-start:disabled { opacity: 0.4; cursor: not-allowed; }

#tour-actions button:last-child {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ddd8ea;
}

#tour-note {
  font-size: 0.7rem;
  color: #6b6382;
  text-align: center;
}

/* --- 対戦表 --- */
#bracket {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: stretch;
}

#bracket:empty { display: none; }

.round {
  display: flex;
  flex-direction: column;
  min-width: 176px;
  flex: 1;
}

/*
   試合を縦に配るのはここ。見出しを含めずに space-around で配ると、
   n 個の項目が高さを n 等分した各区画の中央に来る。
   次の回戦は項目が半分なので区画がちょうど2倍になり、
   **勝ち上がった試合が、元の2試合の中間にそろう。**

   見出し（.round-title）をこの中に入れてはいけない。
   見出しも1項目として数えられ、回戦ごとに項目数が違うぶんだけ
   取り分が変わって、2回戦以降が下へずれる。
*/
.round-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}

.round-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #8a83a0;
  text-align: center;
  margin-bottom: 2px;
}

.match {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0;
  transform: translateY(8px);
}

/* 開いた試合は押して観戦できる */
.match.shown {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  animation: matchIn calc(0.4s * var(--fx)) ease forwards;
}

.match.shown:hover,
.match.shown:focus-visible {
  border-color: rgba(201, 162, 39, 0.6);
  background: rgba(201, 162, 39, 0.08);
  outline: none;
}

.match.shown::after {
  content: "▶";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.18);
  transition: color 0.15s;
}

.match.shown:hover::after { color: #e8c65c; }

#bracket.revealing .match.shown { cursor: default; pointer-events: none; }
#bracket.revealing .match.shown::after { content: ""; }

.match.watched { border-color: rgba(94, 234, 212, 0.35); }
.match.watched::after { content: "✓"; color: #5eead4; }

@keyframes matchIn {
  to { opacity: 1; transform: translateY(0); }
}

.ent {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid transparent;
  transition: background 0.3s, opacity 0.3s;
}

.ent img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.ent-rank {
  font-size: 0.62rem;
  font-weight: 800;
  color: #c9a227;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}

.ent-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d6d3e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ent.win {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.22), rgba(201, 162, 39, 0.05));
  border-left-color: #e8c65c;
}

.ent.win .ent-name { color: #fff; }
.ent.lose { opacity: 0.34; }
.ent.lose img { filter: grayscale(1); }

/* 優勝 */
.round.champion { min-width: 190px; }
.round.champion .round-body { justify-content: center; }

.champ-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #e8c65c;
  box-shadow: 0 0 34px rgba(232, 198, 92, 0.4);
  aspect-ratio: 3 / 4;
  opacity: 0;
}

.champ-card.shown { animation: champIn calc(0.7s * var(--fx)) cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes champIn {
  0% { opacity: 0; transform: scale(0.7) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.champ-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.champ-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 4px 12px 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #17130a;
  background: linear-gradient(90deg, #f0d878, #c9a227);
  border-radius: 12px 0 12px 0;
}

.champ-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 26px 8px 10px;
  text-align: center;
  background: linear-gradient(to top, rgba(8, 6, 12, 0.96) 24%, transparent);
}

.champ-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 12px rgba(232, 198, 92, 0.7);
}

.champ-sub { font-size: 0.66rem; color: #b8b1c9; }

#tour-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #241f33;
  text-align: center;
}

#tour-champion {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e8c65c;
  margin-bottom: 5px;
}

#tour-detail {
  font-size: 0.78rem;
  color: #8a83a0;
  margin-bottom: 12px;
  line-height: 1.7;
}

#tour-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  #tournament { padding: 12px; }
  .mode-tab { font-size: 0.8rem; padding: 8px 16px; }
  .round { min-width: 152px; }
  .ent img { width: 22px; height: 22px; }
  .ent-name { font-size: 0.7rem; }
  .ent-rank { font-size: 0.58rem; min-width: 26px; }
}

#btn-back-tour {
  background: rgba(201, 162, 39, 0.14) !important;
  border-color: rgba(201, 162, 39, 0.5) !important;
  color: #e8c65c !important;
}

/* ================= 言語切り替え ================= */
#lang-switch {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lang-btn {
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #6b6382;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lang-btn:hover { background: rgba(255, 255, 255, 0.06); }

.lang-btn.active {
  background: rgba(201, 162, 39, 0.16);
  border-color: rgba(201, 162, 39, 0.55);
  color: #e8c65c;
}

@media (max-width: 720px) {
  .lang-btn { font-size: 0.62rem; padding: 3px 8px; }
  .header-logo { font-size: 0.92rem; }
}

/* ================= チーム戦（複数対複数） ================= */
/*
   1体ずつの大きな絵は使えない（最大10体並ぶ）ので、
   横長の一行を1体とし、その中に絵・名前・体力バーを収める。
   演出（突進・のけぞり・火花）は .fighter を共有しているので 1対1 と同じものが乗る。
*/

#team-setup {
  margin-bottom: 14px;
}

#team-arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: start;
}

#team-versus {
  align-self: center;
  padding-top: 22px;
}

.team-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  color: #8a83a0;
  min-height: 1.2em;
}

.team-side[data-side="a"] .team-title { color: #7ea6f0; }
.team-side[data-side="b"] .team-title { color: #f08d8d; }

.team-roster {
  display: grid;
  /* 10体並ぶと縦に長くなるので詰める */
  gap: 6px;
}

.team-unit {
  --el: rgba(255, 255, 255, 0.2);
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 9px 6px 6px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--el) 45%, transparent);
  background: color-mix(in srgb, var(--el) 8%, rgba(255, 255, 255, 0.03));
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.35s, filter 0.35s, border-color 0.2s, box-shadow 0.2s;
}

.team-unit:hover { border-color: rgba(201, 162, 39, 0.55); }

.team-unit.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  justify-content: center;
  color: #6b6382;
  font-size: 0.74rem;
  font-weight: 700;
  min-height: 54px;
}

/* 絵は絶対配置の .slot-art とは別枠。1行の左端に小さく置く */
.unit-art {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  transition: filter 0.35s;
}

.unit-body {
  flex: 1;
  min-width: 0;
}

.unit-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.unit-rank {
  font-size: 0.62rem;
  font-weight: 800;
  color: #c9a227;
  flex-shrink: 0;
}

.unit-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f2eefa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-el {
  margin-left: auto;
  font-size: 0.66rem;
  flex-shrink: 0;
}

.unit-hp-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.unit-hp-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ade80, #86efac);
  transition: width calc(0.3s * var(--fx)) ease;
}

.unit-hp-fill.mid { background: linear-gradient(90deg, #facc15, #fde047); }
.unit-hp-fill.low { background: linear-gradient(90deg, #f87171, #fb7185); }

.team-unit.down {
  opacity: 0.34;
  border-color: rgba(255, 255, 255, 0.1);
}

.team-unit.down .unit-art { filter: grayscale(1) brightness(0.6); }
.team-unit.down .unit-name { text-decoration: line-through; }

.team-side.winner .team-title {
  color: #e8c65c;
  text-shadow: 0 0 16px rgba(232, 198, 92, 0.5);
}

#team-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

#btn-team-fight {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 11px 30px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.6);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.24), rgba(201, 162, 39, 0.08));
  color: #f4e6b0;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}

#btn-team-fight:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(201, 162, 39, 0.3);
}

#btn-team-fight:disabled { opacity: 0.4; cursor: not-allowed; }

#btn-team-swap,
#btn-team-again {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #cfc7e0;
  cursor: pointer;
}

#btn-team-swap:hover,
#btn-team-again:hover { background: rgba(255, 255, 255, 0.09); }

#team-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* 6〜10体いると「誰を殴ったのか」が分からないので、行の末尾に宛先を出す */
.log-target {
  color: #6b6382;
  font-size: 0.92em;
}

#team-log { max-height: 300px; }

@media (max-width: 720px) {
  #team-arena {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  #team-versus { padding: 2px 0; text-align: center; }
  .unit-art { width: 36px; height: 36px; }
  .unit-name { font-size: 0.72rem; }
  #team-log { max-height: 220px; }
}

.fx-pop.fx-ko {
  color: #fb7185;
  font-weight: 900;
  font-size: 0.9rem;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.6);
  paint-order: stroke fill;
  text-shadow: 0 0 12px rgba(251, 113, 133, 0.9);
}

/*
   演出は1対1の大きな絵に合わせた寸法なので、1行ぶんの高さに縮める。
   合わせて overflow を開ける。overflow:hidden のままだと、ダメージの数字が
   行の外へ出た瞬間に切り取られて、何も出ていないように見える。
*/
.team-unit { overflow: visible; z-index: 1; }
.team-unit .unit-art { overflow: hidden; }
.team-unit.lunge,
.team-unit.recoil,
.team-unit.skill-flash { z-index: 3; }

.team-unit .fx-pop {
  font-size: 1.05rem;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.85);
}

.team-unit .fx-burst { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-width: 3px; }
.team-unit .fx-flare { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.team-unit .fx-slash { height: 3px; }
.team-unit.skill-flash::after { border-radius: 11px; }

/* 突進・のけぞりも、行の幅では 16〜36px は大きすぎる */
.team-unit.lunge { animation-name: lungeUnit; }
.team-unit[data-side="b"].lunge { animation-name: lungeUnitRev; }
.team-unit.lunge.big { animation-name: lungeUnitBig; }
.team-unit[data-side="b"].lunge.big { animation-name: lungeUnitBigRev; }

@keyframes lungeUnit {
  0% { transform: translateX(0); }
  35% { transform: translateX(9px) scale(1.02); }
  100% { transform: translateX(0); }
}
@keyframes lungeUnitRev {
  0% { transform: translateX(0); }
  35% { transform: translateX(-9px) scale(1.02); }
  100% { transform: translateX(0); }
}
@keyframes lungeUnitBig {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(16px) scale(1.06); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes lungeUnitBigRev {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(-16px) scale(1.06); }
  100% { transform: translateX(0) scale(1); }
}

.team-unit.recoil { animation-name: recoilUnit; }
.team-unit[data-side="a"].recoil { animation-name: recoilUnitRev; }
.team-unit.recoil.hard { animation-name: recoilUnitHard; }
.team-unit[data-side="a"].recoil.hard { animation-name: recoilUnitHardRev; }

@keyframes recoilUnit {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(9px, -3px) rotate(1.4deg); }
}
@keyframes recoilUnitRev {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(-9px, -3px) rotate(-1.4deg); }
}
@keyframes recoilUnitHard {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  14% { transform: translate(19px, -7px) rotate(3deg) scale(0.97); }
  46% { transform: translate(-4px, 2px) rotate(-1deg) scale(1.008); }
}
@keyframes recoilUnitHardRev {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  14% { transform: translate(-19px, -7px) rotate(-3deg) scale(0.97); }
  46% { transform: translate(4px, 2px) rotate(1deg) scale(1.008); }
}

/* ================= Tier の記章 ================= */
/*
   記事は6段階の Tier で強さを評価していて、「Tier が上の相手にはほぼ勝てない」
   と明言している。戦闘もそのとおりに作ってあるので、順位だけでなく
   どの段にいるのかが一目で分かるようにする。
*/
.tier-badge {
  display: inline-block;
  min-width: 2.4em;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.7em;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  vertical-align: 0.08em;
  color: var(--tier);
  border: 1px solid color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 14%, transparent);
}

.tier-badge.small {
  min-width: 2.1em;
  margin-right: 4px;
  padding: 0 4px;
  font-size: 0.62em;
}

/* --- チーム戦：枠の増減 --- */
.team-add {
  display: block;
  width: 100%;
  padding: 9px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #6b6382;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.team-add:hover {
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(201, 162, 39, 0.07);
  color: #e8c65c;
}

/* 外すボタン。枠の右上に小さく置く */
.unit-drop {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 6;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #8a83a0;
  font: inherit;
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.team-unit:hover .unit-drop,
.team-unit:focus-within .unit-drop { opacity: 1; }
.unit-drop:hover { background: rgba(248, 113, 133, 0.85); color: #fff; }

/* 指で触る端末はホバーが無いので、常に出しておく */
@media (hover: none) {
  .unit-drop { opacity: 1; }
}

#team-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  color: #6b6382;
  text-align: center;
}

.predict-count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
}

/* ================= 属性ごとの演出 =================
   色だけ変えても雷と炎と水が同じ絵に見えてしまうので、形そのものを変える。
   すべて .fx-layer（position:absolute; inset:0）の中に置く前提。
   長さは必ず var(--fx) を掛けて、戦闘速度に追従させる。 */

/* --- 雷：折れ線が上から落ちる --- */


/* 白飛び。雷と光の立ち上がりに重ねる */


/* --- 炎：舌が立ち上がる --- */


/* --- 水：波紋としぶき --- */


/* --- 地：破片が下から突き上がる --- */


/* --- 風：渦が広がる --- */


/* --- 光：放射状の光条 --- */


/* --- 闇：触手が這い寄り、あたりが沈む --- */


@keyframes gloomIn {
  0% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

/* --- 理：幾何の環 --- */


/* ================= 守り・回復 ================= */

/* 六角の盾。攻撃の火花と混ざらないよう、輪郭のはっきりした形にする */
.fx-shield {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 78%;
  aspect-ratio: 1 / 1.12;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--el) 42%, transparent),
    color-mix(in srgb, var(--el) 8%, transparent));
  box-shadow: 0 0 26px var(--el);
  pointer-events: none;
  animation: shieldOn calc(0.72s * var(--fx)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shieldOn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(0.97); }
  40% { transform: translate(-50%, -50%) scale(1.02); }
  70% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.06); }
}

/* 張った守りに当たったときの波紋 */
.fx-ward {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 86%;
  aspect-ratio: 1 / 1.12;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 3px solid #fff;
  box-shadow: 0 0 22px var(--el), inset 0 0 22px var(--el);
  pointer-events: none;
  animation: wardHit calc(0.55s * var(--fx)) ease-out forwards;
}

@keyframes wardHit {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.22); }
}

/* 癒し。下から光が立ち上る */
.fx-heal-aura {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to top, color-mix(in srgb, var(--el) 55%, transparent), transparent 72%);
  pointer-events: none;
  animation: gloomIn calc(0.78s * var(--fx)) ease-out forwards;
}

.fx-mote {
  position: absolute;
  left: var(--x);
  bottom: 2%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--el), 0 0 20px var(--el);
  pointer-events: none;
  animation: moteUp calc(0.85s * var(--fx)) ease-out var(--d) both;
}

@keyframes moteUp {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-72px) scale(1); opacity: 0; }
}

/* ================= 爆発（切り札級だけ） ================= */


/* 衝撃波の環。2枚をずらして重ねる */


/* チーム戦の1行は小さいので、盾を控えめにする */
.team-unit .fx-shield,
.team-unit .fx-ward { width: 58%; }

/* 動きを抑える設定では、新しい演出も止める */
@media (prefers-reduced-motion: reduce) {
  .fx-shield, .fx-ward, .fx-heal-aura, .fx-mote { animation: none; opacity: 0; }
  /* canvas 側は描画そのものを止める */
  .fx-canvas { display: none; }
}

/* ================= 演出用の canvas =================
   属性の演出・爆発はここに描く（src/fx.js）。DOM で描いていたころは
   枠の中に閉じ込められて、線も 2.4px より太くできず地味だった。
   canvas なら加算合成で光が飽和し、shadowBlur で本物の発光が出せる。 */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /*
     重ね順：絵（1〜4）＜ canvas（6）＜ ダメージの数字・権能名（8〜9）。
     数字がこの下に潜ると読めなくなるので、.fx-layer と バナーを必ず上に置く。
  */
  z-index: 6;
}

/* 器のほうに位置の基準が要る（#arena は既に持っているが、明示しておく） */
#arena,
#team-arena { position: relative; }

/* ================= ヘッダーの操作（音・言語） ================= */
/*
   音の入切は 1対1 の «戦闘の速さ» の行に置いていたので、
   チーム戦とトーナメントでは触れなかった。ヘッダーなら全モードから届く。
*/
#header-ctl {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#sound-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
}

#btn-sound {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cfc7e0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

#btn-sound:hover { background: rgba(255, 255, 255, 0.1); }
#btn-sound.off { opacity: 0.45; }

/* 音量。細めのつまみにして、ヘッダーの高さを押し広げない */
#volume {
  -webkit-appearance: none;
  appearance: none;
  width: 76px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: opacity 0.15s;
}

#volume:disabled { opacity: 0.3; cursor: not-allowed; }

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8c65c;
  box-shadow: 0 0 8px rgba(232, 198, 92, 0.6);
  cursor: pointer;
}

#volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #e8c65c;
  box-shadow: 0 0 8px rgba(232, 198, 92, 0.6);
  cursor: pointer;
}

/* ================= 戦っている間 =================
   再生中に編成を変えると、記録された体力を «別の神の最大値» で割ることになり、
   体力バーが振り切れる。押せてしまうこと自体が事故なので、見た目でも止める。 */
.busy,
#slot-a.busy,
#slot-b.busy {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* 枠は button なので disabled が効くが、印を分かりやすくする */
body.is-busy .slot.busy { border-style: dashed; }

@media (max-width: 720px) {
  #header-ctl { gap: 6px; }
  #volume { width: 52px; }
  #btn-sound { font-size: 0.76rem; padding: 3px 5px; }
}

@media (max-width: 420px) {
  /* 幅が足りないときは音量を隠す。入切だけは残す */
  #volume { display: none; }
}

/* ================= 読み込み失敗・JS 無効 ================= */
/*
   どちらも «何も出ない画面» になりがち。壊れているのか、待てばいいのか、
   自分の環境の問題なのかが分からないので、必ず言葉と出口を出す。
*/
#load-error,
#no-js {
  margin: 20px auto;
  max-width: 560px;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.07);
  text-align: center;
}

#no-js {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.07);
  font-size: 0.85rem;
  line-height: 1.8;
  color: #cfc7e0;
}

#no-js a { color: #e8c65c; }

.load-error-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fb7185;
  margin-bottom: 8px;
}

.load-error-note {
  font-size: 0.82rem;
  color: #a49dbb;
  margin-bottom: 16px;
}

.load-error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#btn-reload {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.14);
  color: #f4e6b0;
  cursor: pointer;
}

#btn-reload:hover { background: rgba(201, 162, 39, 0.22); }

.load-error-detail {
  font-size: 0.68rem;
  color: #5c5570;
  font-family: ui-monospace, monospace;
}
