/* シリアルバトル画面 — レシートテーマ */

.serial-battle {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 8px;
  gap: 6px;
}

/* バトルヘッダー: ターン + スコア */
.battle-header {
  text-align: center;
}

.battle-header .turn-info {
  font-family: var(--font-px);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--rc-ink);
}

.battle-header .score-display {
  font-family: var(--font-px);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--rc-ink-fade);
  margin-top: 4px;
}

.score-player {
  color: inherit;
}

.score-enemy {
  color: inherit;
}

/* 手札パネル共通 */
.zone-panel {
  /* no bg, no border */
}

.zone-label {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--rc-ink-fade);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 4px;
}

.hand-cards {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 56px;
}

/* カード */
.hand-card {
  width: 42px;
  height: 56px;
  border: 2px solid var(--rc-ink);
  background: var(--rc-paper);
  color: var(--rc-ink);
  font-family: var(--font-px);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* Inner border */
.hand-card::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--rc-ink-ghost);
  pointer-events: none;
}

.hand-card:hover:not(.locked):not(.used) {
  transform: translateY(-4px);
}

.hand-card.selected {
  transform: translateY(-8px);
  background: var(--rc-ink);
  color: var(--rc-paper);
}

.hand-card.selected::before {
  border-color: rgba(255, 255, 255, 0.2);
}

.hand-card.has-skill::after {
  content: "\2605";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  line-height: 1;
  color: inherit;
}

.hand-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.hand-card.locked::after {
  content: "\00D7";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: var(--rc-ink-fade);
}

.hand-card.lock-ignored {
  border-style: dashed;
  cursor: pointer;
}

.hand-card.used {
  opacity: 0.15;
  cursor: default;
}

.hand-card.enemy-card {
  border-color: var(--rc-ink-fade);
  color: var(--rc-ink-fade);
  cursor: default;
}

.hand-card.enemy-card::before {
  border-color: transparent;
}

/* バトルアリーナ */
.battle-arena {
  border: 2px solid var(--rc-ink);
  padding: 14px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: repeating-conic-gradient(
    var(--rc-paper) 0% 25%,
    var(--rc-paper-dark) 25% 50%
  ) 0 0 / 16px 16px;
}

.arena-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.arena-label {
  font-family: var(--font-px);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--rc-ink-fade);
}

.arena-card {
  width: 54px;
  height: 70px;
  border: 2px solid var(--rc-ink);
  background: var(--rc-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-px);
  font-size: 26px;
  color: var(--rc-ink);
  transition: border-color 0.3s ease;
}

.arena-card.empty {
  border-style: dashed;
  color: var(--rc-ink-ghost);
  background: transparent;
}

.arena-card.win {
  border-width: 3px;
  background: var(--rc-ink);
  color: var(--rc-paper);
}

.arena-card.lose {
  border-style: dashed;
  color: var(--rc-ink-ghost);
  opacity: 0.5;
}

.arena-card.draw-result {
  border-style: dotted;
}

.arena-vs {
  font-family: var(--font-px);
  font-size: 12px;
  color: var(--rc-ink-fade);
  animation: rc-blink 1s step-end infinite;
}

.result-badge {
  font-family: var(--font-px);
  font-size: 8px;
  min-height: 12px;
  letter-spacing: 1px;
  color: var(--rc-ink);
  margin-top: 4px;
}

.result-badge.win {
  background: none;
  color: var(--rc-ink);
}

.result-badge.lose {
  background: none;
  color: var(--rc-ink-fade);
}

.result-badge.draw {
  background: none;
  color: var(--rc-ink-fade);
}

/* ステータスバー (エフェクトログ) */
.battle-status {
  border: 1px solid var(--rc-ink);
  background: var(--rc-paper);
  padding: 8px 12px;
  margin: 6px 0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.battle-status::before {
  content: "> ";
  font-family: var(--font-px);
  font-size: 14px;
  color: var(--rc-ink);
}

.battle-status .status-text {
  display: inline;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--rc-ink);
}

.battle-status .effect-text {
  font-family: var(--font-jp);
  font-size: 12px;
  color: var(--rc-ink-fade);
  margin-top: 4px;
}

.battle-status .effect-text::before {
  content: "* ";
}

/* アクションボタンエリア */
.battle-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.battle-actions .btn {
  flex: 1;
}

/* スキルツールチップ */
.skill-tooltip {
  position: fixed;
  background: var(--rc-paper);
  border: 2px solid var(--rc-ink);
  padding: 8px 10px;
  z-index: 100;
  pointer-events: none;
  max-width: 220px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
  animation: fadeInUp 0.15s ease;
}

.skill-tooltip .skill-name {
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: bold;
  color: var(--rc-ink);
  border-bottom: 1px solid var(--rc-ink);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.skill-tooltip .skill-desc {
  font-family: var(--font-jp);
  font-size: 12px;
  color: var(--rc-ink-fade);
}

/* 宣言カード表示 */
.declared-card-notice {
  font-family: var(--font-jp);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--rc-ink-fade);
  padding: 6px 8px;
  color: var(--rc-ink-fade);
}

/* ロック選択モーダル */
.lock-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 40, 38, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.lock-modal {
  background: var(--rc-paper);
  border: 2px solid var(--rc-ink);
  padding: 20px;
  max-width: 320px;
  width: 100%;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: slideUp 0.3s ease;
}

.lock-modal h3 {
  text-align: center;
  margin-bottom: 12px;
  color: var(--rc-ink);
  font-family: var(--font-jp);
}

.lock-modal .lock-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lock-modal .lock-card {
  width: 44px;
  height: 58px;
  border: 2px solid var(--rc-ink);
  background: var(--rc-paper);
  color: var(--rc-ink);
  font-family: var(--font-px);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.lock-modal .lock-card:hover {
  background: var(--rc-ink);
  color: var(--rc-paper);
}

/* 2Pインタースティシャル */
.interstitial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 40, 38, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  gap: 16px;
  color: var(--rc-paper);
}

.interstitial-overlay h2 {
  font-family: var(--font-px);
  font-size: 18px;
  color: var(--rc-paper);
}

.interstitial-overlay p {
  font-family: var(--font-jp);
  color: var(--rc-paper-dark);
}

/* ============================================================
   Receipt Battle Classes (rc-*) — used by rewritten screens
   ============================================================ */

/* === HAND CARDS === */
.rc-hand {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 56px;
  align-items: flex-end;
  padding: 4px 0;
}

.rc-card {
  width: 42px;
  height: 56px;
  border: 2px solid var(--rc-ink);
  background: var(--rc-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-px);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: transform 0.05s step-end;
  user-select: none;
}
.rc-card::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid var(--rc-ink-ghost);
}
.rc-card.selected {
  background: var(--rc-ink);
  color: var(--rc-paper);
  transform: translateY(-8px);
}
.rc-card.selected::before { border-color: rgba(255,255,255,0.2); }
.rc-card.has-skill::after {
  content: "\2605";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  line-height: 1;
}
.rc-card.selected.has-skill::after { color: var(--rc-paper); }
.rc-card.locked { cursor: not-allowed; opacity: 0.4; }
.rc-card.locked::after {
  content: "\00D7" !important;
  position: absolute;
  font-size: 24px;
  color: var(--rc-ink-fade);
  top: 50%; left: 50%; right: auto;
  transform: translate(-50%, -50%);
}
.rc-card.lock-ignored { border-style: dashed; }
.rc-card.enemy-card {
  border-color: var(--rc-ink-fade);
  cursor: default;
  color: var(--rc-ink-fade);
}
.rc-card.enemy-card::before { border-color: transparent; }

/* === ARENA === */
.rc-arena {
  border: 2px solid var(--rc-ink);
  padding: 14px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: repeating-conic-gradient(var(--rc-paper) 0% 25%, var(--rc-paper-dark) 0% 50%) 0 0 / 8px 8px;
}
.rc-arena-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rc-arena-card {
  width: 54px;
  height: 70px;
  border: 2px solid var(--rc-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-px);
  font-size: 26px;
  background: var(--rc-paper);
}
.rc-arena-card.empty { border-style: dashed; color: var(--rc-ink-ghost); background: transparent; }
.rc-arena-card.win { border-width: 3px; background: var(--rc-ink); color: var(--rc-paper); }
.rc-arena-card.lose { border-style: dashed; color: var(--rc-ink-ghost); opacity: 0.5; }
.rc-arena-card.draw-result { border-style: dotted; }
.rc-arena-label {
  font-family: var(--font-px);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--rc-ink-fade);
}
.rc-arena-result {
  font-family: var(--font-px);
  font-size: 8px;
  min-height: 12px;
  letter-spacing: 1px;
}
.rc-vs {
  font-family: var(--font-px);
  font-size: 12px;
  color: var(--rc-ink-fade);
  animation: rc-blink 1s step-end infinite;
}

/* === HEADER === */
.rc-header { text-align: center; margin-bottom: 6px; }
.rc-turn { font-family: var(--font-px); font-size: 14px; letter-spacing: 2px; }
.rc-score-line { font-family: var(--font-px); font-size: 11px; letter-spacing: 1px; margin-top: 4px; color: var(--rc-ink-fade); }

/* === ZONE === */
.rc-zone { margin-bottom: 6px; }
.rc-zone.is-me {
  outline: 2px solid var(--rc-red);
  outline-offset: 2px;
  padding: 4px;
}
.rc-zone-label {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--rc-ink-fade);
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* === STATUS === */
.rc-status {
  border: 1px solid var(--rc-ink);
  background: var(--rc-paper);
  padding: 8px 12px;
  margin: 6px 0;
  font-family: var(--font-jp);
  font-size: 14px;
  min-height: 42px;
}
.rc-status::before {
  content: '>';
  font-family: var(--font-px);
  font-size: 10px;
  margin-right: 6px;
  color: var(--rc-ink-fade);
}
.rc-status .effect-text {
  font-size: 12px;
  color: var(--rc-ink-fade);
  margin-top: 4px;
  padding-left: 16px;
}
.rc-status .effect-text::before { content: "* "; font-family: var(--font-px); }

/* === DECLARED === */
.rc-declared {
  font-family: var(--font-jp);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--rc-ink-fade);
  padding: 6px 8px;
  margin-bottom: 8px;
  color: var(--rc-ink-fade);
}

/* === TOOLTIP === */
.rc-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--rc-paper);
  border: 2px solid var(--rc-ink);
  padding: 8px 10px;
  max-width: 220px;
  pointer-events: none;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15) !important;
}
.rc-tooltip .skill-name {
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid var(--rc-ink);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.rc-tooltip .skill-desc {
  font-family: var(--font-jp);
  font-size: 12px;
  color: var(--rc-ink-fade);
}

/* アニメーション */
@keyframes rc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
