/* ───── カード本体のスタイル ─────
   参加者画面(index.html)と管理者画面(admin.php)の両方から読み込む。
   カードの見た目はここだけで決まるので、どちらの画面で焼いても同じ絵になる。
   カードDOMの構造と描画ロジックは card-render.js と対になっている。 */

/* ───── TCG Card (IPPON edition) ───── */
/* flex を使わずブロックにしている。flex アイテムを縮ませる方式は iOS Safari で
   期待どおりに縮まず、カードが 380px のまま左右にはみ出した。 */
.card-stage {
  padding: 40px 20px;
  background:
    radial-gradient(ellipse at center, #4a0e0e 0%, #1a0606 70%);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.card-stage::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,215,0,0.15) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(255,140,0,0.1) 0%, transparent 30%);
  pointer-events: none;
}
/* カードは常に 380x532 で組み、狭い画面では transform で等比縮小する。
   幅だけを縮めると高さが 532px のまま残って縦長になってしまうため、
   縮小はレイアウトではなく transform 側で行う。倍率は app.js が --card-scale に入れる。
   max-width: 100% がはみ出しの最終防波堤（JS が動かなくても親幅を超えない）。 */
.card-scaler {
  --card-scale: 1;
  width: 380px;
  max-width: 100%;
  aspect-ratio: 380 / 532; /* JS が height を実測値で上書きする */
  margin: 0 auto;
}
.tcg-card {
  --type-color: #c0392b;
  --type-color-dark: #7a1f15;
  /* フッターの文字色。通し番号とキャッチフレーズで共有するので、
     片方だけ変わって食い違わないよう1か所に置く。 */
  --footer-ink: rgba(0,0,0,0.3);
  width: 380px;
  height: 532px;
  transform: scale(var(--card-scale, 1));
  transform-origin: top left;
  border-radius: 18px;
  background:
    linear-gradient(135deg, var(--type-color) 0%, var(--type-color-dark) 100%);
  padding: 12px;
  /* 外周は黒フチ1枚だけ。以前は内側に金フチ3px を重ねていたが、
     既存TCGを想起させる要素になるため撤去した（card-render.js の FRAME と対応）。 */
  box-shadow:
    0 0 0 2px rgba(0,0,0,0.45),
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 0 30px rgba(255,255,255,0.15);
  position: relative;
  overflow: hidden;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.tcg-card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0px, transparent 10px,
      rgba(255,255,255,0.05) 10px, rgba(255,255,255,0.05) 12px);
  pointer-events: none;
}
.tcg-inner {
  position: relative;
  background: linear-gradient(180deg, #fffaf0 0%, #f5ecd9 100%);
  height: 100%;
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.tcg-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.tcg-name {
  font-size: 21px; font-weight: 900;
  color: #1a1a2e;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}
.tcg-hp {
  display: flex; align-items: baseline; gap: 4px;
  color: var(--type-color-dark); font-weight: 900;
}
.tcg-hp .hp-label { font-size: 11px; }
.tcg-hp .hp-num { font-size: 24px; line-height: 1; }
.tcg-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--type-color); color: white;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  margin-bottom: 8px; align-self: flex-start;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.tcg-art {
  width: 100%; height: 240px;
  border-radius: 8px; overflow: hidden;
  border: 3px solid var(--type-color-dark);
  background: #ddd;
  margin-bottom: 10px;
  position: relative;
}
.tcg-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* ───── ブランドコンセプト（キャッチコピー）の帯 ─────
   罫線と✦は pseudo-element ではなく実体の span にしている。card-render.js は
   getBoundingClientRect() で位置を読んで canvas に描き直すため、
   ::before / ::after は焼いたPNGに出てこない。 */
/* 見出し（「ブランドコンセプト」）。opacity は使わない：card-render.js は
   getComputedStyle().color しか読まないため、薄さを opacity で作ると
   焼いたPNGでは濃く出てしまう。透明度は色の alpha に持たせる。 */
.tcg-flavor-label {
  text-align: center;
  font-size: 8px; font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(0,0,0,0.42);
  margin-bottom: 3px;
}
.tcg-flavor-band {
  display: flex; align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
/* 罫線は最低幅(basis)を持たせて縮ませない。コピーが長いときは罫線ではなく
   コピー側を折り返させる（罫線が消えて左右のバランスが崩れるのを防ぐ）。 */
.tcg-flavor-rule {
  flex: 1 0 10px;
  height: 1px;
}
.tcg-flavor-rule:first-child {
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
}
.tcg-flavor-rule:last-child {
  background: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
}
.tcg-flavor-mark {
  flex: 0 0 auto;
  font-size: 10px; line-height: 1;
  color: var(--type-color-dark);
}
.tcg-flavor {
  flex: 0 1 auto; min-width: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "MS PMincho", "Noto Serif JP", serif;
  font-style: italic; font-weight: 600;
  font-size: 14px; line-height: 1.45;
  letter-spacing: 0.5px;
  text-align: center;
  color: #24242f;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  white-space: nowrap;
}
.tcg-stats {
  display: flex; gap: 6px; margin-bottom: 8px;
  font-size: 10px;
}
.tcg-stat {
  flex: 1; background: rgba(0,0,0,0.05);
  border-radius: 4px; padding: 4px 6px;
  display: flex; justify-content: space-between;
}
.tcg-stat .label { color: #666; }
.tcg-stat .val { font-weight: 700; color: #1a1a2e; }
.tcg-attack {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--type-color);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
}
.tcg-attack-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 2px;
}
.tcg-attack-name { font-weight: 900; font-size: 13px; color: #1a1a2e; }
.tcg-attack-dmg { font-weight: 900; font-size: 18px; color: var(--type-color-dark); }
.tcg-attack-desc { font-size: 10px; color: #444; line-height: 1.4; }
.tcg-footer {
  margin-top: auto;
  border-top: 1px dashed rgba(0,0,0,0.2);
  padding-top: 6px;
  font-size: 10px;
  color: #555;
  display: flex; justify-content: space-between; align-items: center;
}
/* フッター右の固定キャッチフレーズ。以前はレア度★を再掲していたが、
   レア度は苦手と並ぶステータス行にも出ているので、こちらは文言に置き換えた。
   データではなく固定文なので data-f は持たせず、card-render.js はクラスで引く。 */
.tcg-tagline {
  /* 色は通し番号と揃える（--footer-ink）。文字サイズだけ少し大きくして、
     番号より読ませたい文であることを示す。 */
  color: var(--footer-ink);
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  white-space: nowrap;
}
/* 番号はフッター左端に置く。カード地の上（右上）に白字で載せていたが、
   HPの数字と重なって読みにくかったため、クリーム地の上の薄灰色に変えている。
   中身は受付でお渡しした参加者番号（最長16文字）。canvas への焼き込みは
   1行前提で座標を取るので、折り返さないよう nowrap で固定する。 */
.tcg-corner {
  font-size: 9px; color: var(--footer-ink);
  font-weight: 700; letter-spacing: 1px;
  white-space: nowrap;
}
