/*
 * reversi001.css
 * Ownership: shared shell, title screen, simple Reversi, shared board primitives,
 * and developer controls.
 * Wakabattle dialogs, cut-ins, results, and responsive presentation belong in reversi002.css.
 */

#reversi *, #reversi *::before, #reversi *::after { box-sizing: border-box; }

#reversi *,
#reversi *:focus,
#reversi *:active,
#reversi button,
#reversi button:focus,
#reversi button:active {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
}

#reversi {
  font-family: 'Baloo 2', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}
#reversi::before {
  content: '';
  position: absolute;
  inset: 0;
  min-height: 100%;
  background: url('https://wakabaland.com/wp-content/uploads/2026/04/reversi1.webp') center center / cover no-repeat;
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 480px) {
  #reversi::before {
    background-image: url('https://wakabaland.com/wp-content/uploads/2026/04/reversi2.webp');
  }
}

.screen        { display: none; width: 100%; min-height: 100vh; }
.screen.active { display: flex; position: relative; z-index: 1; }

/* 開発用表示テスト。通常時は一つのボタンだけを最下段に置く。 */
#sb-test-bar {
  position: relative;
  z-index: 50000;
  display: flex;
  align-self: center;
  justify-content: center;
  width: min(100%, 560px);
  margin: 6px auto 0;
  pointer-events: auto;
  font-family: 'DotGothic16', sans-serif;
}

/* テスト操作は残すが、対局中のスキル発動ボタンより前に出さない。 */
#reversi .sb-bottom-ability-col {
  z-index: 2;
}
#reversi .sb-player-activate-row {
  z-index: 2;
}

.sb-test-launcher,
.sb-test-menu button,
.sb-test-menu select {
  position: relative;
  z-index: 50001;
  font-family: 'DotGothic16', sans-serif;
  font-size: 13px;
  line-height: 1;
  pointer-events: auto;
  touch-action: manipulation;
}

.sb-test-launcher {
  min-width: 112px;
  min-height: 36px;
  padding: 8px 20px;
  border: 2px solid #e8dcff;
  border-radius: 8px;
  background: linear-gradient(180deg, #8c4edf, #5820a3);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #351065, 0 5px 12px rgba(22, 7, 45, .38);
}

.sb-test-launcher::after {
  content: '▲';
  display: inline-block;
  margin-left: 8px;
  font-size: 9px;
  transition: transform .18s ease;
}

#sb-test-bar.is-open .sb-test-launcher::after {
  transform: rotate(180deg);
}

.sb-test-menu[hidden] { display: none !important; }

.sb-test-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 50002;
  width: min(540px, calc(100vw - 18px));
  max-height: min(70vh, 560px);
  padding: 12px;
  border: 2px solid rgba(218, 203, 255, .92);
  border-radius: 8px;
  background: rgba(18, 15, 30, .97);
  color: #fff;
  overflow-y: auto;
  transform: translateX(-50%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255,255,255,.08);
}

.sb-test-menu-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.sb-test-group {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.sb-test-group-title {
  color: #e9e3f5;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.sb-test-grid,
.sb-test-status-row,
.sb-test-cutin-row,
.sb-test-board-row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sb-test-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sb-test-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sb-test-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sb-test-status-row { grid-template-columns: minmax(0, 1fr) 88px; }
.sb-test-cutin-row { grid-template-columns: minmax(0, 1fr) 70px 70px; }
.sb-test-board-row { grid-template-columns: minmax(0, 1fr) 88px; }

.sb-test-menu button,
.sb-test-menu select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 5px;
  background: #353044;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.42);
}

.sb-test-menu button:hover,
.sb-test-menu button:focus-visible,
.sb-test-menu select:focus-visible {
  filter: brightness(1.18);
  border-color: #fff;
}

.sb-test-group-clear button { background: #157a4c; }
.sb-test-group-start button { background: #176fb0; }
.sb-test-group-status button { background: #7542bc; }
.sb-test-group-cutin button { background: #8b3fb5; }
.sb-test-group-board-effect button { background: #a55d19; }
.sb-test-group-endroll button { background: #242127; }
.sb-test-group-result button[data-sb-test='win'] { background: #287252; }
.sb-test-group-result button[data-sb-test='draw'] { background: #55515b; }
.sb-test-group-result button[data-sb-test='lose'] { background: #a63b35; }

@media (max-width: 560px) {
  .sb-test-menu {
    position: absolute;
    inset: auto auto calc(100% + 8px) 50%;
    width: calc(100vw - 18px);
    max-height: calc(100vh - 72px);
    padding: 5px 7px;
    transform: translateX(-50%);
  }
  .sb-test-menu-title {
    margin-bottom: 2px;
    font-size: 14px;
  }
  .sb-test-group {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 2px 4px;
  }
  .sb-test-group-title {
    font-size: 11px;
    text-align: center;
  }
  .sb-test-menu button,
  .sb-test-menu select {
    min-height: 24px;
    padding: 3px 5px;
    font-size: 11px;
  }
}

#screen-title {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  padding: 200px 16px 40px;
}

@media (min-width: 769px) and (max-height: 820px) {
  #screen-title.bg-magic {
    padding-top: clamp(88px, 14vh, 112px);
    padding-bottom: 24px;
  }

  #screen-title.bg-magic .title-logo-area {
    height: clamp(64px, 10vh, 80px);
    margin-bottom: clamp(12px, 2.5vh, 18px);
  }
}

@media (max-width: 480px) {

  #reversi {
    min-height: auto;
  }
  #screen-title.screen {
    min-height: auto;
  }

  #screen-title {
    height: auto;
    padding: 179px 20px 0;
    justify-content: flex-start;
    align-items: center;
  }

  #screen-title .title-logo-area {
    height: 104px;
    margin-bottom: 60px;
  }
  #screen-title .title-discs {
    margin-bottom: 8px;
  }

  #screen-title .title-content {
    max-width: 380px;
    width: 100%;
    padding-bottom: 88px;
  }

  #screen-title .mode-section {
    gap: 8px;
    width: 100%;
  }
  #screen-title .mode-cards {
    gap: 8px;
    width: 100%;
  }
  #screen-title .mode-card {
    border-radius: 16px;
    padding: 12px 16px;
  }

}

#screen-title::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #f6f7f9;
  background-image:
    linear-gradient(rgba(0,0,0,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
  padding: 0 4px;
}

.title-logo-area {
  position: relative;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 80px;
}
.title-logo-default {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title-discs {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}
.title-disc {
  width:  clamp(40px, 10vw, 56px);
  height: clamp(40px, 10vw, 56px);
  border-radius: 50%;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), inset 0 3px 10px rgba(255,255,255,0.3), 0 0 20px rgba(0,0,0,0.1);
}
.title-disc.black { background: radial-gradient(circle at 36% 32%, #555, #111); }
.title-disc.white { background: radial-gradient(circle at 36% 32%, #fff, #e0e0e0); border: 1px solid #ddd; }
.title-main {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(22px, 6vw, 44px);
  font-weight: 900;
  color: #111;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-shadow: none;
}

.mode-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.mode-card {
  position: relative;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 18px;
  padding: clamp(12px, 3vw, 18px) clamp(14px, 4vw, 22px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.02), transparent);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 18px;
}
.mode-card:not(.disabled):hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #aaa;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.mode-card:not(.disabled):hover::before { opacity: 1; }
.mode-card:not(.disabled):active { transform: translateY(0) scale(0.99); }

.mode-card.disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: saturate(0.4);
}

.mode-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.mode-card .mode-select-btn { position: relative; z-index: 1; }
.mode-name {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(16px, 4vw, 20px);
  color: #111;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.mode-desc {
  font-size: clamp(11px, 2.5vw, 13px);
  color: rgba(0,0,0,0.5);
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.mode-badge {
  font-family: 'Fredoka One', sans-serif;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.mode-card.simple .mode-badge {
  background: rgba(0,0,0,0.05);
  color: #444;
  border: 1px solid rgba(0,0,0,0.12);
}
.mode-card.magic .mode-badge {
  background: rgba(0,0,0,0.7);
  color: #eee;
  border: 1px solid rgba(255,255,255,0.2);
}

.magic-sub-btns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s, gap 0.3s;
  pointer-events: none;
}
.magic-sub-btns.open {
  max-height: 70px;
  opacity: 1;
  gap: 8px;
  padding-top: 8px;
  pointer-events: auto;
}
.magic-sub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 1 140px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1.5px solid #ddd;
  background: #f5f5f5;
  color: #333;
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(12px, 3.2vw, 14px);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  white-space: nowrap;
}
.magic-sub-btn:hover {
  background: #eee;
  border-color: #bbb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: #111;
  transform: translateY(-2px) scale(1.04);
}
.magic-sub-btn:active {
  transform: scale(0.97);
}
.magic-sub-btn.new-btn {
  background: #f5f5f5;
  border-color: #ddd;
  color: #333;
}
.magic-sub-btn.new-btn:hover {
  background: #eee;
  border-color: #bbb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: #111;
  transform: translateY(-2px) scale(1.04);
}
.magic-sub-btn.resume-btn {
  background: #111;
  border-color: #333;
  color: #fff;
}
.magic-sub-btn.resume-btn:hover {
  background: #333;
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}
.sub-btn-icon { font-size: 18px; }
.sub-btn-label { font-size: 15px; }

#screen-game {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #f5f5f5;
  padding: 16px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.reversi-game {
  --ot-board:   #3a8a5a;
  --ot-accent:  #444444;
  --ot-accent2: #222222;
  --ot-text:    #111111;
  --ot-dim:     #888888;

  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  font-family: 'Baloo 2', 'Arial Rounded MT Bold', sans-serif;
  font-weight: 800;
  color: var(--ot-text);
  margin: 0 auto;
}

.reversi-game .ot-card {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 22px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 4px 0 rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.06);
  padding: 10px 12px;
  position: relative;
  overflow: clip;
}

.reversi-game .ot-card::before {
  content: '';
  position: absolute;
  top: 4px; left: 8px; right: 8px; height: 38%;
  border-radius: 14px 14px 50% 50%;
  background: rgba(255,255,255,0.25);
  pointer-events: none;
  z-index: 0;
}

.reversi-game .ot-card > * {
  position: relative;
  z-index: 1;
}

.reversi-game .ot-score-panel {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.reversi-game .ot-score-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 14px;
  transition: all .25s;
  position: relative;
  min-width: 80px;
}

.reversi-game .ot-score-side.active {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 0 0 2.5px #333;
}
.reversi-game .ot-score-side.active::after {
  content: none;
}

.reversi-game .ot-score-side.cpu-active {
  background: rgba(0,0,0,0.04);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
}
.reversi-game .ot-score-side.cpu-active::after {
  content: none;
}

.reversi-game .ot-disc-icon {
  width:  clamp(28px, 7vw, 36px);
  height: clamp(28px, 7vw, 36px);
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15), inset 0 -2px 4px rgba(0,0,0,0.1), inset 0 2px 6px rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.reversi-game .ot-disc-icon.black { background: radial-gradient(circle at 38% 35%, #555, #111); }
.reversi-game .ot-disc-icon.white { background: radial-gradient(circle at 38% 35%, #fff, #e0e0e0); border: 1px solid #ddd; }

.reversi-game .ot-score-label {
  font-size: clamp(11px, 2.8vw, 14px);
  letter-spacing: .08em;
  color: rgba(0,0,0,0.85);
  font-weight: 700;
  white-space: nowrap;
}
.reversi-game .ot-score-num {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(36px, 9vw, 46px);
  color: #111;
  text-shadow: none;
  line-height: 1;
}

.reversi-game .ot-vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
  z-index: 1;
}

.reversi-game .ot-message-row {
  width: 100%;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  min-height: 32px;
  flex-shrink: 0;
}
.reversi-game .ot-message-row .ot-message {
  flex: 1;
  width: auto;
  flex-basis: auto;
  text-align: center;
  padding-top: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 481px) {
  .reversi-game .ot-card.ot-score-panel {
    padding-bottom: 0;
    overflow: visible;
  }
  .reversi-game .ot-message-row {
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -10px;
    width: calc(100% + 24px);
    flex-basis: calc(100% + 24px);
    padding: 6px 0 10px;
    border-radius: 0 0 20px 20px;
    min-height: 40px;
  }
  .reversi-game .ot-message-row .ot-message {
    padding-top: 0;
    min-height: 24px;
  }
}

.reversi-game .ot-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(22px, 5.5vw, 30px);
  color: #444;
  letter-spacing: .08em;
  flex-shrink: 0;
  align-self: center;
}

.reversi-game .ot-message {
  width: 100%;
  flex-basis: 100%;
  text-align: center;
  font-size: clamp(12px, 3vw, 15px);
  letter-spacing: .1em;
  color: rgba(0,0,0,0.8);
  padding-top: 2px;
  min-height: 20px;
  display: block;
  white-space: pre;
}

.reversi-game .ot-board-wrap {
  padding: 14px;
  position: relative;
}
.ability-battle .ot-board-wrap {
  width: 100%;
  box-sizing: border-box;
  align-self: stretch;
}
.reversi-game .ot-board-inner {
  background: #234f18;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(20,70,10,0.6),
    0 6px 0 rgba(10,45,5,0.5),
    0 10px 24px rgba(10,45,5,0.3);
  position: relative;
}
.reversi-game .ot-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 2px;
  background: #145c30;
}
.ability-battle .ot-board-inner,
.ability-battle .ot-grid {
  width: 100%;
  box-sizing: border-box;
}
.reversi-game .ot-cell {
  aspect-ratio: 1;
  background: #2f7a4e;
  border-radius: 0;
  position: relative;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reversi-game .ot-cell.combo-on-top,
.ability-battle .ot-cell.combo-on-top,
.reversi-game .ot-cell.fx-target-top,
.ability-battle .ot-cell.fx-target-top {
  z-index: 2;
  isolation: isolate;
}

.combo-board-active.ot-grid {
  background: #b89600 !important;
}
.combo-board-active .ot-cell {
  background: #d4bc30 !important;
  transition: none !important;
}
.combo-board-active .ot-cell:hover {
  background: #dfc840 !important;
}
.combo-board-active .ot-cell.combo-on-top .ot-disc {
  background: radial-gradient(circle at 36% 32%, #fff9b0, #f0c800, #c08000) !important;
  box-shadow: 0 3px 0 rgba(0,0,0,0.28),
              0 0 20px 8px rgba(255,210,0,0.80),
              inset 0 -2px 5px rgba(0,0,0,0.10),
              inset 0 3px 8px rgba(255,255,255,0.50) !important;
}

.reversi-game .placement-board-active.ot-grid,
.ability-battle .placement-board-active.ot-grid,
.placement-board-active.ot-grid {
  background: #0a4060 !important;
}
.reversi-game .placement-board-active .ot-cell,
.ability-battle .placement-board-active .ot-cell,
.placement-board-active .ot-cell {
  transition: none !important;
}

.reversi-game .flip-board-active.ot-grid,
.ability-battle .flip-board-active.ot-grid,
.flip-board-active.ot-grid {
  background: #1a0030 !important;
}
.reversi-game .flip-board-active .ot-cell,
.ability-battle .flip-board-active .ot-cell,
.flip-board-active .ot-cell {
  transition: none !important;
}

.reversi-game .erase-board-active.ot-grid,
.ability-battle .erase-board-active.ot-grid,
.erase-board-active.ot-grid {
  background: #cc3300 !important;
}
.reversi-game .erase-board-active .ot-cell,
.ability-battle .erase-board-active .ot-cell,
.erase-board-active .ot-cell {
  transition: none !important;
}

.reversi-game .block-board-active.ot-grid,
.ability-battle .block-board-active.ot-grid,
.block-board-active.ot-grid {
  background: #3a1800 !important;
}
.reversi-game .block-board-active .ot-cell,
.ability-battle .block-board-active .ot-cell,
.block-board-active .ot-cell {
  transition: none !important;
}

.reversi-game .ot-cell:hover { background: #3a8f5c; }


.ability-battle .ot-grid {
  gap: 2px;
  padding: 2px;
  background: #0d4327;
}
.ability-battle .ot-cell {
  background: #2f8151;
  box-shadow: 1px 1px 0 rgba(123,196,145,0.22) inset, -1px -1px 0 rgba(3,38,20,0.22) inset;
  transition: background-color 80ms steps(2, end);
}
.ability-battle .ot-cell.hint:not(.hint-guided) {
  background: rgba(255, 255, 255, 0.14) !important;
  outline: 2.5px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
  border-radius: 2px;
  animation: normal-hint-glow 1.2s ease-in-out infinite;
  z-index: 1;
}
.ability-battle .ot-cell.hint:not(.hint-guided):hover {
  background: rgba(255, 255, 255, 0.32) !important;
  outline-color: rgba(255, 255, 255, 1.0);
  box-shadow: 0 0 14px 5px rgba(255, 255, 255, 0.60);
  animation: none;
}

.reversi-game .ot-cell.hint {
  background: rgba(255, 255, 255, 0.14);
  outline: 2.5px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
  border-radius: 2px;
  animation: normal-hint-glow 1.2s ease-in-out infinite;
  z-index: 1;
}
.reversi-game .ot-cell.hint::after { content: none; }
.reversi-game .ot-cell.hint:hover {
  background: rgba(255, 255, 255, 0.30);
  outline-color: rgba(255, 255, 255, 1.0);
  box-shadow: 0 0 14px 5px rgba(255, 255, 255, 0.55);
  animation: none;
}

@keyframes normal-hint-glow {
  0%, 100% {
    outline-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.20);
  }
  50% {
    outline-color: rgba(255, 255, 255, 1.0);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 14px 5px rgba(255, 255, 255, 0.55);
  }
}

.reversi-game .ot-disc {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  position: absolute;
  animation: ot-drop .18s cubic-bezier(.3,1.5,.6,1);
  box-shadow:
    0 4px 0 rgba(0,0,0,0.45),
    0 5px 10px rgba(0,0,0,0.35),
    inset 0 -3px 6px rgba(0,0,0,0.2),
    inset 0 3px 10px rgba(255,255,255,0.18);
}
.reversi-game .ot-disc.black {
  background: radial-gradient(circle at 34% 28%, #888 0%, #444 22%, #1a1a1a 55%, #111 100%);
}
.reversi-game .ot-disc.white {
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #f8f8f8 35%, #e0e0e0 70%, #c8c8c8 100%);
  box-shadow:
    0 4px 0 rgba(0,0,0,0.25),
    0 5px 10px rgba(0,0,0,0.2),
    inset 0 -3px 6px rgba(0,0,0,0.08),
    inset 0 3px 10px rgba(255,255,255,0.9);
}
.reversi-game .ot-disc.flip { animation: ot-flip .32s ease; }

@keyframes ot-drop {
  0%   { transform: scale(0) translateY(-8px); opacity: .6; }
  80%  { transform: scale(1.08); }
  100% { transform: scale(1);    opacity: 1;   }
}
@keyframes ot-flip {
  0%   { transform: rotateY(0deg);             }
  50%  { transform: rotateY(90deg) scaleX(.5); }
  100% { transform: rotateY(0deg);             }
}

.reversi-game .ot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 20px;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
  border: none;
  overflow: visible;
}
.reversi-game .ot-result-modal {
  background: url('https://wakabaland.com/wp-content/uploads/2026/04/繧上°縺ｰ3.webp') center top / cover no-repeat;
  border-radius: 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  text-align: center;
  box-shadow: 0 16px 56px rgba(0,0,0,0.8), 0 0 0 2px rgba(255,255,255,0.12);
  width: min(420px, 94vw);
  min-height: min(600px, 90vw);
  position: relative;
  overflow: hidden;
  animation: ot-drop .35s cubic-bezier(.22,1.4,.4,1);
}
.reversi-game .ot-result-modal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.0)  0%,
    rgba(0,0,0,0.0) 45%,
    rgba(0,0,0,0.72) 72%,
    rgba(0,0,0,0.88) 100%
  );
  border-radius: inherit;
  pointer-events: none;
}
.reversi-game .ot-result-modal > * {
  position: relative;
  z-index: 1;
}
.reversi-game .ot-result-modal-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 28px;
}
.reversi-game .ot-overlay.result-lose .ot-result-modal {
  background-image: url('https://wakabaland.com/wp-content/uploads/2026/04/繧上°縺ｰ4.webp');
}

.reversi-game .ot-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}
.reversi-game .ot-overlay.show { opacity: 1; pointer-events: all; }

.reversi-game .ot-result-title {
  font-family: 'DotGothic16', sans-serif;
  font-size: clamp(18px, 8vw, 52px);
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.reversi-game .ot-overlay.result-win .ot-result-title {
  color: #fff;
}
.reversi-game .ot-overlay.result-lose .ot-result-title {
  color: #fff;
}
.reversi-game .ot-overlay.result-draw .ot-result-title {
  color: #fff;
  font-size: clamp(26px, 7vw, 40px);
}
@keyframes result-title-glow {
  0%,100% { text-shadow: none; }
  50%      { text-shadow: none; }
}

.reversi-game .ot-result-scores {
  display: flex;
  gap: 20px;
  align-items: center;
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 16px 36px;
}
.reversi-game .ot-result-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.reversi-game .ot-result-disc {
  width:  clamp(32px, 8vw, 44px);
  height: clamp(32px, 8vw, 44px);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15), inset 0 3px 8px rgba(255,255,255,0.3);
}
.reversi-game .ot-result-disc.black { background: radial-gradient(circle at 36% 32%, #555, #111); }
.reversi-game .ot-result-disc.white { background: radial-gradient(circle at 36% 32%, #fff, #e0e0e0); border: 1px solid #ddd; }
.reversi-game .ot-result-num {
  font-family: 'DotGothic16', sans-serif;
  font-size: clamp(40px, 11vw, 56px);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  line-height: 1;
}
.reversi-game .ot-result-vs {
  font-family: 'DotGothic16', sans-serif;
  font-size: clamp(18px, 4.5vw, 24px);
  color: rgba(255,255,255,0.5);
}
.reversi-game .ot-result-sub {
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: .12em;
  color: rgba(255,255,255,0.65);
  position: relative;
  z-index: 1;
}

.reversi-game .ot-overlay #sb-win-choice,
.reversi-game .ot-overlay #sb-lose-actions {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.reversi-game .ot-overlay #sb-result-wins {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(13px, 3.5vw, 15px);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: .08em;
  position: relative;
  z-index: 1;
}

.reversi-game .ot-overlay #sb-win-choice > div:first-child {
  font-size: clamp(13px, 3.5vw, 16px) !important;
  color: rgba(255,255,255,0.85) !important;
  letter-spacing: .04em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  margin-bottom: 0;
}

