/* ===================================
   試練祭 / JobTribes Game CSS
   横型メイン / 縦持ち自動切替
=================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg0:    #0a0b11;
  --bg1:    #12131a;
  --bg2:    #1a1d2e;
  --bg3:    #1c2040;
  --bg4:    #252a48;
  --gold:   #d4af37;
  --gold2:  #f0d060;
  --teal:   #00a896;
  --coral:  #e8593c;
  --poison: #8040b0;
  --text:   #f0eee8;
  --muted:  #8890b0;
  --border: rgba(255,255,255,0.08);
  --fire:   #e03030;
  --nature: #2ea84a;
  --water:  #2060d0;
  --thunder:#d4af10;
  --earth:  #c05010;
  --card-w: 380px;
  --card-h: 520px;
  --game-max: 1600px;
}

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

html, body {
  width: 100%; height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ===== ゲームルート =====
   モバイル：全画面
   PC：中央寄せ最大900px幅 */
.game-root {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

@media (min-width: 768px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05060a;
  }
  .game-root {
    width: var(--game-max);
    height: 740px;
    border-radius: 16px;
    border: 1px solid rgba(212,175,55,0.2);
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0,0,0,0.8);
  }
}

/* ===== スクリーン共通 ===== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  top: 0; left: 0;
}
.screen.active { display: flex; }

/* ===== ローディング ===== */
#screenLoading {
  background: var(--bg0);
  align-items: center;
  justify-content: center;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.loading-logo {
  font-size: 48px;
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .1em;
}
.loading-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .15em;
}
.loading-bar-wrap {
  width: 200px;
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 2px;
  transition: width .3s ease;
}
.loading-msg {
  font-size: 11px;
  color: var(--muted);
}

/* ===== アイコン選択 ===== */
#screenIconSelect {
  background: var(--bg1);
  align-items: center;
  justify-content: center;
}
.screen-inner { padding: 24px; width: 100%; max-width: 460px; }
.icon-select-head { text-align: center; margin-bottom: 28px; }
.icon-select-title { font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.icon-select-sub { font-size: 13px; color: var(--muted); }
.icon-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 28px;
}
.icon-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all .2s;
}
.icon-choice:hover { border-color: var(--border); background: var(--bg2); }
.icon-choice.selected { border-color: var(--gold); background: rgba(212,175,55,.1); }
.icon-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.icon-label { font-size: 12px; color: var(--muted); }
.icon-future-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  padding: 8px;
  background: var(--bg2);
  border-radius: 6px;
}

/* ===== ゲームTOP ===== */
#screenTop {
  background: var(--bg1);
  overflow-y: auto;
  scrollbar-width: none;
}
.top-header {
  background: var(--bg2);
  border-bottom: 1px solid rgba(212,175,55,.25);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.top-header-left { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.top-header-info { display: flex; flex-direction: column; gap: 2px; }
.top-day-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
  padding: 2px 7px;
  border-radius: 2px;
  display: inline-block;
}
.top-streak { font-size: 11px; color: var(--muted); }
.top-header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.top-title-en { font-size: 9px; color: var(--gold); letter-spacing: .15em; font-family: 'DM Mono', monospace; }
.top-title-ja { font-size: 18px; font-weight: 900; color: var(--text); letter-spacing: .05em; }
.btn-icon-sm {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.btn-icon-sm:hover { color: var(--text); }

.top-today-bar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}
.today-label { font-size: 10px; color: var(--muted); letter-spacing: .06em; margin-bottom: 2px; }
.today-opponent { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.opponent-attr { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.thunder { background: rgba(212,175,16,.2); color: var(--thunder); }
.today-done-msg { display: flex; flex-direction: column; gap: 2px; }
.today-done-msg span:first-child { font-size: 14px; color: var(--teal); font-weight: 700; }
.tomorrow-note { font-size: 11px; color: var(--muted); }

/* カード選択 */
.card-select-area {
  padding: 14px 16px 0;
  flex-shrink: 0;
}
.card-select-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}
.card-count-badge {
  font-size: 11px;
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--muted);
}
.card-scroll-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}
.card-list {
  display: flex;
  gap: 10px;
  padding-bottom: 8px;
  min-height: 110px;
}

/* カードアイテム */
.card-item {
  flex-shrink: 0;
  width: 82px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.card-item:hover { border-color: rgba(255,255,255,.2); background: var(--bg4); }
.card-item.selected { border-color: var(--gold); background: rgba(212,175,55,.1); }
.card-item-img {
  width: 52px; height: 52px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-item-img img { width: 100%; height: 100%; object-fit: cover; }
.card-item-attr {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.card-item-name {
  font-size: 9px;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-item-rarity {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}
.rarity-Common  { background: rgba(136,144,176,.2); color: #b0b8d0; }
.rarity-Rare    { background: rgba(0,168,150,.2);   color: #4dd4c0; }
.rarity-Epic    { background: rgba(128,64,176,.2);  color: #c080f0; }
.rarity-Legend  { background: rgba(212,175,55,.2);  color: var(--gold); }
.attr-赤  { background: var(--fire); }
.attr-青  { background: var(--water); }
.attr-緑  { background: var(--nature); }
.attr-黄  { background: var(--thunder); }
.attr-紫  { background: var(--poison); }
.attr-橙  { background: var(--earth); }

/* 作戦 */
.tactics-area {
  padding: 14px 16px 0;
  flex-shrink: 0;
}
.tactics-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.tactics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tactic-btn {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tactic-btn:hover { background: var(--bg4); color: var(--text); }
.tactic-btn.active { border-color: var(--teal); color: var(--teal); background: rgba(0,168,150,.1); }
.tactic-icon { font-size: 14px; line-height: 1; }
.tactic-name { font-size: 10px; font-weight: 700; }
.tactic-sub  { font-size: 8px; opacity: .7; }

/* 挑むボタン */
.challenge-action {
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-challenge {
  width: 100%;
  max-width: 320px;
  height: 48px;
  background: var(--teal);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
  letter-spacing: .05em;
}
.btn-challenge:hover:not(:disabled) { background: #008a7c; transform: translateY(-1px); }
.btn-challenge:disabled { background: var(--bg3); color: var(--muted); cursor: not-allowed; }
.challenge-hint { font-size: 11px; color: var(--muted); }

/* ===== バトルフィールド ===== */
#screenBattle {
  background: var(--bg0);
}
.battle-field {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 背景 */
.battle-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.battle-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,175,55,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.battle-bg-glow {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}
.battle-bg-glow.left  { left: -80px; top: 50%; transform: translateY(-50%); background: var(--teal); }
.battle-bg-glow.right { right: -80px; top: 50%; transform: translateY(-50%); background: var(--poison); }
.battle-bg-particles { position: absolute; inset: 0; pointer-events: none; }

/* バトルレイアウト：横型 */
.battle-layout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 16px;
  gap: 0;
}

/* 各サイド */
.battle-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.side-label {
  font-size: 10px;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--muted);
}
.player-label { color: var(--teal); }
.enemy-label  { color: var(--poison); }

/* バトルカード */
.battle-card-wrap {
  position: relative;
}
.battle-card {
  width: 120px;
  background: var(--bg3);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all .4s;
}
.player-card { border-color: var(--teal); transform: rotate(-8deg) translateY(0); }
.enemy-card  { border-color: var(--poison); transform: rotate(8deg) translateY(0); }

.battle-card-img {
  height: 100px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.battle-card-img img { width: 100%; height: 100%; object-fit: cover; }
.battle-card-placeholder {
  font-size: 36px;
  color: var(--muted);
  opacity: .4;
}
.enemy-img { background: linear-gradient(135deg, #1a1030, #2a1060); }
.nyan-face { font-size: 48px; animation: float 3s ease-in-out infinite; }
.battle-card-info { padding: 6px 8px; }
.battle-card-name { font-size: 9px; font-weight: 700; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.battle-card-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.battle-card-rarity, .enemy-rarity { font-size: 8px; padding: 1px 4px; border-radius: 2px; background: rgba(128,64,176,.2); color: #c080f0; }
.battle-card-attr, .thunder-attr { font-size: 8px; color: var(--thunder); font-weight: 700; }

.tactic-badge {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* VS中央 */
.battle-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  width: 80px;
  flex-shrink: 0;
}
.vs-text {
  font-size: 22px;
  font-weight: 900;
  color: rgba(212,175,55,.4);
  letter-spacing: .1em;
  font-family: 'DM Mono', monospace;
}
.battle-score-area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  transition: opacity .5s;
}
.score-player { font-size: 20px; font-weight: 700; color: var(--teal); }
.score-sep    { font-size: 14px; color: var(--muted); }
.score-enemy  { font-size: 20px; font-weight: 700; color: var(--poison); }
.effect-layer {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
}

/* バトルログ */
.battle-log-wrap {
  position: relative;
  z-index: 1;
  background: rgba(10,11,17,.85);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
}
.battle-log { display: flex; flex-direction: column; gap: 2px; }
.log-line {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  padding: 2px 0;
  opacity: 0;
  transition: opacity .3s;
  min-height: 1.5em;
}
.log-line.show { opacity: 1; }
.log-line.log-highlight { color: var(--gold2); }
.log-line.log-skill     { color: var(--thunder); font-weight: 700; }
.log-line.log-win       { color: var(--teal); font-weight: 700; font-size: 13px; }
.log-line.log-lose      { color: var(--coral); font-weight: 700; font-size: 13px; }
.log-line.log-score     { color: var(--gold); font-family: 'DM Mono', monospace; }

/* ===== 縦持ちレイアウト切替 ===== */
@media (max-width: 540px) and (orientation: portrait) {
  .battle-layout {
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
  }
  .battle-side {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    width: 100%;
    flex: 0 0 auto;
  }
  .side-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 9px;
    height: auto;
  }
  .battle-center {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
  .battle-card { width: 100px; }
  .battle-card-img { height: 80px; }
  .nyan-face { font-size: 38px; }
}

/* ===== 結果画面 ===== */
#screenResult {
  background: var(--bg1);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.result-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.result-verdict { text-align: center; }
.verdict-icon { font-size: 52px; margin-bottom: 8px; }
.verdict-text { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.verdict-sub  { font-size: 13px; color: var(--muted); }
.verdict-win  .verdict-text { color: var(--teal); }
.verdict-lose .verdict-text { color: var(--coral); }

.result-score-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13px;
}
.score-row:last-child { border-bottom: none; }
.score-label { color: var(--muted); }
.score-val { font-family: 'DM Mono', monospace; font-weight: 700; font-size: 16px; }
.player-score { color: var(--teal); }
.enemy-score  { color: var(--poison); }
.score-break  { font-size: 10px; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); line-height: 1.8; }

.fortune-reveal {
  background: rgba(212,175,55,.06);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}
.fortune-label { font-size: 10px; color: var(--muted); letter-spacing: .1em; margin-bottom: 6px; }
.fortune-grade { font-size: 24px; font-weight: 900; color: var(--gold); margin-bottom: 6px; }
.fortune-msg   { font-size: 12px; color: var(--gold2); line-height: 1.6; }

.result-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===== ステータス ===== */
#screenStatus {
  background: var(--bg1);
  overflow-y: auto;
  scrollbar-width: none;
}
.status-header {
  background: var(--bg2);
  border-bottom: 1px solid rgba(212,175,55,.2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.btn-back {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color .15s;
}
.btn-back:hover { color: var(--text); }
.status-title { font-size: 16px; font-weight: 700; }
.status-body { padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.status-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.status-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.status-username { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.status-rank { font-size: 12px; color: var(--teal); font-weight: 700; }
.status-section { display: flex; flex-direction: column; gap: 10px; }
.status-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-total-badge {
  font-size: 11px;
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 400;
}
.status-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stat-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}
.stat-num { font-size: 20px; font-weight: 700; color: var(--text); font-family: 'DM Mono', monospace; }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.status-cards-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.status-tab {
  padding: 7px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.status-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.status-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

/* ===== ボタン共通 ===== */
.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--teal);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #008a7c; }
.btn-primary:disabled { background: var(--bg3); color: var(--muted); cursor: not-allowed; }
.btn-secondary {
  width: 100%;
  height: 44px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn-secondary:hover { background: var(--bg3); color: var(--text); }

/* ===== アニメーション ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes shake {
  0%, 100% { transform: rotate(8deg); }
  25% { transform: rotate(8deg) translateX(-6px); }
  75% { transform: rotate(8deg) translateX(6px); }
}
@keyframes shake-player {
  0%, 100% { transform: rotate(-8deg); }
  25% { transform: rotate(-8deg) translateX(-6px); }
  75% { transform: rotate(-8deg) translateX(6px); }
}
@keyframes slam {
  0%   { transform: rotate(-8deg) translateX(0); }
  40%  { transform: rotate(-2deg) translateX(60px); }
  60%  { transform: rotate(-2deg) translateX(60px); }
  100% { transform: rotate(-8deg) translateX(0); }
}
@keyframes hit-flash {
  0%, 100% { filter: brightness(1); }
  30% { filter: brightness(2.5) saturate(2); }
}
@keyframes fadeup {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bigScore {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes particle {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.card-slam        { animation: slam .6s ease forwards; }
.enemy-shake      { animation: shake .4s ease; }
.player-shake     { animation: shake-player .4s ease; }
.hit-flash        { animation: hit-flash .4s ease; }
.score-pop        { animation: bigScore .5s cubic-bezier(.175,.885,.32,1.275) forwards; }

/* スクリーン遷移 */
.screen-fade-in  { animation: fadeup .3s ease forwards; }

/* カード演出：ダメージ受けた時に赤く光る */
@keyframes card-damage {
  0%   { filter: brightness(1) saturate(1); }
  25%  { filter: brightness(2) saturate(2) hue-rotate(0deg) drop-shadow(0 0 8px rgba(255,60,60,0.9)); }
  50%  { filter: brightness(1.5) saturate(1.5) hue-rotate(10deg); }
  100% { filter: brightness(1) saturate(1); }
}
.card-damage {
  animation: card-damage 0.5s ease-out forwards !important;
}

/* カード演出：HP危機（25%以下）で脈動 */
@keyframes card-danger-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255,60,60,0.4); }
  50%       { box-shadow: 0 0 18px rgba(255,60,60,0.9), 0 0 30px rgba(255,60,60,0.4); }
}
.card-danger {
  animation: card-danger-pulse 1.2s ease-in-out infinite !important;
}

/* カード演出：回復時に緑グロー */
@keyframes card-heal {
  0%   { filter: brightness(1); }
  30%  { filter: brightness(1.8) saturate(1.5) drop-shadow(0 0 10px rgba(46,216,122,0.9)); }
  100% { filter: brightness(1); }
}
.card-heal {
  animation: card-heal 0.7s ease-out forwards !important;
}
