.tutorial-index-page {
  --home-button-main-start: var(--color-home-button-main-start);
  --home-button-main-end: var(--color-home-button-main-end);
  --home-button-main-border: var(--color-home-button-main-border);
  --home-button-main-text: var(--color-text-inverse);
  --home-button-alt-bg: var(--color-home-button-alt-bg);
  --home-button-alt-border: var(--color-home-button-alt-border);
  --home-button-alt-text: var(--color-home-button-alt-text);
  --home-bottom-banner-start: var(--color-home-bottom-banner-start);
  --home-bottom-banner-end: var(--color-home-bottom-banner-end);
  --home-bottom-banner-border: var(--color-home-bottom-banner-border);
  --home-bottom-banner-title: var(--color-home-bottom-banner-title);
  --home-bottom-banner-body: var(--color-home-bottom-banner-body);
  --home-lessons-meta: var(--color-home-lessons-meta);

  --tutorial-index-desktop-width: 1100px;
  --tutorial-index-desktop-grid-width: 1016px;
  --tutorial-index-mobile-shell-width: 318px;
  --tutorial-index-mobile-card-width: 294px;
  --tutorial-index-hero-pad-y: 24px;
  --tutorial-index-hero-pad-x: 48px;
  --tutorial-index-desktop-card-pad: 20px;
  --tutorial-index-desktop-card-min-height: 275px;
  --tutorial-index-mobile-card-min-height: 210px;
  --tutorial-index-mobile-card-pad: 18px;
  --tutorial-index-cta-pad-y: 38px;
  --tutorial-index-cta-pad-x: 56px;
  --tutorial-index-desktop-width-offset: 48px;

  width: min(100%, var(--tutorial-index-desktop-width));
  margin: 0 auto;
  padding: var(--space-3) 0 var(--space-8);
  overflow-x: clip;
}

@media (min-width: 1024px) {
  .tutorial-index-page {
    width: min(
      calc(100% + var(--tutorial-index-desktop-width-offset)),
      var(--tutorial-index-desktop-width)
    );
  }
}

.tutorial-index-page .tutorial-top-callout {
  margin: 0 0 var(--space-6);
  padding: var(--tutorial-index-hero-pad-y) var(--tutorial-index-hero-pad-x);
  border-radius: 26px;
  border: 1px solid var(--color-home-hero-border);
  background: linear-gradient(
    180deg,
    var(--color-home-hero-bg-start) 0%,
    var(--color-home-hero-bg-end) 100%
  );
  box-shadow: 0 10px 28px
    color-mix(in srgb, var(--color-home-button-main-shadow), transparent 90%);
}

.tutorial-index-page .tutorial-top-copy {
  display: grid;
  gap: var(--space-2);
}

.tutorial-index-page .tutorial-top-kicker {
  width: fit-content;
  justify-self: start;
}

.tutorial-index-page .tutorial-top-copy h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.1;
}

.tutorial-index-page .tutorial-top-copy .tutorial-intro {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.45;
}

.tutorial-index-page .level-grid {
  display: grid;
  gap: var(--space-4);
  margin: 0 0 var(--space-7);
  max-width: var(--tutorial-index-desktop-grid-width);
  margin-left: auto;
  margin-right: auto;
}

.tutorial-index-page .level-card {
  min-height: var(--tutorial-index-desktop-card-min-height);
  align-items: flex-start;
  padding: var(--tutorial-index-desktop-card-pad);
}

.tutorial-index-page .level-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: 100%;
}

.tutorial-index-page .level-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tutorial-index-page .level-number {
  margin: 0;
  color: var(--home-lessons-meta);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tutorial-index-page .level-info h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

.tutorial-index-page .level-info p {
  margin: 0;
  font-size: 18px;
  line-height: 1.42;
}

.tutorial-index-page .level-status {
  margin-top: auto;
  padding-top: var(--space-2);
}

.tutorial-index-page .tutorial-multiplayer {
  margin-top: 0;
}

.tutorial-index-page .tutorial-multiplayer-card {
  gap: 0;
  padding: 28px 40px;
  border-radius: 22px;
  border: 1px solid var(--home-bottom-banner-border);
  background: linear-gradient(
    180deg,
    var(--home-bottom-banner-start) 0%,
    var(--home-bottom-banner-end) 100%
  );
  box-shadow: 0 8px 20px
    color-mix(in srgb, var(--color-surface-dark), transparent 91%);
}

.tutorial-index-page .tutorial-multiplayer-actions {
  gap: 12px;
}

.tutorial-index-page .tutorial-multiplayer-card h2 {
  color: var(--home-bottom-banner-title);
  font-size: clamp(var(--text-16), 2.4vw, var(--text-20));
}

.tutorial-index-page .tutorial-multiplayer-card p {
  color: var(--home-bottom-banner-body);
  font-size: var(--text-md);
}

.tutorial-index-page .tutorial-multiplayer-actions .ds-button {
  min-height: 56px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.005em;
  padding: 0 var(--space-7);
}

.tutorial-index-page .tutorial-multiplayer-actions .ds-button--primary {
  border-color: var(--home-button-main-border);
  background: linear-gradient(
    180deg,
    var(--home-button-main-start) 0%,
    var(--home-button-main-end) 100%
  );
  color: var(--home-button-main-text);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--color-text-inverse), transparent 55%) inset,
    0 12px 24px
    color-mix(in srgb, var(--color-home-button-main-shadow), transparent 66%);
}

.tutorial-index-page .tutorial-multiplayer-actions .ds-button--primary:hover {
  transform: none;
}

.tutorial-index-page .tutorial-multiplayer-actions .ds-button--secondary {
  border-color: var(--home-button-alt-border);
  background: var(--home-button-alt-bg);
  color: var(--home-button-alt-text);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--color-text-inverse), transparent 35%) inset,
    0 8px 16px color-mix(in srgb, var(--home-button-alt-text), transparent 90%);
}

.tutorial-index-page .tutorial-multiplayer-actions .ds-button--secondary:hover {
  transform: none;
}

@media (max-width: 640px) {
  .tutorial-index-page .tutorial-multiplayer-actions .ds-button--primary {
    border-color: var(--color-home-button-main-border-mobile);
    background: linear-gradient(
      180deg,
      var(--color-home-button-main-start-mobile) 0%,
      var(--color-home-button-main-end-mobile) 100%
    );
  }
}

.tutorial-index-page .level-card.locked {
  opacity: 0.72;
}

.tutorial-index-page .level-card .level-badge {
  background: color-mix(in srgb, var(--color-text-primary), transparent 44%);
}

.tutorial-index-page .level-card.next-up .level-badge {
  background: var(--color-home-auth-create-bg);
}

.tutorial-index-page .level-card.battle-level .level-badge {
  background: color-mix(
    in srgb,
    var(--color-danger),
    var(--color-accent-secondary) 30%
  );
}

.tutorial-index-page .level-card.completed {
  border-color: var(--color-border-success);
}

.tutorial-index-page .level-card.next-up {
  border-color: var(--color-highlight-strong);
}

.tutorial-index-page .level-card.battle-level {
  border-color: var(--color-battle-border);
}

@media (min-width: 1024px) {
  .tutorial-index-page .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .tutorial-index-page {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .tutorial-index-page .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tutorial-index-page .tutorial-multiplayer-card {
    align-items: flex-start;
    padding: 28px 28px;
  }

  .tutorial-index-page .tutorial-top-copy h1 {
    font-size: 56px;
  }
}

@media (max-width: 767px) {
  .tutorial-index-page {
    padding-left: 0;
    padding-right: 0;
  }

  .tutorial-index-page .tutorial-top-callout {
    width: min(100%, var(--tutorial-index-mobile-shell-width));
    margin-left: auto;
    margin-right: auto;
    padding: 24px;
  }

  .tutorial-index-page .level-grid {
    grid-template-columns: 1fr;
    width: min(100%, var(--tutorial-index-mobile-card-width));
    margin-left: auto;
    margin-right: auto;
  }

  .tutorial-index-page .level-card {
    min-height: var(--tutorial-index-mobile-card-min-height);
    padding: var(--tutorial-index-mobile-card-pad);
  }

  .tutorial-index-page .tutorial-multiplayer-card {
    width: min(100%, var(--tutorial-index-mobile-shell-width));
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 28px 24px;
  }

  .tutorial-index-page .tutorial-top-copy h1 {
    font-size: 40px;
  }

  .tutorial-index-page .tutorial-top-copy .tutorial-intro {
    font-size: 17px;
  }

  .tutorial-index-page .level-info h2 {
    font-size: 26px;
  }

  .tutorial-index-page .level-info p {
    font-size: 17px;
  }

  .tutorial-index-page .tutorial-multiplayer-actions {
    flex-direction: column;
  }

  .tutorial-index-page .tutorial-multiplayer-actions .ds-button {
    width: 100%;
  }
}

.tutorial-intro {
  color: var(--color-text-muted);
  margin: 0 auto var(--space-7);
  text-align: center;
  max-width: 640px;
  font-size: var(--text-105);
}

.tutorial-top-callout {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-125);
  margin: 0 auto var(--space-175);
  padding: var(--space-135) var(--space-14);
}

.tutorial-top-copy h1 {
  margin: 0 0 var(--space-035);
}

.tutorial-top-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 var(--space-035);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-highlight-border);
  background: var(--color-highlight-surface);
  color: var(--color-highlight-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tutorial-top-copy .tutorial-intro {
  margin: 0;
  max-width: 42ch;
  text-align: left;
}

.tutorial-multiplayer {
  margin-top: var(--space-8);
}

.tutorial-multiplayer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-7);
}

.tutorial-multiplayer-card h2 {
  margin: 0 0 var(--space-045);
  font-size: clamp(var(--text-14), 2.2vw, var(--text-20));
}

.tutorial-multiplayer-card p {
  margin: 0;
  color: var(--color-text-muted);
  max-width: var(--width-sm);
}

.level-grid {
  display: grid;
  gap: var(--space-125);
  max-width: 760px;
  margin: 0 auto var(--space-8);
}

.level-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-125);
  background: var(--color-surface-panel);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.level-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.level-card.completed {
  border-color: var(--color-border-success);
  background: var(--color-success-soft);
}

.level-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--color-surface-soft);
  border-color: var(--color-border-soft);
}

.level-card.battle-level {
  border-color: var(--color-battle-border);
  background: var(--color-battle-soft);
}

.level-card.battle-level .level-badge {
  background: var(--color-battle-primary);
}

.level-card.battle-level.completed {
  border-color: var(--color-battle-primary-strong);
  background: var(--color-battle-soft-strong);
}

.level-card.battle-level.completed .level-badge {
  background: var(--color-success);
}

.level-badge {
  display: inline-flex;
}

.level-card.completed .level-badge {
  background: var(--color-success);
}

.level-card.next-up {
  border-color: var(--color-highlight-border);
  background: linear-gradient(
    180deg,
    var(--color-callout-start),
    var(--color-highlight-surface)
  );
  box-shadow:
    var(--shadow-soft),
    0 0 0 2px var(--color-highlight-shadow);
}

.level-card.next-up:hover {
  border-color: var(--color-highlight-strong);
}

.level-info {
  flex: 1;
}

.level-info h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-11);
}

.level-info p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-09);
}

.level-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.level-lock-reason {
  width: 100%;
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.alert {
  background: var(--color-alert-surface);
  border: 1px solid var(--color-alert-border);
  color: var(--color-alert-text);
  padding: var(--space-085) var(--space-11);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-5);
  text-align: center;
}

.tutorial-lock-alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-12);
}

.tutorial-lock-alert--inline {
  margin-bottom: var(--space-2);
  padding: var(--space-11) var(--space-125);
  border-radius: var(--radius-md);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.tutorial-lock-alert--inline.is-dismissing {
  opacity: 0;
  transform: translateY(-4px);
}

.tutorial-lock-alert--inline .tutorial-lock-alert-icon {
  width: 30px;
  height: 30px;
  font-size: var(--text-md);
}

.tutorial-lock-alert--inline .tutorial-lock-alert-text {
  font-size: var(--text-md);
}

.tutorial-lock-alert-icon {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-highlight-surface);
  color: var(--color-highlight-strong);
  font-size: var(--text-09);
  line-height: 1;
  border: 1px solid var(--color-highlight-border);
}

.tutorial-lock-alert-text {
  margin: 0;
  font-size: var(--text-09);
  font-weight: 600;
  color: var(--color-text-strong);
}

.level-status .stat {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.level-status .stat.perfect {
  color: var(--color-success);
  font-weight: 500;
}

.ai-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: var(--text-072);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.play-modes-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  gap: 24px;
}

.game-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.game-page-top {
  margin-bottom: 0;
}

.game-page-main {
  padding: var(--space-6);
}

.game-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.bot-game-difficulty-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bot-game-difficulty-group legend {
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

.bot-game-difficulty-options {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.bot-game-difficulty-option {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
}

.bot-game-difficulty-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.bot-game-difficulty-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: 12px;
  border: 1px solid var(--color-border-muted);
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.bot-game-difficulty-option:hover .bot-game-difficulty-pill {
  background: var(--color-surface-soft);
  border-color: var(--color-border-strong);
}

.bot-game-difficulty-radio:checked + .bot-game-difficulty-pill {
  background: var(--bot-setup-difficulty-selected-bg);
  border-color: var(--color-home-auth-create-bg);
  color: var(--color-home-auth-create-bg);
  box-shadow: 0 10px 20px
    color-mix(in srgb, var(--color-highlight-border), transparent 74%);
}

.bot-game-difficulty-radio:focus-visible + .bot-game-difficulty-pill {
  outline: 2px solid var(--color-accent-secondary);
  outline-offset: 2px;
}

.bot-game-setup-overlay {
  z-index: 10;
}

.bot-game-setup-dialog {
  text-align: center;
  width: min(480px, 100%);
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--auth-dialog-shell-border);
  background: linear-gradient(
    180deg,
    var(--auth-dialog-shell-gradient-start),
    var(--auth-dialog-shell-gradient-end)
  );
  box-shadow: 0 20px 48px var(--auth-dialog-shell-shadow);
  padding: 12px 32px 16px;
  display: flex;
  flex-direction: column;
}

.bot-game-setup-dialog .ds-dialog__emoji {
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--color-text-primary);
  font-size: 52px;
  margin-top: -2px;
}

.bot-game-setup-dialog .ds-dialog__title {
  margin: 0;
  color: var(--bot-setup-title);
  font-size: 30px;
  line-height: 1.08;
}

.bot-game-setup-dialog .ds-dialog__body {
  display: grid;
  gap: 14px;
  margin-top: 2px;
}

.bot-game-setup-dialog.ds-tutorial-complete-dialog .ds-dialog__close {
  top: 8px;
  right: 8px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--auth-dialog-close-color);
  font-size: 22px;
  transform: none;
}

.bot-game-setup-dialog.ds-tutorial-complete-dialog .ds-dialog__close:hover,
.bot-game-setup-dialog.ds-tutorial-complete-dialog
  .ds-dialog__close:focus-visible {
  color: color-mix(
    in srgb,
    var(--auth-dialog-close-color),
    var(--color-surface-dark) 14%
  );
  background: transparent;
  box-shadow: none;
  transform: none;
}

.bot-game-setup-dialog .game-page-actions {
  margin-top: 16px;
  padding-top: 0;
  justify-content: center;
}

.bot-game-setup-dialog .game-page-actions .ds-button.ds-button--primary {
  width: 300px;
  min-height: 52px;
  border-color: var(--color-home-auth-create-bg);
  background: var(--color-home-auth-create-bg);
  color: var(--auth-dialog-button-text);
  box-shadow: 0 6px 16px var(--auth-dialog-button-shadow);
}

.bot-game-setup-dialog .ds-button.ds-button--primary {
  width: 300px;
  min-height: 52px;
}

.bot-game-setup-dialog .game-page-actions .ds-button.ds-button--primary:hover,
.bot-game-setup-dialog
  .game-page-actions
  .ds-button.ds-button--primary:focus-visible {
  border-color: var(--color-home-auth-create-hover);
  background: var(--color-home-auth-create-hover);
}

.bot-game-first-player-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bot-game-first-player-group legend {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-dialog-description-color);
}

.bot-game-first-player-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.bot-game-first-player-option {
  position: relative;
  display: block;
}

.bot-game-first-player-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.bot-game-first-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid var(--color-border-muted);
  background: var(--bot-setup-first-card-bg);
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.bot-game-first-player-emoji {
  font-size: 38px;
}

.bot-game-first-player-option:hover .bot-game-first-player-card {
  background: var(--color-surface-soft);
  border-color: var(--color-border-strong);
}

.bot-game-first-player-radio:checked + .bot-game-first-player-card {
  background: var(--bot-setup-first-card-selected-bg);
  border-color: var(--color-home-auth-create-bg);
  color: var(--color-home-auth-create-bg);
  box-shadow: 0 10px 20px
    color-mix(in srgb, var(--color-highlight-border), transparent 74%);
}

.bot-game-difficulty-group legend {
  font-size: 13px;
  color: var(--auth-dialog-description-color);
}

.bot-game-first-player-radio:focus-visible + .bot-game-first-player-card {
  outline: 2px solid var(--color-accent-secondary);
  outline-offset: 2px;
}

.bot-player-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.bot-player-legend--top {
  margin-bottom: 0;
}

.bot-player-legend--bottom {
  margin-top: 0;
}

.bot-game-main #board-container .board-wrapper {
  --board-margin: 0 auto 0;
}

.bot-player-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-md);
  font-weight: 600;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease;
}

.bot-player-legend--turn-aware .bot-player-legend-item:not(.is-current-turn) {
  opacity: 0.74;
}

.bot-player-legend-item.is-current-turn {
  border-color: var(--color-highlight-strong);
  background: linear-gradient(
    180deg,
    color-mix(
      in srgb,
      var(--color-callout-start),
      var(--color-text-inverse) 22%
    ),
    color-mix(
      in srgb,
      var(--color-highlight-surface),
      var(--color-text-inverse) 14%
    )
  );
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-highlight-border), transparent 42%),
    0 0 18px color-mix(in srgb, var(--color-highlight-strong), transparent 35%),
    var(--shadow-strong);
  animation: bot-turn-pulse 1.3s ease-in-out infinite;
}

.bot-player-legend-emoji {
  font-size: var(--text-11);
  line-height: 1;
}

.bot-thinking-dots {
  display: none;
  align-items: center;
  gap: 3px;
}

.is-thinking .bot-thinking-dots {
  display: inline-flex;
}

.bot-thinking-dots .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: dot-pulse 0.9s ease-in-out infinite;
}

.bot-thinking-dots .dot:nth-child(1) {
  animation-delay: 0s;
}

.bot-thinking-dots .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.bot-thinking-dots .dot:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.local-friend-mirror-toggle-row {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.local-friend-mirror-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.local-friend-mirror-switch-input {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.local-friend-mirror-switch-track {
  inline-size: 42px;
  block-size: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-soft);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background-color 0.18s ease;
}

.local-friend-mirror-switch-thumb {
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--color-text-inverse);
  box-shadow: var(--shadow-soft);
  transition: translate 0.18s ease;
}

.local-friend-mirror-switch-input:checked + .local-friend-mirror-switch-track {
  background: var(--color-highlight-strong);
  border-color: var(--color-highlight-strong);
}

.local-friend-mirror-switch-input:checked
  + .local-friend-mirror-switch-track
  .local-friend-mirror-switch-thumb {
  translate: 18px 0;
}

.local-friend-mirror-switch-input:focus-visible
  + .local-friend-mirror-switch-track {
  outline: 2px solid var(--color-highlight-border);
  outline-offset: 2px;
}

.local-content--friend-mirrored .local-friend-mirror-switch-text {
  rotate: 180deg;
}

.local-player-legend-face {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.local-content--friend-mirrored
  .local-player-legend--friend
  .local-player-legend-face {
  rotate: 180deg;
}

@keyframes bot-turn-pulse {
  0%,
  100% {
    transform: scale(1.08);
  }

  50% {
    transform: scale(1.12);
  }
}

.play-modes-top {
  margin-bottom: 0;
  width: 100%;
  height: 120px;
  padding: 0 30px;
  border-radius: 26px;
  border: 0;
  background: var(--color-surface-card);
  box-shadow: 0 4px 20px
    color-mix(in srgb, var(--color-text-strong), transparent 90%);
  display: flex;
  align-items: center;
}

.play-modes-heading-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.play-modes-heading-row .tutorial-top-kicker {
  align-self: center;
  margin: 0;
  min-height: 34px;
  padding: 0 12px;
  border-width: 1.5px;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.play-modes-heading-row h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  transform: none;
}

.play-modes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

.play-mode-card {
  --play-mode-accent: var(--color-highlight-border);
  --play-mode-surface: var(--color-highlight-surface);
  --play-mode-emphasis: var(--color-highlight-strong);

  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 258px;
  padding: 32px 34px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  border-width: 2px;
  border-radius: 28px;
  border-color: var(--play-mode-accent);
  background: linear-gradient(
    180deg,
    var(--color-callout-start),
    var(--play-mode-surface)
  );
  box-shadow: 0 12px 36px
    color-mix(in srgb, var(--play-mode-accent), transparent 84%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.play-mode-card:hover {
  transform: translateY(-1px);
  border-color: var(--play-mode-emphasis);
  box-shadow: 0 14px 38px
    color-mix(in srgb, var(--play-mode-accent), transparent 80%);
}

.play-mode-card:focus-visible {
  outline: 3px solid var(--play-mode-accent);
  outline-offset: 2px;
}

.play-mode-card:active {
  transform: translateY(1px);
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px color-mix(in srgb, var(--play-mode-accent), transparent 70%);
}

.play-mode-card--bot {
  --play-mode-accent: var(--color-success);
  --play-mode-surface: var(--color-success-soft);
  --play-mode-emphasis: var(--color-success-strong);
}

.play-mode-card--local {
  --play-mode-accent: var(--color-highlight-border);
  --play-mode-surface: var(--color-highlight-surface);
  --play-mode-emphasis: var(--color-highlight-strong);
}

.play-mode-card--online {
  --play-mode-accent: var(--color-border-strong);
  --play-mode-surface: var(--color-surface-muted);
  --play-mode-emphasis: var(--color-text-muted);
}

.play-mode-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
}

.play-mode-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.play-mode-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  font-size: 40px;
  line-height: 1;
}

.play-mode-emoji--local {
  font-size: 0;
}

.play-mode-emoji--local::before {
  content: "💻";
  font-size: 40px;
  line-height: 1;
}

.play-mode-emoji--pair {
  gap: 0;
}

.play-mode-emoji-slot {
  display: inline-flex;
  font-size: 0;
  line-height: 1;
}

.play-mode-emoji-slot::before {
  font-size: 40px;
  line-height: 1;
  color: inherit;
}

.play-mode-emoji-slot--first::before {
  content: "💻";
}

.play-mode-emoji-slot--second::before {
  content: "📱";
}

.play-mode-emoji--pair span + span {
  margin-left: -0.36em;
}

@media (hover: none) and (pointer: coarse) {
  .play-mode-emoji--local::before {
    content: "📱";
  }

  .play-mode-emoji-slot--first::before {
    content: "📱";
  }

  .play-mode-emoji-slot--second::before {
    content: "💻";
  }
}

.play-mode-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--color-text-muted);
  max-width: 29ch;
}

.play-modes-footer {
  margin: 0;
  margin-top: 6px;
  text-align: center;
}

.play-modes-footer-link {
  color: var(--color-text-muted);
  font-size: var(--text-09);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.play-modes-footer-link:hover,
.play-modes-footer-link:focus-visible {
  color: var(--color-text-primary);
}

@media (max-width: 900px) {
  .play-modes-page {
    max-width: none;
    gap: 20px;
  }

  .play-modes-top {
    height: auto;
    padding: 20px 22px;
    border-radius: 22px;
  }

  .play-modes-heading-row {
    align-items: center;
    gap: 12px;
  }

  .play-modes-heading-row h1 {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 0.98;
  }

  .play-modes-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .play-mode-card {
    min-height: auto;
    padding: 26px 24px;
    border-radius: 22px;
    gap: 14px;
  }

  .play-mode-card h2 {
    font-size: 23px;
  }

  .play-mode-card p {
    font-size: 16px;
    line-height: 1.35;
  }

  .game-page-main {
    padding: var(--space-5);
  }

  .play-mode-card p {
    min-height: 0;
  }
}

.restart-form {
  display: inline;
}

.tutorial-lesson-page {
  --tutorial-lesson-desktop-shell-width: 868px;
  --tutorial-lesson-mobile-shell-width: 322px;
  --tutorial-lesson-title-size-desktop: 52px;
  --tutorial-lesson-title-size-mobile: 36px;
  --tutorial-lesson-step-size-desktop: 16px;
  --tutorial-lesson-step-size-mobile: 14px;
  --tutorial-lesson-callout-height-desktop: 68px;
  --tutorial-lesson-callout-height-mobile: 64px;
  --tutorial-lesson-callout-padding-desktop: 20px 24px;
  --tutorial-lesson-callout-padding-mobile: 18px 20px;
  --tutorial-complete-dialog-width: 480px;
  --tutorial-complete-dialog-start: var(--color-tutorial-complete-dialog-start);
  --tutorial-complete-dialog-end: var(--color-tutorial-complete-dialog-end);
  --tutorial-complete-dialog-border: var(
    --color-tutorial-complete-dialog-border
  );
  --tutorial-complete-dialog-shadow: color-mix(
    in srgb,
    var(--color-tutorial-complete-dialog-shadow),
    transparent 60%
  );

  width: 100%;
  overflow-x: clip;
}

.tutorial-lesson-shell {
  width: 100%;
  max-width: 868px;
  margin: 0 auto;
}

.tutorial-lesson-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 18px;
}

.tutorial-lesson-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--color-home-hero-title);
  font-size: var(--tutorial-lesson-title-size-desktop);
  line-height: 1.08;
}

#lesson-title .tutorial-lesson-step {
  font-size: var(--tutorial-lesson-step-size-desktop);
  color: var(--color-home-lessons-meta);
  font-weight: 600;
}

.tutorial-lesson-title-row .restart-btn.ds-button {
  min-height: 36px;
  padding: 0 24px;
}

.tutorial-lesson-callout {
  width: 100%;
  min-height: var(--tutorial-lesson-callout-height-desktop);
  margin: 18px 0 24px;
  padding: var(--tutorial-lesson-callout-padding-desktop);
  border-radius: 12px;
  border: 1px solid
    color-mix(in srgb, var(--color-home-hero-border), transparent 25%);
  background: var(--color-home-bottom-banner-start);
  box-shadow: var(--shadow-soft);
}

.tutorial-lesson-page #tutorial-content {
  width: 100%;
  max-width: 868px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 767px) and (orientation: portrait) {
  .tutorial-lesson-title-row {
    align-items: flex-start;
    gap: var(--space-2);
  }

  .tutorial-lesson-shell {
    width: min(100%, var(--tutorial-lesson-mobile-shell-width));
  }

  .tutorial-lesson-title {
    font-size: var(--tutorial-lesson-title-size-mobile);
  }

  #lesson-title .tutorial-lesson-step {
    display: block;
    margin-top: 4px;
    font-size: var(--tutorial-lesson-step-size-mobile);
  }

  .tutorial-lesson-callout {
    min-height: var(--tutorial-lesson-callout-height-mobile);
    margin: 14px 0 22px;
    padding: var(--tutorial-lesson-callout-padding-mobile);
    border-radius: 10px;
  }

  .tutorial-lesson-page #tutorial-content {
    width: 100%;
    max-width: 100%;
  }

  .tutorial-lesson-title-row .restart-form {
    display: inline;
    position: static;
    transform: none;
    top: auto;
    right: auto;
    margin: 0;
    align-self: center;
  }

  .tutorial-lesson-title-row .restart-btn.ds-button {
    min-height: 34px;
    padding: 0 14px;
    font-size: var(--text-xs);
  }

  .ds-tutorial-complete-overlay[data-tutorial-result-dialog]
    .ds-tutorial-complete-dialog {
    width: min(100%, 340px);
    max-width: 340px;
    padding: 30px 24px 24px;
    border-radius: 20px;
  }

  .tutorial-complete-shell .ds-dialog__emoji {
    font-size: 40px;
  }

  .tutorial-complete-shell .ds-dialog__title {
    font-size: 28px;
  }
}

.tutorial-description {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.tutorial-instruction-callout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: var(--space-16);
  padding: var(--space-065) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-instruction-border);
  background: var(--color-instruction-bg);
  box-shadow: var(--shadow-soft);
  color: var(--color-text-strong);
  font-weight: 600;
}

.tutorial-instruction-emoji {
  font-size: var(--text-105);
  line-height: 1;
}

#lesson-title .lesson-step-progress {
  font-size: 0.62em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.step-message {
  font-size: var(--text-11);
  font-weight: 600;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  text-align: center;
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-soft);
}

#tutorial-content {
  position: relative;
}

#local-content {
  position: relative;
}

#tutorial-animation-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 9;
}

#local-animation-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 9;
}

.ds-tutorial-complete-overlay {
  position: absolute;
  inset: -56px 0 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius-lg);
  padding-top: var(--space-1);
}

.ds-tutorial-complete-overlay[data-tutorial-result-dialog] {
  position: fixed;
  inset: 0;
  z-index: 12;
  align-items: center;
  border-radius: 0;
  padding: var(--space-3);
  background: color-mix(in srgb, var(--color-surface-dark), transparent 52%);
}

.bot-game-setup-overlay.ds-tutorial-complete-overlay {
  position: fixed;
  inset: 0;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  border-radius: 0;
  padding: clamp(96px, 16vh, 175px) 20px 20px;
  background: var(--bot-setup-overlay-desktop);
}

@media (max-width: 900px) {
  .bot-game-setup-overlay.ds-tutorial-complete-overlay {
    padding: 112px 20px 24px;
    background: var(--bot-setup-overlay-mobile);
  }

  .bot-game-setup-dialog {
    width: min(350px, 100%);
    height: auto;
    border-radius: 20px;
    padding: 10px 20px 12px;
  }

  .bot-game-setup-dialog .ds-dialog__title {
    font-size: 24px;
  }

  .bot-game-setup-dialog .ds-dialog__emoji {
    font-size: 44px;
  }

  .bot-game-difficulty-pill {
    border-radius: 10px;
    font-size: 13px;
  }

  .bot-game-first-player-group,
  .bot-game-difficulty-group {
    gap: 10px;
  }

  .bot-game-first-player-card {
    min-height: 90px;
    border-radius: 12px;
    gap: 4px;
  }

  .bot-game-first-player-emoji {
    font-size: 30px;
  }

  .bot-game-first-player-card .bot-game-first-player-label {
    font-size: 13px;
  }

  .bot-game-setup-dialog .game-page-actions .ds-button.ds-button--primary {
    width: 100%;
    min-height: 50px;
  }

  .bot-game-setup-dialog .game-page-actions {
    margin-top: 12px;
  }

  .bot-game-setup-dialog .ds-button.ds-button--primary {
    width: 100%;
    min-height: 50px;
  }
}

.ds-tutorial-complete-dialog {
  position: relative;
  text-align: center;
}

.ds-tutorial-complete-overlay[data-tutorial-result-dialog]
  .ds-tutorial-complete-dialog {
  width: min(100%, var(--tutorial-complete-dialog-width));
  max-width: var(--tutorial-complete-dialog-width);
  padding: 40px 36px 32px;
  border-radius: 24px;
  border-style: solid;
  border-width: 1.5px;
  border-color: var(--tutorial-complete-dialog-border);
  background-color: var(--tutorial-complete-dialog-start);
  background-image: linear-gradient(
    180deg,
    var(--tutorial-complete-dialog-start) 0%,
    var(--tutorial-complete-dialog-end) 100%
  );
  box-shadow:
    0 20px 42px var(--tutorial-complete-dialog-shadow),
    0 0 0 1.5px
    color-mix(in srgb, var(--tutorial-complete-dialog-border), transparent 24%)
    inset;
}

.tutorial-complete-shell {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

.tutorial-complete-close {
  position: absolute;
  top: 14px;
  right: 28px;
  color: var(--color-tutorial-complete-dialog-close);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}

.tutorial-complete-close:hover,
.tutorial-complete-close:focus-visible {
  color: color-mix(
    in srgb,
    var(--color-tutorial-complete-dialog-close),
    var(--color-surface-dark) 18%
  );
}

.tutorial-complete-shell .ds-dialog__emoji {
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 48px;
  line-height: 1;
  color: var(--color-home-auth-create-bg);
}

.tutorial-complete-shell .ds-dialog__title {
  margin: 0;
  color: var(--color-home-hero-title);
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.1;
}

.tutorial-complete-shell .ds-dialog__description {
  margin: 0;
  color: var(--color-home-lessons-subtext);
  font-size: 16px;
  line-height: 1.45;
}

.tutorial-complete-divider {
  width: 100%;
  height: 1px;
  background: var(--color-tutorial-complete-dialog-divider);
}

.tutorial-complete-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tutorial-complete-actions .ds-button {
  width: 100%;
  min-height: 52px;
}

.tutorial-complete-label-mobile {
  display: none;
}

.tutorial-complete-actions .ds-button--primary {
  border-color: var(--color-home-auth-create-bg);
  background: var(--color-home-auth-create-bg);
  color: var(--color-text-inverse);
}

.tutorial-complete-actions .ds-button--primary:hover {
  border-color: var(--color-home-auth-create-hover);
  background: var(--color-home-auth-create-hover);
  color: var(--color-text-inverse);
}

.tutorial-complete-shell .progress-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: var(--space-4) 0;
  padding: 12px 24px;
  border-radius: 14px;
  border: 1.5px solid var(--color-tutorial-complete-dialog-border);
  background: var(--color-tutorial-complete-dialog-stats-surface);
}

.tutorial-complete-shell .progress-stats .stat {
  color: var(--color-tutorial-complete-dialog-stats-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.tutorial-complete-shell .progress-stats .stats-separator {
  width: 1px;
  height: 18px;
  background: var(--color-tutorial-complete-dialog-border);
}

.ds-tutorial-complete-dialog .landing-auth-close {
  position: absolute;
}

.progress-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-panel);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-soft);
}

.progress-stats .stat {
  color: var(--color-text-muted);
  font-size: var(--text-09);
}

.all-complete {
  font-size: var(--text-11);
  color: var(--color-accent-primary);
  font-weight: 500;
  margin-top: var(--space-4);
}

.result-page-shell {
  --result-bg-start: var(--color-home-page-bg-start);
  --result-bg-end: var(--color-home-page-bg-end);
  --result-panel-bg: var(--color-surface-canvas-warm);
  --result-check-bg: var(--color-home-auth-create-bg);
  --result-title: var(--color-home-auth-signin);
  --result-subtitle: var(--color-text-subtle);
  --result-label: var(--color-text-muted);
  --result-value: var(--color-text-strong);
  --result-card-border: var(--color-home-auth-border);

  width: min(100%, 1440px);
  min-width: 320px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-12);
  background: var(--result-panel-bg);
}

.result-page-shell .result-page {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 128px 0 72px;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.result-page-shell .result-page--standard {
  width: 800px;
  min-height: 560px;
  margin-top: 72px;
  padding: 32px 50px 44px;
  border-radius: 24px;
  background: var(--color-surface-card);
  box-shadow: 0 8px 32px
    color-mix(in srgb, var(--color-text-strong), transparent 91%);
}

.result-page-shell .result-hero {
  text-align: center;
  margin-bottom: var(--space-4);
}

.result-page-shell .result-page--standard .result-hero {
  margin-bottom: 0;
}

.result-page-shell .result-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--result-check-bg);
  border: 0;
  border-radius: 999px;
  margin-bottom: 20px;
}

.result-page-shell .result-check-icon {
  color: var(--color-text-inverse);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.result-page-shell .result-hero h1 {
  margin: 0;
  color: var(--result-title);
  font-size: 48px;
  line-height: 1.1;
}

.result-page-shell .result-message {
  margin: var(--space-4) auto 0;
  max-width: 600px;
  color: var(--result-subtitle);
  font-size: var(--text-md);
  text-align: center;
}

.result-page-shell .result-page--standard .result-message {
  margin-top: 12px;
  font-size: 16px;
}

.result-page-shell .result-lesson-name {
  margin: 0 0 var(--space-6);
  color: var(--result-subtitle);
  font-size: 18px;
  text-align: center;
}

.result-page-shell .result-page--standard .result-lesson-name {
  margin: 14px 0 0;
}

.result-page-shell .result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: min(700px, 100%);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-6);
}

.result-page-shell .result-page--standard .result-stats {
  grid-template-columns: repeat(3, 220px);
  justify-content: center;
  width: 700px;
  margin-top: 24px;
  margin-bottom: 28px;
}

.result-page-shell .result-page--battle .result-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(940px, 100%);
}

.result-page-shell .result-metric {
  border: 1px solid var(--result-card-border);
  background: var(--color-surface-panel);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 1px 0
    color-mix(in srgb, var(--result-card-border), transparent 25%);
  text-align: center;
}

.result-page-shell .result-page--standard .result-metric {
  height: 124px;
  border-radius: 22px;
  border-width: 2px;
  border-color: var(--color-home-button-alt-border);
  background: linear-gradient(
    180deg,
    var(--color-result-metric-card-start) 0%,
    var(--color-result-metric-card-end) 100%
  );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--color-text-inverse), transparent 30%),
    0 10px 24px
    color-mix(in srgb, var(--color-home-auth-signin), transparent 88%);
}

.result-page-shell .stat-label {
  display: block;
  color: var(--result-label);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.result-page-shell .stat-value {
  display: block;
  color: var(--result-value);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
}

.result-page-shell .result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.result-page-shell .result-page--standard .result-actions {
  gap: 16px;
}

.inline-form {
  display: inline;
}

.result-page-shell .result-actions .ds-button,
.ds-tutorial-complete-dialog .ds-button {
  font-size: var(--text-md);
  padding: var(--space-3) var(--space-5);
}

.result-page-shell .result-page--standard .result-actions .ds-button {
  width: 180px;
  height: 48px;
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
}

.result-page-shell .result-actions .ds-button--primary {
  background: var(--color-home-auth-create-bg);
  border-color: var(--color-home-auth-create-bg);
  color: var(--color-text-inverse);
}

.result-page-shell .result-actions .ds-button--primary:hover,
.result-page-shell .result-actions .ds-button--primary:focus-visible {
  background: var(--color-home-auth-create-hover);
  border-color: var(--color-home-auth-create-hover);
}

.page-shell--tutorial-result .global-auth-wrap--tutorial-result {
  border-bottom: 1px solid var(--color-home-auth-border);
  background: var(--color-surface-card);
}

.ds-auth-form {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-2);
}

.ds-auth-email-input.ds-input {
  width: 100%;
  min-height: 48px;
  line-height: 1.4;
}

.ds-auth-email-input.ds-input::placeholder {
  color: var(--color-text-subtle);
}

.ds-auth-code-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}

.ds-auth-code-input.ds-input {
  width: 100%;
  min-height: 48px;
  text-align: center;
  font-size: var(--text-14);
  font-weight: 600;
}

/* Battle Mode Styles */

.battle-title {
  text-align: center;
  color: var(--color-battle-text);
}

.battle-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.battle-title-row .restart-form {
  flex-shrink: 0;
}

.battle-title--lesson6 {
  margin-top: 0;
  margin-bottom: var(--space-1);
  color: var(--color-home-hero-title);
  font-size: 52px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

.battle-title-row--lesson6 {
  margin-bottom: var(--space-1);
}

.battle-title-row--lesson6 .battle-title--lesson6 {
  margin: 0;
  text-align: left;
}

.battle-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.battle-container {
  position: relative;
}

.battle-container--lesson6 {
  width: min(868px, 100%);
  margin: 0 auto;
}

.battle-container--lesson6 .board-wrapper {
  --board-scale: 0.88;
  --board-margin: calc(var(--space-1) * -1) auto var(--space-2);
}

.battle-container--lesson6 .tutorial-board {
  padding: var(--space-4) var(--space-4);
}

.battle-container--lesson6 .pit-label {
  color: var(--color-home-lessons-meta);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.battle-container--lesson6 .bot-player-legend-item {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 12px;
  border-color: var(--color-border-soft);
  box-shadow: none;
}

.battle-container--lesson6 .bot-player-legend--top {
  margin-bottom: var(--space-1);
}

.battle-container--lesson6 .bot-player-legend--bottom {
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

.battle-container--lesson6 .bot-player-legend-item.is-current-turn {
  transform: none;
  border-color: var(--color-highlight-border);
  box-shadow: 0 0 0 1px
    color-mix(in srgb, var(--color-highlight-border), transparent 44%);
  animation: none;
}

.battle-round-result-overlay {
  z-index: 12;
}

.battle-round-result-overlay--lesson6 {
  position: fixed;
  background: var(--color-lesson6-overlay);
  inset: 0;
  border-radius: 0;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
}

.battle-round-result-overlay.is-pending {
  opacity: 0;
  pointer-events: none;
}

.ds-tutorial-complete-overlay.is-pending {
  opacity: 0;
  pointer-events: none;
}

.battle-round-result-dialog h2 {
  margin: var(--space-1) 0 var(--space-1);
}

.battle-round-result-dialog {
  width: min(380px, calc(100% - var(--space-6)));
  padding: var(--space-11) var(--space-9);
}

.battle-round-result-dialog--lesson6 {
  width: min(440px, calc(100% - var(--space-7)));
  border-radius: 24px;
  border: 1.5px solid var(--color-tutorial-complete-dialog-border);
  background: linear-gradient(
    180deg,
    var(--color-tutorial-complete-dialog-start),
    var(--color-tutorial-complete-dialog-end)
  );
  box-shadow:
    0 16px 32px
    color-mix(
      in srgb,
      var(--color-tutorial-complete-dialog-shadow),
      transparent 84%
    ),
    0 0 0 1.5px
    color-mix(
      in srgb,
      var(--color-tutorial-complete-dialog-border),
      transparent 24%
    );
  padding: var(--space-135) var(--space-9) var(--space-11);
}

.battle-round-result-dialog--lesson6 .ds-dialog__emoji {
  margin-bottom: var(--space-3);
}

.battle-round-result-dialog--lesson6 .ds-dialog__title {
  margin-top: 0;
  margin-bottom: var(--space-3);
  color: var(--color-home-hero-title);
  font-weight: 600;
  line-height: 1.15;
}

.battle-round-result-dialog--lesson6.battle-round-result--win .ds-dialog__title,
.battle-round-result-dialog--lesson6.battle-round-result--loss
  .ds-dialog__title,
.battle-round-result-dialog--lesson6.battle-round-result--draw
  .ds-dialog__title {
  color: var(--color-home-hero-title);
}

.battle-round-result-dialog--lesson6 .ds-dialog__description {
  margin-bottom: var(--space-4);
}

.battle-round-result-dialog p {
  margin: 0;
}

.battle-round-result-dialog .battle-round-seeds {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-6) 0 var(--space-4);
  gap: var(--space-6);
}

.battle-round-result-dialog--lesson6 .battle-round-seeds {
  margin: var(--space-5) 0 var(--space-4);
  gap: var(--space-5);
}

.battle-round-result-dialog .battle-round-seed-slot {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --seed-rotation: 0deg;
}

.battle-round-result-dialog .battle-round-seed {
  transform: scale(2.4) rotate(var(--seed-rotation));
  transform-origin: center;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
  filter: drop-shadow(
    0 3px 5px color-mix(in srgb, var(--color-surface-dark), transparent 60%)
  );
}

.battle-round-result-dialog .battle-round-seed-slot:nth-child(4n + 1) {
  --seed-rotation: -5deg;
}

.battle-round-result-dialog .battle-round-seed-slot:nth-child(4n + 2) {
  --seed-rotation: 2deg;
}

.battle-round-result-dialog .battle-round-seed-slot:nth-child(4n + 3) {
  --seed-rotation: -1deg;
}

.battle-round-result-dialog .battle-round-seed-slot:nth-child(4n) {
  --seed-rotation: 4deg;
}

.battle-round-result-dialog .battle-round-seed-slot.pending {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.battle-round-result-dialog .battle-round-seed-slot.pending .battle-round-seed {
  transform: scale(2.05) rotate(var(--seed-rotation));
}

.battle-round-result-dialog .battle-round-seed-slot.earned {
  filter: none;
}

.battle-round-result-dialog .battle-round-seed-slot.earned .battle-round-seed {
  transform: scale(2.4) rotate(var(--seed-rotation));
  filter: drop-shadow(
      0 3px 6px color-mix(in srgb, var(--color-surface-dark), transparent 55%)
    )
    drop-shadow(
      0 0 10px color-mix(in srgb, var(--color-warning), transparent 62%)
    );
}

.battle-round-result-dialog .ds-button {
  margin-top: var(--space-5);
}

#bot-content #bot-game-over .ds-tutorial-complete-overlay {
  position: fixed;
  inset: 0;
  border-radius: 0;
  z-index: 12;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bot-setup-overlay-desktop);
}

#bot-content #bot-game-over .battle-round-result-dialog {
  width: min(480px, 100%);
  padding: 40px 36px 32px;
  border-radius: 24px;
  border: 2px solid var(--color-tutorial-complete-dialog-border);
  background: linear-gradient(
    180deg,
    var(--color-tutorial-complete-dialog-start),
    var(--color-tutorial-complete-dialog-end)
  );
  box-shadow: 0 20px 42px var(--color-tutorial-complete-dialog-shadow);
}

#bot-content #bot-game-over .battle-round-result-dialog .ds-dialog__emoji {
  font-size: 48px;
  color: var(--color-home-auth-create-bg);
  margin-bottom: 8px;
}

#bot-content #bot-game-over .battle-round-result-dialog .ds-dialog__title {
  margin: 0;
  margin-bottom: 12px;
  color: var(--color-home-hero-title);
  font-size: 32px;
  line-height: 1.1;
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog.battle-round-result--win
  .ds-dialog__title {
  color: var(--color-home-hero-title);
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog.battle-round-result--loss
  .ds-dialog__title {
  color: var(--color-home-hero-title);
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog.battle-round-result--draw
  .ds-dialog__title {
  color: var(--color-home-hero-title);
}

#bot-content #bot-game-over .battle-round-result-dialog .ds-dialog__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog
  .battle-round-result-decoration--game-complete {
  width: 100%;
  height: 1px;
  margin: 8px 0 0;
  background: var(--color-tutorial-complete-dialog-divider);
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog
  .ds-dialog__actions
  .ds-button {
  width: 100%;
  min-height: 52px;
  margin-top: 0;
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog
  .ds-dialog__actions
  .ds-button--primary {
  background: linear-gradient(
    180deg,
    var(--color-home-button-main-start-mobile),
    var(--color-home-button-main-end-mobile)
  );
  border-color: var(--color-home-button-main-border-mobile);
  color: var(--color-text-inverse);
  box-shadow: 0 5px 12px
    color-mix(
      in srgb,
      var(--color-home-button-main-border-mobile),
      transparent 66%
    );
}

#bot-content
  #bot-game-over
  .battle-round-result-dialog
  .ds-dialog__actions
  .ds-button--secondary {
  background: var(--color-game-complete-secondary-bg);
  border-color: var(--color-game-complete-secondary-border);
  color: var(--color-game-complete-secondary-text);
}

@media (max-width: 900px) {
  #bot-content #bot-game-over .battle-round-result-dialog {
    width: min(320px, 100%);
    padding: 36px 24px 24px;
  }

  #bot-content #bot-game-over .battle-round-result-dialog .ds-dialog__title {
    font-size: 28px;
  }
}

.battle-round-result-dialog--lesson6 .ds-dialog__actions {
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.battle-round-result-dialog--lesson6 .battle-round-result-decoration {
  width: min(84%, 272px);
  height: 1px;
  margin: var(--space-7) auto 0;
  background: var(--color-tutorial-complete-dialog-divider);
}

.battle-round-result-dialog--lesson6
  .ds-dialog__actions:has(.ds-button--primary:only-child) {
  width: 100%;
}

.battle-round-result-dialog--lesson6 .ds-dialog__actions .ds-button {
  margin-top: 0;
  min-width: 144px;
}

.battle-round-result-dialog--lesson6
  .ds-dialog__actions
  .ds-button--primary:only-child {
  width: 100%;
  min-height: 52px;
  font-size: var(--text-lg);
  font-weight: 700;
}

.battle-round-result-dialog--lesson6 > form.button_to {
  width: 100%;
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.battle-round-result-dialog--lesson6 > form.button_to .ds-button {
  margin-top: 0;
}

.battle-round-result-dialog--lesson6 > form.button_to .ds-button--primary {
  width: min(100%, 280px);
  min-height: 52px;
  font-size: var(--text-lg);
  font-weight: 700;
}

.battle-round-result-dialog--lesson6 .ds-button--primary {
  background: linear-gradient(
    180deg,
    var(--color-home-button-main-start),
    var(--color-home-button-main-end)
  );
  border-color: var(--color-home-button-main-border);
  color: var(--color-text-inverse);
  box-shadow:
    0 1px 0 var(--color-home-button-main-shadow),
    0 8px 16px
    color-mix(in srgb, var(--color-home-button-main-border), transparent 78%);
}

.battle-round-result-dialog--lesson6 .ds-button--primary:hover,
.battle-round-result-dialog--lesson6 .ds-button--primary:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(
    180deg,
    color-mix(
      in srgb,
      var(--color-home-button-main-start),
      var(--color-text-inverse) 8%
    ),
    color-mix(
      in srgb,
      var(--color-home-button-main-end),
      var(--color-surface-dark) 4%
    )
  );
}

.battle-round-result-dialog--lesson6 .tutorial-complete-close {
  top: 18px;
  right: 20px;
  color: var(--color-home-lessons-meta);
  font-size: 20px;
  opacity: 0.9;
}

.battle-round-result-dialog--lesson6 .tutorial-complete-close:hover,
.battle-round-result-dialog--lesson6 .tutorial-complete-close:focus-visible {
  color: var(--color-home-lessons-subtext);
}

.battle-title-row--lesson6 .restart-form {
  margin-left: auto;
  margin-top: var(--space-2);
}

.battle-title-row--lesson6 .restart-btn.ds-button {
  min-height: 36px;
  padding: 0 var(--space-5);
  font-size: var(--text-sm);
}

.tutorial-description--lesson6 {
  font-weight: 400;
  line-height: 1.22;
}

.tutorial-description--lesson6.tutorial-instruction-callout {
  margin-bottom: var(--space-7);
}

.battle-round-result--win h2 {
  color: var(--color-success);
}

.battle-round-result--loss h2 {
  color: var(--color-danger);
}

.battle-round-result--draw h2 {
  color: var(--color-highlight-text);
}

@media (max-width: 900px) {
  .tutorial-multiplayer-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 430px) {
  .battle-title--lesson6 {
    margin-top: 0;
    font-size: 36px;
  }

  .battle-title-row--lesson6 .battle-title--lesson6 {
    text-align: left;
  }

  .battle-container--lesson6 .board-wrapper {
    --board-scale: 0.83;
    --board-margin: 0 auto var(--space-2);
  }

  .battle-container--lesson6 .pit-label {
    font-size: var(--text-072);
    letter-spacing: 0.04em;
  }

  .battle-round-result-overlay--lesson6 {
    justify-content: center;
    padding: var(--space-3);
  }

  .battle-round-result-dialog--lesson6 {
    width: min(338px, calc(100% - var(--space-4)));
    border-radius: 18px;
    padding: var(--space-8) var(--space-5);
  }

  .battle-round-result-dialog--lesson6 .ds-dialog__title {
    font-size: var(--text-xl);
  }

  .battle-round-result-dialog--lesson6 .ds-dialog__description {
    font-size: var(--text-sm);
  }

  .battle-round-result-dialog--lesson6 .battle-round-seeds {
    gap: var(--space-5);
    margin-top: var(--space-4);
  }

  .battle-round-result-dialog--lesson6 .battle-round-seed {
    transform: scale(2.1) rotate(var(--seed-rotation));
  }

  .battle-round-result-dialog--lesson6
    .battle-round-seed-slot.pending
    .battle-round-seed {
    transform: scale(1.8) rotate(var(--seed-rotation));
  }

  .battle-round-result-dialog--lesson6 .ds-dialog__actions {
    flex-direction: row;
    gap: var(--space-2);
  }

  .battle-round-result-dialog--lesson6 .battle-round-result-decoration {
    width: min(86%, 236px);
    margin: var(--space-6) auto 0;
  }

  .battle-round-result-dialog--lesson6 .ds-dialog__actions .ds-button {
    min-width: 132px;
    padding: var(--space-2) var(--space-3);
  }

  .battle-round-result-dialog--lesson6
    .ds-dialog__actions
    .ds-button--primary:only-child {
    width: 100%;
    min-height: 48px;
    font-size: var(--text-md);
  }

  .battle-round-result-dialog--lesson6 > form.button_to .ds-button--primary {
    width: min(100%, 248px);
    min-height: 48px;
    font-size: var(--text-md);
  }

  .battle-round-result-dialog--lesson6 > form.button_to {
    margin-top: 14px;
  }

  .battle-round-result-dialog--lesson6 > form.button_to .ds-button {
    margin-top: 0;
  }

  .battle-title-row--lesson6 .restart-btn.ds-button {
    min-height: 34px;
    padding: 0 var(--space-4);
    font-size: var(--text-xs);
  }
}

.battle-container--lesson6 #hint-button {
  right: var(--space-6);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
}

@media (max-width: 720px) {
  .tutorial-multiplayer-card {
    padding: var(--space-6);
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .tutorial-top-callout {
    padding: var(--space-12);
  }

  .tutorial-top-copy .tutorial-intro {
    max-width: 48ch;
  }

  .tutorial-header {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .ds-tutorial-complete-overlay {
    align-items: center;
    inset: 0;
    padding: 0;
  }

  .progress-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
  }

  .result-page-shell .result-page {
    width: min(900px, 100%);
    padding: var(--space-8) var(--space-6) var(--space-6);
  }

  .result-page-shell .result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .result-page-shell .result-page--battle .result-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .result-page-shell .result-actions {
    flex-direction: row;
    align-items: center;
  }

  #tutorial-content,
  #battle-content {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
}

@media (orientation: landscape) {
  .tutorial-lock-alert {
    width: min(100%, 760px);
    margin-left: auto;
    margin-right: auto;
  }

  #battle-content {
    padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom));
  }

  #bot-content #bot-game-over .ds-tutorial-complete-overlay {
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  #local-content #local-game-over .ds-tutorial-complete-overlay {
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .battle-round-result-overlay--lesson6 {
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
  }

  #hint-button {
    position: fixed;
    right: var(--space-4);
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    z-index: 8;
  }

  #hint-button .ds-button {
    box-shadow: var(--shadow-strong);
    min-height: 48px;
    padding: var(--space-2) var(--space-5);
    white-space: nowrap;
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .battle-round-result-overlay--lesson6 {
    justify-content: center;
    padding-top: var(--space-3);
  }

  .battle-round-result-dialog--lesson6 {
    width: min(460px, calc(100% - var(--space-6)));
    max-height: calc(100vh - var(--space-6));
    padding: var(--space-8) var(--space-6);
  }

  .battle-round-result-dialog--lesson6 .battle-round-seeds {
    margin: var(--space-4) 0 var(--space-3);
    gap: var(--space-4);
  }

  .battle-round-result-dialog--lesson6 .ds-dialog__actions {
    margin-top: var(--space-3);
  }
}

@media (orientation: landscape) and (min-width: 1100px) {
  #hint-button {
    right: var(--space-8);
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  }

  .battle-container--lesson6 #hint-button {
    right: var(--space-7);
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .bot-game-main {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .bot-player-legend--top {
    margin-bottom: 0;
  }

  .bot-player-legend--bottom {
    margin-top: 0;
  }

  .bot-player-legend-item {
    padding: var(--space-1) var(--space-2);
  }

  .bot-game-main #board-container .board-wrapper {
    --board-margin: 0 auto calc(var(--space-1) * -1);
  }

  .tutorial-top-callout {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-095);
    padding: var(--space-11);
  }

  .tutorial-top-copy .tutorial-intro {
    text-align: left;
    max-width: none;
  }

  .tutorial-header {
    position: relative;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
  }

  .tutorial-header .restart-form {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
  }

  .ds-tutorial-complete-overlay {
    align-items: center;
    inset: 0;
    padding: 0;
  }

  .tutorial-multiplayer-card {
    padding: var(--space-175);
  }

  .tutorial-intro {
    font-size: var(--text-md);
    margin-bottom: var(--space-6);
  }

  .level-grid {
    gap: var(--space-4);
  }

  .level-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .level-badge {
    width: 44px;
    height: 44px;
    font-size: var(--text-11);
  }

  .level-info h2 {
    font-size: var(--text-md);
  }

  .step-message {
    font-size: var(--text-md);
    padding: var(--space-085) var(--space-4);
  }

  .progress-stats {
    flex-direction: column;
    gap: var(--space-3);
  }

  .tutorial-complete-shell .progress-stats {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 32px;
    padding: 12px 24px;
  }

  .result-page-shell {
    padding: 0 var(--space-3) var(--space-8);
  }

  .result-page-shell .result-page {
    width: min(390px, 100%);
    padding: var(--space-5) var(--space-4) var(--space-6);
  }

  .result-page-shell .result-page--standard {
    width: min(360px, 100%);
    min-height: 370px;
    margin-top: 22px;
    border-radius: 20px;
  }

  .result-page-shell .result-check {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-3);
  }

  .result-page-shell .result-check-icon {
    font-size: 28px;
  }

  .result-page-shell .result-hero h1 {
    font-size: 24px;
  }

  .result-page-shell .result-message {
    max-width: 310px;
    font-size: 13px;
  }

  .result-page-shell .result-lesson-name {
    font-size: 15px;
    margin-bottom: var(--space-4);
  }

  .result-page-shell .result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .result-page-shell .result-page--standard .result-stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
    margin-bottom: var(--space-4);
  }

  .result-page-shell .result-page--battle .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-page-shell .result-metric {
    border-radius: 12px;
    padding: 14px 10px 12px;
  }

  .result-page-shell .result-page--standard .result-metric {
    height: 96px;
    border-radius: 16px;
    padding: 12px 8px 10px;
  }

  .result-page-shell .stat-label {
    font-size: 10px;
  }

  .result-page-shell .stat-value {
    font-size: 24px;
  }

  .result-page-shell .result-actions {
    flex-direction: row;
    gap: var(--space-2);
  }

  .result-page-shell .result-page--standard .result-actions {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .result-page-shell .result-actions .ds-button {
    min-width: 140px;
    min-height: 40px;
    font-size: 14px;
    padding: var(--space-2) var(--space-3);
  }

  .result-page-shell .result-page--standard .result-actions .ds-button {
    width: 143px;
    height: 40px;
    min-width: 143px;
    min-height: 40px;
  }

  #tutorial-content,
  #battle-content {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
}

@media (max-width: 480px) {
  .tutorial-multiplayer-card {
    padding: var(--space-5);
  }

  .tutorial-multiplayer-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .tutorial-lesson-shell {
    width: min(100%, var(--tutorial-lesson-mobile-shell-width));
  }

  .tutorial-lesson-title {
    font-size: var(--tutorial-lesson-title-size-mobile);
  }

  #lesson-title .tutorial-lesson-step {
    font-size: var(--tutorial-lesson-step-size-mobile);
  }

  .tutorial-lesson-callout {
    min-height: var(--tutorial-lesson-callout-height-mobile);
    margin: 14px 0 22px;
    padding: var(--tutorial-lesson-callout-padding-mobile);
    border-radius: 10px;
  }

  .tutorial-lesson-page #tutorial-content {
    width: min(100%, var(--tutorial-lesson-mobile-shell-width));
  }

  .ds-tutorial-complete-overlay[data-tutorial-result-dialog]
    .ds-tutorial-complete-dialog {
    width: min(320px, calc(100% - 70px));
    max-width: min(320px, calc(100% - 70px));
    padding: 30px 24px 24px;
    border-radius: 20px;
  }

  .tutorial-complete-label-desktop {
    display: none;
  }

  .tutorial-complete-label-mobile {
    display: inline;
  }

  .tutorial-complete-shell .progress-stats {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 32px;
    padding: 12px 24px;
  }

  .tutorial-top-callout {
    padding: var(--space-4);
  }

  .tutorial-top-kicker {
    font-size: var(--text-072);
  }

  .tutorial-description {
    margin-bottom: var(--space-125);
  }

  .tutorial-instruction-callout {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-3) var(--space-3);
    line-height: 1.3;
  }

  .step-message {
    font-size: var(--text-md);
    padding: var(--space-3) var(--space-3);
  }

  .level-card {
    padding: var(--space-4);
  }

  .result-page-shell {
    padding: 0 var(--space-2) var(--space-6);
  }

  .result-page-shell .result-page {
    width: min(100%, 360px);
    padding: var(--space-4);
  }

  .result-page-shell .result-page--standard {
    margin-top: 24px;
  }

  .result-page-shell .result-hero h1 {
    font-size: 22px;
  }

  .result-page-shell .result-actions {
    gap: var(--space-2);
  }

  .result-page-shell .result-actions .ds-button {
    min-width: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-lock-alert--inline {
    transition: none;
  }

  .tutorial-lock-alert--inline.is-dismissing {
    transform: none;
  }

  .bot-player-legend-item.is-current-turn {
    animation: none;
    transform: scale(1.08);
  }

  .bot-thinking-dots .dot {
    animation: none;
    opacity: 0.6;
  }

  .result-page-shell .result-page,
  .ds-tutorial-complete-dialog {
    animation: none;
  }
}
