.mv-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.mv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mv-statline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.mv-stat {
  min-width: 70px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.mv-stat span,
.mv-readout span,
.mv-final-cell span {
  display: block;
  color: var(--cg-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.mv-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mv-actions,
.mv-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mv-btn,
.mv-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.mv-btn {
  padding: 0 14px;
}

.mv-icon {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.mv-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mv-btn:hover,
.mv-close:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.mv-btn:focus-visible,
.mv-close:focus-visible,
.mv-board:focus-visible,
.mv-card:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.35);
  outline-offset: 3px;
}

.mv-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.mv-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #c4d9d3;
  border-radius: 8px;
  background: linear-gradient(145deg, #eaf4f1 0%, #f8f5eb 48%, #eef1f7 100%);
  box-shadow: var(--cg-shadow);
  touch-action: manipulation;
}

.mv-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--mv-cols), minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-height: min(72vh, 650px);
  padding: 12px;
  perspective: 900px;
}

.mv-card {
  position: relative;
  min-width: 44px;
  min-height: 64px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cg-ink);
  font: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
}

.mv-card-inner {
  position: absolute;
  inset: 0;
  display: block;
  transform-style: preserve-3d;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease, filter 300ms ease;
}

.mv-card.mv-open .mv-card-inner,
.mv-card.mv-done .mv-card-inner {
  transform: rotateY(180deg);
}

.mv-card.mv-done .mv-card-inner {
  opacity: 0.24;
  filter: saturate(1.3);
}

.mv-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(30, 37, 40, 0.13);
  border-radius: 8px;
  backface-visibility: hidden;
  box-shadow: 0 8px 18px rgba(33, 43, 40, 0.12);
}

.mv-back {
  background: radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 34%), linear-gradient(145deg, #127a89, #315f9d 58%, #1d7f62);
  color: #fff;
}

.mv-front {
  transform: rotateY(180deg);
  background: rgba(255, 255, 255, 0.94);
}

.mv-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.mv-kind {
  color: var(--cg-teal);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.mv-text {
  display: block;
  width: 100%;
  color: var(--cg-ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
}

.mv-small .mv-text {
  font-size: 13px;
  line-height: 1.14;
}

.mv-tiny .mv-text {
  font-size: 12px;
  line-height: 1.12;
}

.mv-card[data-kind="synonym"] .mv-front {
  background: #f0f8f5;
}

.mv-card[data-kind="antonym"] .mv-front {
  background: #fff6ee;
}

.mv-card.mv-bad .mv-card-inner {
  animation: mv-card-shake 300ms linear;
}

@keyframes mv-card-shake {
  0%, 100% { transform: rotateY(180deg) translateX(0); }
  25% { transform: rotateY(180deg) translateX(-5px); }
  50% { transform: rotateY(180deg) translateX(5px); }
  75% { transform: rotateY(180deg) translateX(-3px); }
}

.mv-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mv-float {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 4;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(30, 37, 40, 0.86);
  color: #fff;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.mv-float.mv-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mv-start,
.mv-result {
  position: absolute;
  left: 50%;
  z-index: 5;
  display: grid;
  gap: 7px;
  width: min(88%, 340px);
  padding: 16px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  color: var(--cg-ink);
  text-align: center;
  box-shadow: var(--cg-shadow);
  backdrop-filter: blur(10px);
}

.mv-start {
  bottom: 18px;
  pointer-events: none;
  transform: translateX(-50%);
}

.mv-result {
  top: 50%;
  transform: translate(-50%, -50%);
  animation: mv-pop 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mv-start strong,
.mv-result strong {
  font-size: 22px;
  line-height: 1.1;
}

.mv-start span,
.mv-result span,
.mv-result p,
.mv-note {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.42;
}

.mv-final-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mv-final-cell {
  padding: 7px 2px;
  border: 1px solid var(--cg-line);
  border-radius: 7px;
  background: rgba(246, 247, 242, 0.92);
}

.mv-final-cell strong {
  display: block;
  color: var(--cg-ink);
  font-size: 15px;
  line-height: 1.2;
}

.mv-result-actions .mv-btn {
  flex: 1 1 0;
}

.mv-below {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

.mv-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.mv-seg-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cg-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.mv-seg-btn[aria-pressed="true"] {
  background: var(--cg-teal);
  color: #fff;
}

.mv-readout {
  display: flex;
  flex: 1 1 280px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.mv-readout span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-muted);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.06);
}

.mv-note {
  margin-top: 10px;
}

.mv-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, 0.34);
}

.mv-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 24px 70px rgba(30, 37, 40, 0.22);
}

.mv-modal-card h2 {
  margin: 0 48px 12px 0;
  font-size: 24px;
  line-height: 1.1;
}

.mv-modal-card p {
  margin: 10px 0 0;
  color: var(--cg-muted);
  line-height: 1.45;
}

.mv-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.mv-hidden {
  display: none !important;
}

.mv-shake {
  animation: mv-stage-shake 260ms linear;
}

@keyframes mv-stage-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

@keyframes mv-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 560px) {
  .mv-shell {
    padding: 0 10px 18px;
  }

  .mv-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mv-statline,
  .mv-actions {
    justify-content: center;
  }

  .mv-stat {
    flex: 1 1 72px;
    min-width: 0;
    text-align: center;
  }

  .mv-board {
    gap: 6px;
    min-height: min(66vh, 580px);
    padding: 8px;
  }

  .mv-card {
    min-height: 58px;
  }

  .mv-text {
    font-size: 13px;
    line-height: 1.13;
  }

  .mv-small .mv-text,
  .mv-tiny .mv-text {
    font-size: 11px;
  }

  .mv-kind {
    font-size: 9px;
  }

  .mv-seg,
  .mv-readout {
    flex: 1 1 100%;
    justify-content: center;
  }

  .mv-seg-btn {
    flex: 1 1 0;
  }
}
