/*
 * reversi002.css
 * Ownership: Wakabattle components, dialogs, cut-ins, results, and responsive presentation.
 * Shared shell, title screen, simple Reversi, and board primitives belong in reversi001.css.
 */

/* WAKABATTLE_COMPONENTS_MOVED_FROM_001 */
/* Wakabattle result screen. */
#sb-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 9500;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.56)),
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-001.webp")
      center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#sb-result-overlay.show {
  opacity: 1;
  pointer-events: all;
}

#sb-result-overlay:not(.show) {
  display: none;
}

#sb-result-overlay .ot-result-modal {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: min(380px, 88vw);
  aspect-ratio: 400 / 650;
  height: auto;
  min-height: 0;
  padding: 40px 36px 78px;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-015.webp")
    center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
  overflow: visible;
}

#sb-result-overlay .ot-result-modal::after,
#sb-result-overlay .ot-result-char-pane::after {
  display: none;
}

#sb-result-overlay .ot-result-char-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

#sb-result-overlay .ot-result-char-pane img {
  display: block;
  width: min(248px, 62vw);
  height: min(248px, 62vw);
  border: 3px solid #3a2010;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

#sb-result-overlay .ot-result-modal-body,
#sb-result-overlay .ot-result-step1,
#sb-result-overlay .ot-result-step2,
#sb-result-overlay #sb-win-choice,
#sb-result-overlay #sb-lose-actions {
  box-sizing: border-box;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}

#sb-result-overlay .ot-result-modal-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

#sb-result-overlay .ot-result-step1 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  height: 100%;
}

#sb-result-overlay .ot-result-step1 .ot-result-title {
  margin-top: auto;
}

#sb-result-overlay .ot-result-step1 #sb-next-btn {
  margin-top: auto;
}

#sb-result-overlay .ot-result-step2,
#sb-result-overlay #sb-win-choice,
#sb-result-overlay #sb-lose-actions {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

#sb-result-overlay .ot-result-title {
  margin: 0;
  color: #3a2010;
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(32px, 10vw, 50px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
  white-space: nowrap;
}

#sb-result-overlay .ot-result-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 7px 16px;
  gap: 10px;
  border: 1.5px solid rgba(58, 32, 16, 0.35);
  border-radius: 16px;
  background: rgba(58, 32, 16, 0.08);
}

#sb-result-overlay .ot-result-num {
  color: #3a2010;
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1;
  text-shadow: none;
}

#sb-result-overlay .ot-result-vs {
  color: rgba(58, 32, 16, 0.5);
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(18px, 4.5vw, 22px);
}

#sb-result-overlay #sb-win-choice > div:first-child {
  width: 100%;
  color: #3a2010;
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(16px, 5vw, 22px);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  text-shadow: none;
}

@media (max-width: 480px) {
  #sb-result-overlay {
    align-items: flex-start;
    padding: 76px 0 16px;
    background:
      linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.56)),
      url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-002.webp")
        center top / cover no-repeat;
  }
  #sb-result-overlay .ot-result-modal {
    width: min(92vw, 340px);
    padding: 46px 30px 102px;
    gap: 10px;
  }
  #sb-result-overlay .ot-result-char-pane img {
    width: min(54vw, 200px);
    height: min(54vw, 200px);
  }
  #sb-result-overlay .ot-result-step1 {
    gap: 12px;
  }
}

@media (max-width: 300px) {
  #sb-result-overlay .ot-result-step1 #sb-next-btn {
    align-self: flex-start;
    width: calc(100% - 46px);
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  #reversi .sb-continue-wins,
  .reversi-game .sb-continue-wins {
    font-size: 24px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  #reversi .sb-continue-title,
  .reversi-game .sb-continue-title {
    font-size: 15px;
    white-space: nowrap;
  }
}

.reversi-game #sb-save-quit-btn {
  font-size: var(--wk-font-control, 18px) !important;
  padding: 9px 22px !important;
  opacity: 1 !important;
  background: #f5f5f5 !important;
  border: 1.5px solid #ddd !important;
  color: rgba(0, 0, 0, 0.6) !important;
  letter-spacing: 0.06em;
  margin-top: 4px;
  animation: none !important;
}
.reversi-game #sb-save-quit-btn:hover {
  background: #eee !important;
  border-color: #bbb !important;
}

.sb-surrender-overlay {
  position: absolute;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  animation: sb-surrender-overlay-in 0.16s ease both;
}

.sb-surrender-overlay.hiding {
  animation: sb-surrender-overlay-out 0.2s ease forwards;
}

.sb-surrender-modal {
  box-sizing: border-box;
  width: min(292px, 88vw);
  padding: 18px 18px 16px;
  border: 2px solid rgba(88, 54, 30, 0.42);
  border-radius: 18px;
  background: rgba(255, 239, 205, 0.96);
  color: #3a2010;
  text-align: center;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-family: "DotGothic16", sans-serif;
  animation: sb-surrender-modal-in 0.18s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

.sb-surrender-title {
  margin: 0 0 14px;
  color: #3a2010;
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-shadow: none;
}

.sb-surrender-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sb-surrender-confirm-btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: 0 1 112px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 18px 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 4px;
  border-radius: 999px;
  background: var(--rv-button-bg, #171717);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
  box-shadow:
    0 4px 0 rgba(42, 22, 10, 0.82),
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 18px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.16s,
    background 0.16s,
    box-shadow 0.16s;
}

.sb-surrender-confirm-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(42, 22, 10, 0.82);
}

.sb-surrender-confirm-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.sb-surrender-no {
  border-color: rgba(92, 58, 28, 0.38);
  background: var(--wk-button-neutral);
  color: var(--wk-button-neutral-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  box-shadow:
    0 2px 0 rgba(92, 58, 28, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.52) inset,
    0 7px 16px rgba(0, 0, 0, 0.1);
}

@keyframes sb-surrender-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sb-surrender-overlay-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes sb-surrender-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sb-result-choice-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

#reversi .sb-result-choice-actions .ot-btn,
.reversi-game .sb-result-choice-actions .ot-btn,
.sb-result-choice-actions .ot-btn {
  min-width: 0;
  width: min(184px, calc((100vw - 88px) / 2));
}

@keyframes ot-pulse {
  0%,
  100% {
    box-shadow:
      0 4px 0 rgba(0, 0, 0, 0.2),
      0 6px 14px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow:
      0 4px 0 rgba(0, 0, 0, 0.2),
      0 10px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
  }
}

.mode-card.magic {
  cursor: pointer;
  background: #111;
  border-color: #fff;
}
.mode-card.magic .mode-name {
  color: #fff;
}
.wakabattle-title-ending {
  white-space: nowrap;
}
.wakabattle-title-crown {
  display: inline-flex;
  width: 22px;
  height: 20px;
  margin-left: 6px;
  vertical-align: -2px;
}
.wakabattle-title-crown[hidden] {
  display: none;
}
.wakabattle-title-crown svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(1px 2px 0 #463617);
}

.mode-card.magic .mode-desc {
  color: #fff;
  word-break: auto-phrase;
  text-wrap: balance;
}
.mode-card.magic .mode-arrow {
  color: rgba(255, 255, 255, 0.4);
}
.mode-card.magic:not(.disabled):hover .mode-arrow {
  color: rgba(255, 255, 255, 0.9);
}
.mode-card.magic:hover {
  border-color: #fff;
}
.mode-card.magic .mode-name,
.mode-card.magic .mode-desc,
.mode-card.magic .mode-badge {
  font-family: "DotGothic16", sans-serif;
}
.mode-badge.spec {
  background: #111;
  color: #fff;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.1em;
}

.ability-battle .sb-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin-bottom: 4px;
  position: relative;
}

.ability-battle .ot-cell.sealed {
  background: rgba(100, 55, 10, 0.85);
  outline: 2.5px solid rgba(160, 100, 40, 0.9);
  outline-offset: -2px;
  border-radius: 4px;
  animation: sealed-cell-pulse 1.2s ease-in-out infinite;
  z-index: 1;
  overflow: visible;
}

@keyframes sealed-cell-pulse {
  0% {
    outline-color: rgba(160, 100, 40, 0.5);
    background: rgba(100, 55, 10, 0.7);
  }
  50% {
    outline-color: rgba(210, 160, 90, 1);
    background: rgba(140, 85, 20, 0.9);
  }
  100% {
    outline-color: rgba(160, 100, 40, 0.5);
    background: rgba(100, 55, 10, 0.7);
  }
}

.ability-battle .ot-cell.sealed .sealed-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), clamp(13px, 3.5vw, 17px));
  font-weight: 900;
  color: rgba(255, 210, 150, 1);
  text-shadow:
    0 0 8px rgba(200, 130, 40, 0.95),
    0 0 20px rgba(160, 90, 10, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.9);
  z-index: 6;
  pointer-events: none;
  animation: sealed-num-pulse 1.2s ease-in-out infinite;
  letter-spacing: 0;
}

@keyframes sealed-num-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.ability-battle .ot-cell.sealed.being-selected {
  outline-color: rgba(220, 170, 100, 1);
  background: rgba(140, 80, 10, 0.7);
}

#screen-spec {
  --rv-button-bg: #171717;
  --rv-button-hover: #383838;
  --wk-button-neutral: #fff;
  --wk-button-neutral-ink: #111;
  --wk-button-neutral-edge: #b7b7b7;
  --wk-button-neutral-hover: #f0f0f0;
  flex-direction: column;
  align-items: center;
  background:
    linear-gradient(rgb(255 255 255 / 72%), rgb(255 255 255 / 76%)),
    var(--wb-field-image, url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-024.webp"))
      center center / cover no-repeat;
  min-height: 100vh;
  padding-bottom: 8px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}
#screen-spec .game-header {
  width: 100%;
  max-width: 520px;
}
#spec-game-root {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.reversi-game.ability-battle {
  gap: 4px;
}

.ability-battle .sb-col {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  min-height: clamp(70px, 20vw, 100px);
  position: relative;
  overflow: hidden;
}

.ability-battle .sb-top-row {
  --sb-top-gap: 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  gap: var(--sb-top-gap);
  padding: 6px 8px;
}

.ability-battle .sb-top-ability-col {
  grid-column: 2 / 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ability-battle .sb-top-ability-area {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sb-top-gap);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  align-items: start;
}

.ability-battle .sb-cpu-activate-spacer {
  height: 0;
  flex-shrink: 0;
}

.ability-battle .sb-top-char-box {
  grid-column: 1;
  min-width: 0;
  max-width: none;
  width: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.ability-battle .sb-top-char-box .sb-char-frame {
  width: 100%;
  flex: 1;
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

@media (max-width: 480px) {
  .ability-battle .sb-top-char-box {
    align-self: flex-start;
  }
  .ability-battle .sb-top-char-box .sb-char-frame {
    width: 100%;
    height: 100%;
    flex: unset;
    aspect-ratio: 1 / 1;
  }
  .ability-battle .sb-top-ability-col {
    grid-column: 2 / 5;
    --sb-skill-card-min-height: 80px;
}

  .ability-battle .sb-bottom-row {
    --sb-row-pad-x: 6px;
    --sb-row-gap: 4px;
    --sb-action-height: 44px;
    --sb-action-offset: 5px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto var(--sb-action-height);
    column-gap: var(--sb-row-gap);
    row-gap: var(--sb-action-offset);
    align-items: stretch;
    padding-bottom: 0;
  }
  .ability-battle .sb-bottom-char-box {
    order: 0;
    display: grid;
    grid-column: 1;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    min-width: unset;
    max-width: unset;
    width: auto;
    flex: none;
    aspect-ratio: auto;
    align-self: stretch;
    overflow: visible;
  }
  .ability-battle .sb-bottom-char-box .sb-char-frame {
    width: 100%;
    height: auto;
    flex: unset;
    aspect-ratio: 1 / 1;
  }
  .ability-battle .sb-surrender-btn {
    position: static;
    width: 100%;
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
    margin: 0;
  }
  .ability-battle .sb-bottom-ability-col {
    order: 1;
    display: grid;
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    flex: none;
    --sb-skill-card-min-height: 80px;
}
}

.ability-battle .sb-score-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 8px;
  gap: 4px;
}

.ability-battle .sb-score-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 4px 4px;
  gap: 1px;
  min-width: 0;
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.16) inset,
    -2px -2px 0 rgba(0, 0, 0, 0.4) inset,
    2px 2px 0 rgba(10, 20, 12, 0.28);
}

.ability-battle .sb-score-box-label {
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  max-width: 100%;
  overflow: visible;
  text-wrap: balance;
  min-height: 20px;
}

.ability-battle .sb-score-box-num {
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(22px, 7vw, 32px);
  color: #fff;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.38);
}

.ability-battle .sb-bottom-row {
  --sb-row-gap: 4px;
  --sb-action-height: 44px;
  --sb-action-offset: 3px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto var(--sb-action-height);
  align-items: stretch;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 0;
  column-gap: var(--sb-row-gap);
  row-gap: var(--sb-action-offset);
  padding: 0 8px;
}

.ability-battle .sb-bottom-char-box {
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  grid-template-rows: auto var(--sb-action-height);
  row-gap: var(--sb-action-offset);
  align-self: stretch;
  min-width: 0;
  max-width: none;
  width: auto;
}
.ability-battle .sb-bottom-char-box .sb-char-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.ability-battle .sb-surrender-btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: var(--sb-action-height);
  min-height: var(--sb-action-height);
  margin: 0;
  padding: 0 6px;
  border: 2px solid #dce6dc;
  border-radius: 3px;
  background: #080b09;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-control, 18px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 2px 2px 0 #000;
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.16) inset,
    -2px -2px 0 rgba(0, 0, 0, 0.55) inset,
    2px 2px 0 rgba(0, 0, 0, 0.3);
}
.ability-battle .sb-surrender-btn:active {
  transform: scale(0.98);
}

.ability-battle .sb-bottom-ability-col {
  display: grid;
  grid-column: 2 / 5;
  grid-row: 1 / 3;
  grid-template-rows: auto var(--sb-action-height);
  row-gap: var(--sb-action-offset);
  min-width: 0;
  width: auto;
}

.ability-battle .sb-bottom-ability-area {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sb-row-gap);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  align-items: stretch;
}

.ability-battle .sb-player-activate-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sb-row-gap);
  padding: 0;
}

.ability-battle .sb-activate-btn {
  box-sizing: border-box;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-control, 18px);
  height: var(--sb-action-height);
  min-height: var(--sb-action-height);
  border-radius: 4px;
  border: 2px solid #eee;
  background: linear-gradient(#303030, var(--rv-button-bg));
  color: #fff;
  cursor: pointer;
  transition:
    color 80ms steps(2, end),
    background-color 80ms steps(2, end),
    transform 0.1s;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  font-weight: 700;
  white-space: nowrap;
  padding: 0;
  width: 100%;
  z-index: 10;
  box-shadow:
    inset 0 1px 0 #6a6a6a,
    0 3px 0 #111,
    0 4px 2px rgba(0, 0, 0, 0.4);
}
.ability-battle .sb-activate-btn:not(:disabled):not(.btn-activating):hover {
  background: var(--rv-button-hover);
  color: #fff;
}
.ability-battle .sb-activate-btn:not(:disabled):not(.btn-activating):active {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 1px #595959, 0 1px 0 #111;
}
.ability-battle .sb-activate-btn:disabled {
  opacity: 1;
  pointer-events: none;
  background: linear-gradient(#4b4b4b, #363636);
  color: #d0d0d0;
  border-color: #929292;
  box-shadow: inset 0 1px 0 #626262, 0 2px 0 #222;
}
.ability-battle .sb-activate-btn.btn-activating {
  background: #fff;
  border-color: #111;
  color: #111;
  box-shadow: inset 0 0 0 1px #aaa, 0 3px 0 #111;
}

.ability-battle .sb-top-row.cpu-active .sb-top-ability-area,
.ability-battle .sb-top-row.cpu-active .sb-top-char-box .sb-char-frame {
  border-color: #aaa;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.ability-battle .sb-bottom-row.active .sb-bottom-ability-area,
.ability-battle .sb-bottom-row.active .sb-bottom-char-box .sb-char-frame {
  border-color: #555;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
}
.ability-battle .sb-score-bar .sb-score-box.active-score {
  box-shadow:
    0 0 0 2px #2c1b02,
    0 0 0 4px #ffd84a,
    3px 3px 0 rgba(0, 0, 0, 0.28);
  border-color: #ffd84a;
}

.ability-battle .sb-score-box[data-disc-color="black"] {
  background: #111;
  border-color: rgba(255, 255, 255, 0.18);
}
.ability-battle .sb-score-box[data-disc-color="black"] .sb-score-box-label {
  color: #fff;
  font-size: var(--wk-font-meta, 14px);
  white-space: normal;
  text-wrap: balance;
  min-height: 20px;
}
.ability-battle .sb-score-box[data-disc-color="black"] .sb-score-box-num {
  color: #fff;
}
.ability-battle .sb-score-box[data-disc-color="black"].active-score {
  box-shadow:
    0 0 0 2px #2c1b02,
    0 0 0 4px #ffd84a,
    3px 3px 0 rgba(0, 0, 0, 0.28);
  border-color: #ffd84a;
}

.ability-battle .sb-score-box[data-disc-color="white"] {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.8) inset,
    -2px -2px 0 rgba(0, 0, 0, 0.12) inset,
    2px 2px 0 rgba(0, 0, 0, 0.16);
}
.ability-battle .sb-score-box[data-disc-color="white"] .sb-score-box-label {
  color: #000;
  font-size: var(--wk-font-meta, 14px);
  white-space: normal;
  text-wrap: balance;
  min-height: 20px;
}
.ability-battle .sb-score-box[data-disc-color="white"] .sb-score-box-num {
  color: #111;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}
.ability-battle .sb-score-box[data-disc-color="white"].active-score {
  box-shadow:
    0 0 0 2px #2c1b02,
    0 0 0 4px #ffd84a,
    3px 3px 0 rgba(0, 0, 0, 0.22);
  border-color: #ffd84a;
}

.ability-battle .sb-score-box[data-disc-color="neutral"] {
  background: #111;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    2px 2px 0 rgba(255, 255, 255, 0.06);
}
.ability-battle .sb-score-box[data-disc-color="neutral"] .sb-score-box-label {
  color: #fff;
  font-size: var(--wk-font-meta, 14px);
  white-space: normal;
  text-wrap: balance;
  min-height: 20px;
}
.ability-battle .sb-score-box[data-disc-color="neutral"] .sb-score-box-num {
  color: #fff;
  text-shadow: none;
}

.ability-battle .sb-char-frame {
  background: #f0f0f0;
  border: 2px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.ability-battle .sb-char-frame.cpu-frame {
  border-color: #bbb;
  background: #f5f5f5;
}
.ability-battle .sb-char-frame.player-frame {
  border-color: #888;
  background: #f0f0f0;
}
.ability-battle .sb-char-img {
  width: 100%;
  height: 100%;
  background-size: auto 100%;
  background-position: center top;
  background-repeat: no-repeat;
}

.ability-battle .sb-character-status-trigger {
  cursor: help;
  touch-action: manipulation;
}
.ability-battle .sb-character-status-trigger:focus-visible {
  outline: 3px solid #ffe577;
  outline-offset: 3px;
}

/* 画像の近くに出す表示専用パネル。対局の枠やスクロール位置は動かさない。 */
.sb-character-status {
  position: fixed;
  z-index: 10000;
  width: 260px;
  box-sizing: border-box;
  padding: 12px;
  overflow: auto;
  border: 3px double #e4eee5;
  border-radius: 3px;
  background: #07110b;
  color: #fff;
  box-shadow:
    0 4px 0 #000,
    0 7px 18px rgba(0, 0, 0, 0.35);
  font-family: "DotGothic16", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  text-shadow: 1px 1px #000;
}
.sb-character-status[hidden] {
  display: none;
}
.sb-character-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sb-character-status-head strong {
  font-size: 17px;
}
.sb-character-status-head button {
  margin: 0;
  padding: 7px 8px;
  min-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #171717;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.sb-character-status-head button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.sb-character-status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  white-space: nowrap;
}
.sb-character-status-line.is-current {
  color: #ffe577;
}
.sb-character-status-stars {
  color: #ffe577;
  white-space: nowrap;
}
.sb-character-status-stars > span {
  color: #849388;
}
.sb-character-status-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #849388;
}

.ability-battle .sb-message-bar {
  text-align: center;
  font-family: "DotGothic16", sans-serif;
  width: calc(100% - 16px);
  max-width: 404px;
  margin: 0 auto;
  box-sizing: border-box;
}
.ability-battle .sb-message-bar.is-atari {
  color: #111111;
  background: linear-gradient(180deg, #ffffff 0%, #d8dbe0 48%, #9ca2aa 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 16px rgba(210, 220, 235, 0.82);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
  animation: sb-atari-message-pop 2s ease-out 1;
}

.ability-battle .sb-atari-sparkle-layer {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.34) 0 8%,
      transparent 42%
    ),
    radial-gradient(
      circle at 22% 30%,
      rgba(255, 244, 165, 0.95) 0 2px,
      transparent 5px
    ),
    radial-gradient(
      circle at 76% 24%,
      rgba(255, 255, 255, 0.95) 0 2px,
      transparent 6px
    ),
    radial-gradient(
      circle at 28% 76%,
      rgba(255, 244, 165, 0.9) 0 2px,
      transparent 6px
    ),
    radial-gradient(
      circle at 72% 72%,
      rgba(255, 255, 255, 0.88) 0 2px,
      transparent 5px
    );
  mix-blend-mode: screen;
  animation: sb-atari-sparkle-burst 2s ease-out both;
}

.ability-battle .sb-atari-sparkle-layer::before,
.ability-battle .sb-atari-sparkle-layer::after {
  content: "";
  position: absolute;
  inset: var(--sb-atari-inset, 12%);
  background:
    radial-gradient(
      circle at 18% 48%,
      rgba(255, 255, 255, 0.95) 0 3px,
      transparent 7px
    ),
    radial-gradient(
      circle at 40% 18%,
      rgba(255, 237, 92, 0.95) 0 3px,
      transparent 8px
    ),
    radial-gradient(
      circle at 62% 58%,
      rgba(255, 255, 255, 0.92) 0 2px,
      transparent 7px
    ),
    radial-gradient(
      circle at 84% 42%,
      rgba(255, 237, 92, 0.9) 0 3px,
      transparent 8px
    );
  filter: drop-shadow(0 0 8px rgba(255, 248, 180, 0.95));
  animation: sb-atari-sparkle-drift 2s ease-out both;
}

.ability-battle .sb-atari-sparkle-layer::after {
  --sb-atari-inset: 5%;
  transform: rotate(24deg);
  animation-name: sb-atari-sparkle-drift-alt;
}

@keyframes sb-atari-sparkle-burst {
  0% {
    opacity: 0;
    transform: scale(0.92);
    filter: brightness(1);
  }
  12% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1.6);
  }
  58% {
    opacity: 0.78;
    filter: brightness(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
    filter: brightness(0.9);
  }
}

@keyframes sb-atari-sparkle-drift {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(1.12);
  }
}

@keyframes sb-atari-sparkle-drift-alt {
  0% {
    opacity: 0;
    transform: rotate(24deg) translateY(12px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: rotate(24deg) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(24deg) translateY(-24px) scale(1.16);
  }
}

@keyframes sb-atari-message-pop {
  0% {
    transform: scale(0.98);
    filter: brightness(1);
  }
  18% {
    transform: scale(1.035);
    filter: brightness(1.45);
  }
  42% {
    transform: scale(1);
    filter: brightness(1.18);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.ability-battle .ot-board-wrap,
.ability-battle .ot-board-inner,
.ability-battle .ot-grid,
.ability-battle .ot-cell {
  visibility: visible !important;
}
.ability-battle .ot-board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(
    --board-bg-image,
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-013-hd.webp")
  );
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}
.ability-battle .ot-board-inner {
  position: relative;
  z-index: 1;
  background: #0d4327;
  border: 3px solid #07170e;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #e9f7e9,
    0 0 0 5px #174f30,
    0 6px 0 #092b19,
    0 10px 16px rgba(4, 28, 15, 0.28);
}

.ability-battle .sb-end-announcement {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 0, 0, 0.3);
}

.ability-battle .sb-end-announcement.show {
  visibility: visible;
  opacity: 1;
}

.ability-battle .sb-end-announcement-dialog {
  display: grid;
  place-items: center;
  width: min(88%, 360px);
  min-height: 52px;
  padding: 9px 10px 8px;
  box-sizing: border-box;
  border: 3px solid #f4f6f4;
  outline: 3px solid #07170e;
  background: #080b09;
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), min(4.2vw, 22px));
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #000;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.48);
  animation: sb-end-announcement-pop 1.2s steps(2, end) both;
}

.ability-battle .sb-end-announcement-dialog > span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .ability-battle .sb-end-announcement-dialog {
    width: calc(100% - 24px);
    max-width: none;
    min-height: 40px;
    padding: 7px 4px 6px;
    font-size: max(var(--wk-font-min, 14px), min(3.8vw, 15px));
    letter-spacing: 0;
    line-height: 1;
    overflow: hidden;
  }
}

@keyframes sb-end-announcement-pop {
  0% {
    transform: scale(0.86);
    filter: brightness(1.8);
  }
  18% {
    transform: scale(1.04);
    filter: brightness(1.2);
  }
  35%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.ability-battle .ot-disc {
  width: 80%;
  height: 80%;
  box-sizing: border-box;
  border: 2px solid;
  filter: none;
}

.ability-battle .ot-disc.black {
  border-color: #050505;
  background: radial-gradient(
    circle at 34% 28%,
    #a3a3a3 0 8%,
    #686868 9% 18%,
    #353535 19% 43%,
    #191919 44% 72%,
    #080808 73% 100%
  );
  box-shadow:
    0 3px 0 #020202,
    3px 3px 0 rgba(0, 0, 0, 0.22),
    -2px -2px 0 rgba(255, 255, 255, 0.12) inset;
}

.ability-battle .ot-disc.white {
  border-color: #b8b8b8;
  background: radial-gradient(
    circle at 34% 28%,
    #fff 0 12%,
    #f4f4f4 13% 36%,
    #dedede 37% 70%,
    #bcbcbc 71% 100%
  );
  box-shadow:
    0 3px 0 #969696,
    3px 3px 0 rgba(0, 0, 0, 0.18),
    -2px -2px 0 rgba(255, 255, 255, 0.72) inset;
}

.ability-battle .sb-ability-panel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
}

#reversi .ability-battle .sb-ability-slot.slot-empty {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: default;
  visibility: visible !important;
  background: #0b100e !important;
  border: 2px solid #aab8ae !important;
  border-radius: 3px !important;
  box-shadow:
    inset 0 0 0 3px #0b100e,
    inset 0 0 0 4px rgba(235, 244, 237, 0.3),
    0 2px 0 #050806 !important;
}
#reversi .ability-battle .slot-empty .sb-inline-ability-name {
  visibility: visible !important;
  color: #f5f7f3 !important;
  font-size: 16px !important;
  font-family: "DotGothic16", sans-serif;
  font-weight: 900 !important;
  letter-spacing: 0.08em;
  text-shadow: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.ability-battle .sb-ability-slot.slot-empty * {
  visibility: hidden;
}
.ability-battle .sb-ability-slot.slot-empty .sb-activate-btn {
  display: none !important;
}

.ability-battle .sb-top-ability-area .sb-ability-slot,
.ability-battle .sb-bottom-ability-area .sb-ability-slot {
  width: 100%;
  aspect-ratio: auto;
  display: flex;
  min-height: var(--sb-skill-card-min-height, 132px);
}

.ability-battle .sb-ability-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 5px;
  border-radius: 4px;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  transition:
    opacity 80ms steps(2, end),
    box-shadow 80ms steps(2, end);
  position: relative;
  overflow: hidden;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.ability-battle .sb-ability-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.24) 0 22%,
    transparent 23% 100%
  );
  border-radius: 3px;
  pointer-events: none;
}
.ability-battle .sb-ability-slot[class*="slot-cat-"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  border-radius: 3px;
  pointer-events: none;
  z-index: 0;
}
.ability-battle .sb-ability-slot > * {
  position: relative;
  z-index: 1;
}
.ability-battle .sb-ability-slot:not(.slot-used):not(.slot-disabled):hover {
  box-shadow:
    0 0 0 2px #f7fff7,
    3px 3px 0 rgba(0, 0, 0, 0.26);
}
.ability-battle .sb-ability-slot:not(.slot-used):not(.slot-disabled):active {
  box-shadow:
    0 0 0 2px #ffd84a,
    2px 2px 0 rgba(0, 0, 0, 0.28);
}

.ability-battle .sb-ability-slot.slot-used {
  background-color: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 0.45;
}

.ability-battle .sb-ability-slot.slot-disabled {
  cursor: not-allowed;
}

.ability-battle .cpu-ability-area .sb-ability-slot {
  cursor: default;
}

.ability-battle .sb-slot-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
  margin-top: 3px;
  flex-shrink: 0;
}

.ability-battle .sb-slot-cond-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  background: linear-gradient(180deg, #fff 0 46%, #c5c5c5 47% 100%);
  border: 1px solid #111;
  border-bottom: 2px solid #111;
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    2px 2px 0 rgba(0, 0, 0, 0.22);
  min-height: 26px;
  height: auto;
  padding: 2px 7px 3px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: 0;
  vertical-align: middle;
}

.ability-battle .sb-ability-slot[class*="slot-cat-"] {
  background-color: #333;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.ability-battle .sb-ability-slot.slot-cat-placement {
  background-color: #236fc8;
}
.ability-battle .sb-ability-slot.slot-cat-flip {
  background-color: #8140c8;
}
.ability-battle .sb-ability-slot.slot-cat-erase {
  background-color: #c83a32;
}
.ability-battle .sb-ability-slot.slot-cat-guard {
  background-color: #21964a;
}
.ability-battle .sb-ability-slot.slot-cat-combo {
  background-color: #b88d00;
}
.ability-battle .sb-ability-slot.slot-cat-block {
  background-color: #9a5b24;
}
.ability-battle .sb-ability-slot.slot-cat-hint {
  background-color: #666a70;
}
.ability-battle .sb-ability-slot.slot-cat-null {
  background-color: #242424;
}

/* Every ability category has its card art.  Keep this mapping in one place. */
.ability-battle .sb-ability-slot.slot-cat-placement {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-007-hd.webp");
}
.ability-battle .sb-ability-slot.slot-cat-erase {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-009-hd.webp");
}
.ability-battle .sb-ability-slot.slot-cat-guard {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-012-hd.webp");
}
.ability-battle .sb-ability-slot.slot-cat-block {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-011-hd.webp");
}
.ability-battle .sb-ability-slot.slot-cat-hint {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-013-hd.webp");
}
.ability-battle .sb-ability-slot.slot-cat-null {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-014-hd.webp");
}

.ability-battle .sb-ability-slot.slot-cat-flip.slot-lv1 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-008-hd.webp");
  border: 1.5px solid #cc88ff;
  box-shadow:
    0 3px 8px rgba(147, 40, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: brightness(1.15);
}
.ability-battle .sb-ability-slot.slot-cat-flip.slot-lv2 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-008-hd.webp");
  border: 1.5px solid #9328ff;
  box-shadow:
    0 3px 8px rgba(147, 40, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.ability-battle .sb-ability-slot.slot-cat-flip.slot-lv3 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-008-hd.webp");
  border: 1.5px solid #5500cc;
  box-shadow:
    0 3px 8px rgba(147, 40, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(0.85);
}
.ability-battle .sb-ability-slot.slot-cat-flip {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-008-hd.webp");
  border: 1.5px solid #9328ff;
  box-shadow:
    0 3px 8px rgba(147, 40, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ability-battle .sb-ability-slot.slot-cat-combo.slot-lv1 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-010-hd.webp");
  border: 1.5px solid #ffff88;
  box-shadow:
    0 3px 8px rgba(255, 255, 40, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: brightness(1.15);
}
.ability-battle .sb-ability-slot.slot-cat-combo.slot-lv2 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-010-hd.webp");
  border: 1.5px solid #ffff28;
  box-shadow:
    0 3px 8px rgba(255, 255, 40, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.ability-battle .sb-ability-slot.slot-cat-combo.slot-lv3 {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-010-hd.webp");
  border: 1.5px solid #aaaa00;
  box-shadow:
    0 3px 8px rgba(255, 255, 40, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(0.85);
}
.ability-battle .sb-ability-slot.slot-cat-combo {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-010-hd.webp");
  border: 1.5px solid #ffff28;
  box-shadow:
    0 3px 8px rgba(255, 255, 40, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* スキル説明は #reversi を基準に重ね、対局全体のレイアウトには参加させない。 */
#reversi .sb-ability-tooltip {
  position: absolute;
  z-index: 120;
  display: none;
  width: min(280px, calc(100% - 24px));
  box-sizing: border-box;
  padding: 10px 12px;
  border: 2px solid rgba(20, 20, 20, 0.78);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.97);
  color: #111;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}
#reversi .sb-ability-tooltip.visible {
  display: block;
}
#reversi .sb-ability-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 7px;
  transform: translateX(-50%);
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.sb-ability-tooltip.tip-below {
  transform: none;
}
.sb-ability-tooltip.tip-below.visible {
  transform: none;
}
.sb-ability-tooltip.tip-below::after {
  bottom: auto;
  top: -6px;
  background: #fff;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.sb-tip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.sb-tip-name {
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #111;
}
.sb-tip-cond-group {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.sb-tip-cond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9d9 48%, #a9a9a9 100%);
  border: 1px solid #111;
  border-bottom: 2px solid #111;
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.18);
  min-height: 21px;
  height: 21px;
  padding: 2px 7px 3px;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
  vertical-align: middle;
}
.sb-tip-desc {
  font-family: system-ui, "Yu Gothic", Meiryo, sans-serif;
  font-size: var(--wk-font-body, 16px);
  color: #333;
  line-height: 1.6;
  font-weight: 400;
  white-space: normal;
  text-shadow: none;
}

.ability-battle .sb-ability-slot .sb-inline-activate-btn {
  display: none;
}

.ability-battle .sb-inline-ability-label {
  display: block;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  line-height: 1.2;
  width: 100%;
  text-align: center;
  align-self: flex-start;
}
.ability-battle .cpu-ability-area .sb-inline-ability-label {
  color: rgba(0, 0, 0, 0.45);
}

@media (max-width: 767px) {
  .ability-battle .sb-inline-ability-label {
    display: none;
  }
}

.ability-battle .sb-inline-ability-name {
  display: contents;
}
.ability-battle .cpu-ability-area .sb-inline-ability-name {
  display: contents;
}

.ability-battle .sb-inline-ability-name.sb-dom-ability-card {
  position: absolute;
  inset: 4px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 4px;
  border-radius: 7px;
  pointer-events: none;
  overflow: hidden;
  container-type: inline-size;
}
.ability-battle .sb-inline-activate-btn {
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-control, 18px);
  padding: 4px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.3, 1.4, 0.6, 1);
  letter-spacing: 0.1em;
  border: none;
  line-height: 1.5;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.ability-battle .sb-inline-activate-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.15s;
}
.ability-battle .sb-inline-activate-btn:not(:disabled):hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.ability-battle .sb-inline-activate-btn.player-btn {
  background: #111;
  color: #fff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.ability-battle .sb-inline-activate-btn.player-btn:not(:disabled):hover {
  background: #333;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.04);
}
.ability-battle .sb-inline-activate-btn.player-btn.activating {
  background: #444;
  box-shadow:
    0 0 14px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: ot-pulse 1.4s ease-in-out infinite;
}

.ability-battle .sb-inline-activate-btn.cpu-btn {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.35);
  box-shadow: none;
}

.ability-battle .sb-inline-activate-btn:disabled {
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: saturate(0.4) brightness(0.7);
}
.ability-battle .sb-inline-activate-btn.used {
  filter: saturate(0.3) brightness(0.6);
}

@media (min-width: 768px) {
  #screen-spec .game-header,
  #spec-game-root {
    max-width: 520px;
  }

  .ability-battle .sb-top-row,
  .ability-battle .sb-bottom-row,
  .ability-battle .sb-score-bar {
    max-width: 520px;
    padding: 0 8px;
  }
  .ability-battle .sb-top-row {
    --sb-top-gap: 5px;
    margin-top: 1px;
    margin-bottom: 0;
  }
  .ability-battle .sb-top-char-box .sb-char-frame {
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    flex: none;
    aspect-ratio: 1 / 1;
  }
  .ability-battle .sb-score-bar {
    gap: 5px;
    margin-top: 1px;
    margin-bottom: 1px;
  }
  .ability-battle .sb-top-row,
  .ability-battle .sb-bottom-row {
    align-items: stretch;
  }

  .ability-battle .sb-cpu-activate-spacer {
    height: 0;
  }
  .ability-battle .sb-activate-btn {
    height: var(--sb-action-height);
    font-size: var(--wk-font-control, 18px);
  }
  .ability-battle .sb-bottom-row {
    --sb-row-gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ability-battle .sb-bottom-ability-area {
    gap: var(--sb-row-gap);
    padding: 0;
  }

  .ability-battle .sb-score-box-num {
    font-size: clamp(26px, 4.5vw, 36px);
  }

  .ability-battle .ot-board-wrap {
    max-width: 520px;
    padding: 57px;
  }

  .ability-battle .sb-ability-panel {
    max-width: 520px;
  }

  .ability-battle .sb-message-bar {
    width: calc(100% - 16px);
    max-width: 504px;
  }
}

@keyframes sbCoinSpin {
  0% {
    transform: rotateY(0deg) rotateX(0deg);
  }
  72% {
    transform: rotateY(calc(var(--spin-deg, 1080deg) + 12deg)) rotateX(0deg);
  }
  90% {
    transform: rotateY(calc(var(--spin-deg, 1080deg) - 6deg));
  }
  100% {
    transform: rotateY(var(--spin-deg, 1080deg));
  }
}
.sb-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.sb-coin-black {
  background: radial-gradient(
    circle at 34% 28%,
    #a3a3a3 0 8%,
    #686868 9% 18%,
    #353535 19% 43%,
    #191919 44% 72%,
    #080808 73% 100%
  );
  border: 3px solid #050505;
  box-shadow:
    0 5px 0 #020202,
    5px 5px 0 rgba(0, 0, 0, 0.24),
    -3px -3px 0 rgba(255, 255, 255, 0.12) inset;
  transform: rotateY(0deg);
}
.sb-coin-white {
  background: radial-gradient(
    circle at 34% 28%,
    #fff 0 12%,
    #f4f4f4 13% 36%,
    #dedede 37% 70%,
    #bcbcbc 71% 100%
  );
  border: 3px solid #a9a9a9;
  box-shadow:
    0 5px 0 #8e8e8e,
    5px 5px 0 rgba(0, 0, 0, 0.18),
    -3px -3px 0 rgba(255, 255, 255, 0.72) inset;
  transform: rotateY(180deg);
}

.sb-coin-face::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 23%;
  width: 18%;
  height: 8%;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 8px -4px 0 rgba(255, 255, 255, 0.22);
}

.sb-coin-white::after {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 8px -4px 0 rgba(255, 255, 255, 0.68);
}

.sb-coin-disc-label {
  display: none;
}

.sb-coin-result {
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(18px, 5vw, 32px);
  font-weight: 900;
  letter-spacing: 0.06em;
  opacity: 0;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.22, 1.4, 0.4, 1);
  transform: translateY(12px) scale(0.92);
  line-height: 1.7;
  text-align: center;
  color: #3a2010;
}
.sb-coin-result.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.sb-coin-result.black {
  color: #3a2010;
}
.sb-coin-result.white {
  color: #3a2010;
}

.sb-swap-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(10, 3, 22, 0.45), rgba(10, 3, 22, 0.45)),
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-001.webp")
      center center / cover no-repeat !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  padding: 12px;
  overflow-y: auto;
  --sb-swap-bg-img: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-001.webp");
  --sb-swap-bg-grad: linear-gradient(
    to bottom,
    rgba(10, 3, 22, 0.5) 0%,
    rgba(10, 3, 22, 0.15) 35%,
    rgba(10, 3, 22, 0.4) 100%
  );
}
@media (max-width: 480px) {
  .sb-swap-overlay {
    background:
      linear-gradient(rgba(10, 3, 22, 0.45), rgba(10, 3, 22, 0.45)),
      url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-002.webp")
        center center / cover no-repeat !important;
    --sb-swap-bg-img: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-002.webp");
    --sb-swap-bg-grad: linear-gradient(
      to bottom,
      rgba(10, 3, 22, 0.65) 0%,
      rgba(10, 3, 22, 0.45) 100%
    );
  }
}
.sb-swap-overlay > * {
  position: relative;
  z-index: 1;
}

.sb-swap-modal {
  background: rgba(14, 14, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px 22px 26px;
  width: 100%;
  max-width: 480px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}
@media (max-width: 480px) {
  .sb-swap-modal {
    background: rgba(10, 10, 18, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.sb-swap-modal:not(.sb-choice-modal) {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-015.webp") !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45)) !important;
  overflow: visible !important;
  padding: 56px 40px 78px !important;
  max-width: 360px !important;
  width: 92vw !important;
}
@media (min-width: 481px) {
  .sb-swap-modal:not(.sb-choice-modal) {
    max-width: 500px !important;
    padding: 72px 54px 116px !important;
    margin-top: -49px !important;
  }
}

.sb-swap-title {
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(20px, 11vw, 42px);
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.9),
    0 2px 12px rgba(0, 0, 0, 0.7);
}

.sb-swap-subtitle {
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-body, 16px);
  color: #ffffff;
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.sb-swap-incoming-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.sb-swap-incoming-label {
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sb-swap-incoming-card {
  width: 100%;
  cursor: default;
}

.sb-swap-incoming-card.selected {
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
}

.sb-swap-incoming-icon {
  font-size: 20px;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(255, 200, 0, 0.6);
  margin-bottom: 4px;
}

.sb-swap-incoming-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-swap-incoming-name {
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), clamp(11px, 3.5vw, 15px));
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.sb-swap-incoming-cond {
  font-size: var(--wk-font-meta, 14px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}

.sb-swap-incoming-desc {
  font-family: system-ui, "Yu Gothic", Meiryo, sans-serif;
  font-size: var(--wk-font-body, 16px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.6;
  text-shadow: none;
}

.sb-swap-arrow {
  font-size: 26px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  margin: 8px 0 10px;
  animation: swapArrowPulse 1.2s ease-in-out infinite;
}

@keyframes swapArrowPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  50% {
    opacity: 0.8;
    transform: translateY(3px);
  }
}

.sb-swap-slots-label {
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-align: center;
}

.sb-swap-slots-sublabel {
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  color: #3a2010;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  text-align: center;
  margin-bottom: 10px;
}

.sb-swap-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.sb-swap-slot {
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition:
    box-shadow 0.18s,
    transform 0.15s,
    border-color 0.18s;
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.sb-swap-slot.filled {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.sb-swap-slot.empty {
  background: rgba(255, 255, 255, 0.04);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

.sb-swap-slot.sb-swap-cat-placement {
  background: rgba(30, 100, 200, 0.55) !important;
  border-color: rgba(30, 100, 200, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-flip {
  background: rgba(160, 80, 230, 0.55) !important;
  border-color: rgba(160, 80, 230, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-erase {
  background: rgba(240, 60, 60, 0.55) !important;
  border-color: rgba(240, 60, 60, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-combo {
  background: rgba(200, 155, 0, 0.55) !important;
  border-color: rgba(200, 155, 0, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-block {
  background: rgba(160, 100, 40, 0.55) !important;
  border-color: rgba(160, 100, 40, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-hint {
  background: rgba(140, 140, 140, 0.5) !important;
  border-color: rgba(140, 140, 140, 0.75) !important;
}
.sb-swap-slot.sb-swap-cat-guard {
  background: rgba(40, 180, 80, 0.55) !important;
  border-color: rgba(40, 180, 80, 0.8) !important;
}
.sb-swap-slot.sb-swap-cat-null {
  background: rgba(60, 60, 60, 0.6) !important;
  border-color: rgba(120, 120, 120, 0.75) !important;
}

.sb-swap-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.sb-swap-slot:active {
  transform: scale(0.97);
}

.sb-swap-slot-name-row {
  display: flex;
  flex-wrap: nowrap;
  margin-bottom: 4px;
}

.sb-swap-slot-icon {
  flex-shrink: 0;
}

.sb-swap-slot-empty-icon {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.2);
  line-height: 1;
}

.sb-swap-slot-name {
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), clamp(11px, 3.5vw, 15px));
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.sb-swap-slot.empty .sb-swap-slot-name {
  color: rgba(255, 255, 255, 0.3);
  font-size: var(--wk-font-body, 16px);
}

.sb-swap-slot-desc {
  font-family: system-ui, "Yu Gothic", Meiryo, sans-serif;
  font-size: var(--wk-font-body, 16px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.6;
  text-shadow: none;
}

.sb-swap-slot-cond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9d9 48%, #a9a9a9 100%);
  border: 1px solid #111;
  border-bottom: 2px solid #111;
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.18);
  min-height: 21px;
  height: 21px;
  border-radius: 6px;
  padding: 2px 7px 3px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 2px;
  letter-spacing: 0;
  vertical-align: middle;
}

.sb-swap-slot-hint {
  font-size: var(--wk-font-meta, 14px);
  color: rgba(0, 0, 0, 0.4);
  margin-top: 2px;
  opacity: 0.8;
}

.sb-swap-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

#reversi .sb-swap-actions .ot-btn,
.reversi-game .sb-swap-actions .ot-btn,
.sb-swap-actions .ot-btn {
  min-width: 0;
  width: min(184px, calc((100vw - 88px) / 2));
}

#reversi .sb-swap-actions .ot-btn:only-child,
.reversi-game .sb-swap-actions .ot-btn:only-child,
.sb-swap-actions .ot-btn:only-child {
  min-width: min(230px, 75vw);
  width: auto;
}

@media (max-width: 360px) {
  .sb-swap-actions {
    gap: 8px;
  }
  #reversi .sb-swap-actions .ot-btn,
  .reversi-game .sb-swap-actions .ot-btn,
  .sb-swap-actions .ot-btn {
    width: min(164px, calc((100vw - 64px) / 2));
    padding-left: 10px;
    padding-right: 10px;
    font-size: var(--wk-font-control, 16px);
  }
}

.sb-choice-card.selected {
  outline: 2.5px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.5);
}
.sb-choice-card.selected.sb-choice-cat-placement {
  background: rgba(30, 100, 200, 0.8);
  border-color: rgba(100, 160, 255, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-flip {
  background: rgba(148, 0, 211, 0.8);
  border-color: rgba(200, 100, 255, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-erase {
  background: rgba(220, 50, 50, 0.8);
  border-color: rgba(255, 120, 120, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-combo {
  background: rgba(180, 135, 0, 0.8);
  border-color: rgba(255, 210, 50, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-block {
  background: rgba(160, 100, 40, 0.8);
  border-color: rgba(210, 150, 80, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-hint {
  background: rgba(130, 130, 130, 0.75);
  border-color: rgba(200, 200, 200, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-guard {
  background: rgba(30, 160, 60, 0.8);
  border-color: rgba(80, 220, 110, 0.9);
}
.sb-choice-card.selected.sb-choice-cat-null {
  background: rgba(60, 60, 60, 0.85);
  border-color: rgba(160, 160, 160, 0.9);
}

.sb-swap-slot.swap-selected {
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.sb-continue-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-001.webp")
      center center / cover no-repeat;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
@media (max-width: 480px) {
  .sb-continue-overlay {
    background:
      linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
      url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-002.webp")
        center center / cover no-repeat;
  }
}
.sb-continue-overlay > * {
  position: relative;
  z-index: 1;
}

.sb-continue-modal {
  background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-015.webp");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
  overflow: visible;
  padding: 56px 40px 78px;
  max-width: 360px;
  width: 92vw;
  min-width: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: continueModalIn 0.3s ease;
}

@keyframes continueModalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sb-continue-face {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #3a2010;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.sb-continue-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.sb-continue-wins {
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 400;
  color: #3a2010;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-shadow: none;
  margin: 0;
}

.sb-continue-title {
  font-family: "DotGothic16", sans-serif;
  color: #3a2010;
  text-shadow: none;
  margin: 0;
}

.sb-continue-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin-top: 4px;
}

.sb-continue-actions .ot-btn {
  width: 75%;
}

.sb-cutin {
  position: absolute;
  inset: 0;
  left: 50%;
  right: auto;
  width: min(86%, 820px);
  max-width: 820px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
  overflow: visible;
}

.sb-cutin-wrap {
  position: relative;
  width: 100%;
  animation: ci-in 160ms steps(4, end) both;
}
.sb-cutin-card {
  position: relative;
  height: clamp(250px, 22vw, 300px);
  border: 2px solid var(--ci-accent);
  border-radius: 3px;
  background: var(--ci-base);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    4px 4px 0 #080b10,
    0 10px 24px rgba(0, 0, 0, 0.28);
}
.sb-cutin-card-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
}
.sb-cutin-char {
  position: absolute;
  bottom: 0;
  width: 44%;
  height: 100%;
  object-fit: contain;
  z-index: 4;
  filter: drop-shadow(2px 0 0 #080b10);
  animation: ci-portrait 220ms steps(4, end) both;
}
.sb-cutin-char.side-l {
  left: 0;
  object-position: left bottom;
}
.sb-cutin-char.side-r {
  right: 0;
  object-position: right bottom;
}
.sb-cutin-text {
  position: absolute;
  top: 34%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: ci-title 160ms steps(3, end) var(--ci-reveal) both;
}
.sb-cutin-text.side-r {
  left: 46%;
  right: 4%;
  text-align: center;
}
.sb-cutin-text.side-l {
  left: 4%;
  right: 46%;
  text-align: center;
}
.sb-cutin-title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}
.sb-cutin-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sb-cutin-skill-rank,
.sb-cutin-atari {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid #fff0ae;
  border-radius: 2px;
  background: #4b341a;
  color: #fff0ae;
  font-family: "DotGothic16", sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
  box-shadow: 2px 2px 0 #17120a;
}
.sb-cutin-atari {
  color: #211805;
  background: #ffdf62;
  border-color: #fff4bd;
}
.sb-cutin-text-name {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: "DotGothic16", sans-serif;
  font-size: clamp(38px, 4.4vw, 56px);
  font-weight: 400;
  color: var(--ci-title);
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 2px 2px 0 var(--ci-base);
  overflow: visible;
  -webkit-text-stroke: 0;
}
.sb-cutin-text-name.is-long-name {
  font-size: clamp(34px, 4vw, 50px);
}
.sb-cutin.cutin-exit .sb-cutin-wrap {
  animation: ci-out 180ms steps(4, end) forwards;
}
@media (max-width: 430px) {
  .sb-cutin {
    left: 4px;
    right: 4px;
    width: auto;
    max-width: none;
    transform: none;
  }
  .sb-cutin-card {
    height: clamp(166px, 43vw, 188px);
  }
  .sb-cutin-char {
    width: 44%;
  }
  .sb-cutin-text.side-r {
    left: 45%;
    right: 9px;
  }
  .sb-cutin-text.side-l {
    left: 9px;
    right: 45%;
  }
  .sb-cutin-text-name {
    font-size: clamp(23px, 6.6vw, 28px);
  }
  .sb-cutin-text-name.is-long-name {
    font-size: clamp(21px, 6vw, 26px);
  }
  .sb-cutin-title-row {
    gap: 8px;
  }
  .sb-cutin-badges {
    gap: 4px;
  }
  .sb-cutin-skill-rank,
  .sb-cutin-atari {
    padding: 3px 5px;
    font-size: var(--wk-font-min, 14px);
    border-width: 1px;
  }
}
@media (min-width: 431px) and (max-width: 834px) {
  .sb-cutin-card {
    height: clamp(188px, 30vw, 250px);
  }
  .sb-cutin-text-name {
    font-size: clamp(27px, 4.8vw, 40px);
  }
  .sb-cutin-text-name.is-long-name {
    font-size: clamp(25px, 4.4vw, 36px);
  }
  .sb-cutin-skill-rank,
  .sb-cutin-atari {
    font-size: 17px;
  }
}
@keyframes ci-in {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes ci-out {
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}
@keyframes ci-portrait {
  from {
    transform: translateY(18px);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes ci-title {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 6px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@media (max-width: 767px) {
  .ability-battle .sb-score-box-label .sb-score-color-note {
    display: none;
  }

  .reversi-game .ot-board-wrap {
    padding: 14px 36px;
  }

  .ability-battle .ot-board-wrap {
    width: min(calc(100vw - 28px), 360px);
    max-width: 360px;
    box-sizing: border-box;
    align-self: center;
    padding: clamp(34px, 9.75vw, 41px);
  }
  .ability-battle .ot-board-inner,
  .ability-battle .ot-grid {
    width: 100%;
    box-sizing: border-box;
  }

  .ability-battle .sb-top-row,
  .ability-battle .sb-bottom-row {
    width: min(calc(100vw - 28px), 360px);
    max-width: 360px;
    padding: 2px 6px;
  }
  .ability-battle .sb-top-row {
    --sb-top-gap: 4px;
  }
  .ability-battle .sb-score-bar {
    width: min(calc(100vw - 28px), 360px);
    max-width: 360px;
    padding: 0 6px;
    gap: 4px;
  }

  .ability-battle .sb-message-bar {
    width: min(calc(100vw - 40px), 348px);
    max-width: 348px;
  }

  .ability-battle .sb-top-char-box .sb-char-frame {
    width: 100%;
    height: 100%;
    flex: unset;
    aspect-ratio: 1 / 1;
    min-height: unset;
    max-height: unset;
  }
  .ability-battle .sb-bottom-char-box .sb-char-frame {
    width: 100%;
    height: auto;
    flex: unset;
    aspect-ratio: 1 / 1;
    min-height: unset;
    max-height: unset;
  }

  .ability-battle .sb-score-box-num {
    font-size: clamp(20px, 6vw, 24px);
  }
  .ability-battle .sb-score-box-label {
    font-size: var(--wk-font-meta, 14px);
    white-space: normal;
  text-wrap: balance;
  min-height: 20px;
}

  .ability-battle .sb-activate-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
    font-size: max(var(--wk-font-control, 16px), clamp(12px, 3.4vw, 14px));
  }
  .ability-battle .sb-cpu-activate-spacer {
    height: 0;
  }

  .ability-battle .sb-bottom-row {
    margin-bottom: 20px;
    --sb-row-pad-x: 6px;
    --sb-row-gap: 4px;
    --sb-action-height: 44px;
    --sb-action-offset: 5px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto var(--sb-action-height);
    column-gap: var(--sb-row-gap);
    row-gap: var(--sb-action-offset);
    align-items: stretch;
    padding-bottom: 2px;
  }
  .ability-battle .sb-bottom-ability-col {
    display: grid;
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
  }
  .ability-battle .sb-bottom-ability-area {
    flex: unset;
    width: 100%;
    padding: 0;
  }
  .ability-battle .sb-player-activate-row {
    position: static;
    margin-top: 0;
    gap: 3px;
    padding: 0;
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
  }
  .ability-battle .sb-bottom-char-box {
    display: grid;
    grid-column: 1;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
    overflow: visible;
  }
  .ability-battle .sb-surrender-btn {
    position: static;
    width: 100%;
    margin: 0;
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
    font-size: var(--wk-font-control, 16px);
  }
}

@media (max-width: 390px) {
  .ability-battle .sb-top-row,
  .ability-battle .sb-bottom-row,
  .ability-battle .sb-score-bar {
    padding: 0 6px;
  }
  .ability-battle .sb-top-row {
    --sb-top-gap: 5px;
  }
  .ability-battle .sb-score-bar {
    gap: 5px;
  }
  .ability-battle .sb-bottom-row {
    --sb-row-pad-x: 6px;
    --sb-row-gap: 5px;
    --sb-action-height: 44px;
    --sb-action-offset: 5px;
    padding-bottom: 0;
  }
  .ability-battle .sb-top-char-box .sb-char-frame,
  .ability-battle .sb-bottom-char-box .sb-char-frame {
    height: auto;
    min-height: unset;
    max-height: unset;
  }
  .ability-battle .sb-cpu-activate-spacer {
    height: 0;
  }
  .ability-battle .sb-activate-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
  }
  .ability-battle .sb-surrender-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
    font-size: max(var(--wk-font-control, 16px), clamp(9px, 2.6vw, 11px));
  }
  .ability-battle .sb-score-box-num {
    font-size: clamp(18px, 7vw, 28px);
  }
  .ability-battle .sb-score-box-label {
    font-size: var(--wk-font-meta, 14px);
    white-space: normal;
  text-wrap: balance;
  min-height: 20px;
}
  .ability-battle .sb-player-activate-row {
    position: static;
    gap: 4px;
    padding: 0;
  }
  .ability-battle .sb-bottom-ability-col {
    display: grid;
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
  }
  .ability-battle .sb-bottom-ability-area {
    flex: unset;
    width: 100%;
    padding: 0;
  }
  .ability-battle .sb-bottom-char-box {
    display: grid;
    grid-column: 1;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
    overflow: visible;
  }
  .ability-battle .sb-surrender-btn {
    position: static;
    width: 100%;
    margin: 0;
  }
  .ability-battle .sb-bottom-row {
    margin-bottom: 30px;
  }

  .ability-battle .sb-message-bar {
    width: calc(100% - 12px);
    max-width: 408px;
  }
}
@media (max-width: 340px) {
  .ability-battle .sb-top-row {
    --sb-top-gap: 3px;
  }
  .ability-battle .sb-top-char-box .sb-char-frame {
    height: 100%;
    min-height: unset;
    max-height: unset;
  }
  .ability-battle .sb-bottom-char-box .sb-char-frame {
    height: auto;
    min-height: unset;
    max-height: unset;
  }
  .ability-battle .sb-score-box-num {
    font-size: 16px;
  }
  .ability-battle .sb-cpu-activate-spacer {
    height: 0;
  }
  .ability-battle .sb-activate-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
  }
  .ability-battle .sb-bottom-row {
    --sb-row-pad-x: 6px;
    --sb-row-gap: 4px;
    --sb-action-height: 44px;
    --sb-action-offset: 5px;
    padding-bottom: 0;
  }
  .ability-battle .sb-surrender-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
    font-size: var(--wk-font-control, 16px);
  }
  .ability-battle .sb-bottom-ability-col {
    display: grid;
    grid-column: 2 / 5;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
  }
  .ability-battle .sb-bottom-ability-area {
    flex: unset;
    width: 100%;
    padding: 0;
  }
  .ability-battle .sb-bottom-char-box {
    display: grid;
    grid-column: 1;
    grid-row: 1 / 3;
    grid-template-rows: auto var(--sb-action-height);
    row-gap: var(--sb-action-offset);
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
    overflow: visible;
  }
  .ability-battle .sb-player-activate-row {
    position: static;
    gap: 3px;
    padding: 0;
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
  }
  .ability-battle .sb-bottom-row {
    margin-bottom: 20px;
  }
}
@media (max-height: 700px) {
  .ability-battle .sb-cpu-activate-spacer {
    height: 0;
  }
  .ability-battle .sb-activate-btn {
    height: var(--sb-action-height, 44px);
    min-height: var(--sb-action-height, 44px);
  }
  .ability-battle .sb-surrender-btn {
    height: var(--sb-action-height, 44px);
    min-height: var(--sb-action-height, 44px);
  }
}

@media (max-width: 380px) and (max-height: 640px) {
  .ability-battle .sb-bottom-row {
    --sb-action-height: 44px;
  }
  .ability-battle .sb-player-activate-row,
  .ability-battle .sb-activate-btn,
  .ability-battle .sb-surrender-btn {
    height: var(--sb-action-height);
    min-height: var(--sb-action-height);
  }
}

.ot-disc.disc-ability {
  animation: discAbilityDrop 0.45s cubic-bezier(0.22, 1.5, 0.4, 1) both;
}

@keyframes discAbilityDrop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ot-disc.disc-flipped {
  animation:
    discFlippedIn 0.45s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discFlippedGlow 0.6s ease-out 0.1s both;
}

@keyframes discFlippedIn {
  0% {
    transform: scaleX(0);
    opacity: 0.4;
  }
  55% {
    transform: scaleX(1.12);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes discFlippedGlow {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 20px 8px rgba(160, 80, 230, 0.9),
      inset 0 3px 8px rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 0px 0px rgba(160, 80, 230, 0),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
}

.ot-disc.disc-set {
  animation:
    discSetDrop 0.55s cubic-bezier(0.18, 1.4, 0.4, 1) both,
    discSetGlow 3.8s ease-out 0.08s both;
}

@keyframes discSetDrop {
  0% {
    transform: scale(0) translateY(-6px);
    opacity: 0;
  }
  55% {
    transform: scale(1.12) translateY(2px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes discSetGlow {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 28px 12px rgba(50, 160, 240, 1),
      inset 0 3px 8px rgba(200, 240, 255, 0.5);
  }
  30% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 20px 8px rgba(40, 140, 220, 0.7),
      inset 0 3px 8px rgba(180, 230, 255, 0.3);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 0px 0px rgba(40, 140, 220, 0),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
}

.ot-disc.disc-pass {
  animation:
    discPassDrop 0.38s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discPassGlow 0.7s ease-out 0.05s both;
}

@keyframes discPassDrop {
  0% {
    transform: scale(0.3) translateY(-8px);
    opacity: 0;
  }
  55% {
    transform: scale(1.12) translateY(2px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes discPassGlow {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 28px 12px rgba(240, 190, 0, 1),
      inset 0 3px 8px rgba(255, 255, 255, 0.4);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 0px 0px rgba(240, 190, 0, 0),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
}

.ability-battle .ot-cell.cell-erased {
  animation: cellErasedFlash 0.55s ease-out both;
}

@keyframes cellErasedFlash {
  0% {
    background: rgba(239, 68, 68, 0.85);
    box-shadow: inset 0 0 16px 4px rgba(255, 100, 100, 0.9);
  }
  40% {
    background: rgba(239, 68, 68, 0.5);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.ot-disc.disc-guarded {
  animation: discGuardedPulse 1.4s ease-in-out infinite;
  overflow: visible;
  position: relative;
}

.ot-disc.flip.disc-guarded {
  animation:
    discFlippedIn 0.45s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discGuardedPulse 1.4s ease-in-out 0.45s infinite;
}
.ot-disc.disc-set.disc-guarded {
  animation:
    discSetDrop 0.55s cubic-bezier(0.18, 1.4, 0.4, 1) both,
    discGuardedPulse 1.4s ease-in-out 0.55s infinite;
}
.ot-disc.disc-pass.disc-guarded {
  animation:
    discPassDrop 0.38s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discGuardedPulse 1.4s ease-in-out 0.38s infinite;
}

@keyframes discGuardedPulse {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 3px rgba(40, 180, 80, 0.5),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 22px 9px rgba(80, 220, 120, 0.8),
      inset 0 3px 8px rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 3px rgba(40, 180, 80, 0.5),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
}

.ability-battle .ot-disc .guard-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), clamp(11px, 3vw, 15px));
  font-weight: 900;
  color: rgba(160, 255, 180, 1);
  text-shadow:
    0 0 6px rgba(40, 200, 80, 0.95),
    0 0 16px rgba(20, 160, 50, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.9);
  z-index: 6;
  pointer-events: none;
  animation: guard-num-pulse 1.4s ease-in-out infinite;
  letter-spacing: 0;
}

@keyframes guard-num-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.ot-disc.disc-cpu-guarded {
  animation: discCpuGuardedPulse 1.4s ease-in-out infinite;
  overflow: visible;
  position: relative;
}

.ot-disc.flip.disc-cpu-guarded {
  animation:
    discFlippedIn 0.45s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discCpuGuardedPulse 1.4s ease-in-out 0.45s infinite;
}
.ot-disc.disc-set.disc-cpu-guarded {
  animation:
    discSetDrop 0.55s cubic-bezier(0.18, 1.4, 0.4, 1) both,
    discCpuGuardedPulse 1.4s ease-in-out 0.55s infinite;
}
.ot-disc.disc-pass.disc-cpu-guarded {
  animation:
    discPassDrop 0.38s cubic-bezier(0.22, 1.5, 0.4, 1) both,
    discCpuGuardedPulse 1.4s ease-in-out 0.38s infinite;
}

@keyframes discCpuGuardedPulse {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 3px rgba(10, 130, 40, 0.45),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 20px 8px rgba(40, 180, 80, 0.75),
      inset 0 3px 8px rgba(255, 255, 255, 0.25);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 3px rgba(10, 130, 40, 0.45),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
  }
}

.ability-battle .ot-board-wrap.board-ability-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  animation: boardAbilityFlash 0.9s ease-out forwards;
  z-index: 10;
}

.ability-battle .ot-board-wrap.board-ability-flash-player::after {
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 75%
  );
}

.ability-battle .ot-board-wrap.board-ability-flash-cpu::after {
  background: radial-gradient(
    circle at center,
    rgba(80, 80, 80, 0.35) 0%,
    rgba(40, 40, 40, 0.15) 50%,
    transparent 75%
  );
}

@keyframes boardAbilityFlash {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

.cutin-exit .sb-cutin-band {
  animation-duration: 0.4s !important;
}
.cutin-exit .sb-cutin-content {
  animation-duration: 0.35s !important;
}
.ability-battle .ot-cell.hint-guided {
  background: rgba(255, 255, 255, 0.22) !important;
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: -2px;
  border-radius: 4px;
  animation: guided-cell-pulse 0.75s ease-in-out infinite;
  z-index: 1;
}
.ability-battle .ot-cell.hint-guided::after {
  content: none;
}
@keyframes guided-cell-pulse {
  0%,
  100% {
    outline-color: rgba(200, 200, 200, 0.6);
    background: rgba(255, 255, 255, 0.12) !important;
  }
  50% {
    outline-color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.32) !important;
  }
}

.sb-choice-modal {
  max-width: 360px;
  width: 92vw;
}

.sb-choice-chapter {
  text-align: center;
  font-size: var(--wk-font-meta, 14px);
  font-family: "DotGothic16", sans-serif;
  font-weight: 700;
  color: #3a2010;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.sb-choice-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.sb-choice-card {
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition:
    box-shadow 0.18s,
    transform 0.15s,
    border-color 0.18s;
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}
.sb-choice-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.sb-choice-card:active {
  transform: scale(0.98);
}

.sb-choice-cat-placement {
  background: rgba(30, 100, 200, 0.55);
  border-color: rgba(30, 100, 200, 0.8);
}
.sb-choice-cat-flip {
  background: rgba(160, 80, 230, 0.55);
  border-color: rgba(160, 80, 230, 0.8);
}
.sb-choice-cat-erase {
  background: rgba(240, 60, 60, 0.55);
  border-color: rgba(240, 60, 60, 0.8);
}
.sb-choice-cat-combo {
  background: rgba(200, 155, 0, 0.55);
  border-color: rgba(200, 155, 0, 0.8);
}
.sb-choice-cat-block {
  background: rgba(160, 100, 40, 0.55);
  border-color: rgba(160, 100, 40, 0.8);
}
.sb-choice-cat-hint {
  background: rgba(140, 140, 140, 0.5);
  border-color: rgba(140, 140, 140, 0.75);
}
.sb-choice-cat-guard {
  background: rgba(40, 180, 80, 0.55);
  border-color: rgba(40, 180, 80, 0.8);
}
.sb-choice-cat-null {
  background: rgba(60, 60, 60, 0.6);
  border-color: rgba(120, 120, 120, 0.75);
}

.sb-choice-name-row {
  display: flex;
  flex-wrap: nowrap;
  margin-bottom: 4px;
}
.sb-choice-icon {
  flex-shrink: 0;
}
.sb-choice-name {
  font-family: "DotGothic16", sans-serif;
  font-size: max(var(--wk-font-min, 14px), clamp(11px, 3.5vw, 15px));
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  display: inline;
  flex-shrink: 0;
  margin-bottom: 0;
}
.sb-choice-cond-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9d9 48%, #a9a9a9 100%);
  border: 1px solid #111;
  border-bottom: 2px solid #111;
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.18);
  min-height: 21px;
  height: 21px;
  padding: 2px 7px 3px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 2px;
  letter-spacing: 0;
  vertical-align: middle;
}
.sb-choice-desc {
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-body, 16px);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.55;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.ability-battle .ot-cell.hint-flip {
  outline: 2.5px solid rgba(160, 80, 230, 0.9);
  outline-offset: -2px;
  border-radius: 4px;
  background: rgba(110, 30, 190, 0.18);
  animation: flip-cell-pulse 1.1s ease-in-out infinite;
  z-index: 1;
}

@keyframes flip-cell-pulse {
  0% {
    outline-color: rgba(160, 80, 230, 0.6);
    background: rgba(110, 30, 190, 0.1);
  }
  50% {
    outline-color: rgba(210, 140, 255, 1);
    background: rgba(150, 60, 220, 0.28);
  }
  100% {
    outline-color: rgba(160, 80, 230, 0.6);
    background: rgba(110, 30, 190, 0.1);
  }
}

.ability-battle .ot-disc.disc-flip-target {
  animation: flip-disc-glow 1.1s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes flip-disc-glow {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 2px rgba(160, 80, 230, 0.4),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 18px 6px rgba(200, 120, 255, 0.85),
      inset 0 3px 8px rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 2px rgba(160, 80, 230, 0.4),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
    transform: scale(1);
  }
}

.ability-battle .ot-cell.hint-flip:hover {
  background: rgba(130, 50, 210, 0.35);
  outline-color: rgba(210, 140, 255, 1);
}

.ability-battle .ot-cell.hint-flip:hover .ot-disc.disc-flip-target {
  animation: none;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.3),
    0 0 24px 8px rgba(200, 120, 255, 1),
    inset 0 3px 8px rgba(255, 255, 255, 0.35);
  transform: scale(1.15);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}

.ability-battle .ot-board-wrap.board-block-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  animation: boardBlockFlash 1s ease-out forwards;
  z-index: 10;
  background: radial-gradient(
    circle at center,
    rgba(160, 100, 40, 0.75) 0%,
    rgba(100, 55, 10, 0.3) 50%,
    transparent 75%
  );
}

@keyframes boardBlockFlash {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

.ability-battle .ot-cell.hint-block {
  background: rgba(100, 55, 10, 0.35);
  outline: 2.5px solid rgba(210, 165, 100, 0.9);
  outline-offset: -2px;
  border-radius: 4px;
  animation: block-cell-pulse 1.1s ease-in-out infinite;
  z-index: 1;
}

@keyframes block-cell-pulse {
  0% {
    outline-color: rgba(160, 100, 40, 0.55);
    background: rgba(100, 55, 10, 0.2);
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.15);
  }
  50% {
    outline-color: rgba(255, 220, 140, 1);
    background: rgba(140, 85, 20, 0.45);
    box-shadow:
      0 0 14px 5px rgba(255, 220, 140, 0.5),
      0 0 6px 2px rgba(255, 255, 255, 0.35);
  }
  100% {
    outline-color: rgba(160, 100, 40, 0.55);
    background: rgba(100, 55, 10, 0.2);
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.15);
  }
}

.ability-battle .ot-cell.hint-block::after {
  content: none;
}

.ability-battle .ot-cell.hint-erase {
  outline: 2.5px solid rgba(252, 100, 100, 0.9);
  outline-offset: -2px;
  border-radius: 4px;
  background: rgba(200, 30, 30, 0.18);
  animation: erase-cell-pulse 1.1s ease-in-out infinite;
  z-index: 1;
}

@keyframes erase-cell-pulse {
  0% {
    outline-color: rgba(252, 100, 100, 0.5);
    background: rgba(200, 30, 30, 0.1);
  }
  50% {
    outline-color: rgba(255, 160, 160, 1);
    background: rgba(220, 50, 50, 0.3);
  }
  100% {
    outline-color: rgba(252, 100, 100, 0.5);
    background: rgba(200, 30, 30, 0.1);
  }
}

.ability-battle .ot-disc.disc-erase-target {
  animation: erase-disc-glow 1.1s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes erase-disc-glow {
  0% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 2px rgba(252, 100, 100, 0.4),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 18px 6px rgba(255, 120, 120, 0.85),
      inset 0 3px 8px rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
  }
  100% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.3),
      0 0 8px 2px rgba(252, 100, 100, 0.4),
      inset 0 3px 8px rgba(255, 255, 255, 0.15);
    transform: scale(1);
  }
}

.ability-battle .ot-cell.hint-erase:hover {
  background: rgba(220, 50, 50, 0.38);
  outline-color: rgba(255, 180, 180, 1);
}

.ability-battle .ot-cell.hint-erase:hover .ot-disc.disc-erase-target {
  animation: none;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.3),
    0 0 24px 8px rgba(255, 120, 120, 1),
    inset 0 3px 8px rgba(255, 255, 255, 0.35);
  transform: scale(1.15);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}

#screen-spec,
#screen-spec
  :where(
    :not(
      .sb-tip-desc,
      .sb-swap-incoming-desc,
      .sb-swap-slot-desc,
      .sb-skill-choice-desc
    )
  ),
.sb-swap-overlay,
.sb-swap-overlay
  :where(
    :not(
      .sb-tip-desc,
      .sb-swap-incoming-desc,
      .sb-swap-slot-desc,
      .sb-skill-choice-desc
    )
  ),
.sb-continue-overlay,
.sb-continue-overlay
  :where(
    :not(
      .sb-tip-desc,
      .sb-swap-incoming-desc,
      .sb-swap-slot-desc,
      .sb-skill-choice-desc
    )
  ),
.sb-coin-overlay,
.sb-coin-overlay
  :where(
    :not(
      .sb-tip-desc,
      .sb-swap-incoming-desc,
      .sb-swap-slot-desc,
      .sb-skill-choice-desc
    )
  ),
.sb-ability-tooltip,
.sb-ability-tooltip
  :where(
    :not(
      .sb-tip-desc,
      .sb-swap-incoming-desc,
      .sb-swap-slot-desc,
      .sb-skill-choice-desc
    )
  ) {
  font-family: "DotGothic16", sans-serif !important;
}

.sb-cutin-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 1;
  background-color: var(--ci-base, #050607);
  background-image: linear-gradient(
    115deg,
    var(--ci-tint, #183345),
    var(--ci-base) 76%
  );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.sb-cutin-bg::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 43%;
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--ci-accent) 32%, var(--ci-base)),
    color-mix(in srgb, var(--ci-accent) 16%, var(--ci-base))
  );
  clip-path: polygon(
    0 0,
    100% 0,
    100% 28%,
    97% 28%,
    97% 62%,
    94% 62%,
    94% 100%,
    0 100%
  );
}
.cutin-cpu .sb-cutin-bg {
  background-image: linear-gradient(
    245deg,
    var(--ci-tint, #183345),
    var(--ci-base) 76%
  );
}
.cutin-cpu .sb-cutin-bg::before {
  left: auto;
  right: 0;
  transform: scaleX(-1);
}
.sb-cutin-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: linear-gradient(90deg, var(--ci-accent) 0 22%, transparent 22%)
    top left / 100% 3px no-repeat;
}
.cutin-cpu .sb-cutin-bg::after {
  transform: scaleX(-1);
}

/* 盤面を選択するスキルの対象マス。JS では状態だけ付与し、見た目はここで一元管理する。 */
#reversi .ot-cell.pending-sel,
.reversi-game .ot-cell.pending-sel {
  position: relative;
  outline: 4px solid #050505 !important;
  outline-offset: -4px !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.86),
    0 0 13px rgba(0, 0, 0, 0.48) !important;
  z-index: 8;
}
#reversi .ot-cell.pending-sel[data-selected-order]::before,
.reversi-game .ot-cell.pending-sel[data-selected-order]::before {
  content: attr(data-selected-order);
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.78);
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-min, 14px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.mode-arrow {
  display: none;
}

.mode-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 4px;
  border: 2px solid currentColor;
  font-family: "Fredoka One", sans-serif;
  font-size: var(--wk-font-control, 18px);
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  width: 100%;
  min-height: 44px;
  transition:
    opacity 0.15s,
    transform 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: none;
}

.mode-select-btn::before {
  display: none;
}

.mode-select-label {
  position: relative;
  z-index: 1;
}

.mode-save-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}
#reversi .mode-select-btn[hidden],
#reversi .mode-save-actions[hidden] {
  display: none;
}

.mode-select-btn:hover {
  opacity: 0.82;
  transform: none;
  box-shadow: none;
}

.mode-select-btn:active {
  transform: none;
}

.mode-card.simple .mode-select-btn {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: none;
}

.mode-card.simple .mode-select-btn:hover {
  background: #333;
  box-shadow: none;
}

.mode-card.magic .mode-select-btn {
  background: #fff;
  color: #111;
  border-color: #fff;
  box-shadow: none;
}

.mode-card.magic .mode-select-btn:hover {
  background: #e8e8e8;
  box-shadow: none;
}

.mode-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px 7px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  touch-action: manipulation;
  cursor: pointer;
  box-shadow: none;
}

.mode-save-btn:hover {
  background: #e8e8e8;
  transform: none;
}

.mode-card.mode-card-selected {
  outline: 2px solid #555;
  outline-offset: 3px;
  box-shadow: none;
}

.mode-card.simple.mode-card-selected {
  border-color: #111;
}

.mode-card.magic.mode-card-selected {
  border-color: #fff;
}

#screen-title {
  transition:
    background-color 0.5s ease,
    background-image 0.5s ease;
}

#screen-title.bg-simple::before {
  background-color: #e8f5f4;
  background-image:
    linear-gradient(rgba(17, 153, 142, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 153, 142, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  transition:
    background-color 0.5s,
    background-image 0.5s;
}

#screen-title.bg-simple {
  background: linear-gradient(160deg, #e8f5f4 0%, #f0fffe 60%, #e0f2f1 100%);
}

#screen-title.bg-magic::before,
#screen-title[data-bg-mode="magic"]::before {
  display: none;
}

#screen-title.bg-magic::before {
  content: none;
}

#screen-title.bg-magic {
  background:
    linear-gradient(
      to bottom,
      rgba(10, 3, 22, 0.5) 0%,
      rgba(10, 3, 22, 0.15) 35%,
      rgba(10, 3, 22, 0.4) 100%
    ),
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-003.webp")
      center center / cover no-repeat;
}

@media (max-width: 480px) {
  #screen-title.bg-magic {
    background:
      linear-gradient(
        to bottom,
        rgba(10, 3, 22, 0.5) 0%,
        rgba(10, 3, 22, 0.15) 35%,
        rgba(10, 3, 22, 0.4) 100%
      ),
      url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-004.webp")
        center top / cover no-repeat;
  }
}

/* Milestone scenes: original artwork, large counts and a quiet pixel frame. */
.sb-level-clear-overlay,
.sb-level-start-overlay {
  --sb-milestone-space: 32px;
  --sb-milestone-height: calc(
    var(--wb-visible-height, 100svh) - var(--wb-header-height, 0px) - 2 *
      var(--wb-stage-gap, 16px)
  );
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  overflow: hidden;
  border-radius: inherit;
  isolation: isolate;
  color: #f7f6ef;
  background: radial-gradient(
    ellipse at 50% 40%,
    #12252a 0%,
    #0b141a 43%,
    #070c10 80%
  );
  animation: sb-fade-in 0.5s ease;
}
.sb-level-clear-overlay.hiding,
.sb-level-start-overlay.hiding {
  animation: sb-fade-out 0.42s ease forwards;
}
.sb-level-clear-inner,
.sb-level-start-inner {
  --sb-milestone-corner: #e2c685;
  position: relative;
  z-index: 3;
  isolation: isolate;
  box-sizing: border-box;
  width: min(100%, 640px);
  height: min(
    660px,
    calc(var(--sb-milestone-height) - var(--sb-milestone-space))
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 30px);
  border: 1px solid #7d795a;
  border-radius: 8px;
  text-align: center;
  background: linear-gradient(150deg, #0f1c21ee, #071115ee);
  box-shadow:
    0 0 0 3px #0a1115,
    0 14px 48px #0006;
  overflow: hidden;
  font-family: "DotGothic16", sans-serif;
}
.sb-level-start-inner {
  --sb-milestone-corner: #b5d6c5;
}
.sb-level-clear-inner::before,
.sb-level-start-inner::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #434a3e;
  border-radius: 3px;
  pointer-events: none;
}
.sb-level-clear-inner::after,
.sb-level-start-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    #fff 4px
  );
  opacity: 0.025;
}
.sb-milestone-corners {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner)) left
      top / 18px 2px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner)) left
      top / 2px 18px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner))
      right top / 18px 2px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner))
      right top / 2px 18px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner)) left
      bottom / 18px 2px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner)) left
      bottom / 2px 18px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner))
      right bottom / 18px 2px no-repeat,
    linear-gradient(var(--sb-milestone-corner), var(--sb-milestone-corner))
      right bottom / 2px 18px no-repeat;
}
.sb-level-clear-badge,
.sb-level-start-label {
  flex: none;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-bottom: 15px;
}
.sb-level-clear-badge::after,
.sb-level-start-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4b97688, transparent);
}
.sb-level-clear-count,
.sb-level-start-count {
  font-size: clamp(64px, min(12vw, 11svh), 100px);
  font-weight: 400;
  line-height: 1.05;
  color: #efdb9c;
  font-variant-numeric: tabular-nums;
  text-shadow:
    3px 3px #423c29,
    0 0 20px #e6c87c1f;
}
.sb-level-start-count {
  color: #c1e4d6;
  text-shadow:
    3px 3px #29463e,
    0 0 20px #a0d9c41f;
}
.sb-milestone-heading-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.sb-level-clear-copy,
.sb-level-start-copy {
  font-size: clamp(19px, 4.2vw, 28px);
  line-height: 1.2;
  letter-spacing: 2px;
  color: #a5b8b4;
  white-space: nowrap;
}
.sb-level-clear-sub,
.sb-level-start-sub {
  font-size: clamp(23px, 5.2vw, 34px);
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: 1px;
}
.sb-milestone-character-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-milestone-character-stage::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 6%;
  bottom: 6%;
  z-index: -1;
  background: radial-gradient(
    ellipse,
    #c6dba41a 0%,
    #e7c37a0a 42%,
    transparent 70%
  );
}
.sb-milestone-character-stage::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4b97655, transparent);
}
.sb-level-clear-character,
.sb-level-start-character {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 16px #0006);
  user-select: none;
  -webkit-user-drag: none;
}
.sb-level-clear-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 176px;
  min-height: 48px;
  padding: 8px 24px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #171717;
  color: #fff;
  font:
    21px "DotGothic16",
    sans-serif;
  box-shadow: inset 0 0 0 3px #111;
  cursor: pointer;
  touch-action: manipulation;
}
.sb-level-clear-btn span {
  font-size: var(--wk-font-meta, 14px);
  color: inherit;
}
.sb-level-clear-btn:active {
  background: #383838;
}
.sb-level-clear-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
.sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-badge,
.sb-level-start-overlay.wakabattle-scene-ready .sb-level-start-label {
  animation: sbMilestoneCopyIn 0.38s steps(6, end) both;
}
.sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-character,
.sb-level-start-overlay.wakabattle-scene-ready .sb-level-start-character {
  animation: sbMilestoneCharacterIn 0.55s ease 0.12s both;
}
.sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-btn {
  animation: sbMilestoneCopyIn 0.3s steps(6, end) 0.4s both;
}
@media (max-width: 480px) {
  .sb-level-clear-overlay,
  .sb-level-start-overlay {
    --sb-milestone-space: 16px;
  }
  .sb-level-clear-inner,
  .sb-level-start-inner {
    padding: 18px 14px;
    gap: 12px;
  }
  .sb-level-clear-badge,
  .sb-level-start-label {
    gap: 14px;
    padding-bottom: 12px;
  }
  .sb-level-clear-count,
  .sb-level-start-count {
    font-size: clamp(58px, 18vw, 78px);
  }
  .sb-milestone-heading-copy {
    gap: 5px;
  }
  .sb-level-clear-copy,
  .sb-level-start-copy {
    font-size: 18px;
    letter-spacing: 1px;
  }
  .sb-level-clear-sub,
  .sb-level-start-sub {
    font-size: 22px;
  }
  .sb-level-clear-btn {
    min-height: 44px;
    min-width: 156px;
    font-size: 18px;
  }
}
@media (max-height: 520px) {
  .sb-level-clear-inner,
  .sb-level-start-inner {
    gap: 10px;
    padding: 12px 14px;
  }
  .sb-level-clear-badge,
  .sb-level-start-label {
    padding-bottom: 8px;
  }
  .sb-level-clear-count,
  .sb-level-start-count {
    font-size: 54px;
  }
  .sb-milestone-heading-copy {
    gap: 3px;
  }
  .sb-level-clear-copy,
  .sb-level-start-copy {
    font-size: 16px;
  }
  .sb-level-clear-sub,
  .sb-level-start-sub {
    font-size: 20px;
  }
  .sb-level-clear-btn {
    min-height: 44px;
    font-size: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sb-level-clear-overlay,
  .sb-level-start-overlay,
  .sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-badge,
  .sb-level-start-overlay.wakabattle-scene-ready .sb-level-start-label,
  .sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-character,
  .sb-level-start-overlay.wakabattle-scene-ready .sb-level-start-character,
  .sb-level-clear-overlay.wakabattle-scene-ready .sb-level-clear-btn {
    animation: none;
  }
}
.bi-overlay {
  position: absolute;
  inset: 0;
  z-index: 10500;
  background-color: #000;
  background-image: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.bi-overlay > * {
  animation: biFadeIn 0.4s ease 0.05s both;
}
@keyframes biFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.bi-overlay.hiding {
  animation: biFadeOut 0.4s ease forwards;
}
@keyframes biFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.bi-taunt-colorbg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: color;
  opacity: 0.9;
}

.bi-taunt-img {
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 92%;
  height: auto;
  image-rendering: pixelated;
  z-index: 3;
  transform: translateX(-50%) scale(0.75) translateY(24px);
  opacity: 0;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease;
}
.bi-taunt-img.enter {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(0);
}

.bi-taunt-name {
  display: none;
}

.bi-taunt-msgbox {
  border-width: 5px;
  border-radius: 18px !important;
  display: flex;
  flex-direction: column;
}

.bi-status-outer {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 178px;
}
.bi-status-frame {
  position: relative;
  width: 100%;
}
.bi-status-frame-img {
  display: none;
}
.bi-status-inner {
  position: relative;
  padding: 10px 14px 12px;
  background: #000000;
  border: 5px solid #ffffff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "DotGothic16", monospace;
}
.bi-status-head {
  font-family: "DotGothic16", monospace;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
  padding-bottom: 6px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.bi-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bi-status-label {
  font-family: "DotGothic16", monospace;
  font-size: var(--wk-font-meta, 14px);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.bi-status-stars {
  font-size: 15px;
  color: #f0c040;
  letter-spacing: -1px;
  text-shadow: 0 0 6px rgba(240, 192, 64, 0.5);
}
@media (max-width: 480px) {
  .bi-status-outer {
    width: 120px;
  }
  .bi-status-inner {
    padding: 6px 8px 8px;
    gap: 4px;
  }
  .bi-status-head {
    font-size: var(--wk-font-min, 14px);
    padding-bottom: 4px;
    margin-bottom: 0;
  }
  .bi-status-label {
    font-size: var(--wk-font-min, 14px);
  }
  .bi-status-stars {
    font-size: var(--wk-font-min, 14px);
  }
}

.bi-name-tag-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 0;
  z-index: 20;
}
.bi-name-frame {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translateY(0);
  width: auto;
  min-width: 80px;
  max-width: 220px;
}
.bi-name-frame-img {
  display: none;
}
.bi-name-inner {
  position: relative;
  background: #000000;
  border: 5px solid #ffffff;
  border-radius: 14px;
  padding: 5px 18px 5px 14px;
  font-family: "DotGothic16", "PixelMplus10", monospace;
  font-size: clamp(17px, 4.5vw, 22px);
  color: #ffffff;
  letter-spacing: 0.05em;
  line-height: 1.75;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .bi-taunt-img {
    width: 88%;
  }
}

.bi-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  border-style: solid;
  border-width: 5px;
  border-color: #ffffff;
  border-radius: 18px;
  box-sizing: border-box;
}
.bi-overlay:not(.bi-taunt-overlay) .bi-stage {
  box-shadow: none;
}

.bi-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bi-player {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52%;
  height: auto;
  image-rendering: pixelated;
  z-index: 3;
  transform: translateX(-160%);
  opacity: 0;
  filter: url(#bi-duotone);
}
.bi-player.enter {
  animation: biSlideFromLeft 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}
@keyframes biSlideFromLeft {
  from {
    transform: translateX(-160%);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.bi-cpu {
  position: absolute;
  top: 0;
  right: 0;
  width: 52%;
  height: auto;
  image-rendering: pixelated;
  z-index: 3;
  transform: translateX(160%);
  opacity: 0;
  filter: url(#bi-duotone);
}
.bi-cpu.enter {
  animation: biSlideFromRight 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards;
}
@keyframes biSlideFromRight {
  from {
    transform: translateX(160%);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.bi-taunt-overlay .bi-name-tag-wrap {
  display: none;
}

.bi-taunt-nametag-wrap {
  width: 100%;
  max-width: 480px;
  position: relative;
  height: 0;
  z-index: 30;
  flex-shrink: 0;
}
.bi-taunt-nametag {
  position: absolute;
  left: -5px;
  top: -35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 158px;
  height: 59px;
}
.bi-taunt-nametag-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}
.bi-taunt-nametag-text {
  position: absolute;
  inset: 0;
  z-index: 1;
  font-family: "DotGothic16", "PixelMplus10", monospace;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  padding: 28px 38px 0 16px;
  line-height: 1;
  text-align: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
@media (min-width: 481px) {
  .bi-taunt-nametag {
    top: -48px;
    left: -5px;
    width: 235px;
    height: 87px;
  }
  .bi-taunt-nametag-text {
    font-size: 22px;
    padding: 36px 56px 0 24px;
    align-items: flex-start;
    color: #ffffff;
  }
}

@media (max-width: 360px) {
  .bi-taunt-nametag {
    width: 126px;
    height: 47px;
    top: -30px;
    left: -5px;
  }
  .bi-taunt-nametag-text {
    font-size: max(var(--wk-font-min, 14px), clamp(11px, 3.2vw, 13px));
    padding: 22px 30px 0 14px;
    align-items: flex-start;
  }
}

.bi-msgwrap {
  width: 100%;
  max-width: 480px;
  flex-shrink: 0;
  padding: 0;
  margin-top: 6px;
}

.bi-msgbox {
  background: #000000;
  border-style: solid;
  border-width: 5px;
  border-color: #ffffff;
  border-radius: 18px;
  padding: 18px 28px 14px;
  min-height: 80px;
  position: relative;
}
.bi-overlay:not(.bi-taunt-overlay) .bi-msgbox {
  box-shadow: none;
}

.bi-taunt-overlay .bi-stage,
.bi-taunt-overlay .bi-msgbox {
  animation: biTauntGlow 2s ease-in-out infinite;
}
@keyframes biTauntGlow {
  0%,
  100% {
    box-shadow:
      0 0 8px 2px var(--bi-glow-col, rgba(255, 255, 255, 0.6)),
      0 0 18px 6px var(--bi-glow-col, rgba(255, 255, 255, 0.35));
  }
  50% {
    box-shadow:
      0 0 14px 4px var(--bi-glow-col, rgba(255, 255, 255, 0.9)),
      0 0 28px 10px var(--bi-glow-col, rgba(255, 255, 255, 0.55));
  }
}

.bi-taunt-name-line {
  display: none;
}
.bi-taunt-name-divider {
  display: none;
}

.bi-taunt-status {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  container-type: inline-size;
}
.bi-taunt-status-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
}
.bi-taunt-status-row {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 12px;
  align-items: baseline;
  white-space: nowrap;
}
.bi-taunt-status-label {
  color: #ffffff;
  font-family: "DotGothic16", "PixelMplus10", monospace;
  font-size: clamp(17px, 4.5vw, 22px);
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}
.bi-taunt-status-stars {
  font-family: "DotGothic16", "PixelMplus10", monospace;
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 400;
  color: #f0c040;
  letter-spacing: 0.05em;
  line-height: 1.45;
  text-shadow: 0 0 6px rgba(240, 192, 64, 0.5);
  white-space: nowrap;
}

.bi-msg {
  font-family: "DotGothic16", "PixelMplus10", monospace;
  font-size: clamp(17px, 4.5vw, 22px);
  color: #ffffff;
  line-height: 1.75;
  white-space: pre-wrap;
  letter-spacing: 0.05em;
  min-height: 3.5em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* CPU dialogue is authored as three deliberate sentences.  Keep its lines
   independent on every viewport instead of relying on newline rendering. */
.bi-taunt-overlay .bi-msg-line1,
.bi-taunt-overlay .bi-msg-line2,
.bi-taunt-overlay .bi-msg-line3 {
  display: block;
}

/* The opponent-status step replaces the dialogue completely.  This explicit
   state also wins over the generic mobile display rules used by the intro. */
.bi-taunt-overlay.bi-taunt-show-status .bi-msg {
  display: none !important;
}
.bi-taunt-overlay.bi-taunt-show-status .bi-taunt-status {
  display: flex !important;
}

.bi-overlay:not(.bi-taunt-overlay) .bi-stage {
  border-color: #d0c6bd;
}
.bi-overlay:not(.bi-taunt-overlay) .bi-msgbox {
  border-color: #d0c6bd;
  background: #252524;
}
.bi-overlay:not(.bi-taunt-overlay) .bi-msg-line1,
.bi-overlay:not(.bi-taunt-overlay) .bi-msg-line2,
.bi-overlay:not(.bi-taunt-overlay) .bi-msg-line3 {
  color: #d0c6bd;
}

.bi-tap-hint {
  font-family: "DotGothic16", monospace;
  font-size: var(--wk-font-meta, 14px);
  color: rgba(60, 40, 10, 0.5);
  text-align: right;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  animation: biTapBlink 0.9s ease-in-out infinite;
}
.bi-tap-hint.visible {
  opacity: 1;
}
@keyframes biTapBlink {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 480px) {
  .bi-name-tag-wrap {
    max-width: 100%;
    align-self: stretch;
  }
  .bi-name-frame {
    left: 0;
  }
  .bi-name-inner {
    font-size: clamp(14px, 3.8vw, 17px);
    padding: 4px 12px 4px 10px;
  }
  .bi-msgbox {
    box-sizing: border-box;
    width: 100%;
    height: 168px;
    min-height: 168px;
    overflow: hidden;
  }
  .bi-taunt-show-status .bi-taunt-msgbox {
    padding-inline: 12px;
  }
  .bi-taunt-name-line {
    font-size: clamp(14px, 3.8vw, 17px);
  }
  .bi-taunt-status-label,
  .bi-taunt-status-stars {
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.45;
  }
  .bi-taunt-status-main {
    gap: 4px;
  }
  .bi-taunt-status-row {
    grid-template-columns: 5.8em 1fr;
    gap: 8px;
  }
  .bi-msg-line1,
  .bi-msg-line2,
  .bi-msg-line3 {
    font-family: "DotGothic16", "PixelMplus10", monospace;
    font-size: clamp(14px, 3.8vw, 17px);
    color: #ffffff;
    letter-spacing: 0.05em;
    line-height: 1.75;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  }
  .bi-msg-line1 {
    margin-bottom: 2px;
  }
}

@media (min-width: 481px) {
  .bi-msg {
    font-size: 22px;
  }
  .bi-msgbox {
    min-height: 96px;
    padding: 20px 32px 16px;
  }
  .bi-name-tag-wrap {
    max-width: 480px;
  }
  .bi-name-frame {
    left: 0;
  }
  .bi-name-inner {
    font-size: 22px;
  }
  .bi-msg-line1,
  .bi-msg-line2,
  .bi-msg-line3 {
    font-family: "DotGothic16", "PixelMplus10", monospace;
    font-size: 22px;
    color: #ffffff;
    line-height: 1.75;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  }
  .bi-msg-line1 {
    margin-bottom: 2px;
  }
  .bi-overlay:not(.bi-taunt-overlay) .bi-msgbox {
    height: 154px;
    min-height: unset;
    overflow: hidden;
  }
  .bi-taunt-overlay .bi-msgbox {
    height: 154px;
    min-height: unset;
    overflow: hidden;
  }
  .bi-taunt-status-label,
  .bi-taunt-status-stars {
    font-size: 22px;
    line-height: 1.45;
  }
}

@media (min-width: 769px) {
  .bi-stage {
    max-width: 640px;
  }
  .bi-msgwrap {
    max-width: 640px;
  }
  .bi-name-tag-wrap {
    max-width: 640px;
  }
  .bi-taunt-nametag-wrap {
    max-width: 640px;
  }
  .bi-taunt-nametag {
    top: -52px;
    left: -5px;
    width: 256px;
    height: 95px;
  }
  .bi-taunt-nametag-text {
    font-size: 26px;
    padding: 42px 62px 0 28px;
    align-items: flex-start;
    color: #ffffff;
  }
  .bi-msgbox {
    padding: 22px 36px 18px;
    min-height: 96px;
  }
  .bi-name-frame {
    left: 0;
  }
  .bi-name-inner {
    font-size: 26px;
  }
  .bi-overlay:not(.bi-taunt-overlay) .bi-msgbox {
    height: 179px;
    min-height: unset;
    overflow: hidden;
  }
  .bi-taunt-overlay .bi-msgbox {
    height: 179px;
    min-height: unset;
    overflow: hidden;
  }
  .bi-msg {
    font-size: 26px;
  }
  .bi-msg-line1,
  .bi-msg-line2,
  .bi-msg-line3 {
    font-size: 26px;
  }
  .bi-taunt-overlay:not(.bi-taunt-show-status) .bi-msg-line1,
  .bi-taunt-overlay:not(.bi-taunt-show-status) .bi-msg-line2,
  .bi-taunt-overlay:not(.bi-taunt-show-status) .bi-msg-line3 {
    font-size: 25px;
  }
  .bi-taunt-status-label,
  .bi-taunt-status-stars {
    font-size: 26px;
    line-height: 1.45;
  }
}

.bi-encounter-overlay {
  position: absolute;
  inset: 0;
  z-index: 10480;
  pointer-events: none;
  overflow: hidden;
  background: #1a1a18;
}

.bi-enc-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bi-encounter-wipes {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
}
.bi-encounter-wipe {
  background: #1a1a18;
  transform: scaleX(0);
}
.bi-encounter-wipe:nth-child(odd) {
  transform-origin: left center;
}
.bi-encounter-wipe:nth-child(even) {
  transform-origin: right center;
}
.bi-encounter-wipe.go {
  animation: biWipeClose 0.65s cubic-bezier(0.4, 0, 0.1, 1) forwards;
}
@keyframes biWipeClose {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@media (max-width: 480px) {
  .sb-swap-overlay {
    align-items: flex-start;
    padding-top: 48px;
  }
}
.sb-result-reward-cond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DotGothic16", sans-serif;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9d9 48%, #a9a9a9 100%);
  border: 1px solid #111;
  border-bottom: 2px solid #111;
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(0, 0, 0, 0.18);
  min-height: 21px;
  height: 21px;
  padding: 2px 7px 3px;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
  vertical-align: middle;
}

@media (min-width: 481px) {
  .sb-continue-overlay {
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .sb-continue-modal {
    flex-direction: column;
    align-items: center;
    width: 92vw;
    max-width: 500px;
    min-width: unset;
    min-height: unset;
    height: auto;
    padding: 72px 54px 96px;
    background-image: url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-015.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
    overflow: visible;
    gap: 15px;
  }
  .sb-continue-modal::after {
    display: none;
  }

  .sb-continue-face {
    width: 150px;
    height: 150px;
  }

  .sb-continue-wins {
    font-size: 36px;
    color: #3a2010;
    text-shadow: none;
    margin: 0;
  }

  .sb-continue-title {
    font-size: 16px;
    color: #3a2010;
    text-shadow: none;
    margin: 0;
  }

  .sb-continue-actions {
    align-items: center;
    width: 100%;
    margin-top: 0;
  }
}

/* Final polish for skill wording, chapter overlays, cut-ins and selection clarity. */
@media (max-width: 480px) {
  .sb-continue-modal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0;
    width: 92vw;
    max-width: 340px;
    height: auto;
    min-height: unset;
    padding: 52px 32px 56px;
    border: none;
  }
  .sb-continue-wins {
    font-family: "DotGothic16", sans-serif;
    font-size: 32px;
    color: #3a2010;
    text-shadow: none;
  }
  .sb-continue-title {
    font-size: 14px;
    color: #3a2010;
    text-shadow: none;
  }
  .sb-continue-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .sb-coin-overlay-inner {
    margin: 0 auto;
  }

  .reversi-game.ability-battle {
    padding-top: 19px;
  }

  .reversi-game .ot-board-wrap {
    padding: 36px;
  }
}
.back-btn {
  display: none;
}

/* Skill selection is isolated from the older replacement-dialog cascade. */
.sb-skill-choice-dialog {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(66vw, 486px);
  height: min(704px, calc(100dvh - 24px));
  min-height: 0;
  margin: 0 auto;
  padding: 60px 50px 120px;
  overflow: hidden;
  border: 0;
  background: transparent
    url("https://wakabaland.com/wp-content/uploads/2026/10/E001-reversi-screen-015.webp")
    center / 100% 100% no-repeat;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
  color: #3a2010;
  font-family: "DotGothic16", sans-serif;
}

#reversi .sb-skill-choice-title {
  flex: 0 0 auto;
  position: static;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  color: #3a2010;
  font:
    900 24px/1.15 "DotGothic16",
    sans-serif;
  letter-spacing: 0;
  text-align: center;
}

.sb-skill-choice-list {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0.5cm auto 12px;
  padding: 7px 7px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.sb-skill-choice-card {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  min-height: 112px;
  width: 100%;
  flex-direction: column;
  gap: 6px;
  padding: 12px 15px;
  overflow: visible;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-bottom-width: 3px;
  border-radius: 8px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  text-align: left;
  cursor: pointer;
}

.sb-skill-choice-cat-placement {
  background: rgba(30, 100, 200, 0.78);
  border-color: rgb(20, 80, 180);
}
.sb-skill-choice-cat-flip {
  background: rgba(140, 60, 210, 0.78);
  border-color: rgb(120, 40, 190);
}
.sb-skill-choice-cat-erase {
  background: rgba(210, 50, 50, 0.78);
  border-color: rgb(190, 30, 30);
}
.sb-skill-choice-cat-combo {
  background: rgba(180, 130, 0, 0.78);
  border-color: rgb(160, 110, 0);
}
.sb-skill-choice-cat-block {
  background: rgba(140, 80, 20, 0.78);
  border-color: rgb(120, 60, 10);
}
.sb-skill-choice-cat-hint {
  background: rgba(100, 100, 100, 0.76);
  border-color: rgb(80, 80, 80);
}
.sb-skill-choice-cat-guard {
  background: rgba(20, 160, 60, 0.78);
  border-color: rgb(10, 140, 40);
}
.sb-skill-choice-cat-null {
  background: rgba(50, 50, 50, 0.8);
  border-color: rgb(80, 80, 80);
}

.sb-skill-choice-card.selected {
  border-color: #d40000;
  border-width: 4px;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 5px #d40000,
    0 8px 18px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(255, 42, 42, 0.74);
  filter: brightness(1.08) saturate(1.12);
}

.sb-skill-choice-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.sb-skill-choice-name {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(16px, 3.6vw, 18px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.sb-skill-choice-rank,
.sb-skill-choice-cond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 21px;
  padding: 2px 7px 3px;
  border: 1px solid #111;
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #111;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sb-skill-choice-rank {
  background: linear-gradient(#fff6a6, #f1c84d);
}

.sb-skill-choice-cond {
  background: linear-gradient(#fff, #c3c3c3);
}

.sb-skill-choice-desc {
  font-family: system-ui, "Yu Gothic", Meiryo, sans-serif;
  display: block;
  min-width: 0;
  color: #fff;
  font-size: var(--wk-font-body, 16px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
  text-shadow: none;
  text-wrap: balance;
}

.sb-skill-choice-actions {
  box-sizing: border-box;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 auto;
}

.sb-skill-choice-action {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 7px 10px 9px;
  border: 1px solid #777;
  border-bottom-width: 4px;
  border-radius: 999px;
  background: var(--rv-button-bg, #171717);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 5px 10px rgba(40, 20, 6, 0.22);
  color: #fff;
  font:
    900 17px/1.1 "DotGothic16",
    sans-serif;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
  cursor: pointer;
}

.sb-skill-choice-action.secondary {
  border-color: #999;
  background: var(--wk-button-neutral);
  color: var(--wk-button-neutral-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.sb-skill-choice-actions .sb-choice-confirm-btn:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 220px);
}

.sb-skill-choice-actions .sb-choice-confirm-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 767px) {
  .sb-skill-choice-dialog {
    width: min(92vw, 340px);
    height: min(568px, calc(100svh - 88px));
    margin-top: 0;
    padding: 44px 26px 96px;
  }

  .sb-skill-choice-title {
    margin-bottom: 7px;
    font-size: clamp(19px, 5.6vw, 22px);
  }

  .sb-skill-choice-list {
    gap: 6px;
    margin: 10px auto 8px;
    padding: 7px 6px 8px;
    scrollbar-gutter: auto;
  }

  .sb-skill-choice-card {
    min-height: 82px;
    gap: 4px;
    padding: 8px 10px;
  }

  .sb-skill-choice-name {
    font-size: clamp(14px, 4.1vw, 16px);
  }

  .sb-skill-choice-rank,
  .sb-skill-choice-cond {
    min-height: 19px;
    padding: 2px 5px 3px;
    font-size: var(--wk-font-min, 14px);
  }

  .sb-skill-choice-desc {
    font-size: var(--wk-font-body, 16px);
    word-break: auto-phrase;
  text-wrap: balance;
}

  .sb-skill-choice-action {
    min-height: 42px;
    font-size: clamp(14px, 4.2vw, 17px);
  }
}

@media (max-width: 380px) and (max-height: 640px) {
  .sb-skill-choice-dialog {
    height: calc(100svh - 72px);
    padding: 36px 22px 100px;
  }

  .sb-skill-choice-title {
    margin-bottom: 5px;
    font-size: 18px;
  }

  .sb-skill-choice-list {
    gap: 5px;
    margin: 7px auto 6px;
  }

  .sb-skill-choice-card {
    min-height: 78px;
    gap: 3px;
    padding: 6px 8px;
  }

  .sb-skill-choice-action {
    min-height: 38px;
  }
}
#reversi:has(.ot-overlay.show) {
  background-color: #000 !important;
}
#reversi:has(.ot-overlay.show)::before {
  opacity: 0 !important;
}

.sb-swap-modal {
  padding-bottom: 40px;
}

@media (min-width: 481px) {
  .sb-swap-overlay .sb-swap-modal {
    margin-top: -49px !important;
  }
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-title {
  font-size: clamp(16px, 5vw, 22px) !important;
  font-weight: 700 !important;
  margin-bottom: 10px !important;
  line-height: 1.2 !important;
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-title {
  color: #3a2010 !important;
  text-shadow: none !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-incoming-label {
  display: none !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slots-label,
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slots-sublabel {
  display: none !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-arrow {
  color: #5a3a20 !important;
  text-shadow: none !important;
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot {
  border-radius: 10px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.filled {
  background: rgba(255, 255, 255, 0.05) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-placement {
  background: rgb(30, 100, 200) !important;
  border-color: rgb(20, 80, 180) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-flip {
  background: rgb(140, 60, 210) !important;
  border-color: rgb(120, 40, 190) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-erase {
  background: rgb(210, 50, 50) !important;
  border-color: rgb(190, 30, 30) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-combo {
  background: rgb(180, 130, 0) !important;
  border-color: rgb(160, 110, 0) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-block {
  background: rgb(140, 80, 20) !important;
  border-color: rgb(120, 60, 10) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-hint {
  background: rgb(100, 100, 100) !important;
  border-color: rgb(80, 80, 80) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-guard {
  background: rgb(20, 160, 60) !important;
  border-color: rgb(10, 140, 40) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.sb-swap-cat-null {
  background: rgb(50, 50, 50) !important;
  border-color: rgb(80, 80, 80) !important;
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot-name {
  color: #ffffff !important;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 1),
    0 2px 8px rgba(0, 0, 0, 0.9) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot-icon {
  text-shadow: 0 0 8px rgba(255, 200, 0, 0.9) !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot-desc {
  color: #f0f0f0 !important;
  text-shadow: none !important;
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.empty {
  background: rgba(10, 10, 20, 0.7) !important;
  border: 2px dashed rgba(255, 255, 255, 0.3) !important;
  border-radius: 10px !important;
}
.sb-swap-modal:not(.sb-choice-modal) .sb-swap-slot.empty .sb-swap-slot-name {
  color: rgba(255, 255, 255, 0.55) !important;
  text-shadow: none !important;
}
.sb-swap-modal:not(.sb-choice-modal)
  .sb-swap-slot.empty
  .sb-swap-slot-empty-icon {
  color: rgba(255, 255, 255, 0.45) !important;
}

.sb-swap-modal:not(.sb-choice-modal) .sb-swap-incoming-area {
  margin-top: 26px !important;
}

#sb-result-overlay.result-win:has(
    #sb-result-step1[style*="display: flex"]
  )::before,
#sb-result-overlay.result-win:has(
    #sb-result-step1[style*="display: flex"]
  )::after {
  z-index: 8;
  inset: auto;
  background: none;
  animation-fill-mode: forwards;
}
#sb-result-overlay.result-win:has(
    #sb-result-step1[style*="display: flex"]
  )::before {
  content: "\2605";
  top: 12%;
  left: 9%;
  font-size: clamp(14px, 3.8vw, 27px);
  color: #fff9c2;
  text-shadow:
    16vw 4vh 0 #ffe86b,
    45vw 2vh 0 #fff9c2,
    67vw 8vh 0 #ffe86b,
    4vw 17vh 0 #fff9c2,
    61vw 20vh 0 #fff2a2,
    20vw 30vh 0 #ffe86b,
    72vw 34vh 0 #fff9c2,
    1vw 45vh 0 #ffe86b,
    48vw 49vh 0 #fff9c2,
    69vw 56vh 0 #ffe86b;
  filter: drop-shadow(0 0 6px rgba(255, 220, 58, 0.92));
  animation: sb-win-stars-a 2.9s ease-out forwards;
}
#sb-result-overlay.result-win:has(
    #sb-result-step1[style*="display: flex"]
  )::after {
  content: "\2605";
  top: 20%;
  left: 76%;
  font-size: max(var(--wk-font-min, 14px), clamp(11px, 3.1vw, 22px));
  color: #fff;
  text-shadow:
    -31vw 0vh 0 #ffe86b,
    -58vw 9vh 0 #fff9c2,
    -8vw 16vh 0 #ffe86b,
    -49vw 25vh 0 #fff9c2,
    -71vw 33vh 0 #ffe86b,
    -17vw 39vh 0 #fff9c2,
    -43vw 53vh 0 #ffe86b,
    -4vw 60vh 0 #fff9c2;
  filter: drop-shadow(0 0 5px rgba(255, 232, 99, 0.9));
  animation: sb-win-stars-b 2.9s 0.18s ease-out forwards;
}
#sb-result-overlay.result-win:has(#sb-result-step1[style*="display: flex"])
  .ot-result-modal {
  z-index: 4 !important;
}
@keyframes sb-win-stars-a {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-12deg);
  }
  12% {
    opacity: 1;
    transform: scale(1.12) rotate(5deg);
  }
  30% {
    opacity: 0.45;
    transform: scale(0.78) rotate(-3deg);
  }
  48% {
    opacity: 1;
    transform: scale(1.05) rotate(3deg);
  }
  70% {
    opacity: 0.5;
    transform: scale(0.82);
  }
  100% {
    opacity: 0;
    transform: scale(0.25);
  }
}
