/* MATH_WAR_V110 */
.math-war-body {
  background:
    radial-gradient(circle at top left, rgba(120, 210, 255, 0.24), transparent 36vw),
    linear-gradient(180deg, #f5fbff 0%, #edf5ff 100%);
}

.math-war-page {
  display: grid;
  gap: 18px;
}

.math-war-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.math-war-header::after {
  content: "";
  position: absolute;
  inset: auto -30px -80px auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(78, 193, 255, 0.16);
  pointer-events: none;
}

.math-war-header-copy {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.math-war-header h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.math-war-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.math-war-header-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.math-war-shell {
  position: relative;
  overflow: hidden;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 255, 0.9));
}

.math-war-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--math-war-bg);
  background-size: cover;
  background-position: center;
  filter: blur(22px);
  transform: scale(1.08);
  opacity: 0.38;
  pointer-events: none;
}

.math-war-topbar,
.math-war-main {
  position: relative;
  z-index: 1;
}

.math-war-topbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.math-war-stat {
  border: 1px solid rgba(184, 195, 226, 0.85);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(39, 68, 124, 0.08);
}

.math-war-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.math-war-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.math-war-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.math-war-toolbar .is-hidden {
  display: none;
}

.math-war-main {
  display: block;
}

.math-war-canvas-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38), 0 16px 38px rgba(31, 70, 121, 0.18);
  min-height: 500px;
  touch-action: auto;
}

.math-war-canvas-wrap canvas {
  display: block;
  width: 100%;
  max-height: min(62vh, 700px);
  min-height: 500px;
  background: transparent;
  touch-action: none;
}

.math-war-floating-message {
  display: none !important;
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 7;
  max-width: min(92%, 640px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 32, 64, 0.78);
  color: #fff;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 12px 24px rgba(11, 22, 48, 0.2);
  pointer-events: none;
}

.math-war-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 14px;
  background: linear-gradient(180deg, rgba(9, 18, 44, 0.26), rgba(9, 18, 44, 0.46));
  backdrop-filter: blur(8px);
}

.math-war-overlay.hidden,
.math-war-challenge .hidden,
.math-war-end-card .hidden {
  display: none !important;
}

.math-war-overlay-card,
.math-war-challenge-card {
  width: min(620px, 94vw);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(220, 226, 240, 0.96);
  box-shadow: 0 24px 62px rgba(7, 16, 44, 0.24);
  padding: clamp(20px, 4vw, 34px);
  text-align: center;
}

.math-war-overlay-card h2,
.math-war-challenge-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.math-war-overlay-card p,
.math-war-overlay-card li,
.math-war-challenge-card p {
  color: var(--muted);
  line-height: 1.7;
}

.math-war-overlay-card ul {
  margin: 16px auto 20px;
  padding-left: 1.2rem;
  text-align: left;
  max-width: 520px;
}

.math-war-challenge-card {
  background:
    radial-gradient(circle at top, rgba(255, 235, 128, 0.36), transparent 34%),
    rgba(255, 255, 255, 0.97);
}

.math-war-challenge-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(91, 108, 240, 0.12);
  color: var(--primary-2);
  font-weight: 900;
}

.math-war-countdown {
  font-size: clamp(6rem, 18vw, 11rem);
  font-weight: 1000;
  line-height: 1;
  color: #fff;
  text-shadow: 0 8px 0 rgba(35, 49, 77, 0.22), 0 20px 42px rgba(47, 79, 148, 0.32);
  -webkit-text-stroke: 6px rgba(91, 108, 240, 0.76);
  paint-order: stroke fill;
  animation: math-war-count-pop 0.82s ease both;
}

@keyframes math-war-count-pop {
  0% { transform: scale(0.62); opacity: 0; }
  28% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.math-war-quiz-problem {
  margin: 16px auto;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(135deg, #26395f, #4355d8);
  color: #fff;
  font-size: clamp(2.2rem, 8vw, 4.6rem);
  font-weight: 1000;
  letter-spacing: 0.03em;
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.14), 0 14px 30px rgba(52, 72, 170, 0.22);
}

.math-war-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.math-war-quiz-option {
  appearance: none;
  border: 0;
  border-radius: 24px;
  padding: 18px 12px;
  color: #fff;
  background: linear-gradient(135deg, #ffae3d, #ff7d4f);
  box-shadow: 0 12px 26px rgba(255, 117, 64, 0.24);
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  font-weight: 1000;
  cursor: pointer;
}

.math-war-quiz-option:nth-child(2) {
  background: linear-gradient(135deg, #39c992, #2ea3ff);
  box-shadow: 0 12px 26px rgba(46, 163, 255, 0.24);
}

.math-war-quiz-option:hover {
  transform: translateY(-2px);
}

.math-war-return-icon {
  font-size: clamp(3.2rem, 10vw, 6rem);
  line-height: 1;
  filter: drop-shadow(0 12px 20px rgba(91, 108, 240, 0.22));
  animation: math-war-return-pulse 0.94s ease infinite alternate;
}

@keyframes math-war-return-pulse {
  from { transform: scale(0.94) rotate(-2deg); }
  to { transform: scale(1.08) rotate(2deg); }
}

.math-war-end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.math-war-end-stats div {
  padding: 14px 10px;
  border-radius: 18px;
  background: #f5f7ff;
}

.math-war-end-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.math-war-end-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.5rem;
}

.math-war-clear-bonus {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 215, 85, 0.28), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(240, 190, 64, 0.45);
}

.math-war-clear-bonus strong,
.math-war-clear-bonus span {
  display: block;
}

.math-war-clear-bonus span {
  margin-top: 4px;
  color: #8b681e;
  line-height: 1.5;
}

.math-war-end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.math-war-side-panel {
  display: grid;
  gap: 12px;
}

.math-war-side-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(184, 195, 226, 0.82);
  box-shadow: 0 12px 26px rgba(39, 68, 124, 0.08);
}

.math-war-side-card h2 {
  margin: 0 0 10px;
}

.math-war-side-card p,
.math-war-side-card li {
  color: var(--muted);
  line-height: 1.68;
}

.math-war-side-card ol {
  margin: 0;
  padding-left: 1.2rem;
}

.math-war-touch-controls {
  display: none;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.math-war-touch-button {
  appearance: none;
  border: 0;
  min-height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #5b6cf0, #89a0ff);
  color: #fff;
  font-weight: 1000;
  font-size: 1.25rem;
  box-shadow: 0 12px 24px rgba(91, 108, 240, 0.22);
}

.math-war-touch-wide {
  background: linear-gradient(135deg, #27385f, #4b5f94);
}

@media (max-width: 980px) {
  .math-war-header {
    display: grid;
    padding: 16px;
  }

  .math-war-header-actions {
    justify-content: flex-start;
  }

  .math-war-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-war-toolbar {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .math-war-canvas-wrap,
  .math-war-canvas-wrap canvas {
    min-height: 470px;
  }

  .math-war-canvas-wrap canvas {
    max-height: 66vh;
  }

  .math-war-touch-controls,
  .math-war-sticky-actions {
    display: grid;
  }

  .math-war-sticky-actions {
    grid-template-columns: 1.2fr 1fr;
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 16;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 12px, 1180px);
  }

  .math-war-shell {
    padding: 8px;
  }

  .math-war-topbar {
    gap: 8px;
  }

  .math-war-stat {
    padding: 8px 10px;
    border-radius: 14px;
  }

  .math-war-stat strong {
    font-size: 0.95rem;
  }

  .math-war-canvas-wrap,
  .math-war-canvas-wrap canvas {
    min-height: 420px;
  }

  .math-war-floating-message {
  display: none !important;
    top: 8px;
    font-size: 0.82rem;
    padding: 8px 12px;
  }

  .math-war-quiz-options,
  .math-war-end-stats {
    grid-template-columns: 1fr;
  }
}

.math-war-quiz-option.is-correct {
  outline: 5px solid rgba(90, 238, 147, 0.9);
  filter: saturate(1.18) brightness(1.08);
}

.math-war-quiz-option.is-wrong {
  outline: 5px solid rgba(255, 82, 108, 0.85);
  filter: grayscale(0.18) brightness(0.92);
}


/* MATH_WAR_V60 integrated mobile/game-only adjustments */
.math-war-shell {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,249,255,0.94));
}

.math-war-canvas-wrap {
  width: 100%;
}

.math-war-overlay {
  touch-action: auto;
}

.math-war-overlay-card {
  max-height: calc(100% - 10px);
  overflow: auto;
}

.math-war-start-card {
  max-width: 560px;
}

.math-war-start-points {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.math-war-overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.math-war-side-panel {
  display: none !important;
}

.math-war-sticky-actions {
  display: none;
  gap: 10px;
  margin-top: 12px;
}

.math-war-sticky-actions .is-hidden {
  display: none !important;
}

.math-war-canvas-wrap.is-portrait-mobile {
  min-height: 430px;
}

.math-war-canvas-wrap.is-portrait-mobile canvas {
  max-height: 58svh;
  min-height: 420px;
}

@media (max-width: 560px) {
  .math-war-header {
    padding: 12px;
  }

  .math-war-header h1 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  .math-war-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-war-toolbar {
    grid-column: 1 / -1;
  }

  .math-war-overlay-card,
  .math-war-challenge-card {
    margin-top: 6px;
  }
}


.math-war-buddy-picker {
  margin: 10px 0 16px;
  text-align: left;
}

.math-war-buddy-picker h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.math-war-buddy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.math-war-buddy-card {
  border: 1px solid rgba(181, 194, 229, 0.9);
  border-radius: 16px;
  padding: 12px;
  background: rgba(248, 252, 255, 0.96);
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.math-war-buddy-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(54, 88, 158, 0.12);
}

.math-war-buddy-card.is-selected {
  border-color: rgba(98, 120, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(98, 120, 255, 0.16);
}

.math-war-buddy-thumb {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff5c9, #ffd983);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
}

.math-war-buddy-meta strong,
.math-war-buddy-meta span {
  display: block;
}

.math-war-buddy-meta span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .math-war-canvas-wrap,
  .math-war-canvas-wrap canvas {
    min-height: 420px;
  }

  .math-war-canvas-wrap canvas {
    max-height: 54svh;
  }
}


.math-war-start-card {
  max-width: 560px;
  max-height: min(72vh, 620px);
  overflow: auto;
  padding: 22px 20px 20px;
}

.math-war-start-card h2 {
  margin: 6px 0 12px;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.18;
}

.math-war-start-copy {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.math-war-start-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 16px;
}

.math-war-start-points span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 246, 255, 0.95);
  border: 1px solid rgba(184, 195, 226, 0.8);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.math-war-buddy-picker {
  margin: 2px 0 8px;
  text-align: left;
}

.math-war-buddy-picker h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.math-war-buddy-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.math-war-buddy-card {
  padding: 10px 12px;
  grid-template-columns: 56px 1fr;
}

.math-war-buddy-thumb {
  width: 56px;
  height: 56px;
  font-size: 1.55rem;
}

.math-war-buddy-meta strong {
  font-size: 0.98rem;
}

.math-war-buddy-meta span {
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  .math-war-start-card {
    max-height: min(78vh, 620px);
    padding: 18px 14px 16px;
  }

  .math-war-start-card h2 {
    font-size: clamp(1.7rem, 9vw, 2.4rem);
  }
}


/* MATH_WAR_V63: keep canvas aspect ratio to prevent slime distortion. */
.math-war-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
}

.math-war-canvas-wrap canvas {
  width: auto;
  max-width: 100%;
  min-height: 0;
  max-height: none;
}

.math-war-start-card {
  max-width: 540px;
  max-height: min(76vh, 640px);
  padding: 18px 18px 18px;
}

.math-war-start-card h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.85rem, 4.2vw, 2.55rem);
  line-height: 1.14;
}

.math-war-buddy-picker {
  margin: 2px 0 8px;
}

.math-war-buddy-list {
  max-height: 176px;
  overflow: auto;
  padding: 2px 3px 2px 2px;
}

.math-war-buddy-card {
  min-height: 58px;
  padding: 8px 10px;
}

.math-war-start-copy {
  margin: 8px 0 10px;
  font-size: 0.94rem;
}

.math-war-start-points {
  margin: 8px 0 14px;
}

.math-war-coop-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(12, 20, 42, 0.42);
  backdrop-filter: blur(8px);
}

.math-war-coop-panel.hidden,
.math-war-coop-controller.hidden,
.math-war-coop-room.hidden,
.math-war-coop-role-hint.hidden {
  display: none !important;
}

.math-war-coop-card {
  width: min(760px, 96vw);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
}

.math-war-coop-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.math-war-coop-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
}

.math-war-coop-status,
.math-war-coop-role-hint {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(240, 246, 255, 0.96);
  color: var(--muted);
  line-height: 1.55;
}

.math-war-coop-status.is-error {
  background: rgba(255, 236, 240, 0.98);
  color: #a12f4a;
}

.math-war-coop-steps,
.math-war-coop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.math-war-coop-step-box,
.math-war-coop-box {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(184, 195, 226, 0.85);
  background: rgba(255, 255, 255, 0.92);
}

.math-war-coop-step-box ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.55;
}

.math-war-coop-box p {
  color: var(--muted);
  line-height: 1.55;
}

.math-war-coop-room {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.math-war-coop-room strong {
  font-size: 2rem;
  letter-spacing: 0.18em;
  color: var(--primary-2);
}

.math-war-coop-join-row {
  display: flex;
  gap: 8px;
}

.math-war-coop-join-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(184, 195, 226, 0.95);
  border-radius: 14px;
  padding: 12px;
  font-weight: 900;
  font-size: 1.1rem;
}

.math-war-coop-controller {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.96);
  border: 1px solid rgba(152, 177, 255, 0.72);
}

.math-war-coop-controller-title {
  margin: 0 0 10px;
  font-weight: 1000;
}

.math-war-coop-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 760px) {
  .math-war-canvas-wrap {
    min-height: 360px;
  }
  .math-war-coop-steps,
  .math-war-coop-grid,
  .math-war-coop-actions {
    grid-template-columns: 1fr;
  }
  .math-war-coop-card {
    padding: 16px;
  }
}


/* MATH_WAR_V69: 初期画面はゲームフィールド内のクリック開始表示へ寄せる */
.math-war-start-overlay {
  background: linear-gradient(180deg, rgba(4, 12, 32, 0.06), rgba(4, 12, 32, 0.14));
  backdrop-filter: none;
  place-items: center;
  cursor: pointer;
}

.math-war-start-overlay .math-war-start-card {
  width: min(470px, 88%);
  max-height: min(82%, 520px);
  overflow: auto;
  border-radius: 24px;
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 18px 44px rgba(7, 16, 44, 0.18);
}

.math-war-start-overlay .math-war-start-card h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  line-height: 1.12;
}

.math-war-start-overlay .math-war-start-copy {
  margin: 9px 0 10px;
  line-height: 1.55;
  color: var(--muted);
}

.math-war-start-overlay .math-war-buddy-picker {
  margin: 4px 0 8px;
}

.math-war-start-overlay .math-war-buddy-picker h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.math-war-start-overlay .math-war-buddy-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
}

.math-war-start-overlay .math-war-buddy-card {
  min-height: 58px;
  padding: 8px 10px;
  grid-template-columns: 48px 1fr;
}

.math-war-start-overlay .math-war-buddy-thumb {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.math-war-start-overlay .math-war-buddy-meta strong {
  font-size: 0.94rem;
}

.math-war-start-overlay .math-war-buddy-meta span {
  font-size: 0.76rem;
}

.math-war-start-overlay .math-war-start-points {
  margin: 8px 0 12px;
  gap: 6px;
}

.math-war-start-overlay .math-war-start-points span {
  font-size: 0.82rem;
  padding: 5px 9px;
}

.math-war-start-overlay .math-war-overlay-actions {
  gap: 8px;
}

@media (max-width: 760px) {
  .math-war-start-overlay .math-war-start-card {
    width: min(440px, 92%);
    max-height: min(86%, 560px);
    padding: 16px 14px;
  }
  .math-war-start-overlay .math-war-start-card h2 {
    font-size: clamp(1.65rem, 8vw, 2.35rem);
  }
}



/* MATH_WAR_V69: iOS Safari cannot use the Fullscreen API reliably.
   Use a CSS-based mobile play shell so the game is playable without page scrolling. */
@media (max-width: 760px) {
  body.math-war-mobile-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
    background: #eef5ff;
  }

  body.math-war-mobile-lock .page-shell {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.math-war-mobile-lock .math-war-header {
    display: none !important;
  }

  body.math-war-mobile-lock .math-war-page {
    display: block;
    gap: 0;
  }

  .math-war-shell.math-war-mobile-focus {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    padding: max(4px, env(safe-area-inset-top)) 4px max(4px, env(safe-area-inset-bottom));
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #f7fbff, #eef5ff);
  }

  .math-war-mobile-focus .math-war-topbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 4px;
    align-items: stretch;
  }

  .math-war-mobile-focus .math-war-stat {
    min-height: 38px;
    padding: 4px 5px;
    border-radius: 10px;
  }

  .math-war-mobile-focus .math-war-stat span {
    font-size: 0.56rem;
    letter-spacing: 0;
  }

  .math-war-mobile-focus .math-war-stat strong {
    font-size: 0.76rem;
    line-height: 1.08;
    margin-top: 1px;
    white-space: nowrap;
  }

  .math-war-mobile-focus .math-war-toolbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr 1fr 1fr;
    gap: 4px;
    justify-content: stretch;
  }

  .math-war-mobile-focus .math-war-toolbar .button {
    min-height: 34px;
    padding: 6px 3px;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .math-war-mobile-focus .math-war-main {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
  }

  .math-war-mobile-focus .math-war-canvas-wrap {
    height: 100%;
    min-height: 0 !important;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .math-war-mobile-focus .math-war-canvas-wrap canvas {
    min-height: 0 !important;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }

  .math-war-mobile-focus .math-war-touch-controls {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.05fr 1fr;
    gap: 5px;
    margin-top: 4px;
  }

  .math-war-mobile-focus .math-war-touch-button {
    min-height: 40px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .math-war-mobile-focus .math-war-sticky-actions {
    display: none !important;
  }

  .math-war-mobile-focus .math-war-start-overlay {
    padding: 8px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-start-card {
    width: min(92vw, 360px);
    max-height: 92%;
    padding: 12px 12px 10px;
    border-radius: 18px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-start-card .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-start-card h2 {
    font-size: clamp(1.35rem, 7vw, 1.85rem);
    margin: 2px 0 8px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-picker {
    margin: 0 0 7px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-picker h3 {
    font-size: 0.82rem;
    margin-bottom: 5px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-list {
    max-height: 110px;
    overflow: auto;
    gap: 5px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-card {
    min-height: 46px;
    grid-template-columns: 40px 1fr;
    gap: 7px;
    padding: 6px 8px;
    border-radius: 13px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-thumb {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 1.1rem;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-meta strong {
    font-size: 0.82rem;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-buddy-meta span {
    font-size: 0.66rem;
    line-height: 1.22;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-start-copy {
    display: none;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-start-points {
    display: none;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-overlay-actions {
    gap: 6px;
  }

  .math-war-mobile-focus .math-war-start-overlay .math-war-overlay-actions .button {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.85rem;
  }

  .math-war-mobile-focus .math-war-challenge-card,
  .math-war-mobile-focus .math-war-end-card {
    width: min(92vw, 380px);
    max-height: 92%;
    overflow: auto;
    padding: 14px 12px;
    border-radius: 18px;
  }

  .math-war-mobile-focus .math-war-quiz-problem {
    font-size: clamp(2rem, 12vw, 3.4rem);
    padding: 12px;
  }

  .math-war-mobile-focus .math-war-quiz-options {
    gap: 8px;
  }

  .math-war-mobile-focus .math-war-quiz-option {
    padding: 12px 8px;
  }
}


/* MATH_WAR_V69: coop buddy movement controls + compact quiz for phones/tablets */
.math-war-coop-move {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.math-war-coop-move-button {
  min-height: 52px;
  font-size: 1.05rem;
}

.math-war-challenge-card {
  max-height: min(92vh, 720px);
  overflow: auto;
}

@media (max-width: 900px), (pointer: coarse) {
  .math-war-challenge {
    position: fixed;
    inset: 0;
    z-index: 10020;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    place-items: center;
  }

  .math-war-challenge-card {
    width: min(94vw, 520px);
    max-height: calc(100dvh - 18px);
    padding: 14px 12px;
    border-radius: 18px;
    overflow: auto;
  }

  .math-war-challenge-kicker {
    margin-bottom: 8px;
    padding: 6px 10px;
    font-size: 0.84rem;
  }

  .math-war-challenge-card h2 {
    margin: 0 0 4px;
    font-size: clamp(1.15rem, 5.4vw, 1.7rem);
  }

  .math-war-challenge-card p {
    margin: 4px 0;
    line-height: 1.35;
    font-size: 0.88rem;
  }

  .math-war-quiz-problem {
    margin: 8px auto;
    padding: 10px;
    border-radius: 16px;
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .math-war-quiz-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .math-war-quiz-option {
    min-height: 58px;
    padding: 10px 6px;
    border-radius: 16px;
    font-size: clamp(1.7rem, 9vw, 2.7rem);
  }

  .math-war-coop-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 620px) and (pointer: coarse) {
  .math-war-challenge-card {
    max-height: calc(100dvh - 10px);
    padding: 10px 8px;
  }

  .math-war-quiz-problem {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
    margin: 6px auto;
  }

  .math-war-quiz-option {
    min-height: 50px;
    font-size: clamp(1.45rem, 8vw, 2.3rem);
  }
}


/* MATH_WAR_V78: tablet/PC compact layout + emergency bomb button. */
.math-war-bomb-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 12px !important;
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
}

.math-war-bomb-button:disabled {
  opacity: 0.46;
  filter: grayscale(0.35);
}

@media (min-width: 760px) {
  .math-war-header {
    padding: 12px 18px;
    gap: 12px;
    min-height: 0;
  }

  .math-war-header h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3.05vw, 2.75rem);
    line-height: 1;
  }

  .math-war-header .eyebrow {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  .math-war-header::after {
    width: 160px;
    height: 160px;
    inset: auto -22px -66px auto;
  }

  .math-war-header-actions {
    align-items: center;
    gap: 7px;
  }

  .math-war-shell {
    padding-top: 10px;
  }

  .math-war-challenge-card {
    width: min(560px, 64vw);
    max-height: min(84vh, 620px);
    padding: 16px 18px 18px;
  }

  .math-war-challenge-kicker,
  #mathWarQuizTitle,
  #mathWarQuizLead {
    display: none !important;
  }

  .math-war-quiz-problem {
    margin: 0 auto 12px;
    padding: 16px 18px;
    border-radius: 20px;
    font-size: clamp(2.6rem, 5.6vw, 4.8rem);
  }

  .math-war-quiz-options {
    margin-top: 10px;
    gap: 12px;
  }

  .math-war-quiz-option {
    min-height: 82px;
    padding: 12px 8px;
    border-radius: 20px;
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  }
}

@media (min-width: 760px) and (max-width: 1100px) {
  .math-war-challenge-card {
    width: min(520px, 76vw);
  }

  .math-war-header {
    padding: 10px 14px;
  }

  .math-war-header h1 {
    font-size: clamp(1.75rem, 3.6vw, 2.4rem);
  }
}


/* MATH_WAR_V110 */
.math-war-end-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,255,0.98)), radial-gradient(circle at top center, rgba(255,222,120,0.26), rgba(255,255,255,0) 48%);
}
.math-war-clear-choice-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 8px;
}
.math-war-clear-choice-box.hidden {
  display: none !important;
}
.math-war-clear-choice-box .button {
  width: 100%;
  justify-content: center;
}
.math-war-clear-bonus {
  background: rgba(245, 249, 255, 0.95);
}

/* MATH_WAR_V110 */


/* MATH_WAR_V110 */
.math-war-clear-choice-box .button {
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.math-war-reward-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
}
.math-war-reward-thumb {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.38);
}
.math-war-reward-thumb.is-weapon { background: linear-gradient(180deg, #ffe2ab, #f7b154); }
.math-war-reward-thumb.is-army { background: linear-gradient(180deg, #c7efff, #62b6ff); }
.math-war-reward-thumb-inner { font-size: 2rem; transform: translateY(-6px); }
.math-war-reward-chest { position: absolute; right: 8px; bottom: 6px; font-size: 1.5rem; }
.math-war-reward-copy { display: grid; gap: 4px; min-width: 0; }
.math-war-reward-copy strong { font-size: 1rem; line-height: 1.2; }
.math-war-reward-copy span { font-size: 0.96rem; line-height: 1.35; }
.math-war-reward-copy small { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 560px) {
  .math-war-reward-choice { grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 12px; }
  .math-war-reward-thumb { width: 72px; height: 72px; border-radius: 16px; }
  .math-war-reward-thumb-inner { font-size: 1.7rem; }
  .math-war-reward-chest { font-size: 1.3rem; }
}


/* MATH_WAR_V110 */
.math-war-buddy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.math-war-buddy-thumb span {
  font-size: 1.7rem;
}


/* MATH_WAR_V110 */
.math-war-end-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(245,248,255,0.92)), url('/static/assets/backgrounds/math_war_reward_room_v109.jpg') center/cover no-repeat !important;
}

.math-war-clear-bonus {
  background: rgba(255,255,255,0.82) !important;
  backdrop-filter: blur(2px);
}

.math-war-reward-choice {
  grid-template-columns: 112px 1fr !important;
  gap: 14px !important;
}

.math-war-reward-thumb {
  width: 104px !important;
  height: 104px !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.math-war-reward-thumb.is-weapon,
.math-war-reward-thumb.is-army {
  background: transparent !important;
}

.math-war-reward-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.16));
}

.math-war-reward-thumb-inner,
.math-war-reward-chest {
  display: none !important;
}

@media (max-width: 560px) {
  .math-war-reward-choice {
    grid-template-columns: 86px 1fr !important;
  }
  .math-war-reward-thumb {
    width: 86px !important;
    height: 86px !important;
  }
}


/* MATH_WAR_V110 */
.math-war-return-icon[data-mode="image"] {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(84px, 18vw, 128px);
  font-size: 0;
}

.math-war-return-icon[data-mode="image"] img {
  display: block;
  width: clamp(120px, 24vw, 220px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(34, 50, 120, 0.22));
}


/* ROBOTAN_MATH_WAR_DESKTOP_LAYOUT_V1
   Desktop/tablet correction: keep the Math War header/HUD compact and let the
   actual 720:1080 play field use the available height instead of leaving a huge
   horizontal canvas well around it. Mobile focus mode below 760px keeps the
   original dedicated layout. */
@media (min-width: 761px) {
  body.play-body.math-war-body {
    overflow: hidden !important;
    height: var(--app-height, 100dvh);
  }

  body.play-body.math-war-body .page-shell {
    width: 100% !important;
    max-width: none !important;
    min-height: var(--app-height, 100dvh) !important;
    height: var(--app-height, 100dvh) !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .math-war-page {
    height: var(--app-height, 100dvh);
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .math-war-header {
    flex: 0 0 auto;
    align-items: center;
    padding: 8px 16px !important;
    gap: 12px;
    min-height: 62px;
    border-radius: 0 0 20px 20px;
  }

  .math-war-header-copy {
    min-width: 0;
  }

  .math-war-header h1 {
    margin: 0 !important;
    font-size: clamp(1.55rem, 2.45vw, 2.25rem) !important;
    line-height: 1 !important;
    letter-spacing: 0.02em;
  }

  .math-war-header .eyebrow {
    margin: 0 0 3px !important;
    font-size: 0.68rem !important;
    line-height: 1.12 !important;
    letter-spacing: 0.16em;
  }

  .math-war-header::after {
    width: 132px !important;
    height: 132px !important;
    inset: auto -18px -58px auto !important;
  }

  .math-war-header-actions {
    align-items: center;
    gap: 6px;
  }

  .math-war-header-actions .button {
    min-height: 34px;
    padding: 7px 13px;
    font-size: 0.82rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .math-war-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 12px 10px !important;
    border-radius: 20px 20px 0 0;
  }

  .math-war-topbar {
    flex: 0 0 auto;
    grid-template-columns: repeat(5, minmax(86px, 1fr)) auto;
    gap: 7px;
    margin-bottom: 8px;
    align-items: center;
  }

  .math-war-stat {
    min-height: 42px;
    padding: 7px 10px !important;
    border-radius: 14px;
  }

  .math-war-stat span {
    font-size: 0.64rem;
    line-height: 1.08;
  }

  .math-war-stat strong {
    margin-top: 2px;
    font-size: 0.94rem;
    line-height: 1.12;
  }

  .math-war-toolbar {
    gap: 6px;
  }

  .math-war-toolbar .button {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 0.8rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .math-war-bomb-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .math-war-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }

  .math-war-canvas-wrap {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px;
  }

  .math-war-canvas-wrap canvas {
    min-height: 0 !important;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .math-war-header {
    align-items: flex-start;
  }

  .math-war-header-actions {
    justify-content: flex-end;
  }

  .math-war-topbar {
    grid-template-columns: repeat(5, minmax(78px, 1fr));
  }

  .math-war-toolbar {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  .math-war-page {
    gap: 6px;
  }

  .math-war-header {
    min-height: 52px;
    padding: 6px 12px !important;
  }

  .math-war-header h1 {
    font-size: clamp(1.35rem, 2.15vw, 1.9rem) !important;
  }

  .math-war-header-actions .button,
  .math-war-toolbar .button {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.74rem;
  }

  .math-war-shell {
    padding: 6px 10px 8px !important;
  }

  .math-war-topbar {
    gap: 6px;
    margin-bottom: 6px;
  }

  .math-war-stat {
    min-height: 36px;
    padding: 5px 8px !important;
  }

  .math-war-stat span {
    font-size: 0.58rem;
  }

  .math-war-stat strong {
    font-size: 0.84rem;
  }
}

/* ROBOTAN_PROMO_PORTAL_V1 */
.math-war-promo-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: center;
  width: min(920px, 100%);
  margin: 0 auto;
}
.math-war-promo-copy {
  text-align: left;
}
.math-war-promo-brand {
  display: inline-flex;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 131, 177, 0.18);
  color: #a72d60;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}
.math-war-promo-panel h3 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 3.4vw, 2.45rem);
  color: #18223d;
}
.math-war-promo-panel p {
  margin: 0;
  color: #526079;
}
.math-war-promo-hero {
  width: min(100%, 280px);
  justify-self: center;
  filter: drop-shadow(0 16px 26px rgba(37, 31, 80, 0.18));
}
.math-war-promo-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
  margin-top: clamp(14px, 2vw, 22px);
}
.math-war-promo-choice {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,245,251,0.92));
  border: 2px solid rgba(255, 142, 184, 0.32);
  box-shadow: 0 18px 34px rgba(81, 62, 131, 0.16);
  color: #18223d;
}
.math-war-promo-choice:hover,
.math-war-promo-choice:focus-visible {
  transform: translateY(-3px) scale(1.015);
}
.math-war-promo-choice img {
  width: min(100%, 170px);
  max-height: 118px;
  object-fit: contain;
  pointer-events: none;
}
.math-war-promo-choice strong {
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
}
.math-war-promo-choice small {
  display: block;
  color: #61708e;
  font-weight: 700;
}
@media (max-width: 720px) {
  .math-war-promo-panel,
  .math-war-promo-options {
    grid-template-columns: 1fr;
  }
  .math-war-promo-choice {
    min-height: 160px;
  }
}


/* ROBOTAN_PROMO_PORTAL_V1B */
.math-war-challenge-card,
.math-war-end-card {
  max-height: min(86dvh, 860px);
  overflow: auto;
}
.math-war-challenge-card.is-promo,
.math-war-end-card.is-promo {
  width: min(760px, 94vw);
  padding: clamp(14px, 2.2vw, 24px);
}
.math-war-challenge-card.is-promo .math-war-quiz-box,
.math-war-end-card.is-promo .math-war-clear-choice-box {
  display: grid;
  gap: 12px;
}
.math-war-challenge-card.is-promo .math-war-quiz-problem {
  margin: 10px auto;
  padding: 14px;
  border-radius: 22px;
}
.math-war-challenge-card.is-promo .math-war-quiz-options {
  margin-top: 6px;
}
.math-war-challenge-card.is-promo .math-war-promo-panel {
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}
.math-war-challenge-card.is-promo .math-war-promo-hero {
  width: min(100%, 170px);
  max-height: 140px;
}
.math-war-challenge-card.is-promo .math-war-promo-panel h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
}
.math-war-challenge-card.is-promo .math-war-promo-options,
.math-war-end-card.is-promo .math-war-promo-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.math-war-challenge-card.is-promo .math-war-promo-choice,
.math-war-end-card.is-promo .math-war-promo-choice {
  min-height: 0;
  padding: 12px;
  border-radius: 18px;
  gap: 8px;
}
.math-war-challenge-card.is-promo .math-war-promo-choice img,
.math-war-end-card.is-promo .math-war-promo-choice img {
  width: min(100%, 120px);
  max-height: 82px;
}
.math-war-challenge-card.is-promo .math-war-promo-choice strong,
.math-war-end-card.is-promo .math-war-promo-choice strong {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
}
.math-war-end-card.is-promo {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,248,255,0.96)), radial-gradient(circle at top center, rgba(255,195,222,0.22), rgba(255,255,255,0) 52%) !important;
}
.math-war-end-card.is-promo .math-war-clear-bonus {
  background: rgba(255,247,251,0.92) !important;
  border: 1px solid rgba(255, 168, 196, 0.35);
}
.math-war-promo-final-note {
  margin-top: 8px;
  color: #61708e;
  font-weight: 700;
}
@media (max-width: 720px) {
  .math-war-challenge-card.is-promo,
  .math-war-end-card.is-promo {
    width: min(96vw, 520px);
    max-height: min(90dvh, 760px);
  }
  .math-war-challenge-card.is-promo .math-war-promo-panel,
  .math-war-end-card.is-promo .math-war-promo-panel,
  .math-war-challenge-card.is-promo .math-war-promo-options,
  .math-war-end-card.is-promo .math-war-promo-options {
    grid-template-columns: 1fr;
  }
}


/* ROBOTAN_PROMO_MODAL_V2
   Promotion screens are no longer treated as the old multiplication quiz panel.
   They are fixed, compact modals so the ad image + 2 choices fit in one viewport. */
body.math-war-promo-open {
  overflow: hidden !important;
}

#mathWarChallengeOverlay.is-promo-mode,
#mathWarEndOverlay.is-promo-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: var(--app-height, 100dvh) !important;
  z-index: 99990 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
  overflow: hidden !important;
  background: radial-gradient(circle at 50% 22%, rgba(255,255,255,0.22), rgba(13,19,44,0.58) 54%, rgba(9,14,28,0.72)) !important;
  backdrop-filter: blur(10px) !important;
  box-sizing: border-box !important;
}

#mathWarChallengeOverlay.is-promo-mode.hidden,
#mathWarEndOverlay.is-promo-mode.hidden {
  display: none !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-challenge-card,
#mathWarEndOverlay.is-promo-mode .math-war-end-card {
  width: min(720px, calc(100vw - 24px)) !important;
  max-width: min(720px, calc(100vw - 24px)) !important;
  height: auto !important;
  max-height: calc(var(--app-height, 100dvh) - 24px) !important;
  overflow: hidden !important;
  padding: clamp(12px, 2.2vw, 20px) !important;
  border-radius: clamp(18px, 3vw, 28px) !important;
  text-align: center !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.97)) !important;
  border: 1px solid rgba(207, 219, 245, 0.95) !important;
  box-shadow: 0 28px 80px rgba(7, 16, 44, 0.28) !important;
  box-sizing: border-box !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-challenge-kicker,
#mathWarEndOverlay.is-promo-mode .eyebrow {
  margin: 0 0 8px !important;
  padding: 5px 10px !important;
  font-size: clamp(0.68rem, 1.4vw, 0.82rem) !important;
  line-height: 1.1 !important;
}

#mathWarChallengeOverlay.is-promo-mode #mathWarQuizTitle,
#mathWarEndOverlay.is-promo-mode #mathWarEndTitle {
  margin: 0 0 5px !important;
  font-size: clamp(1.18rem, 3.2vw, 1.95rem) !important;
  line-height: 1.16 !important;
}

#mathWarChallengeOverlay.is-promo-mode #mathWarQuizLead,
#mathWarEndOverlay.is-promo-mode #mathWarEndSummary {
  margin: 0 0 8px !important;
  font-size: clamp(0.82rem, 1.7vw, 1rem) !important;
  line-height: 1.45 !important;
  color: #526079 !important;
}

#mathWarChallengeOverlay.is-promo-mode #mathWarQuizProblem.math-war-promo-problem,
#mathWarChallengeOverlay.is-promo-mode #mathWarQuizProblem {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #18223d !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel,
#mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel-v2 {
  display: grid !important;
  grid-template-columns: minmax(118px, 168px) minmax(0, 1fr) !important;
  gap: clamp(10px, 2vw, 16px) !important;
  align-items: center !important;
  width: 100% !important;
  margin: 0 auto 10px !important;
  padding: clamp(10px, 2vw, 14px) !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, #fff7fb, #fff0d9) !important;
  border: 1px solid rgba(255, 173, 202, 0.36) !important;
  box-shadow: 0 12px 30px rgba(81, 62, 131, 0.13) !important;
  box-sizing: border-box !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-hero {
  display: block !important;
  width: min(100%, 168px) !important;
  max-width: 168px !important;
  height: auto !important;
  max-height: 104px !important;
  object-fit: contain !important;
  justify-self: center !important;
  filter: drop-shadow(0 10px 18px rgba(37, 31, 80, 0.14)) !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-copy {
  min-width: 0 !important;
  text-align: left !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-brand {
  margin: 0 0 5px !important;
  padding: 4px 9px !important;
  font-size: clamp(0.68rem, 1.2vw, 0.78rem) !important;
  line-height: 1 !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel h3 {
  margin: 0 0 4px !important;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem) !important;
  line-height: 1.18 !important;
  color: #18223d !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel p {
  margin: 0 !important;
  font-size: clamp(0.78rem, 1.45vw, 0.92rem) !important;
  line-height: 1.45 !important;
  color: #526079 !important;
}

#mathWarChallengeOverlay.is-promo-mode #mathWarQuizOptions,
#mathWarChallengeOverlay.is-promo-mode #mathWarQuizOptions.is-promo-options {
  display: block !important;
  margin: 0 !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-options,
#mathWarEndOverlay.is-promo-mode .math-war-promo-options,
#mathWarEndOverlay.is-promo-mode .math-war-clear-choice-box {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(8px, 1.8vw, 12px) !important;
  margin: 0 !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice,
#mathWarEndOverlay.is-promo-mode .math-war-promo-choice {
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  justify-items: center !important;
  align-items: start !important;
  gap: 6px !important;
  padding: clamp(9px, 1.7vw, 13px) !important;
  border-radius: 18px !important;
  color: #18223d !important;
  font-size: 1rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
  box-shadow: 0 14px 28px rgba(81, 62, 131, 0.13) !important;
  box-sizing: border-box !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice img,
#mathWarEndOverlay.is-promo-mode .math-war-promo-choice img {
  display: block !important;
  width: auto !important;
  max-width: min(132px, 42vw) !important;
  height: auto !important;
  max-height: clamp(58px, 12dvh, 92px) !important;
  object-fit: contain !important;
  margin: 0 auto 2px !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice span,
#mathWarEndOverlay.is-promo-mode .math-war-promo-choice span {
  min-width: 0 !important;
  display: block !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice strong,
#mathWarEndOverlay.is-promo-mode .math-war-promo-choice strong {
  display: block !important;
  font-size: clamp(0.92rem, 2.2vw, 1.15rem) !important;
  line-height: 1.22 !important;
  color: #18223d !important;
}

#mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice small,
#mathWarEndOverlay.is-promo-mode .math-war-promo-choice small {
  display: block !important;
  margin-top: 3px !important;
  font-size: clamp(0.72rem, 1.5vw, 0.86rem) !important;
  line-height: 1.32 !important;
  color: #60708e !important;
}

#mathWarEndOverlay.is-promo-mode .math-war-end-stats {
  display: none !important;
}

#mathWarEndOverlay.is-promo-mode .math-war-clear-bonus {
  margin: 8px 0 10px !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
}

#mathWarEndOverlay.is-promo-mode .math-war-end-actions {
  margin-top: 10px !important;
}

@media (max-height: 720px) and (min-width: 721px) {
  #mathWarChallengeOverlay.is-promo-mode .math-war-challenge-card,
  #mathWarEndOverlay.is-promo-mode .math-war-end-card {
    width: min(660px, calc(100vw - 20px)) !important;
    padding: 10px !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel {
    grid-template-columns: 128px minmax(0, 1fr) !important;
    margin-bottom: 8px !important;
    padding: 10px !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-hero {
    max-width: 128px !important;
    max-height: 78px !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-choice img,
  #mathWarEndOverlay.is-promo-mode .math-war-promo-choice img {
    max-height: 56px !important;
  }
  #mathWarChallengeOverlay.is-promo-mode #mathWarQuizTitle,
  #mathWarEndOverlay.is-promo-mode #mathWarEndTitle {
    font-size: 1.18rem !important;
  }
  #mathWarChallengeOverlay.is-promo-mode #mathWarQuizLead,
  #mathWarEndOverlay.is-promo-mode #mathWarEndSummary {
    font-size: 0.78rem !important;
    margin-bottom: 6px !important;
  }
}

@media (max-width: 720px) {
  #mathWarChallengeOverlay.is-promo-mode .math-war-challenge-card,
  #mathWarEndOverlay.is-promo-mode .math-war-end-card {
    width: min(96vw, 520px) !important;
    max-height: calc(var(--app-height, 100dvh) - 20px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-panel {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-copy {
    text-align: center !important;
  }
  #mathWarChallengeOverlay.is-promo-mode .math-war-promo-options,
  #mathWarEndOverlay.is-promo-mode .math-war-promo-options,
  #mathWarEndOverlay.is-promo-mode .math-war-clear-choice-box {
    grid-template-columns: 1fr !important;
  }
}


/* ROBOTAN_PROMO_ENEMY_ASSET_EDITOR_V3 */
.math-war-promo-choice {
  align-items: stretch;
}
.math-war-promo-choice-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 150px;
  max-height: 170px;
  overflow: hidden;
}
.math-war-promo-choice img {
  width: 100%;
  height: 150px;
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  pointer-events: none;
}
.math-war-promo-choice > span:last-child {
  display: grid;
  gap: 6px;
  align-content: start;
}
@media (max-width: 720px) {
  .math-war-promo-choice-thumb {
    min-height: 120px;
    max-height: 132px;
  }
  .math-war-promo-choice img {
    height: 120px;
    max-height: 120px;
  }
}

/* ROBOTAN_PROMO_CHOICE_CARD_SCALE_V2_START */

/*
  商品2択カードの画像を大きく見せるためのhotfix。
  旧指定や既存CSSに勝てるよう、セレクタを強め + !important で上書き。
*/
.math-war-quiz-overlay .math-war-promo-options,
#mathWarQuizOptions .math-war-promo-options,
#mathWarEndOverlay .math-war-promo-options,
#mathWarEndOverlay .math-war-clear-choice-box {
  align-items: stretch !important;
}

.math-war-quiz-overlay .math-war-promo-choice,
#mathWarQuizOptions .math-war-promo-choice,
#mathWarEndOverlay .math-war-promo-choice {
  display: grid !important;
  grid-template-rows: minmax(190px, 1fr) auto !important;
  align-content: stretch !important;
  justify-items: stretch !important;
  gap: 12px !important;
  padding: 18px 18px 20px !important;
  min-height: 330px !important;
}

.math-war-quiz-overlay .math-war-promo-choice-thumb,
#mathWarQuizOptions .math-war-promo-choice-thumb,
#mathWarEndOverlay .math-war-promo-choice-thumb {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 210px !important;
  min-height: 210px !important;
  max-height: 230px !important;
  padding: 4px 6px 0 !important;
  overflow: hidden !important;
}

.math-war-quiz-overlay .math-war-promo-choice img,
#mathWarQuizOptions .math-war-promo-choice img,
#mathWarEndOverlay .math-war-promo-choice img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
}

.math-war-quiz-overlay .math-war-promo-choice > span:last-child,
#mathWarQuizOptions .math-war-promo-choice > span:last-child,
#mathWarEndOverlay .math-war-promo-choice > span:last-child {
  display: grid !important;
  gap: 8px !important;
  align-content: start !important;
  text-align: center !important;
}

.math-war-quiz-overlay .math-war-promo-choice > span:last-child strong,
#mathWarQuizOptions .math-war-promo-choice > span:last-child strong,
#mathWarEndOverlay .math-war-promo-choice > span:last-child strong {
  font-size: clamp(28px, 2.7vw, 46px) !important;
  line-height: 1.18 !important;
}

.math-war-quiz-overlay .math-war-promo-choice > span:last-child small,
#mathWarQuizOptions .math-war-promo-choice > span:last-child small,
#mathWarEndOverlay .math-war-promo-choice > span:last-child small {
  font-size: clamp(13px, 1.3vw, 18px) !important;
  line-height: 1.45 !important;
}

@media (max-width: 900px) {
  .math-war-quiz-overlay .math-war-promo-choice,
  #mathWarQuizOptions .math-war-promo-choice,
  #mathWarEndOverlay .math-war-promo-choice {
    grid-template-rows: minmax(160px, auto) auto !important;
    min-height: 285px !important;
  }

  .math-war-quiz-overlay .math-war-promo-choice-thumb,
  #mathWarQuizOptions .math-war-promo-choice-thumb,
  #mathWarEndOverlay .math-war-promo-choice-thumb {
    height: 170px !important;
    min-height: 170px !important;
    max-height: 180px !important;
  }

  .math-war-quiz-overlay .math-war-promo-choice > span:last-child strong,
  #mathWarQuizOptions .math-war-promo-choice > span:last-child strong,
  #mathWarEndOverlay .math-war-promo-choice > span:last-child strong {
    font-size: clamp(22px, 4.8vw, 34px) !important;
  }
}

@media (max-width: 640px) {
  .math-war-quiz-overlay .math-war-promo-choice,
  #mathWarQuizOptions .math-war-promo-choice,
  #mathWarEndOverlay .math-war-promo-choice {
    grid-template-rows: minmax(132px, auto) auto !important;
    min-height: 240px !important;
    padding: 14px 14px 16px !important;
    gap: 10px !important;
  }

  .math-war-quiz-overlay .math-war-promo-choice-thumb,
  #mathWarQuizOptions .math-war-promo-choice-thumb,
  #mathWarEndOverlay .math-war-promo-choice-thumb {
    height: 138px !important;
    min-height: 138px !important;
    max-height: 148px !important;
    padding-top: 2px !important;
  }

  .math-war-quiz-overlay .math-war-promo-choice > span:last-child strong,
  #mathWarQuizOptions .math-war-promo-choice > span:last-child strong,
  #mathWarEndOverlay .math-war-promo-choice > span:last-child strong {
    font-size: clamp(18px, 5.4vw, 28px) !important;
  }

  .math-war-quiz-overlay .math-war-promo-choice > span:last-child small,
  #mathWarQuizOptions .math-war-promo-choice > span:last-child small,
  #mathWarEndOverlay .math-war-promo-choice > span:last-child small {
    font-size: clamp(12px, 3.4vw, 16px) !important;
  }
}
/* ROBOTAN_PROMO_CHOICE_CARD_SCALE_V2_END */


/* ROBOTAN_PROMO_LAYOUT_FIX_V3_START */
.math-war-promo-choice {
  display: grid !important;
  grid-template-rows: minmax(160px, 210px) auto !important;
  align-items: start !important;
  justify-items: stretch !important;
  gap: 14px !important;
  min-height: 360px !important;
  padding: 18px !important;
}
.math-war-promo-choice-thumb {
  width: 100% !important;
  height: 190px !important;
  min-height: 190px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}
.math-war-promo-choice-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}
.math-war-promo-choice-copy {
  display: grid !important;
  gap: 8px !important;
  align-content: start !important;
  text-align: center !important;
}
.math-war-promo-choice-copy strong {
  display: block !important;
  font-size: clamp(1.55rem, 3.5vw, 2.8rem) !important;
  line-height: 1.18 !important;
}
.math-war-promo-choice-copy small {
  display: block !important;
  color: #61708e !important;
  font-weight: 700 !important;
  font-size: clamp(1rem, 1.65vw, 1.25rem) !important;
  line-height: 1.45 !important;
}
.math-war-challenge-card.is-promo .math-war-promo-choice,
.math-war-end-card.is-promo .math-war-promo-choice {
  grid-template-rows: minmax(130px, 170px) auto !important;
  min-height: 280px !important;
  padding: 16px !important;
  gap: 10px !important;
}
.math-war-challenge-card.is-promo .math-war-promo-choice-thumb,
.math-war-end-card.is-promo .math-war-promo-choice-thumb {
  height: 144px !important;
  min-height: 144px !important;
}
.math-war-challenge-card.is-promo .math-war-promo-choice-copy strong,
.math-war-end-card.is-promo .math-war-promo-choice-copy strong {
  font-size: clamp(1.15rem, 2.4vw, 1.95rem) !important;
}
.math-war-challenge-card.is-promo .math-war-promo-choice-copy small,
.math-war-end-card.is-promo .math-war-promo-choice-copy small {
  font-size: clamp(0.9rem, 1.45vw, 1.08rem) !important;
}
@media (max-width: 720px) {
  .math-war-promo-choice {
    min-height: 260px !important;
    grid-template-rows: minmax(122px, 150px) auto !important;
    padding: 14px !important;
  }
  .math-war-promo-choice-thumb {
    height: 130px !important;
    min-height: 130px !important;
  }
  .math-war-promo-choice-copy strong {
    font-size: clamp(1.2rem, 5.4vw, 2rem) !important;
  }
  .math-war-promo-choice-copy small {
    font-size: clamp(0.88rem, 3.4vw, 1.05rem) !important;
  }
}
/* ROBOTAN_PROMO_LAYOUT_FIX_V3_END */


/* ROBOTAN_PROMO_CHOICE_LOGO_STABILIZER_REUP_V2 */
.math-war-promo-options {
  align-items: stretch;
}
.math-war-promo-choice.math-war-promo-choice--stabilized,
.math-war-challenge-card.is-promo .math-war-promo-choice.math-war-promo-choice--stabilized,
.math-war-end-card.is-promo .math-war-promo-choice.math-war-promo-choice--stabilized {
  display: grid !important;
  grid-template-rows: minmax(150px, 1fr) auto !important;
  align-items: start !important;
  justify-items: center !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: clamp(280px, 36vw, 420px) !important;
  padding: clamp(16px, 2.2vw, 24px) !important;
  border-radius: 28px !important;
  background: var(--promo-choice-bg, #ffffff) !important;
  border: 3px solid rgba(240, 188, 211, 0.88) !important;
  box-shadow: 0 18px 34px rgba(81, 62, 131, 0.14) !important;
  color: #18223d !important;
}
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-visual {
  width: 100%;
  min-height: clamp(130px, 20vw, 190px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-visual.is-empty {
  min-height: clamp(100px, 16vw, 150px);
}
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-visual img,
.math-war-promo-choice.math-war-promo-choice--stabilized img {
  width: auto !important;
  max-width: min(86%, 240px) !important;
  height: auto !important;
  max-height: clamp(120px, 18vw, 190px) !important;
  object-fit: contain !important;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.14));
  margin: 0 auto !important;
}
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-copy {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: center;
  align-self: end;
}
.math-war-promo-choice.math-war-promo-choice--stabilized strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 3rem) !important;
  line-height: 1.12 !important;
  letter-spacing: 0.01em;
}
.math-war-promo-choice.math-war-promo-choice--stabilized small {
  display: block;
  font-size: clamp(0.98rem, 2.2vw, 1.35rem) !important;
  line-height: 1.4 !important;
  color: #60708e !important;
  font-weight: 700 !important;
}
.math-war-stage-logo-slot {
  position: absolute;
  left: 50%;
  top: clamp(56px, 7vh, 96px);
  transform: translateX(-50%);
  z-index: 4;
  display: none;
  pointer-events: none;
  max-width: min(260px, 42vw);
  max-height: 92px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.52);
  backdrop-filter: blur(2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}
.math-war-stage-logo-slot.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}
.math-war-stage-logo-slot img {
  display: block;
  max-width: 100%;
  max-height: 76px;
  width: auto;
  height: auto;
  object-fit: contain;
}
@media (max-width: 720px) {
  .math-war-promo-choice.math-war-promo-choice--stabilized,
  .math-war-challenge-card.is-promo .math-war-promo-choice.math-war-promo-choice--stabilized,
  .math-war-end-card.is-promo .math-war-promo-choice.math-war-promo-choice--stabilized {
    min-height: 220px !important;
  }
  .math-war-promo-choice.math-war-promo-choice--stabilized strong {
    font-size: clamp(1.45rem, 6vw, 2.2rem) !important;
  }
  .math-war-stage-logo-slot {
    top: 52px;
    max-width: min(200px, 58vw);
    max-height: 72px;
    padding: 6px 10px;
  }
  .math-war-stage-logo-slot img {
    max-height: 58px;
  }
}


/* ROBOTAN_PROMO_VISUAL_TUNE_V1 */
.math-war-promo-choice,
.math-war-quiz-option {
  overflow: hidden !important;
}
.math-war-promo-choice img,
.math-war-quiz-option img {
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.math-war-promo-choice-visual,
.math-war-promo-choice .math-war-promo-choice-visual,
.math-war-quiz-option .math-war-promo-choice-visual {
  width: 100% !important;
  min-height: 220px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.math-war-promo-choice-visual img,
.math-war-promo-choice .math-war-promo-choice-visual img,
.math-war-quiz-option .math-war-promo-choice-visual img {
  max-width: 82% !important;
  max-height: 210px !important;
  margin: 0 auto !important;
}
.math-war-stage-logo-slot {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  z-index: 1 !important;
}
.math-war-stage-logo-slot img {
  max-height: 64px !important;
}
[class*="ad-squad"],
[class*="promo-ad"],
[class*="enemy-squad"] {
  overflow: hidden !important;
}
[class*="ad-squad"] img,
[class*="promo-ad"] img,
[class*="enemy-squad"] img {
  object-fit: contain !important;
  object-position: center center !important;
  max-width: 100% !important;
  max-height: 100% !important;
}


/* ROBOTAN_PROMO_CARD_IMAGE_FORCE_V3 */
#mathWarQuizOptions .math-war-promo-choice,
#mathWarEndOverlay .math-war-promo-choice,
.math-war-challenge-card.is-promo .math-war-promo-choice,
.math-war-end-card.is-promo .math-war-promo-choice {
  display: grid !important;
  grid-template-rows: minmax(190px, 240px) auto !important;
  align-items: start !important;
  justify-items: center !important;
  gap: 12px !important;
}
#mathWarQuizOptions .math-war-promo-choice > img,
#mathWarQuizOptions .math-war-promo-choice img,
#mathWarEndOverlay .math-war-promo-choice > img,
#mathWarEndOverlay .math-war-promo-choice img,
.math-war-challenge-card.is-promo .math-war-promo-choice > img,
.math-war-challenge-card.is-promo .math-war-promo-choice img,
.math-war-end-card.is-promo .math-war-promo-choice > img,
.math-war-end-card.is-promo .math-war-promo-choice img {
  width: clamp(150px, 18vw, 255px) !important;
  height: auto !important;
  max-width: 88% !important;
  max-height: 230px !important;
  min-width: 130px !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 auto !important;
}
#mathWarQuizOptions .math-war-promo-choice > span:first-child,
#mathWarEndOverlay .math-war-promo-choice > span:first-child,
.math-war-challenge-card.is-promo .math-war-promo-choice > span:first-child,
.math-war-end-card.is-promo .math-war-promo-choice > span:first-child {
  min-height: 190px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}
@media (max-width: 720px) {
  #mathWarQuizOptions .math-war-promo-choice,
  #mathWarEndOverlay .math-war-promo-choice,
  .math-war-challenge-card.is-promo .math-war-promo-choice,
  .math-war-end-card.is-promo .math-war-promo-choice {
    grid-template-rows: minmax(130px, 170px) auto !important;
  }
  #mathWarQuizOptions .math-war-promo-choice img,
  #mathWarEndOverlay .math-war-promo-choice img,
  .math-war-challenge-card.is-promo .math-war-promo-choice img,
  .math-war-end-card.is-promo .math-war-promo-choice img {
    width: clamp(120px, 36vw, 180px) !important;
    max-height: 165px !important;
    min-width: 100px !important;
  }
}

/* ROBOTAN_CHOICE_CARD_FIX_REUP_START */
#mathWarQuizOptions .math-war-promo-choice,
#mathWarEndOverlay .math-war-promo-choice,
.math-war-quiz-overlay .math-war-promo-choice,
.math-war-challenge-card.is-promo .math-war-promo-choice,
.math-war-end-card.is-promo .math-war-promo-choice,
.math-war-promo-choice.math-war-promo-choice--stabilized {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  height: auto !important;
  min-height: clamp(260px, 30vw, 380px) !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: clamp(14px, 1.8vw, 22px) !important;
}

#mathWarQuizOptions .math-war-promo-choice-visual,
#mathWarEndOverlay .math-war-promo-choice-visual,
.math-war-quiz-overlay .math-war-promo-choice-visual,
.math-war-challenge-card.is-promo .math-war-promo-choice-visual,
.math-war-end-card.is-promo .math-war-promo-choice-visual,
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-visual,
#mathWarQuizOptions .math-war-promo-choice > span:first-child,
#mathWarEndOverlay .math-war-promo-choice > span:first-child,
.math-war-quiz-overlay .math-war-promo-choice > span:first-child,
.math-war-challenge-card.is-promo .math-war-promo-choice > span:first-child,
.math-war-end-card.is-promo .math-war-promo-choice > span:first-child {
  width: 100% !important;
  flex: 0 0 clamp(95px, 14vw, 140px) !important;
  min-height: clamp(95px, 14vw, 140px) !important;
  max-height: clamp(110px, 15vw, 155px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

#mathWarQuizOptions .math-war-promo-choice img,
#mathWarEndOverlay .math-war-promo-choice img,
.math-war-quiz-overlay .math-war-promo-choice img,
.math-war-challenge-card.is-promo .math-war-promo-choice img,
.math-war-end-card.is-promo .math-war-promo-choice img,
.math-war-promo-choice.math-war-promo-choice--stabilized img {
  display: block !important;
  width: clamp(96px, 12vw, 145px) !important;
  min-width: 88px !important;
  max-width: 62% !important;
  height: auto !important;
  max-height: clamp(88px, 12vw, 138px) !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
  transform: scale(1.35) !important;
  transform-origin: center center !important;
}

#mathWarQuizOptions .math-war-promo-choice-copy,
#mathWarEndOverlay .math-war-promo-choice-copy,
.math-war-quiz-overlay .math-war-promo-choice-copy,
.math-war-challenge-card.is-promo .math-war-promo-choice-copy,
.math-war-end-card.is-promo .math-war-promo-choice-copy,
.math-war-promo-choice.math-war-promo-choice--stabilized .math-war-promo-choice-copy,
#mathWarQuizOptions .math-war-promo-choice > span:last-child,
#mathWarEndOverlay .math-war-promo-choice > span:last-child,
.math-war-quiz-overlay .math-war-promo-choice > span:last-child,
.math-war-challenge-card.is-promo .math-war-promo-choice > span:last-child,
.math-war-end-card.is-promo .math-war-promo-choice > span:last-child {
  width: 100% !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 8px !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 0 4px 8px !important;
  overflow: visible !important;
}

#mathWarQuizOptions .math-war-promo-choice strong,
#mathWarEndOverlay .math-war-promo-choice strong,
.math-war-quiz-overlay .math-war-promo-choice strong,
.math-war-challenge-card.is-promo .math-war-promo-choice strong,
.math-war-end-card.is-promo .math-war-promo-choice strong,
.math-war-promo-choice.math-war-promo-choice--stabilized strong {
  display: block !important;
  font-size: clamp(1.25rem, 2.4vw, 2.35rem) !important;
  line-height: 1.1 !important;
  letter-spacing: 0.01em !important;
  word-break: keep-all !important;
}

#mathWarQuizOptions .math-war-promo-choice small,
#mathWarEndOverlay .math-war-promo-choice small,
.math-war-quiz-overlay .math-war-promo-choice small,
.math-war-challenge-card.is-promo .math-war-promo-choice small,
.math-war-end-card.is-promo .math-war-promo-choice small,
.math-war-promo-choice.math-war-promo-choice--stabilized small {
  display: block !important;
  font-size: clamp(0.86rem, 1.25vw, 1.12rem) !important;
  line-height: 1.28 !important;
  color: #60708e !important;
  font-weight: 700 !important;
  word-break: keep-all !important;
}

@media (max-width: 900px) {
  #mathWarQuizOptions .math-war-promo-choice,
  #mathWarEndOverlay .math-war-promo-choice,
  .math-war-quiz-overlay .math-war-promo-choice,
  .math-war-challenge-card.is-promo .math-war-promo-choice,
  .math-war-end-card.is-promo .math-war-promo-choice,
  .math-war-promo-choice.math-war-promo-choice--stabilized {
    min-height: 235px !important;
    gap: 9px !important;
  }

  #mathWarQuizOptions .math-war-promo-choice img,
  #mathWarEndOverlay .math-war-promo-choice img,
  .math-war-quiz-overlay .math-war-promo-choice img,
  .math-war-challenge-card.is-promo .math-war-promo-choice img,
  .math-war-end-card.is-promo .math-war-promo-choice img,
  .math-war-promo-choice.math-war-promo-choice--stabilized img {
    width: clamp(82px, 17vw, 118px) !important;
    max-height: clamp(74px, 15vw, 106px) !important;
    transform: scale(1.3) !important;
  }

  #mathWarQuizOptions .math-war-promo-choice strong,
  #mathWarEndOverlay .math-war-promo-choice strong,
  .math-war-quiz-overlay .math-war-promo-choice strong,
  .math-war-challenge-card.is-promo .math-war-promo-choice strong,
  .math-war-end-card.is-promo .math-war-promo-choice strong,
  .math-war-promo-choice.math-war-promo-choice--stabilized strong {
    font-size: clamp(1.08rem, 4vw, 1.85rem) !important;
  }

  #mathWarQuizOptions .math-war-promo-choice small,
  #mathWarEndOverlay .math-war-promo-choice small,
  .math-war-quiz-overlay .math-war-promo-choice small,
  .math-war-challenge-card.is-promo .math-war-promo-choice small,
  .math-war-end-card.is-promo .math-war-promo-choice small,
  .math-war-promo-choice.math-war-promo-choice--stabilized small {
    font-size: clamp(0.78rem, 2.5vw, 0.95rem) !important;
  }
}
/* ROBOTAN_CHOICE_CARD_FIX_REUP_END */


/* ROBOTAN_BANNER_CHOICE_MODE_V1 */
.math-war-promo-options {
  align-items: stretch !important;
}
.math-war-promo-choice--banner,
#mathWarQuizOptions .math-war-promo-choice--banner,
#mathWarEndOverlay .math-war-promo-choice--banner,
.math-war-quiz-overlay .math-war-promo-choice--banner,
.math-war-challenge-card.is-promo .math-war-promo-choice--banner,
.math-war-end-card.is-promo .math-war-promo-choice--banner {
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  width: 100% !important;
  min-height: clamp(280px, 34vw, 460px) !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: clamp(18px, 2.2vw, 30px) !important;
  background: var(--promo-choice-bg, #fff) !important;
  border: 3px solid rgba(240, 188, 211, 0.9) !important;
  box-shadow: 0 18px 36px rgba(81, 62, 131, 0.16) !important;
}
.math-war-promo-banner-wrap,
.math-war-promo-choice--banner .math-war-promo-banner-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  overflow: hidden !important;
}
.math-war-promo-choice--banner .math-war-promo-banner-image,
#mathWarQuizOptions .math-war-promo-choice--banner .math-war-promo-banner-image,
#mathWarEndOverlay .math-war-promo-choice--banner .math-war-promo-banner-image,
.math-war-quiz-overlay .math-war-promo-choice--banner .math-war-promo-banner-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: var(--promo-banner-fit, contain) !important;
  object-position: center center !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  filter: none !important;
}
.math-war-promo-banner-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  font-weight: 900;
  text-align: center;
  color: #18223d;
}
@media (max-width: 720px) {
  .math-war-promo-choice--banner,
  #mathWarQuizOptions .math-war-promo-choice--banner,
  #mathWarEndOverlay .math-war-promo-choice--banner,
  .math-war-quiz-overlay .math-war-promo-choice--banner {
    min-height: clamp(210px, 68vw, 340px) !important;
  }
}

/* ROBOTAN_BANNER_MODE_FIX_V2_START */
.math-war-promo-options {
  align-items: stretch !important;
}

.math-war-promo-choice--banner,
.math-war-promo-choice--banner-v2,
#mathWarQuizOptions .math-war-promo-choice--banner,
#mathWarQuizOptions .math-war-promo-choice--banner-v2,
#mathWarEndOverlay .math-war-promo-choice--banner,
#mathWarEndOverlay .math-war-promo-choice--banner-v2,
.math-war-quiz-overlay .math-war-promo-choice--banner,
.math-war-quiz-overlay .math-war-promo-choice--banner-v2,
.math-war-challenge-card.is-promo .math-war-promo-choice--banner,
.math-war-challenge-card.is-promo .math-war-promo-choice--banner-v2,
.math-war-end-card.is-promo .math-war-promo-choice--banner,
.math-war-end-card.is-promo .math-war-promo-choice--banner-v2 {
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  width: 100% !important;
  height: auto !important;
  min-height: clamp(300px, 35vw, 470px) !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: clamp(18px, 2.2vw, 30px) !important;
  background: var(--promo-choice-bg, #fff) !important;
  border: 3px solid rgba(240, 188, 211, 0.9) !important;
  box-shadow: 0 18px 36px rgba(81, 62, 131, 0.16) !important;
  color: #18223d !important;
}

.math-war-promo-banner-wrap,
.math-war-promo-choice--banner .math-war-promo-banner-wrap,
.math-war-promo-choice--banner-v2 .math-war-promo-banner-wrap,
#mathWarQuizOptions .math-war-promo-banner-wrap,
#mathWarEndOverlay .math-war-promo-banner-wrap,
.math-war-quiz-overlay .math-war-promo-banner-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

.math-war-promo-choice--banner .math-war-promo-banner-image,
.math-war-promo-choice--banner-v2 .math-war-promo-banner-image,
#mathWarQuizOptions .math-war-promo-choice--banner .math-war-promo-banner-image,
#mathWarQuizOptions .math-war-promo-choice--banner-v2 .math-war-promo-banner-image,
#mathWarEndOverlay .math-war-promo-choice--banner .math-war-promo-banner-image,
#mathWarEndOverlay .math-war-promo-choice--banner-v2 .math-war-promo-banner-image,
.math-war-quiz-overlay .math-war-promo-choice--banner .math-war-promo-banner-image,
.math-war-quiz-overlay .math-war-promo-choice--banner-v2 .math-war-promo-banner-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  filter: none !important;
}

.math-war-promo-banner-empty {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 24px !important;
  font-size: clamp(1.3rem, 3vw, 2.4rem) !important;
  font-weight: 900 !important;
  text-align: center !important;
  color: #18223d !important;
}

@media (max-width: 720px) {
  .math-war-promo-choice--banner,
  .math-war-promo-choice--banner-v2,
  #mathWarQuizOptions .math-war-promo-choice--banner,
  #mathWarQuizOptions .math-war-promo-choice--banner-v2,
  #mathWarEndOverlay .math-war-promo-choice--banner,
  #mathWarEndOverlay .math-war-promo-choice--banner-v2,
  .math-war-quiz-overlay .math-war-promo-choice--banner,
  .math-war-quiz-overlay .math-war-promo-choice--banner-v2 {
    min-height: clamp(220px, 70vw, 360px) !important;
  }
}
/* ROBOTAN_BANNER_MODE_FIX_V2_END */



/* ===== ROBOTAN_BANNER_MODE_LAYOUT_FIX_V1 ===== */
/* 完成バナー画像を左右に出すモード専用の見た目補正 */

.rbanner-choice-modal .rbanner-choice-cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

.rbanner-choice-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  min-height: 480px !important;
  box-sizing: border-box !important;
  padding: 14px !important;
  overflow: hidden !important;
}

.rbanner-choice-media {
  flex: 0 0 62% !important;
  min-height: 260px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.rbanner-choice-media-stage {
  width: 92% !important;
  height: 100% !important;
  min-height: 240px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.rbanner-choice-media-stage img,
.rbanner-choice-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 auto !important;
}

.rbanner-choice-text {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  text-align: center !important;
  padding: 10px 8px 6px !important;
  overflow: hidden !important;
}

.rbanner-choice-title {
  width: 100% !important;
  margin: 0 !important;
  font-weight: 800 !important;
  font-size: clamp(28px, 3.4vw, 42px) !important;
  line-height: 1.18 !important;
  color: #1d2748 !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.rbanner-choice-desc {
  width: 100% !important;
  margin: 0 !important;
  font-weight: 600 !important;
  font-size: clamp(16px, 1.8vw, 26px) !important;
  line-height: 1.35 !important;
  color: #68779a !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 900px) {
  .rbanner-choice-modal .rbanner-choice-cards {
    grid-template-columns: 1fr !important;
  }

  .rbanner-choice-card {
    min-height: 420px !important;
  }

  .rbanner-choice-media {
    min-height: 220px !important;
  }

  .rbanner-choice-media-stage {
    min-height: 200px !important;
  }
}
/* ===== /ROBOTAN_BANNER_MODE_LAYOUT_FIX_V1 ===== */



/* ROBOTAN_REAL_BANNER_CHOICE_V3 */
.rbanner-choice-card-v3,
.math-war-quiz-option.rbanner-choice-card-v3,
.button.rbanner-choice-card-v3 {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: clamp(300px, 36vw, 460px) !important;
  height: 100% !important;
  padding: 10px !important;
  border: 3px solid rgba(240, 188, 211, 0.95) !important;
  border-radius: 28px !important;
  background: var(--rbanner-bg, #ffffff) !important;
  overflow: hidden !important;
  box-shadow: 0 18px 34px rgba(81, 62, 131, 0.12) !important;
  cursor: pointer !important;
}

.rbanner-choice-media-v3 {
  width: 100% !important;
  height: 100% !important;
  min-height: clamp(280px, 34vw, 430px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.rbanner-choice-img-v3,
.rbanner-choice-card-v3 img.rbanner-choice-img-v3,
.math-war-quiz-option.rbanner-choice-card-v3 img.rbanner-choice-img-v3 {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: var(--rbanner-fit, contain) !important;
  object-position: center center !important;
  transform: none !important;
  margin: 0 !important;
  filter: none !important;
}

.rbanner-choice-missing-v3 {
  width: 100% !important;
  min-height: clamp(260px, 30vw, 380px) !important;
  display: grid !important;
  place-items: center !important;
  padding: 18px !important;
  border: 2px dashed rgba(202, 109, 144, 0.45) !important;
  border-radius: 22px !important;
  color: #9c3b5e !important;
  font-weight: 800 !important;
  text-align: center !important;
  background: rgba(255,255,255,0.62) !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .rbanner-choice-card-v3,
  .math-war-quiz-option.rbanner-choice-card-v3,
  .button.rbanner-choice-card-v3 {
    min-height: 240px !important;
    border-radius: 22px !important;
  }
  .rbanner-choice-media-v3 {
    min-height: 220px !important;
  }
}
