/* ドラぽか アドバイザー — カード描画・グリッド */

/* スクロールバー（縦/横共通） */
:root {
  --dorapoka-scrollbar-size: 10px;
  --dorapoka-scrollbar-track: rgba(15, 23, 42, 0.92);
  --dorapoka-scrollbar-thumb: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  --dorapoka-scrollbar-thumb-hover: linear-gradient(180deg, #475569 0%, #334155 100%);
  --dorapoka-scrollbar-border: rgba(148, 163, 184, 0.28);
}

html,
body,
.dorapoka-deck-instance-row,
.dorapoka-deck-expanded,
.dorapoka-battle-modifiers-dialog-inner,
.dorapoka-reference-dialog-inner,
#dorapoka-prob-dialog-body {
  scrollbar-width: thin;
  scrollbar-color: #475569 rgba(15, 23, 42, 0.92);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.dorapoka-deck-instance-row::-webkit-scrollbar,
.dorapoka-deck-expanded::-webkit-scrollbar,
.dorapoka-battle-modifiers-dialog-inner::-webkit-scrollbar,
.dorapoka-reference-dialog-inner::-webkit-scrollbar,
#dorapoka-prob-dialog-body::-webkit-scrollbar {
  width: var(--dorapoka-scrollbar-size);
  height: var(--dorapoka-scrollbar-size);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.dorapoka-deck-instance-row::-webkit-scrollbar-track,
.dorapoka-deck-expanded::-webkit-scrollbar-track,
.dorapoka-battle-modifiers-dialog-inner::-webkit-scrollbar-track,
.dorapoka-reference-dialog-inner::-webkit-scrollbar-track,
#dorapoka-prob-dialog-body::-webkit-scrollbar-track {
  background: var(--dorapoka-scrollbar-track);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.dorapoka-deck-instance-row::-webkit-scrollbar-thumb,
.dorapoka-deck-expanded::-webkit-scrollbar-thumb,
.dorapoka-battle-modifiers-dialog-inner::-webkit-scrollbar-thumb,
.dorapoka-reference-dialog-inner::-webkit-scrollbar-thumb,
#dorapoka-prob-dialog-body::-webkit-scrollbar-thumb {
  background: var(--dorapoka-scrollbar-thumb);
  border: 1px solid var(--dorapoka-scrollbar-border);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.dorapoka-deck-instance-row::-webkit-scrollbar-thumb:hover,
.dorapoka-deck-expanded::-webkit-scrollbar-thumb:hover,
.dorapoka-battle-modifiers-dialog-inner::-webkit-scrollbar-thumb:hover,
.dorapoka-reference-dialog-inner::-webkit-scrollbar-thumb:hover,
#dorapoka-prob-dialog-body::-webkit-scrollbar-thumb:hover {
  background: var(--dorapoka-scrollbar-thumb-hover);
}

.dorapoka-card-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dorapoka-hand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dorapoka-hand-actions > button {
  flex: 0 0 auto;
}

.dorapoka-lock-random-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}

.dorapoka-lock-random-btn > span {
  font-size: 10px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.01em;
}

.dorapoka-card-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
}

.dorapoka-deck-edit-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.dorapoka-deck-plus {
  min-height: 34px;
  min-width: 34px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 17px;
  font-weight: 700;
}

.dorapoka-deck-plus:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dorapoka-deck-minus {
  min-height: 34px;
  min-width: 34px;
  border-radius: 6px;
  border: 1px solid #7f1d1d;
  background: rgba(127, 29, 29, 0.45);
  color: #fecaca;
  font-size: 17px;
  font-weight: 700;
}

.dorapoka-deck-minus:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dorapoka-deck-edit-suit {
  margin-bottom: 8px;
}

.dorapoka-deck-instance-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex: 1;
  min-width: 0;
}

.dorapoka-deck-rank-group {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.dorapoka-deck-edit-controls {
  gap: 4px;
}

.dorapoka-deck-rank-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dorapoka-deck-child-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dorapoka-deck-btn-spacer {
  display: block;
  width: 34px;
  min-width: 34px;
  height: 34px;
  visibility: hidden;
  pointer-events: none;
}

.dorapoka-deck-instance-ghost {
  min-height: 44px;
  min-width: 44px;
  border: 1px dashed #64748b;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: #0f172a;
}

.dorapoka-deck-instance-card {
  position: relative;
  min-height: 44px;
  min-width: 44px;
  border-radius: 6px;
  border: 1px solid #64748b;
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
}

.dorapoka-deck-instance-card.has-mod.type-power,
.dorapoka-card-btn.has-mod.type-power,
.dorapoka-role-card.has-mod.type-power {
  border-color: #f97316;
  background: rgba(194, 65, 12, 0.35);
}

.dorapoka-deck-instance-card.has-mod.type-combo,
.dorapoka-card-btn.has-mod.type-combo,
.dorapoka-role-card.has-mod.type-combo {
  border-color: #3b82f6;
  background: rgba(30, 64, 175, 0.35);
}

.dorapoka-deck-instance-card.has-mod.type-metal,
.dorapoka-card-btn.has-mod.type-metal,
.dorapoka-role-card.has-mod.type-metal {
  border-color: #94a3b8;
  background: rgba(71, 85, 105, 0.45);
}

.dorapoka-deck-instance-card.has-mod.type-dark,
.dorapoka-card-btn.has-mod.type-dark,
.dorapoka-role-card.has-mod.type-dark {
  border-color: #a855f7;
  background: rgba(88, 28, 135, 0.35);
}

.dorapoka-deck-instance-card.has-mod.type-wild,
.dorapoka-card-btn.has-mod.type-wild,
.dorapoka-role-card.has-mod.type-wild {
  border-color: #fbbf24;
  background: rgba(180, 130, 0, 0.35);
}

.dorapoka-deck-instance-card.has-mod.type-lv99,
.dorapoka-card-btn.has-mod.type-lv99,
.dorapoka-role-card.has-mod.type-lv99 {
  border-color: #f59e0b;
  background: rgba(180, 120, 0, 0.35);
}

.dorapoka-deck-parent-card.has-mod.type-lv99,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-lv99 {
  border-color: #f59e0b;
  background: rgba(180, 120, 0, 0.35);
}

.dorapoka-deck-parent-card.is-empty {
  opacity: 0.45;
}

.dorapoka-deck-parent-card.has-mod.type-power,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-power {
  border-color: #f97316;
  background: rgba(194, 65, 12, 0.35);
}

.dorapoka-deck-parent-card.has-mod.type-combo,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-combo {
  border-color: #3b82f6;
  background: rgba(30, 64, 175, 0.35);
}

.dorapoka-deck-parent-card.has-mod.type-metal,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-metal {
  border-color: #94a3b8;
  background: rgba(71, 85, 105, 0.45);
}

.dorapoka-deck-parent-card.has-mod.type-dark,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-dark {
  border-color: #a855f7;
  background: rgba(88, 28, 135, 0.35);
}

.dorapoka-deck-parent-card.has-mod.type-wild,
.dorapoka-card-btn.dorapoka-deck-instance-card.has-mod.type-wild {
  border-color: #fbbf24;
  background: rgba(180, 130, 0, 0.35);
}

.dorapoka-card-instance-mod,
.dorapoka-deck-instance-mod {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 99px;
  background: rgba(2, 6, 23, 0.75);
  color: #e2e8f0;
  font-weight: 700;
  pointer-events: none;
}

.dorapoka-role-card.has-mod.type-power.keep,
.dorapoka-role-card.has-mod.type-power.locked {
  background: linear-gradient(160deg, #7c2d12 0%, #422006 45%, #1e293b 100%);
}

.dorapoka-role-card.has-mod.type-combo.keep,
.dorapoka-role-card.has-mod.type-combo.locked {
  background: linear-gradient(160deg, #1e3a8a 0%, #172554 45%, #1e293b 100%);
}

.dorapoka-role-card.has-mod.type-metal.keep,
.dorapoka-role-card.has-mod.type-metal.locked {
  background: linear-gradient(160deg, #475569 0%, #334155 45%, #1e293b 100%);
}

.dorapoka-role-card.has-mod.type-dark.keep,
.dorapoka-role-card.has-mod.type-dark.locked {
  background: linear-gradient(160deg, #581c87 0%, #3b0764 45%, #1e293b 100%);
}

.dorapoka-suit-expanded {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.dorapoka-suit-row-label {
  font-size: 18px;
  font-weight: 700;
  min-width: 1.25rem;
  padding-top: 12px;
  flex-shrink: 0;
}

.dorapoka-deck-expanded {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.dorapoka-hand-strip-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dorapoka-hand-strip-select-cbx {
  width: 14px;
  height: 14px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.dorapoka-hand-strip-select-cbx:disabled {
  opacity: 0.35;
  cursor: default;
}

.dorapoka-hand-strip-discard-cbx {
  width: 13px;
  height: 13px;
  accent-color: #ef4444;
  cursor: pointer;
}

.dorapoka-hand-pick-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dorapoka-hand-pick-cbx-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
}

.dorapoka-hand-pick-cbx-wrap.is-discarded,
.dorapoka-hand-pick-cbx-wrap.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.dorapoka-hand-pick-cbx {
  width: 14px;
  height: 14px;
  accent-color: #f59e0b;
  cursor: pointer;
}

@media (max-width: 640px) {
  .dorapoka-hand-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }

  .dorapoka-hand-actions > button {
    width: auto;
    flex: 0 0 auto;
    min-width: max-content;
  }

  .dorapoka-card-grid {
    gap: 3px;
  }

  .dorapoka-deck-expanded {
    gap: 3px;
  }
}

.dorapoka-card-btn {
  min-height: 44px;
  min-width: 0;
  border-radius: 6px;
  border: 2px solid #475569;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 2px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s;
  touch-action: manipulation;
  user-select: none;
}

.dorapoka-card-btn.tile {
  position: relative;
  width: 42px;
  min-width: 42px;
  flex-shrink: 0;
}

.card-mod-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #fbbf24;
  pointer-events: none;
}

.dorapoka-card-btn:active {
  transform: scale(0.96);
}

.dorapoka-card-btn .card-hand-pos {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.dorapoka-card-btn.locked {
  box-shadow: inset 0 -3px 0 rgba(180, 83, 9, 0.85);
  cursor: default;
}

.dorapoka-card-btn.locked::after {
  content: '🔒';
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  line-height: 1;
  opacity: 0.85;
}

.dorapoka-card-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.dorapoka-card-btn.face-down-masked {
  background: rgb(30 27 75 / 0.85);
  border-color: rgb(109 40 217 / 0.6);
  color: rgb(167 139 250);
  filter: saturate(0.3) brightness(0.7);
}
.dorapoka-card-btn.face-down-masked .rank,
.dorapoka-card-btn.face-down-masked .suit {
  color: rgb(167 139 250 / 0.8);
}

.dorapoka-hand-action-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: saturate(0.55);
}

.dorapoka-card-btn .card-lv {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

.dorapoka-card-btn .card-lv-override {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 99px;
  background: rgba(2, 6, 23, 0.75);
  color: #fbbf24;
  pointer-events: none;
}

.dorapoka-lv-cell {
  min-width: 0;
}

.dorapoka-lv-cell input {
  min-height: 36px;
}

/*
 * iOS Safari: フォーカス時の自動ズーム回避（/orbs/ 検索バー・growth 絞り込みと同型）
 */
@media (max-width: 640px) {
  .dorapoka-ios-input-wrap {
    overflow: hidden;
    display: flex;
    align-items: center;
    align-self: stretch;
    min-width: 0;
    min-height: 2rem;
    height: 2rem;
    max-height: 2rem;
  }

  .dorapoka-ios-input-wrap .dorapoka-ios-input {
    box-sizing: border-box;
    font-size: 16px !important;
    line-height: 1.25rem !important;
    height: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    min-height: 2rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .dorapoka-ios-input-wrap .dorapoka-ios-input::placeholder {
    font-size: 14px !important;
    line-height: 1.25rem;
    opacity: 0.72;
  }

  .dorapoka-lv-cell .dorapoka-ios-input-wrap {
    width: 100%;
  }

  /*
   * 育成Lvポップアップ: 16pxで自動ズーム回避しつつ scale で見た目は他UIと同サイズ
   * （/treasure/ 検索バー・/orbs/ .orbs-ios-input-compact と同型）
   */
  #dorapoka-profile-panel .dorapoka-profile-role-row .dorapoka-ios-input-wrap {
    justify-content: flex-end;
  }

  #dorapoka-profile-panel .dorapoka-profile-role-row .dorapoka-ios-input-wrap .dorapoka-ios-input {
    line-height: 1 !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    width: 125% !important;
    max-width: none !important;
    transform: translateY(4.5px) scale(0.8) !important;
    transform-origin: right top;
  }

  #dorapoka-profile-panel .dorapoka-lv-cell .dorapoka-ios-input-wrap .dorapoka-ios-input {
    line-height: 1 !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    width: 125% !important;
    max-width: none !important;
    transform: translateY(4.5px) scale(0.8) !important;
    transform-origin: left top;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
}

.dorapoka-profile-bulk-btn {
  touch-action: manipulation;
}

.dorapoka-profile-save-btn--ok {
  background: #15803d !important;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}

.dorapoka-profile-save-status {
  font-size: 0.875rem;
  font-weight: 700;
  color: #4ade80;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dorapoka-profile-save-status.is-visible {
  opacity: 1;
}

.dorapoka-kill-line strong {
  font-weight: 700;
}

.dorapoka-fight-sim .text-emerald-300 {
  font-size: 1.125rem;
}

.dorapoka-lv-cell .dorapoka-profile-atk {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  margin-top: 2px;
  line-height: 1.2;
}

/* 育成Lv · カードLv: セル間隔を詰めて入力幅を確保 */
#dorapoka-profile-cards .dorapoka-card-grid {
  gap: 1px;
}

#dorapoka-profile-cards .dorapoka-card-grid.mb-2 {
  margin-bottom: 0.375rem;
}

#dorapoka-profile-cards .dorapoka-lv-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#dorapoka-profile-cards .dorapoka-lv-cell .dorapoka-ios-input-wrap {
  width: 100%;
}

#dorapoka-profile-cards .dorapoka-lv-cell .dorapoka-ios-input {
  padding-left: 2px;
  padding-right: 2px;
}

#dorapoka-profile-cards .dorapoka-lv-cell .dorapoka-profile-atk {
  margin-top: 0;
}

.dorapoka-profile-roles-wrap {
  min-width: 0;
}

.dorapoka-profile-roles-body {
  column-count: 1;
  column-gap: 1rem;
}

@media (min-width: 640px) {
  .dorapoka-profile-roles-body {
    column-count: 2;
  }
}

.dorapoka-profile-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 1.75rem 2.65rem 2.35rem 2.65rem;
  align-items: start;
  gap: 0.35rem 0.35rem;
  padding: 0.35rem 0.15rem;
  border-bottom: 1px solid #1e293b;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.dorapoka-profile-role-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 1.75rem 2.65rem 2.35rem 2.65rem;
  align-items: end;
  gap: 0.35rem 0.35rem;
}

.dorapoka-profile-role-name {
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  padding-right: 0.15rem;
}

.dorapoka-profile-rank {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dorapoka-profile-stat {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  padding-top: 0.15rem;
}

.dorapoka-info-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-size: 0.65rem;
  line-height: 1;
  cursor: help;
  touch-action: manipulation;
}

.dorapoka-info-mark:hover,
.dorapoka-info-mark:focus-visible {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  outline: none;
}

.dorapoka-damage-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-damage-expand:hover,
.dorapoka-damage-expand:focus-visible {
  background: rgba(251, 191, 36, 0.22);
  outline: none;
}

.dorapoka-damage-breakdown {
  animation: dorapoka-damage-expand-in 0.12s ease-out;
}

@keyframes dorapoka-damage-expand-in {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dorapoka-card-btn .rank {
  display: block;
}

/* ♥ ピンク / ♦ 青 / ♣ 黄緑 / ♠ グレー / ☆ 黄 */
.dorapoka-card-btn.suit-h .rank,
.dorapoka-card-btn.suit-h .suit,
.dorapoka-suit-h {
  color: #f9a8d4;
}

.dorapoka-card-btn.suit-d .rank,
.dorapoka-card-btn.suit-d .suit,
.dorapoka-suit-d {
  color: #60a5fa;
}

.dorapoka-card-btn.suit-c .rank,
.dorapoka-card-btn.suit-c .suit,
.dorapoka-suit-c {
  color: #bef264;
}

.dorapoka-card-btn.suit-s .rank,
.dorapoka-card-btn.suit-s .suit,
.dorapoka-suit-s {
  color: #94a3b8;
}

.dorapoka-card-btn.suit-w .rank,
.dorapoka-card-btn.suit-w .suit,
.dorapoka-suit-w {
  color: #fbbf24;
}

.dorapoka-discards-setting {
  border-top: 1px solid rgba(51, 65, 85, 0.45);
  padding-top: 0.65rem;
}

.dorapoka-current-hand {
  /* 従来 390×35.4×51 → 縦横80%でキリの良い数値 */
  --dorapoka-role-hand-width: 312px;
  --dorapoka-role-card-gap: 3px;
  --dorapoka-role-card-w: 28px;
  --dorapoka-role-card-h: 41px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--dorapoka-role-card-gap);
  align-items: flex-start;
  max-width: var(--dorapoka-role-hand-width);
}

.dorapoka-role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: var(--dorapoka-role-card-w);
  height: var(--dorapoka-role-card-h);
  padding: 3px 2px 2px;
  border-radius: 4px;
  border: 1.5px solid #475569;
  background: linear-gradient(160deg, #243044 0%, #111827 55%, #0b1220 100%);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 800;
  line-height: 1;
  user-select: none;
  transition: transform 0.08s ease;
}

.dorapoka-role-card .role-card-rank {
  font-size: 10px;
  letter-spacing: -0.02em;
}

.dorapoka-role-card .role-card-suit {
  font-size: 9px;
}

.dorapoka-role-card.keep {
  border-color: #fbbf24;
  background: linear-gradient(160deg, #5c3a0a 0%, #2a1f0f 45%, #1e293b 100%);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(251, 191, 36, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dorapoka-role-card.locked {
  border-color: #fbbf24;
  background: linear-gradient(160deg, #5c3a0a 0%, #2a1f0f 45%, #1e293b 100%);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35),
    inset 0 -3px 0 rgba(180, 83, 9, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dorapoka-role-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 6px;
  line-height: 1;
  opacity: 0.9;
}

.dorapoka-role-card.discard-mark {
  border-color: #f87171;
  background: linear-gradient(160deg, #7f1d1d 0%, #450a0a 45%, #1e293b 100%);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(248, 113, 113, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dorapoka-role-card.discard-mark .role-card-rank,
.dorapoka-role-card.discard-mark .role-card-suit {
  opacity: 0.82;
}

.dorapoka-mini-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #64748b;
  background: #1e293b;
  font-size: 11px;
  font-weight: 700;
}

.dorapoka-mini-card.keep {
  border-color: #fbbf24;
  background: #422006;
}

.dorapoka-mini-card.locked {
  border-color: #fbbf24;
  background: #422006;
  box-shadow: inset 0 -2px 0 rgba(180, 83, 9, 0.85);
}

.dorapoka-mini-card-btn.is-locked {
  cursor: default;
}

.dorapoka-mini-card.discard {
  opacity: 0.45;
  text-decoration: line-through;
}

.dorapoka-prob-bar {
  height: 6px;
  border-radius: 3px;
  background: #334155;
  overflow: hidden;
}

.dorapoka-prob-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  border-radius: 3px;
  transition: width 0.2s;
}

.dorapoka-card-btn.discarded {
  opacity: 0.28;
  filter: grayscale(0.9);
  pointer-events: none;
  border-color: #334155;
}

.dorapoka-mini-card.discard-mark {
  border-color: #f87171;
  background: #450a0a;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35);
}

.dorapoka-mini-card.need {
  border-color: #38bdf8;
  border-style: dashed;
  background: #0c4a6e;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.dorapoka-mini-card.wildcard {
  border-color: #facc15;
  color: #fde047;
  background: #422006;
  font-size: 13px;
  line-height: 1;
}

.dorapoka-mini-card.wildcard.need {
  border-color: #facc15;
  border-style: dashed;
  background: #422006;
  color: #fde047;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.25);
}

.dorapoka-mini-card.in_hand {
  border-color: #64748b;
  background: #1e293b;
  opacity: 0.72;
}

.dorapoka-mini-card.in_hand.keep {
  opacity: 1;
}

.dorapoka-mini-card.wildcard.rank-wild {
  font-size: 11px;
  letter-spacing: -0.02em;
}

.dorapoka-mini-card.wildcard.suit-wild {
  font-size: 11px;
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-h,
.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-h.need {
  color: #f9a8d4;
  border-color: #f472b6;
  background: #3b1428;
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.25);
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-d,
.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-d.need {
  color: #60a5fa;
  border-color: #38bdf8;
  background: #0c1929;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-c,
.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-c.need {
  color: #bef264;
  border-color: #84cc16;
  background: #1a2e05;
  box-shadow: 0 0 0 1px rgba(132, 204, 22, 0.25);
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-s,
.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-s.need {
  color: #94a3b8;
  border-color: #64748b;
  background: #1e293b;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.35);
}

.dorapoka-mini-card.wildcard.rank-wild.keep,
.dorapoka-mini-card.wildcard.suit-wild.keep {
  border-style: solid;
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-h.keep {
  border-color: #f472b6;
  background: #3b1428;
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-d.keep {
  border-color: #38bdf8;
  background: #0c1929;
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-c.keep {
  border-color: #84cc16;
  background: #1a2e05;
}

.dorapoka-mini-card.wildcard.suit-wild.dorapoka-suit-s.keep {
  border-color: #64748b;
  background: #1e293b;
}

.dorapoka-mini-card.wildcard.rank-wild.keep {
  border-color: #fbbf24;
  background: #422006;
}

.dorapoka-target-patterns {
  padding-left: 0.15rem;
  border-left: 2px solid #334155;
}

.dorapoka-mini-card.need-x {
  font-size: 9px;
  color: #7dd3fc;
  margin-left: 1px;
}

.dorapoka-prob-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem 0.35rem;
  margin: -0.1rem -0.35rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #7dd3fc;
  font-weight: 800;
  font-size: inherit;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: underline dotted rgba(125, 211, 252, 0.45);
  text-underline-offset: 2px;
}

.dorapoka-prob-trigger:hover,
.dorapoka-prob-trigger:focus-visible {
  background: rgba(14, 165, 233, 0.12);
  outline: none;
}

.dorapoka-prob-trigger-lg {
  font-size: 1.125rem;
  padding: 0.15rem 0.4rem;
}

.dorapoka-prob-trigger-sm {
  font-size: 0.75rem;
  font-weight: 700;
}

.dorapoka-prob-trigger-hint {
  font-size: 0.65em;
  font-weight: 400;
  opacity: 0.55;
  text-decoration: none;
}

.dorapoka-prob-dialog {
  max-width: min(92vw, 28rem);
  width: calc(100% - 2rem);
  padding: 0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #cbd5e1;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

.dorapoka-prob-dialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.dorapoka-prob-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.dorapoka-prob-dialog-inner {
  padding: 0.875rem 1rem 1rem;
}

.dorapoka-prob-dialog-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.375rem;
  background: #1e293b;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dorapoka-prob-dialog-close:hover {
  background: #334155;
  color: #e2e8f0;
}

.dorapoka-strategy-thinking summary:hover {
  color: #cbd5e1;
}

.dorapoka-strategy-thinking-body {
  margin: 0;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.625rem;
  line-height: 1.45;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
}

.dorapoka-mini-card-btn,
.dorapoka-role-card-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-role-card-btn:not(:disabled):active .dorapoka-role-card {
  transform: scale(0.96);
}

.dorapoka-role-card-btn.is-locked {
  cursor: default;
}

.dorapoka-mini-card-btn:disabled,
.dorapoka-role-card-btn:disabled {
  cursor: default;
}

/* 初期描画 — list/ と同様のブートオーバーレイ */
#dorapoka-boot {
  position: relative;
}

#dorapoka-boot.dorapoka-boot-pending .dorapoka-boot-inner {
  visibility: hidden;
  pointer-events: none;
}

.dorapoka-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 560px);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#dorapoka-boot.dorapoka-boot-pending .dorapoka-loading-overlay {
  display: flex;
}

.dorapoka-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.dorapoka-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.22);
  border-top-color: #fbbf24;
  animation: dorapoka-loading-spin 0.75s linear infinite;
}

@keyframes dorapoka-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.dorapoka-loading-text {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.06em;
}

.dorapoka-loading-hint {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
}

/* ダメージ・戦略計算中 — 設定・手札入力・結果エリア（ヘッダー/フッターは対象外） */
.dorapoka-workspace {
  position: relative;
}

.dorapoka-workspace-inner {
  transition: opacity 0.15s ease;
}

.dorapoka-workspace.dorapoka-workspace-pending .dorapoka-workspace-inner {
  opacity: 0.62;
  pointer-events: none;
  user-select: none;
}

.dorapoka-workspace-loading-bar {
  display: none;
  position: relative;
  z-index: 381;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(120, 53, 15, 0.38);
  border: 1px solid rgba(217, 119, 6, 0.5);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fcd34d;
  letter-spacing: 0.04em;
}

.dorapoka-workspace.dorapoka-workspace-pending .dorapoka-workspace-loading-bar {
  display: flex;
}

.dorapoka-workspace-loading-bar-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.25);
  border-top-color: #fbbf24;
  animation: dorapoka-loading-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.dorapoka-workspace-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 380;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  border-radius: 8px;
  pointer-events: all;
}

.dorapoka-workspace.dorapoka-workspace-pending .dorapoka-workspace-loading-overlay {
  display: flex;
}

.dorapoka-loading-panel--compact {
  padding: 12px 18px;
  gap: 8px;
}

.dorapoka-loading-panel--compact .dorapoka-loading-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.dorapoka-loading-panel--compact .dorapoka-loading-hint {
  font-size: 9px;
}

.dorapoka-calc-area {
  position: relative;
}

.dorapoka-help-panel[hidden] {
  display: none !important;
}

/* 助っ人一覧 — 星別テーブル */
.dorapoka-assistant-catalog-root {
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}

.dorapoka-catalog-intro {
  margin-top: 0;
}

.dorapoka-assistant-catalog-section + .dorapoka-assistant-catalog-section {
  margin-top: 0.85rem;
}

.dorapoka-assistant-catalog-heading {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e2e8f0;
}

.dorapoka-rarity-stars {
  color: #fbbf24;
  letter-spacing: 0.05em;
}

.dorapoka-assistant-catalog-count {
  font-size: 0.6875rem;
  font-weight: 400;
  color: #64748b;
}

.dorapoka-assistant-catalog-scroll {
  overflow-x: auto;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.45);
}

.dorapoka-assistant-catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.dorapoka-assistant-catalog-table th,
.dorapoka-assistant-catalog-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #1e293b;
  vertical-align: top;
  text-align: left;
}

.dorapoka-assistant-catalog-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.dorapoka-assistant-catalog-table tbody tr:last-child td {
  border-bottom: none;
}

.dorapoka-assistant-catalog-table tbody tr:hover td {
  background: rgba(51, 65, 85, 0.35);
}

.dorapoka-ac-no {
  width: 2.25rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dorapoka-ac-name {
  white-space: nowrap;
  color: #f1f5f9;
  font-weight: 500;
}

.dorapoka-ac-cat {
  white-space: nowrap;
  color: #a5b4fc;
}

.dorapoka-ac-summary {
  max-width: 14rem;
  color: #cbd5e1;
}

.dorapoka-ac-row {
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-ac-row:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.55);
  outline-offset: -2px;
}

.dorapoka-ac-name::after {
  content: '▸';
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.625rem;
  color: #64748b;
  transition: transform 0.12s ease;
}

.dorapoka-ac-group.is-open .dorapoka-ac-name::after {
  transform: rotate(90deg);
  color: #fbbf24;
}

.dorapoka-ac-effect-row[hidden] {
  display: none;
}

.dorapoka-ac-effect-cell {
  padding: 0.45rem 0.55rem 0.55rem !important;
  font-size: 10px;
  line-height: 1.55;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid #334155 !important;
}

.dorapoka-ac-group.is-open .dorapoka-ac-row td {
  background: rgba(51, 65, 85, 0.28);
}

@media (max-width: 640px) {
  .dorapoka-assistant-catalog-intro,
  .dorapoka-catalog-intro {
    line-height: 1.5;
  }

  .dorapoka-assistant-catalog-table {
    font-size: 11px;
  }

  .dorapoka-ac-summary {
    max-width: none;
    min-width: 5.5rem;
  }

  .dorapoka-ac-cat {
    display: none;
  }

  .dorapoka-ac-cg {
    white-space: nowrap;
  }

  .dorapoka-ac-cg.dorapoka-dg-cg--provisional,
  .dorapoka-ac-cg .text-slate-500 {
    color: #cbd5e1;
  }

  .dorapoka-assistant-catalog-table th:nth-child(4),
  .dorapoka-assistant-catalog-table td:nth-child(4) {
    display: none;
  }

  .dorapoka-ac-name {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dorapoka-reference-section {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
  }
}

.dorapoka-reference-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #1e293b;
}

.dorapoka-ac-calc,
.dorapoka-dg-calc {
  width: 5.5rem;
  max-width: 5.5rem;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  font-size: 0.6875rem;
  line-height: 1.25;
  color: #475569;
}

.dorapoka-catalog-calc-inline {
  display: inline;
  white-space: nowrap;
  font-weight: 600;
}

.dorapoka-catalog-calc-stacked {
  display: inline-block;
  white-space: normal;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.dorapoka-ac-calc-supported .dorapoka-ac-calc,
.dorapoka-catalog-calc-in,
.dorapoka-ac-calc.dorapoka-catalog-calc-in,
.dorapoka-dg-calc.dorapoka-catalog-calc-in {
  color: #86efac;
  font-weight: 600;
}

.dorapoka-catalog-calc-pending,
.dorapoka-ac-calc.dorapoka-catalog-calc-pending,
.dorapoka-dg-calc.dorapoka-catalog-calc-pending {
  color: #fbbf24;
  font-weight: 600;
}

.dorapoka-catalog-calc-later,
.dorapoka-ac-calc.dorapoka-catalog-calc-later,
.dorapoka-dg-calc.dorapoka-catalog-calc-later {
  color: #fbbf24;
  font-weight: 600;
}

.dorapoka-catalog-calc-out,
.dorapoka-ac-calc.dorapoka-catalog-calc-out,
.dorapoka-dg-calc.dorapoka-catalog-calc-out {
  color: #7dd3fc;
  font-weight: 600;
}


.dorapoka-dougu-catalog-scroll {
  overflow-x: auto;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.45);
}

.dorapoka-dougu-catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.dorapoka-dougu-catalog-table th,
.dorapoka-dougu-catalog-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #1e293b;
  vertical-align: top;
  text-align: left;
}

.dorapoka-dougu-catalog-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.dorapoka-dg-cg {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #fcd34d;
}

.dorapoka-items-catalog-section + .dorapoka-items-catalog-section {
  margin-top: 1.25rem;
}

.dorapoka-items-catalog-heading {
  letter-spacing: 0.02em;
}

.dorapoka-assistant-mirage-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 0.375rem;
  padding: 0.5rem 0.6rem;
  background: rgba(76, 29, 149, 0.15);
  cursor: pointer;
}

.dorapoka-assistant-mirage-input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
}

.dorapoka-assistant-mirage-text {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(221, 214, 254, 0.92);
  word-break: break-word;
}

.dorapoka-assistant-slot-card--mirage-copy {
  opacity: 0.78;
  filter: saturate(0.5) brightness(0.92);
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(30, 41, 59, 0.55);
}

.dorapoka-assistant-slot-card--mirage-copy .dorapoka-assistant-slot-name,
.dorapoka-assistant-slot-card--mirage-copy .dorapoka-assistant-slot-summary {
  color: rgb(148 163 184);
}

.dorapoka-battle-modifier-otakara-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  min-height: 44px;
}

.dorapoka-battle-modifier-otakara-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dorapoka-assistant-mirage-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 9px;
  font-weight: 700;
  color: #e9d5ff;
  background: rgba(109, 40, 217, 0.45);
  vertical-align: middle;
}

.dorapoka-dg-row {
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-dg-name::after {
  content: '▸';
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.625rem;
  color: #64748b;
}

.dorapoka-dg-group.is-open .dorapoka-dg-name::after {
  transform: rotate(90deg);
  color: #38bdf8;
}

.dorapoka-dg-effect-row[hidden] {
  display: none;
}

.dorapoka-dg-effect-cell {
  padding: 0.45rem 0.55rem 0.55rem !important;
  font-size: 10px;
  line-height: 1.55;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.65);
}

/* 役の説明 — Intent 展開 */
.dorapoka-role-intent {
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.dorapoka-role-intent + .dorapoka-role-intent {
  margin-top: 0.35rem;
}

.dorapoka-role-intent-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  user-select: none;
}

.dorapoka-role-intent-summary::-webkit-details-marker {
  display: none;
}

.dorapoka-role-intent-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #64748b;
  transition: transform 0.15s ease;
}

.dorapoka-role-intent[open] > .dorapoka-role-intent-summary .dorapoka-role-intent-chevron {
  transform: rotate(90deg);
}

.dorapoka-role-intent-body {
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid #1e293b;
}

.dorapoka-intent-nested {
  margin-top: 0.25rem;
}

.dorapoka-intent-nested-summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7dd3fc;
  padding: 0.35rem 0;
  list-style: none;
  touch-action: manipulation;
}

.dorapoka-intent-nested-summary::-webkit-details-marker {
  display: none;
}

.dorapoka-intent-nested-body {
  padding-left: 0.25rem;
}

.dorapoka-intent-section + .dorapoka-intent-section {
  margin-top: 0.5rem;
}

/* 初回コーチング帯（× で全消し・localStorage 永続） */
.dorapoka-coach {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin: 0.2rem 0 0.28rem;
  padding: 0.26rem 0.35rem 0.26rem 0.42rem;
  border-radius: 5px;
  border: 1px solid rgba(71, 85, 105, 0.95);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-size: clamp(8px, 2.35vw, 10px);
  line-height: 1.2;
  transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease, filter 160ms ease;
}

.dorapoka-coach-line {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.22rem;
  overflow: hidden;
}

.dorapoka-coach-kicker {
  flex-shrink: 0;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dorapoka-coach-msg {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dorapoka-coach--step1.dorapoka-coach-active {
  border-color: rgba(248, 113, 113, 0.75);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.76) 0%, rgba(31, 12, 12, 0.96) 100%);
}

.dorapoka-coach--step2.dorapoka-coach-active {
  border-color: rgba(59, 130, 246, 0.78);
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.76) 0%, rgba(12, 24, 54, 0.96) 100%);
}

.dorapoka-coach--step3.dorapoka-coach-active {
  border-color: rgba(234, 179, 8, 0.8);
  background: linear-gradient(180deg, rgba(133, 77, 14, 0.82) 0%, rgba(46, 27, 6, 0.96) 100%);
}

.dorapoka-coach--step1.dorapoka-coach-soft {
  border-color: rgba(248, 113, 113, 0.4);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.28) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.dorapoka-coach--step2.dorapoka-coach-soft {
  border-color: rgba(59, 130, 246, 0.38);
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.26) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.dorapoka-coach--step3.dorapoka-coach-soft {
  border-color: rgba(234, 179, 8, 0.42);
  background: linear-gradient(180deg, rgba(113, 63, 18, 0.32) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.dorapoka-coach-done {
  opacity: 0.52;
  filter: grayscale(0.35);
  border-color: rgba(71, 85, 105, 0.85);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.65) 0%, rgba(15, 23, 42, 0.92) 100%);
}

.dorapoka-coach-done .dorapoka-coach-kicker,
.dorapoka-coach-done .dorapoka-coach-msg {
  color: #94a3b8;
}

.dorapoka-coach-active .dorapoka-coach-kicker,
.dorapoka-coach-soft .dorapoka-coach-kicker {
  font-weight: 900;
}

.dorapoka-coach--step1.dorapoka-coach-active .dorapoka-coach-kicker,
.dorapoka-coach--step1.dorapoka-coach-soft .dorapoka-coach-kicker {
  color: #fecaca;
}

.dorapoka-coach--step2.dorapoka-coach-active .dorapoka-coach-kicker,
.dorapoka-coach--step2.dorapoka-coach-soft .dorapoka-coach-kicker {
  color: #93c5fd;
}

.dorapoka-coach--step3.dorapoka-coach-active .dorapoka-coach-kicker,
.dorapoka-coach--step3.dorapoka-coach-soft .dorapoka-coach-kicker {
  color: #fde047;
}

.dorapoka-coach-dismiss {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.45rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dorapoka-coach-dismiss:active {
  opacity: 0.85;
}

.dorapoka-assistant-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dorapoka-assistant-slot-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 0.375rem;
  border: 1px solid rgb(71 85 105);
  background: rgb(15 23 42 / 0.85);
  color: rgb(241 245 249);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-assistant-slot-card:hover,
.dorapoka-assistant-slot-card:focus-visible {
  border-color: rgb(139 92 246 / 0.7);
  outline: none;
}

.dorapoka-assistant-slot-card.is-empty {
  border-style: dashed;
  color: rgb(148 163 184);
  justify-content: center;
  align-items: center;
}

.dorapoka-assistant-slot-index {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: rgb(167 139 250);
  min-width: 1.25rem;
}

.dorapoka-assistant-slot-body {
  flex: 1;
  min-width: 0;
}

.dorapoka-assistant-slot-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.dorapoka-assistant-slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.dorapoka-assistant-slot-summary {
  font-size: 11px;
  color: rgb(196 181 253);
  line-height: 1.35;
  margin-top: 2px;
}

.dorapoka-assistant-slot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
}

.dorapoka-assistant-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgb(30 41 59);
  color: rgb(148 163 184);
  border: 1px solid rgb(51 65 85);
}

.dorapoka-assistant-tag--premise {
  color: rgb(125 211 252);
  border-color: rgb(14 116 144 / 0.5);
  background: rgb(8 47 73 / 0.35);
}

.dorapoka-assistant-tag--calc {
  color: rgb(110 231 183);
  border-color: rgb(6 95 70 / 0.5);
  background: rgb(6 78 59 / 0.35);
}

.dorapoka-assistant-slot-clear {
  flex-shrink: 0;
  min-width: 2rem;
  min-height: 2rem;
  border: none;
  border-radius: 0.25rem;
  background: rgb(30 41 59);
  color: rgb(148 163 184);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.dorapoka-assistant-dialog {
  width: min(100vw - 16px, 480px);
  max-height: min(90vh, 720px);
  margin: auto;
  padding: 0;
  border: 1px solid rgb(71 85 105);
  border-radius: 0.5rem;
  background: rgb(15 23 42);
  color: rgb(241 245 249);
}

.dorapoka-assistant-dialog::backdrop {
  background: rgb(0 0 0 / 0.65);
}

.dorapoka-assistant-dialog-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  max-height: min(90vh, 720px);
}

.dorapoka-assistant-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dorapoka-assistant-dialog-close {
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: none;
  border-radius: 0.25rem;
  background: rgb(30 41 59);
  color: rgb(226 232 240);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dorapoka-assistant-search {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  border: 1px solid rgb(71 85 105);
  background: rgb(2 6 23);
  color: rgb(241 245 249);
  font-size: 0.875rem;
}

.dorapoka-assistant-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dorapoka-assistant-filter-btn {
  font-size: 11px;
  padding: 4px 10px;
  min-height: 32px;
  border-radius: 9999px;
  border: 1px solid rgb(71 85 105);
  background: rgb(30 41 59);
  color: rgb(203 213 225);
  cursor: pointer;
}

.dorapoka-assistant-filter-btn.is-active {
  border-color: rgb(139 92 246);
  background: rgb(76 29 149 / 0.45);
  color: rgb(233 213 255);
}

.dorapoka-assistant-picker-list {
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.dorapoka-assistant-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 0.375rem;
  border: 1px solid rgb(51 65 85);
  background: rgb(2 6 23 / 0.6);
  color: rgb(241 245 249);
  cursor: pointer;
}

.dorapoka-assistant-picker-item:hover,
.dorapoka-assistant-picker-item:focus-visible {
  border-color: rgb(139 92 246 / 0.6);
  outline: none;
}

.dorapoka-assistant-picker-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dorapoka-assistant-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.dorapoka-assistant-picker-no {
  font-size: 10px;
  color: rgb(100 116 139);
}

.dorapoka-assistant-picker-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.dorapoka-assistant-picker-rarity {
  font-size: 10px;
  color: rgb(250 204 21);
}

.dorapoka-assistant-picker-summary {
  font-size: 0.8125rem;
  color: rgb(196 181 253);
  margin-top: 4px;
  line-height: 1.35;
}

.dorapoka-assistant-slot-card.has-drivers {
  cursor: default;
  align-items: center;
  min-height: 0;
  padding: 6px 8px;
}

.dorapoka-assistant-slot-card.has-drivers .dorapoka-assistant-slot-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.dorapoka-assistant-slot-main {
  cursor: pointer;
  touch-action: manipulation;
}

.dorapoka-assistant-slot-card.has-drivers .dorapoka-assistant-slot-main {
  flex: 0 1 auto;
  min-width: 0;
}

.dorapoka-assistant-slot-card.has-drivers .dorapoka-assistant-slot-summary {
  display: none;
}

.dorapoka-assistant-slot-card.has-drivers .dorapoka-assistant-slot-main:hover .dorapoka-assistant-slot-name {
  color: rgb(196 181 253);
}

.dorapoka-assistant-slot-main:hover,
.dorapoka-assistant-slot-main:focus-visible {
  outline: none;
}

.dorapoka-assistant-slot-drivers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.dorapoka-assistant-slot-driver {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgb(203 213 225);
  white-space: nowrap;
}

.dorapoka-assistant-slot-driver span {
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dorapoka-assistant-slot-driver input {
  width: 2.75rem;
  min-height: 28px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid rgb(91 33 182 / 0.5);
  background: rgb(2 6 23);
  color: rgb(241 245 249);
  font-size: 12px;
}

.dorapoka-assistant-slot-driver-preview {
  font-size: 11px;
  line-height: 1.35;
  color: rgb(196 181 253 / 0.95);
  margin: 0;
  white-space: nowrap;
}

.dorapoka-assistant-slot-toggles {
  margin-top: 0.35rem;
}

.dorapoka-assistant-slot-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}

.dorapoka-assistant-slot-toggle-input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: #fbbf24;
}

.dorapoka-assistant-picker-detail {
  font-size: 11px;
  color: rgb(100 116 139);
  margin-top: 4px;
  line-height: 1.4;
}

body.dorapoka-coach-dismissed .dorapoka-coach {
  display: none;
}

/* 手動ラン 育成Lv未設定アテンション */
.dorapoka-play-level-attention .dorapoka-coach-msg {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.dorapoka-play-level-attention-btn {
  flex-shrink: 0;
  padding: 0.18rem 0.5rem;
  min-height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(234, 179, 8, 0.6);
  background: rgba(133, 77, 14, 0.5);
  color: #fde68a;
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 120ms ease;
}

.dorapoka-play-level-attention-btn:hover {
  background: rgba(133, 77, 14, 0.8);
}

#dorapoka-profile-btn.dorapoka-profile-btn--attention {
  border-color: rgba(234, 179, 8, 0.6);
  background: rgba(133, 77, 14, 0.5);
  color: #fde68a;
}

.dorapoka-battle-modifiers {
  max-width: var(--dorapoka-role-hand-width, 312px);
}

.dorapoka-battle-modifiers-badge {
  font-size: 11px;
  color: rgb(251 191 36 / 0.95);
  font-weight: 700;
}

.dorapoka-battle-modifiers-edit-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgb(180 83 9 / 0.6);
  background: linear-gradient(180deg, rgb(120 53 15 / 0.38), rgb(69 26 3 / 0.3));
  color: rgb(254 243 199);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.dorapoka-battle-modifiers-edit-btn:hover:not(:disabled),
.dorapoka-battle-modifiers-edit-btn:focus-visible:not(:disabled) {
  border-color: rgb(251 191 36 / 0.8);
  background: linear-gradient(180deg, rgb(146 64 14 / 0.45), rgb(92 38 9 / 0.35));
  outline: none;
}

.dorapoka-battle-modifiers-edit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dorapoka-battle-modifiers-edit-title {
  color: rgb(254 243 199);
}

.dorapoka-battle-modifiers-active {
  font-size: 12px;
  color: rgb(253 230 138 / 0.92);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dorapoka-battle-modifiers-active-head {
  font-weight: 700;
  color: rgb(251 191 36);
}

.dorapoka-battle-modifiers-active-item {
  color: rgb(226 232 240 / 0.92);
  font-size: 11px;
}

.dorapoka-battle-modifiers-upcoming {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dorapoka-battle-modifiers-upcoming-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgb(71 85 105);
  background: rgb(30 41 59 / 0.5);
  color: rgb(148 163 184);
}

.dorapoka-reference-dialog {
  border: none;
  padding: 0;
  max-width: min(100vw - 20px, 720px);
  width: 100%;
  background: transparent;
  color: inherit;
}

.dorapoka-reference-dialog--wide {
  max-width: min(100vw - 20px, 960px);
}

.dorapoka-reference-dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
}

.dorapoka-reference-dialog-inner {
  margin: 12px auto;
  max-height: min(88vh, 720px);
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgb(71 85 105);
  background: rgb(15 23 42);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.dorapoka-reference-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 8px;
  background: rgb(15 23 42);
  border-bottom: 1px solid rgb(51 65 85 / 0.6);
}

.dorapoka-reference-dialog-body {
  padding-top: 4px;
}
@media (max-width: 1023px) {
  #dorapoka-play-board {
    display: none !important;
  }
}
@media (max-width: 1023px) {
  .dorapoka-reference-dialog--tall .dorapoka-reference-dialog-inner {
    margin-top: 4px;
    margin-bottom: 4px;
    max-height: calc(95vh - 8px);
    height: calc(95vh - 8px);
    display: flex;
    flex-direction: column;
  }
  .dorapoka-reference-dialog--tall .dorapoka-reference-dialog-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }
  #dorapoka-play-board-dialog .dorapoka-play-deck-grid {
    max-height: none;
    overflow: visible;
  }
}

.dorapoka-reference-section .flex.flex-wrap.gap-2 button[aria-haspopup='dialog'] {
  border-color: rgb(100 116 139);
}
@media (max-width: 639px) {
  .dorapoka-reference-section .flex.flex-wrap.gap-2 button[aria-haspopup='dialog'] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-size: 12px;
  }
}

.dorapoka-reference-section .flex.flex-wrap.gap-2 button[aria-haspopup='dialog']:hover,
.dorapoka-reference-section .flex.flex-wrap.gap-2 button[aria-haspopup='dialog']:focus-visible {
  border-color: rgb(56 189 248 / 0.55);
  background: rgb(30 41 59);
}

.dorapoka-battle-modifiers-dialog {
  border: none;
  padding: 0;
  max-width: min(100vw - 20px, 760px);
  width: 100%;
  background: transparent;
  color: inherit;
  margin: auto;
}

.dorapoka-battle-modifiers-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.dorapoka-battle-modifiers-dialog-inner {
  margin: 12px auto;
  max-height: min(85vh, 640px);
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgb(71 85 105);
  background: rgb(15 23 42);
}

.dorapoka-battle-modifiers-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.dorapoka-battle-modifiers-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.dorapoka-battle-card-modifier-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.dorapoka-card-mod-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dorapoka-card-mod-section-title {
  font-size: 11px;
  font-weight: 700;
  color: rgb(186 230 253);
}

.dorapoka-card-mod-section-title.muted {
  color: rgb(148 163 184);
}

.dorapoka-card-mod-row {
  border: 1px solid rgb(51 65 85);
  border-radius: 8px;
  padding: 8px;
  background: rgb(2 6 23 / 0.45);
}

.dorapoka-card-mod-row.is-focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.45);
}

.dorapoka-card-mod-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dorapoka-card-mod-card {
  font-size: 12px;
  font-weight: 700;
  color: rgb(226 232 240);
}

.dorapoka-card-mod-impact {
  font-size: 10px;
  color: rgb(148 163 184);
}

.dorapoka-card-mod-row-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dorapoka-card-mod-type {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgb(71 85 105);
  background: rgb(30 41 59 / 0.8);
  color: rgb(203 213 225);
  font-size: 11px;
  font-weight: 700;
}

.dorapoka-card-mod-type.is-on.type-power {
  border-color: #f97316;
  background: rgba(194, 65, 12, 0.35);
  color: #fdba74;
}

.dorapoka-card-mod-type.is-on.type-combo {
  border-color: #3b82f6;
  background: rgba(30, 64, 175, 0.35);
  color: #93c5fd;
}

.dorapoka-card-mod-type.is-on.type-metal {
  border-color: #94a3b8;
  background: rgba(71, 85, 105, 0.45);
  color: #e2e8f0;
}

.dorapoka-card-mod-type.is-on.type-dark {
  border-color: #a855f7;
  background: rgba(88, 28, 135, 0.35);
  color: #d8b4fe;
}

.dorapoka-card-mod-type.is-on.type-wild {
  border-color: #fbbf24;
  background: rgba(180, 130, 0, 0.35);
  color: #fde68a;
}

.dorapoka-battle-modifier-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid rgb(51 65 85);
  background: rgb(2 6 23 / 0.5);
}

.dorapoka-battle-modifier-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dorapoka-battle-modifier-row-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.dorapoka-battle-modifier-name {
  font-size: 10px;
  font-weight: 700;
  color: rgb(226 232 240);
  line-height: 1.1;
}

.dorapoka-battle-modifier-meta {
  font-size: 9px;
  color: rgb(148 163 184);
  line-height: 1.1;
}

.dorapoka-battle-modifier-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.dorapoka-battle-modifier-input-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.dorapoka-battle-modifier-input,
.dorapoka-battle-tool-count {
  color: #e2e8f0;
}

.dorapoka-battle-modifier-input {
  width: 3rem;
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid rgb(71 85 105);
  background: rgb(15 23 42);
  color: rgb(226 232 240);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.dorapoka-battle-modifier-input:focus {
  outline: none;
  border-color: rgb(56 189 248 / 0.8);
  box-shadow: 0 0 0 1px rgb(56 189 248 / 0.35);
}

.dorapoka-battle-modifier-step {
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid rgb(71 85 105);
  background: rgb(30 41 59);
  color: rgb(226 232 240);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.dorapoka-battle-modifier-step:hover:not(:disabled),
.dorapoka-battle-modifier-step:focus-visible:not(:disabled) {
  border-color: rgb(251 191 36 / 0.6);
}

.dorapoka-battle-modifier-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dorapoka-battle-modifier-qty {
  min-width: 1.25rem;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgb(251 191 36);
}

@media (max-width: 640px) {
  .dorapoka-battle-modifiers-dialog {
    max-width: min(100vw - 12px, 100vw);
  }

  .dorapoka-battle-modifiers-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .dorapoka-battle-modifier-row {
    padding: 4px 5px;
  }

  /* iOS Safari: フォーカス時の自動ズームを防止 */
  .dorapoka-battle-modifier-input-wrap {
    min-height: 2rem;
    height: 2rem;
    max-height: 2rem;
  }

  .dorapoka-battle-modifier-input-wrap .dorapoka-battle-modifier-input {
    box-sizing: border-box;
    font-size: 16px !important;
    line-height: 1.25rem !important;
    height: 2rem !important;
    min-height: 2rem !important;
    width: 100% !important;
    max-width: 3.2rem !important;
    transform: none !important;
    margin: 0 !important;
  }

  .dorapoka-battle-modifier-input-wrap .dorapoka-battle-modifier-input::placeholder {
    font-size: 14px !important;
    line-height: 1.25rem;
    opacity: 0.72;
  }
}

/* --- /dorapoka/run/ ダンジョン生成 --- */
.dorapoka-run-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.95);
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.dorapoka-run-btn:hover:not(:disabled):not(.is-disabled) {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(51, 65, 85, 0.95);
}
.dorapoka-run-btn:disabled,
.dorapoka-run-btn.is-disabled,
.dorapoka-run-btn[aria-disabled='true'] {
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(71, 85, 105, 0.8);
  background: rgba(30, 41, 59, 0.72);
  color: #64748b;
  box-shadow: none;
  filter: none;
  opacity: 1;
}
.dorapoka-run-btn--primary {
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.85) 0%, rgba(6, 46, 34, 0.98) 100%);
  color: #a7f3d0;
}
.dorapoka-run-btn--primary:hover:not(:disabled):not(.is-disabled) {
  border-color: rgba(110, 231, 183, 0.65);
}

.dorapoka-run-btn--stop {
  min-width: 7rem;
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
}

.dorapoka-run-btn--stop:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.45);
  border-color: rgba(252, 165, 165, 0.7);
}

.dorapoka-run-btn--stop:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dorapoka-run-btn--ghost {
  background: transparent;
  border-color: rgba(71, 85, 105, 0.8);
}
.dorapoka-run-btn--ghost:hover:not(:disabled):not(.is-disabled) {
  background: rgba(51, 65, 85, 0.5);
  border-color: rgba(148, 163, 184, 0.6);
}

.dorapoka-run-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dorapoka-run-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 4.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.85);
}
.dorapoka-run-stat-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dorapoka-run-stat-value {
  font-weight: 800;
  color: #f1f5f9;
  font-size: 15px;
}

.dorapoka-run-fail-attack-table th,
.dorapoka-run-fail-attack-table td {
  white-space: nowrap;
}
.dorapoka-run-clear-attack .dorapoka-run-fail-attack-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.06);
}

.dorapoka-run-fail-attack-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

.dorapoka-run-sim-conditions > summary {
  list-style: none;
}
.dorapoka-run-sim-conditions > summary::-webkit-details-marker {
  display: none;
}
.dorapoka-run-sim-conditions > summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}
.dorapoka-run-sim-conditions[open] > summary::before {
  transform: rotate(90deg);
}

.dorapoka-run-tag-dashboard {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(91, 33, 182, 0.35);
  background: rgba(15, 23, 42, 0.75);
}
.dorapoka-run-tag-dashboard-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}
.dorapoka-run-tag-section-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.dorapoka-run-tag-bar-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  font-size: 11px;
  margin-bottom: 0.2rem;
}
.dorapoka-run-tag-bar-label {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dorapoka-run-tag-bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(51, 65, 85, 0.8);
  overflow: hidden;
}
.dorapoka-run-tag-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.85), rgba(167, 139, 250, 0.65));
}
.dorapoka-run-tag-bar-n {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dorapoka-run-tag-samples {
  display: grid;
  gap: 0.35rem;
}
.dorapoka-run-tag-sample {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
.dorapoka-run-tag-sample-title {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.dorapoka-run-floor-tags-details > summary,
.dorapoka-run-tag-dashboard-details > summary,
.dorapoka-run-tag-sample-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.dorapoka-run-floor-tags-details > summary::-webkit-details-marker,
.dorapoka-run-tag-dashboard-details > summary::-webkit-details-marker,
.dorapoka-run-tag-sample-details > summary::-webkit-details-marker {
  display: none;
}
.dorapoka-run-floor-tags-details > summary::before,
.dorapoka-run-tag-dashboard-details > summary::before,
.dorapoka-run-tag-sample-details > summary::before {
  content: '▸ ';
  display: inline-block;
  color: #64748b;
  transition: transform 0.15s ease;
}
.dorapoka-run-floor-tags-details[open] > summary::before,
.dorapoka-run-tag-dashboard-details[open] > summary::before,
.dorapoka-run-tag-sample-details[open] > summary::before {
  transform: rotate(90deg);
}

.dorapoka-run-log-floor-tags {
  font-size: 11px;
  color: #a78bfa;
  margin: 0.2rem 0 0.35rem;
  line-height: 1.45;
}
.dorapoka-run-log-floor-tags-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dorapoka-run-tag-dashboard-details > summary {
  padding: 0.35rem 0;
}
.dorapoka-run-tag-dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
}

.dorapoka-run-tag-sample-details {
  margin-bottom: 0.35rem;
}
.dorapoka-run-tag-sample-summary {
  font-size: 11px;
  color: #c4b5fd;
  line-height: 1.45;
  padding: 0.25rem 0;
}
.dorapoka-run-tag-sample-body {
  padding: 0.35rem 0 0.5rem 0.85rem;
  border-left: 2px solid rgba(91, 33, 182, 0.35);
  margin-left: 0.35rem;
  margin-bottom: 0.25rem;
}
.dorapoka-run-tag-sample-body .dorapoka-run-log-roster {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
}

.dorapoka-run-table th,
.dorapoka-run-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  vertical-align: top;
}
.dorapoka-run-table th {
  text-align: left;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  white-space: nowrap;
}
.dorapoka-run-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

.dorapoka-run-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dorapoka-run-badge--battle {
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
}
.dorapoka-run-badge--luida {
  background: rgba(120, 53, 15, 0.55);
  color: #fde68a;
}
.dorapoka-run-badge--toruneko {
  background: rgba(30, 58, 138, 0.55);
  color: #bfdbfe;
}
.dorapoka-run-badge--jii {
  background: rgba(88, 28, 135, 0.55);
  color: #e9d5ff;
}
.dorapoka-run-badge--other {
  background: rgba(51, 65, 85, 0.75);
  color: #cbd5e1;
}

.dorapoka-run-row--selected {
  background: rgba(6, 78, 59, 0.25) !important;
}
.dorapoka-run-sim-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(6, 46, 34, 0.8);
  color: #a7f3d0;
  cursor: pointer;
}
.dorapoka-run-sim-btn:hover {
  border-color: rgba(110, 231, 183, 0.65);
}

.dorapoka-run-sim-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dorapoka-run-sim-overlay.hidden {
  display: none;
}

body.dorapoka-run-sim-pending {
  overflow: hidden;
}

.dorapoka-run-sim-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(100%, 440px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.dorapoka-run-sim-overlay-slow {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(69, 26, 3, 0.35);
  text-align: left;
  box-sizing: border-box;
}

.dorapoka-run-sim-overlay-slow[hidden] {
  display: none;
}

.dorapoka-run-sim-overlay-slow-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fbbf24;
  text-transform: uppercase;
}

.dorapoka-run-slow-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  max-height: 9rem;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.45;
  color: #fde68a;
  list-style: disc;
}

.dorapoka-run-slow-list li {
  margin: 0 0 4px;
}

.dorapoka-run-slow-list li:last-child {
  margin-bottom: 0;
}

.dorapoka-run-slow-ms {
  display: inline-block;
  min-width: 3.2em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fcd34d;
}

.dorapoka-run-sim-overlay-detail {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.dorapoka-run-sim-overlay-live {
  width: 100%;
  margin: 2px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(6, 46, 34, 0.35);
  text-align: left;
  min-height: 3.6rem;
  box-sizing: border-box;
}

.dorapoka-run-sim-overlay-live[hidden] {
  display: none;
}

.dorapoka-run-sim-overlay-live-title {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  text-transform: uppercase;
}

.dorapoka-run-sim-overlay-live-clear {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #a7f3d0;
  font-variant-numeric: tabular-nums;
}

.dorapoka-run-sim-overlay-live-fail {
  margin: 3px 0 0;
  min-height: 1.35em;
  font-size: 11px;
  font-weight: 500;
  color: #fda4af;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dorapoka-run-sim-overlay-status {
  width: 100%;
  min-height: 4.1rem;
}

.dorapoka-run-sim-overlay-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.35rem;
}

.dorapoka-run-sim-overlay-step {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dorapoka-run-sim-overlay-step-badge {
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.55);
  background: rgba(6, 46, 34, 0.55);
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.25;
}

.dorapoka-run-sim-overlay-activity {
  margin: 0.35rem 0 0;
  min-height: calc(1.35em * 2);
}

.dorapoka-run-sim-overlay-activity-line {
  margin: 0;
  min-height: 1.35em;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dorapoka-run-sim-overlay-activity--pulse {
  animation: dorapoka-run-sim-activity-pulse 1.4s ease-in-out infinite;
}

.dorapoka-run-sim-overlay-activity--pulse .dorapoka-run-sim-overlay-activity-line {
  animation: inherit;
}

@keyframes dorapoka-run-sim-activity-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.dorapoka-run-sim-overlay--active .dorapoka-run-sim-progress-fill {
  background: linear-gradient(90deg, #d97706, #fbbf24, #d97706);
  background-size: 200% 100%;
  animation: dorapoka-run-sim-progress-pulse 1.2s linear infinite;
}

@keyframes dorapoka-run-sim-progress-pulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.dorapoka-run-sim-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(51, 65, 85, 0.85);
  border-radius: 999px;
  overflow: hidden;
}

.dorapoka-run-sim-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d97706, #fbbf24);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.dorapoka-run-battle-panel {
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(15, 23, 42, 0.92);
  padding: 0.85rem 1rem;
}
.dorapoka-run-battle-result {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(2, 6, 23, 0.65);
}

.dorapoka-run-trial-log-tabs {
  margin-top: 0.25rem;
}

.dorapoka-run-trial-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.75);
}

.dorapoka-run-trial-tab {
  appearance: none;
  border: 1px solid rgba(71, 85, 105, 0.85);
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.dorapoka-run-trial-tab:hover {
  border-color: rgba(148, 163, 184, 0.55);
  color: #e2e8f0;
}

.dorapoka-run-trial-tab.is-active {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15);
}

.dorapoka-run-trial-tab.is-clear:not(.is-active) {
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.dorapoka-run-trial-tab.is-fail:not(.is-active) {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.dorapoka-run-trial-tab-panel {
  min-height: 2rem;
}

.dorapoka-run-trial-tab-panel .dorapoka-run-log-section {
  border-top: none;
  padding-top: 0;
  margin-bottom: 0;
}

.dorapoka-run-log-section {
  padding-top: 0.25rem;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
}
.dorapoka-run-log-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.dorapoka-run-log-config-fail {
  color: #fca5a5;
  font-weight: 600;
  list-style: none;
  margin-left: -1rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(127, 29, 29, 0.35);
}
.dorapoka-run-log-battle-summary.is-fail-step,
.dorapoka-run-log-battle.is-fail-step > .dorapoka-run-log-battle-details > summary {
  color: #fca5a5;
}
.dorapoka-run-log-battle.is-fail-step {
  border-left: 2px solid #f87171;
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}
.dorapoka-run-log-floor-header {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.25rem;
  background: rgba(30, 41, 59, 0.75);
  border-left: 3px solid #38bdf8;
}
.dorapoka-run-log-floor-title {
  font-weight: 700;
  color: #7dd3fc;
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}
.dorapoka-run-log-floor-roster-note {
  margin: 0 0 0.1rem;
  font-size: 9px;
  color: #64748b;
}
.dorapoka-run-log-otakara-use {
  margin-top: 0.2rem;
}
.dorapoka-run-log-opening-block {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
}
.dorapoka-run-log-opening-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}
.dorapoka-run-log-floor-header .dorapoka-run-log-deck-details {
  margin-top: 0.35rem;
}
.dorapoka-run-log-roster {
  margin: 0.15rem 0 0;
  font-size: 0.65rem;
  line-height: 1.45;
  color: #94a3b8;
}
.dorapoka-run-log-event .dorapoka-run-log-roster,
.dorapoka-run-log-battle-summary .dorapoka-run-log-roster,
.dorapoka-run-log-shop .dorapoka-run-log-roster {
  margin-top: 0.2rem;
}
.dorapoka-run-log-shop-summary {
  cursor: pointer;
  color: #cbd5e1;
}
.dorapoka-run-log-shop-actions {
  margin-top: 0.25rem;
  padding-left: 1rem;
  list-style: disc;
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.45;
}
.dorapoka-run-log-list {
  list-style: decimal;
}

.dorapoka-run-log-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dorapoka-run-log-tree-floor {
  list-style: none;
  margin: 0.35rem 0;
}

.dorapoka-run-log-tree-floor-details {
  border-radius: 0.25rem;
  border: 1px solid rgba(51, 65, 85, 0.75);
  background: rgba(15, 23, 42, 0.45);
}

.dorapoka-run-log-tree-floor-summary {
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  font-weight: 700;
  color: #7dd3fc;
  font-size: 0.75rem;
  list-style: none;
}

.dorapoka-run-log-tree-floor-summary::-webkit-details-marker {
  display: none;
}

.dorapoka-run-log-tree-floor-summary::before {
  content: '▸ ';
  color: #64748b;
  display: inline-block;
  transition: transform 0.15s ease;
}

.dorapoka-run-log-tree-floor-details[open] > .dorapoka-run-log-tree-floor-summary::before {
  transform: rotate(90deg);
}

.dorapoka-run-log-tree-floor-body {
  padding: 0 0.55rem 0.45rem;
}

.dorapoka-run-log-tree-floor-body .dorapoka-run-log-floor-header {
  margin-top: 0;
  border-left-width: 2px;
}

.dorapoka-run-log-tree-steps {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0 0 0 0.55rem;
  border-left: 1px solid rgba(71, 85, 105, 0.55);
}

.dorapoka-run-log-tree-steps > li {
  margin: 0.3rem 0;
}
.dorapoka-run-log-battle-details {
  margin-top: 0.15rem;
}
.dorapoka-run-log-battle-summary {
  cursor: pointer;
  font-weight: 700;
  color: #e2e8f0;
  list-style: none;
}
.dorapoka-run-log-battle-summary .dorapoka-run-log-summary-card,
.dorapoka-run-log-shop-summary .dorapoka-run-log-summary-card,
.dorapoka-run-log-field .dorapoka-log-card,
.dorapoka-run-log-turn-actions .dorapoka-log-card,
.dorapoka-run-log-battle-flow .dorapoka-log-card,
.dorapoka-run-log-deck-body .dorapoka-log-card,
.dorapoka-run-log-shop-actions .dorapoka-log-card {
  font-weight: 800;
  letter-spacing: 0.01em;
}
.dorapoka-run-log-hand .dorapoka-log-card {
  margin-right: 0.12em;
}
.dorapoka-run-deck-card .dorapoka-log-card {
  font-weight: 700;
}
.dorapoka-run-log-deck-suit-mark.dorapoka-suit-h,
.dorapoka-run-log-deck-suit-mark.dorapoka-suit-d,
.dorapoka-run-log-deck-suit-mark.dorapoka-suit-c,
.dorapoka-run-log-deck-suit-mark.dorapoka-suit-s {
  font-weight: 800;
}
.dorapoka-run-log-battle-details summary::-webkit-details-marker {
  display: none;
}
.dorapoka-run-log-battle-details summary::before {
  content: '▸ ';
  color: #64748b;
  display: inline-block;
  transition: transform 0.15s ease;
}
.dorapoka-run-log-battle-details[open] summary::before {
  transform: rotate(90deg);
}
.dorapoka-run-log-battle-flow {
  margin: 0.35rem 0 0.5rem 0;
}
.dorapoka-run-log-turn-block {
  margin: 0.65rem 0 0.85rem 0;
  padding: 0.45rem 0 0.45rem 0.55rem;
  border-left: 2px solid rgba(51, 65, 85, 0.65);
}
.dorapoka-run-log-turn-block.is-pre-battle {
  border-left-color: rgba(56, 189, 248, 0.45);
}
.dorapoka-run-log-turn-title {
  font-weight: 600;
  font-size: 11px;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}
.dorapoka-run-log-turn-header .dorapoka-run-log-turn-title {
  color: #fbbf24;
}
.dorapoka-run-log-turn-summary {
  color: #94a3b8;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
}
.dorapoka-run-log-turn-hand {
  margin-top: 0.2rem;
  color: #64748b;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.45;
  word-break: break-all;
}
.dorapoka-run-log-turn-kill {
  margin-top: 0.2rem;
  color: #fbbf24;
  font-size: 10px;
  line-height: 1.45;
}
.dorapoka-run-log-turn-deck {
  margin-top: 0.2rem;
  color: #475569;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.45;
  word-break: break-all;
}
.dorapoka-run-log-deck-legend {
  margin-bottom: 0.35rem;
  font-size: 10px;
  color: #64748b;
}
.dorapoka-run-log-deck-legend-note {
  display: block;
  margin-top: 0.15rem;
  margin-left: 0.1rem;
  font-size: 9px;
  color: #475569;
}
.dorapoka-run-deck-card.is-hand {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 2px;
  padding: 0 1px;
}
.dorapoka-run-deck-card.is-stock {
  color: #64748b;
}
.dorapoka-run-deck-card.is-flow {
  color: #334155;
  opacity: 0.48;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0.5px 0 0 rgba(15, 23, 42, 0.35);
}
.dorapoka-run-log-deck-details {
  margin-top: 0.22rem;
}
.dorapoka-run-log-deck-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: #64748b;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
}
.dorapoka-run-log-deck-summary::-webkit-details-marker {
  display: none;
}
.dorapoka-run-log-deck-summary::before {
  content: '▸ ';
  display: inline-block;
  color: #64748b;
  transition: transform 0.15s ease;
}
.dorapoka-run-log-deck-details[open] .dorapoka-run-log-deck-summary::before {
  transform: rotate(90deg);
}
.dorapoka-run-log-deck-body {
  margin: 0.25rem 0 0 0.65rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(51, 65, 85, 0.55);
}
.dorapoka-run-log-deck-suit-line {
  margin: 0.2rem 0;
  color: #475569;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.55;
  word-break: break-all;
}
.dorapoka-run-log-deck-suit-mark {
  color: #94a3b8;
  font-weight: 600;
}
.dorapoka-run-log-battle-premise {
  margin-top: 0.25rem;
}
.dorapoka-run-log-field {
  margin-top: 0.22rem;
  color: #94a3b8;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
}
.dorapoka-run-log-field-label {
  color: #64748b;
  font-weight: 600;
}
.dorapoka-run-log-turn-plan {
  margin-top: 0.2rem;
  color: #7dd3fc;
  font-size: 10px;
  line-height: 1.4;
}
.dorapoka-run-log-turn-meta {
  margin-top: 0.2rem;
  color: #a78bfa;
  font-size: 10px;
  line-height: 1.45;
}
.dorapoka-run-log-turn-axis {
  margin-top: 0.2rem;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.45;
}
.dorapoka-run-log-battle-start-detail .dorapoka-run-log-turn-summary:first-child {
  margin-top: 0;
}
.dorapoka-run-log-turn-actions li.dorapoka-run-log-turn-start {
  list-style: none;
  margin-left: -0.5rem;
}
.dorapoka-run-log-turn-start .dorapoka-run-strategy-plan {
  margin-bottom: 0.35rem;
}
.dorapoka-run-log-battle-result {
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(71, 85, 105, 0.55);
}
.dorapoka-run-log-battle-result-line {
  margin: 0.15rem 0 0 0.5rem;
  color: #cbd5e1;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
}
.dorapoka-run-log-turn-actions-wrap {
  margin-top: 0.35rem;
}
.dorapoka-run-log-turn-actions-label {
  margin: 0.2rem 0 0.15rem;
  color: #cbd5e1;
  font-size: 11px;
}
.dorapoka-run-log-turn-actions {
  margin: 0.15rem 0 0 0.5rem;
  padding: 0;
  list-style: none;
}
.dorapoka-run-log-turn-actions li {
  margin: 0.28rem 0;
  color: #94a3b8;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
}
.dorapoka-run-log-turns {
  margin: 0.35rem 0 0.5rem 0.85rem;
  padding: 0;
  list-style: none;
  border-left: 2px solid rgba(51, 65, 85, 0.8);
  padding-left: 0.65rem;
}
.dorapoka-run-log-turns li {
  margin: 0.2rem 0;
  color: #94a3b8;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.45;
}
.dorapoka-run-dmg-details summary {
  list-style: none;
}
.dorapoka-run-dmg-details summary::-webkit-details-marker {
  display: none;
}
.dorapoka-run-dmg-details summary::before {
  content: '▸ ';
  display: inline-block;
  color: #a78bfa;
  transition: transform 0.15s ease;
}
.dorapoka-run-dmg-details[open] summary::before {
  transform: rotate(90deg);
}
.dorapoka-run-log-event {
  color: #64748b;
}

/* --- 手動ラン /dorapoka/play/ 常時ボード --- */
.dorapoka-play-board {
  box-shadow: inset 0 1px 0 rgba(129, 140, 248, 0.08);
}
.dorapoka-play-deck-grid {
  padding: 4px 2px;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.65);
  max-height: min(52vh, 280px);
  overflow: auto;
  gap: 4px;
}
.dorapoka-play-deck-grid .dorapoka-suit-expanded {
  gap: 8px;
}
.dorapoka-play-deck-grid .dorapoka-suit-expanded + .dorapoka-suit-expanded {
  margin-top: 2px;
}
.dorapoka-play-deck-grid .dorapoka-deck-expanded {
  gap: 4px;
}
.dorapoka-play-deck-grid .dorapoka-run-deck-card {
  display: inline-flex;
  border-radius: 6px;
  padding: 0;
}
.dorapoka-play-deck-grid .dorapoka-run-deck-card .dorapoka-card-btn {
  cursor: default;
}
.dorapoka-play-deck-grid .dorapoka-run-deck-card.is-hand .dorapoka-card-btn:not(.selected) {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}
.dorapoka-play-deck-grid .dorapoka-run-deck-card.is-flow .dorapoka-card-btn {
  opacity: 0.42;
}
.dorapoka-play-loadout-row,
.dorapoka-play-step-loadout {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}
.dorapoka-play-loadout-row {
  padding: 4px 2px 2px;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}
.dorapoka-play-step-loadout {
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}
.dorapoka-play-loadout-chip {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 4.5rem;
  max-width: 7.5rem;
  min-height: 3.25rem;
  padding: 4px 6px;
  border-radius: 0.375rem;
  border: 2px solid rgba(120, 113, 108, 0.55);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  text-align: center;
  flex-shrink: 0;
  font: inherit;
  color: inherit;
}
button.dorapoka-play-loadout-chip {
  cursor: pointer;
}
button.dorapoka-play-loadout-chip.is-actionable:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: rgba(251, 191, 36, 0.85);
}
button.dorapoka-play-loadout-chip.is-disabled,
button.dorapoka-play-loadout-chip:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.dorapoka-play-loadout-chip.is-used {
  opacity: 0.75;
  border-style: dashed;
}
.dorapoka-play-loadout-chip.is-empty {
  border-style: dashed;
  opacity: 0.55;
}
.dorapoka-play-loadout-chip--otakara.is-filled {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.15);
}
.dorapoka-play-loadout-chip--dougu.is-filled {
  border-color: rgba(52, 211, 153, 0.55);
}
.dorapoka-play-loadout-chip--assistant.is-filled {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.12);
}
.dorapoka-play-loadout-chip--assist-start {
  margin-left: auto;
}

.dorapoka-play-sticky-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.25rem 0.625rem;
  border-radius: 5px;
  border: 1px solid rgba(109, 86, 163, 0.6);
  background: rgba(46, 16, 101, 0.55);
  color: #c4b5fd;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.dorapoka-play-sticky-popup-btn:hover {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(76, 29, 149, 0.6);
}
@media (max-width: 1023px) {
  .dorapoka-play-sticky-bar {
    position: sticky;
    top: var(--play-sticky-top, 0px);
    z-index: 400;
  }
}
.dorapoka-play-battle-actions {
  row-gap: 0.5rem;
}
@media (max-width: 639px) {
  .dorapoka-play-battle-actions .dorapoka-run-btn {
    padding: 0.375rem 0.625rem;
    font-size: 12px;
  }
}
.dorapoka-play-breakdown-summary {
  list-style: none;
  user-select: none;
}
.dorapoka-play-breakdown-summary::-webkit-details-marker {
  display: none;
}
.dorapoka-play-breakdown-summary::before {
  content: '▶ ';
  font-size: 10px;
  opacity: 0.6;
}
.dorapoka-play-breakdown-details[open] .dorapoka-play-breakdown-summary::before {
  content: '▼ ';
}
.dorapoka-play-battle-hand {
  padding: 4px 2px;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(51, 65, 85, 0.55);
}
.dorapoka-play-undo-btn {
  font-size: 13px;
  letter-spacing: 0;
}
.dorapoka-play-loadout-kind {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.dorapoka-play-loadout-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dorapoka-play-loadout-name-text {
  /* PC: inline (flows in .dorapoka-play-loadout-name) */
}
.dorapoka-play-loadout-name-rarity {
  /* PC: inline after name-text */
}
.dorapoka-play-loadout-name-rarity--r5 { color: #fbbf24; } /* amber-400: ★5 */
.dorapoka-play-loadout-name-rarity--r4 { color: #a78bfa; } /* violet-400: ★4 */
.dorapoka-play-loadout-name-rarity--r3 { color: #94a3b8; } /* slate-400: ★3 */
.dorapoka-play-loadout-carousel {
  display: contents; /* PC: no carousel, chips flow into parent flex */
}
@media (max-width: 639px) {
  .dorapoka-play-loadout-chip {
    min-width: 3.5rem;
    max-width: 5.5rem;
    padding: 3px 5px;
    min-height: 2.75rem;
  }
  .dorapoka-play-loadout-carousel {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    max-width: 100%;
  }
  .dorapoka-play-loadout-carousel::-webkit-scrollbar {
    display: none;
  }
  .dorapoka-play-loadout-chip--assistant .dorapoka-play-loadout-name {
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    text-overflow: unset;
  }
  .dorapoka-play-loadout-chip--assistant .dorapoka-play-loadout-name-text {
    display: block;
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dorapoka-play-loadout-chip--assistant .dorapoka-play-loadout-name-rarity {
    display: block;
    font-size: 9px;
    margin-top: 1px;
  }
  .dorapoka-loadout-effect-inline-btn {
    display: none !important;
  }
}
.dorapoka-play-loadout-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  flex-shrink: 0;
}
.dorapoka-play-loadout-sell {
  font: inherit;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 0.25rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(30, 41, 59, 0.95);
  color: #fcd34d;
  cursor: pointer;
}
.dorapoka-play-loadout-sell:hover {
  filter: brightness(1.1);
  border-color: rgba(251, 191, 36, 0.75);
}

.dorapoka-play-shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.5rem;
  align-items: start;
}
.dorapoka-play-shop-item__info {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.dorapoka-play-shop-item__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.5rem;
  margin-bottom: 0.125rem;
}
.dorapoka-play-shop-expand {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
}
.dorapoka-play-shop-expand:hover {
  color: #fde68a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dorapoka-play-shop-item__actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-end;
  flex-shrink: 0;
}
.dorapoka-play-shop-item__actions .dorapoka-run-btn {
  min-height: 40px;
  padding: 0.375rem 0.75rem;
  font-size: 12px;
  white-space: nowrap;
}

/* ── Step Summary: Slime Scene ──────────────────────────── */
.slime-scene {
  position: relative;
  height: 88px;
  overflow: hidden;
}
.scene-ground {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #475569 15%, #64748b 50%, #475569 85%, transparent 100%);
}
.sign-wrapper {
  position: absolute;
  right: 14px;
  bottom: 10px;
  transform: translateY(90px);
  animation: sign-rise 0.5s cubic-bezier(.22,1,.36,1) 0.15s forwards;
}
.sign-plank {
  background: linear-gradient(180deg, #D4981E 0%, #B57C0A 100%);
  border: 2px solid #6B4A0A;
  border-radius: 2px;
  padding: 5px 10px 4px;
  min-width: 88px;
  max-width: 140px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,230,100,.25), 0 3px 6px rgba(0,0,0,.45);
}
.sign-line1 {
  display: block;
  font-size: 9px;
  color: #4a3200;
  font-family: 'DotGothic16', monospace;
  letter-spacing: .05em;
}
.sign-line2 {
  display: block;
  font-size: 11px;
  color: #1e0f00;
  font-family: 'DotGothic16', monospace;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 134px;
  opacity: 0;
  animation: sign-text-in .35s ease .7s forwards;
}
.sign-line3 {
  display: block;
  font-size: 9px;
  color: #5a3e00;
  font-family: 'DotGothic16', monospace;
  opacity: 0;
  animation: sign-text-in .35s ease .85s forwards;
}
.slime-walker {
  position: absolute;
  bottom: 10px;
  left: 0;
  animation: slime-walk 2.4s ease-in-out 0.7s both;
}
.slime-hopper {
  animation: slime-hop .9s ease-in-out 0.7s infinite;
  transform-origin: bottom center;
  line-height: 0;
}
.slime-pixels {
  display: block;
  position: relative;
  overflow: visible;
}
@keyframes sign-rise {
  from { transform: translateY(90px); }
  to   { transform: translateY(0); }
}
@keyframes sign-text-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slime-walk {
  from { transform: translateX(-55px); }
  to   { transform: translateX(var(--slime-end-x, 180px)); }
}
@keyframes slime-hop {
  0%   { transform: translateY(0)      scaleX(1.22) scaleY(0.80); }
  18%  { transform: translateY(-14px)  scaleX(0.92) scaleY(1.10); }
  50%  { transform: translateY(-26px)  scaleX(0.86) scaleY(1.20); }
  78%  { transform: translateY(-10px)  scaleX(0.96) scaleY(1.05); }
  90%  { transform: translateY(0)      scaleX(1.28) scaleY(0.76); }
  100% { transform: translateY(0)      scaleX(1.22) scaleY(0.80); }
}
@keyframes slime-idle {
  from { transform: scaleX(1.08) scaleY(0.94); }
  to   { transform: scaleX(0.95) scaleY(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .sign-wrapper { animation: none !important; transform: translateY(0) !important; }
  .sign-line2, .sign-line3 { animation: none !important; opacity: 1 !important; transform: none !important; }
  .slime-walker { animation: none !important; transform: translateX(var(--slime-end-x, 180px)) !important; }
  .slime-hopper { animation: none !important; }
}
