.mfgames-resta11-root,
.mfgames-resta11-root * {
  box-sizing: border-box;
}

.mfgames-resta11-root {
  --mf-r11-bg: #fff7ed;
  --mf-r11-card: #ffffff;
  --mf-r11-ink: #1f2937;
  --mf-r11-soft: #fef3c7;
  --mf-r11-primary: #2563eb;
  --mf-r11-primary-dark: #1d4ed8;
  --mf-r11-accent: #f97316;
  --mf-r11-good: #16a34a;
  --mf-r11-bad: #dc2626;
  --mf-r11-help: #7c3aed;
  --mf-r11-muted: #64748b;
  --mf-r11-border: rgba(31, 41, 55, 0.14);
  --mf-r11-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  width: 100%;
  min-height: 720px;
  color: var(--mf-r11-ink);
  font-family: Nunito, Atkinson Hyperlegible, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mf-resta11-theme-pastel {
  --mf-r11-bg: linear-gradient(135deg, #fff7ed 0%, #e0f2fe 50%, #fce7f3 100%);
  --mf-r11-card: rgba(255, 255, 255, 0.94);
  --mf-r11-soft: #fffbeb;
  --mf-r11-primary: #2563eb;
  --mf-r11-primary-dark: #1d4ed8;
  --mf-r11-accent: #f97316;
}

.mf-resta11-theme-cuaderno {
  --mf-r11-bg: repeating-linear-gradient(0deg, #f8fafc 0, #f8fafc 34px, #e0f2fe 35px), linear-gradient(90deg, transparent 0, transparent 72px, #fecaca 73px, transparent 74px);
  --mf-r11-card: rgba(255, 255, 255, 0.98);
  --mf-r11-soft: #eff6ff;
  --mf-r11-primary: #0f766e;
  --mf-r11-primary-dark: #115e59;
  --mf-r11-accent: #e11d48;
}

.mf-resta11-theme-arcade {
  --mf-r11-bg: radial-gradient(circle at top left, #334155, #111827 65%);
  --mf-r11-card: rgba(15, 23, 42, 0.88);
  --mf-r11-ink: #f8fafc;
  --mf-r11-soft: rgba(37, 99, 235, 0.18);
  --mf-r11-primary: #22c55e;
  --mf-r11-primary-dark: #16a34a;
  --mf-r11-accent: #facc15;
  --mf-r11-muted: #cbd5e1;
  --mf-r11-border: rgba(255, 255, 255, 0.18);
  --mf-r11-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.mf-resta11-app {
  min-height: 720px;
  padding: 16px;
  border-radius: 28px;
  background: var(--mf-r11-bg);
}

.mf-resta11-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid var(--mf-r11-border);
  border-radius: 24px;
  background: var(--mf-r11-card);
  box-shadow: var(--mf-r11-shadow);
}

.mf-resta11-iconbtn,
.mf-resta11-topbar button,
.mf-resta11-card-actions button,
.mf-resta11-keypad button,
.mf-resta11-next,
.mf-resta11-play-actions button,
.mf-resta11-learn-actions button,
.mf-resta11-result-actions button {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.mf-resta11-iconbtn:hover,
.mf-resta11-topbar button:hover,
.mf-resta11-card-actions button:hover,
.mf-resta11-keypad button:hover,
.mf-resta11-next:hover,
.mf-resta11-play-actions button:hover,
.mf-resta11-learn-actions button:hover,
.mf-resta11-result-actions button:hover,
.mf-resta11-object:hover,
.mf-resta11-finger:hover {
  transform: translateY(-1px);
}

.mf-resta11-topbar button:disabled,
.mf-resta11-card-actions button:disabled,
.mf-resta11-learn-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.mf-resta11-iconbtn {
  min-width: 52px;
  min-height: 52px;
  font-size: 26px;
  background: var(--mf-r11-soft);
}

.mf-resta11-titlebox {
  flex: 1;
  min-width: 160px;
}

.mf-resta11-title {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.mf-resta11-session {
  font-size: 13px;
  color: var(--mf-r11-muted);
  font-weight: 800;
}

.mf-resta11-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--mf-r11-primary);
  font-weight: 1000;
}

.mf-resta11-theme-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mf-resta11-theme-picker button {
  padding: 9px 10px;
  background: var(--mf-r11-soft);
  color: var(--mf-r11-ink);
  font-size: 12px;
}

.mf-resta11-theme-picker button.active {
  background: var(--mf-r11-primary);
  color: #ffffff;
}

.mf-resta11-main {
  max-width: 1180px;
  margin: 0 auto;
}

.mf-resta11-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--mf-r11-border);
  border-radius: 32px;
  background: var(--mf-r11-card);
  box-shadow: var(--mf-r11-shadow);
}

.mf-resta11-hero h1,
.mf-resta11-learn h1,
.mf-resta11-results h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.mf-resta11-hero p {
  margin: 8px 0 0;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  color: var(--mf-r11-muted);
}

.mf-resta11-hero-emoji {
  display: grid;
  place-items: center;
  width: clamp(72px, 11vw, 120px);
  height: clamp(72px, 11vw, 120px);
  border-radius: 30px;
  font-size: clamp(44px, 7vw, 74px);
  background: var(--mf-r11-soft);
}

.mf-resta11-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 14px;
}

.mf-resta11-card {
  min-height: 265px;
  padding: 18px;
  border: 1px solid var(--mf-r11-border);
  border-radius: 28px;
  background: var(--mf-r11-card);
  box-shadow: var(--mf-r11-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mf-resta11-card.is-locked {
  filter: grayscale(0.2);
  opacity: 0.72;
}

.mf-resta11-card-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 42px;
  background: var(--mf-r11-soft);
}

.mf-resta11-card h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.mf-resta11-card p {
  margin: 0;
  color: var(--mf-r11-muted);
  font-weight: 800;
}

.mf-resta11-example {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--mf-r11-soft);
  font-size: 22px;
  font-weight: 1000;
}

.mf-resta11-lock {
  color: var(--mf-r11-bad);
  font-weight: 900;
  font-size: 13px;
}

.mf-resta11-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mf-resta11-card-actions button,
.mf-resta11-next,
.mf-resta11-play-actions button,
.mf-resta11-learn-actions button,
.mf-resta11-result-actions button {
  padding: 13px 14px;
  background: var(--mf-r11-primary);
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.mf-resta11-card-actions button:nth-child(2),
.mf-resta11-play-actions button:first-child,
.mf-resta11-learn-actions button:first-child {
  background: var(--mf-r11-accent);
}

.mf-resta11-note {
  margin: 16px 0 0;
  color: var(--mf-r11-muted);
  font-weight: 800;
  text-align: center;
}

.mf-resta11-note.small {
  font-size: 14px;
}

.mf-resta11-play,
.mf-resta11-learn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
}

.mf-resta11-board,
.mf-resta11-side,
.mf-resta11-results-card {
  border: 1px solid var(--mf-r11-border);
  border-radius: 32px;
  background: var(--mf-r11-card);
  box-shadow: var(--mf-r11-shadow);
}

.mf-resta11-board {
  min-height: 560px;
  padding: clamp(16px, 3vw, 28px);
}

.mf-resta11-side {
  padding: 16px;
  align-self: start;
  position: sticky;
  top: 12px;
}

.mf-resta11-challenge-head {
  display: grid;
  grid-template-columns: minmax(120px, 230px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.mf-resta11-op {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 12px 18px;
  border: 3px solid var(--mf-r11-primary);
  border-radius: 28px;
  background: var(--mf-r11-soft);
  color: var(--mf-r11-primary-dark);
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 1000;
  letter-spacing: -0.06em;
}

.mf-resta11-op.big {
  max-width: 420px;
  margin-bottom: 18px;
}

.mf-resta11-prompt {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 1000;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.mf-resta11-question {
  margin-top: 8px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 950;
  color: var(--mf-r11-muted);
}

.mf-resta11-visual {
  min-height: 220px;
  margin: 16px 0;
  padding: 18px;
  border-radius: 28px;
  background: var(--mf-r11-soft);
}

.mf-resta11-object-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 14px;
  align-items: center;
}

.mf-resta11-object {
  aspect-ratio: 1;
  border: 4px solid rgba(37, 99, 235, 0.28);
  border-radius: 24px;
  background: #ffffff;
  font-size: clamp(36px, 6vw, 60px);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.mf-resta11-theme-arcade .mf-resta11-object {
  background: rgba(255, 255, 255, 0.12);
}

.mf-resta11-object.removed {
  opacity: 0.38;
  filter: grayscale(0.4);
  transform: scale(0.92);
  border-color: var(--mf-r11-bad);
  position: relative;
}

.mf-resta11-object.removed::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 6px;
  border-radius: 999px;
  background: var(--mf-r11-bad);
  transform: rotate(-20deg);
}

.mf-resta11-hands {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 18px;
  align-items: center;
}

.mf-resta11-hand-label {
  font-size: 18px;
  font-weight: 1000;
  color: var(--mf-r11-muted);
}

.mf-resta11-hand {
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 10px;
}

.mf-resta11-finger {
  height: clamp(72px, 9vw, 104px);
  border: 4px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px 999px 30px 30px;
  background: #fcd34d;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 -12px 0 rgba(180, 83, 9, 0.16), 0 9px 18px rgba(15, 23, 42, 0.1);
}

.mf-resta11-finger span {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 38%;
  height: 6px;
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.2);
  transform: translateX(-50%);
}

.mf-resta11-finger.down {
  opacity: 0.18;
  height: 42px;
  align-self: end;
  cursor: not-allowed;
}

.mf-resta11-finger.removed {
  opacity: 0.36;
  height: 48px;
  align-self: end;
  background: #fca5a5;
  border-color: var(--mf-r11-bad);
}

.mf-resta11-compare {
  display: grid;
  gap: 14px;
}

.mf-resta11-compare-row,
.mf-resta11-extra-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: center;
  font-size: 20px;
}

.mf-resta11-token {
  display: inline-grid;
  place-items: center;
  width: clamp(28px, 4vw, 42px);
  height: clamp(28px, 4vw, 42px);
  margin: 3px;
  border-radius: 999px;
  color: transparent;
}

.mf-resta11-token.tica {
  background: #60a5fa;
}

.mf-resta11-token.leo {
  background: #fb923c;
}

.mf-resta11-token.extra {
  background: #22c55e;
  animation: mfR11Pulse 1.2s ease-in-out infinite alternate;
}

.mf-resta11-tenframe {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  gap: 12px;
  max-width: 660px;
}

.mf-resta11-ten-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 22px;
  border: 4px solid rgba(37, 99, 235, 0.3);
  font-size: 44px;
  font-weight: 1000;
}

.mf-resta11-ten-cell.filled {
  background: #60a5fa;
  color: #ffffff;
}

.mf-resta11-ten-cell.empty {
  background: rgba(255, 255, 255, 0.65);
  border-style: dashed;
}

.mf-resta11-feedback {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 22px;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 1000;
  text-align: center;
}

.mf-resta11-feedback-neutral {
  background: rgba(37, 99, 235, 0.12);
  color: var(--mf-r11-primary-dark);
}

.mf-resta11-feedback-success {
  background: rgba(22, 163, 74, 0.16);
  color: var(--mf-r11-good);
}

.mf-resta11-feedback-error {
  background: rgba(220, 38, 38, 0.14);
  color: var(--mf-r11-bad);
}

.mf-resta11-feedback-help {
  background: rgba(124, 58, 237, 0.14);
  color: var(--mf-r11-help);
}

.mf-resta11-answer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 20px;
  font-weight: 1000;
}

.mf-resta11-answer-box {
  display: grid;
  place-items: center;
  min-width: 94px;
  height: 82px;
  border: 5px solid var(--mf-r11-primary);
  border-radius: 24px;
  background: #ffffff;
  color: var(--mf-r11-ink);
  font-size: 46px;
  font-weight: 1000;
  line-height: 1;
}

.mf-resta11-theme-arcade .mf-resta11-answer-box {
  background: rgba(255, 255, 255, 0.14);
}

.mf-resta11-answer-box.correct {
  border-color: var(--mf-r11-good);
  background: var(--mf-r11-good);
  color: #ffffff;
}

.mf-resta11-answer-box.help {
  border-color: var(--mf-r11-help);
  background: var(--mf-r11-help);
  color: #ffffff;
}

.mf-resta11-helpbox {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(124, 58, 237, 0.12);
  border: 2px dashed rgba(124, 58, 237, 0.4);
}

.mf-resta11-helpbox h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.mf-resta11-helpbox ol {
  margin: 0;
  padding-left: 24px;
  font-weight: 900;
  font-size: 18px;
}

.mf-resta11-helpbox p {
  margin-bottom: 0;
  color: var(--mf-r11-muted);
  font-weight: 900;
}

.mf-resta11-hearts {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 34px;
}

.mf-resta11-hearts .on {
  color: #ef4444;
  filter: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.28));
}

.mf-resta11-hearts .off {
  color: rgba(100, 116, 139, 0.35);
}

.mf-resta11-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mf-resta11-keypad button {
  min-height: 66px;
  background: #ffffff;
  color: var(--mf-r11-primary-dark);
  border: 3px solid rgba(37, 99, 235, 0.26);
  font-size: 28px;
  font-weight: 1000;
}

.mf-resta11-theme-arcade .mf-resta11-keypad button {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.mf-resta11-keypad button.wide {
  grid-column: span 2;
  background: var(--mf-r11-soft);
  color: var(--mf-r11-ink);
  font-size: 18px;
}

.mf-resta11-play-actions,
.mf-resta11-learn-actions,
.mf-resta11-result-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mf-resta11-learn-badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--mf-r11-accent);
  font-weight: 1000;
}

.mf-resta11-learn-text {
  margin: 12px 0;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 1000;
  color: var(--mf-r11-muted);
}

.mf-resta11-learn-answer {
  margin-top: 14px;
  min-height: 48px;
  font-size: clamp(26px, 5vw, 50px);
  font-weight: 1000;
  color: var(--mf-r11-good);
  text-align: center;
}

.mf-resta11-step-count {
  display: grid;
  place-items: center;
  min-height: 80px;
  border-radius: 24px;
  background: var(--mf-r11-soft);
  font-size: 24px;
  font-weight: 1000;
}

.mf-resta11-results {
  display: grid;
  place-items: center;
  min-height: 560px;
}

.mf-resta11-results-card {
  width: min(100%, 560px);
  padding: 28px;
  text-align: center;
}

.mf-resta11-stars {
  margin: 14px 0;
  color: #f59e0b;
  font-size: clamp(36px, 7vw, 68px);
  letter-spacing: 2px;
}

.mf-resta11-results-card p {
  margin: 8px 0;
  font-size: 20px;
  font-weight: 850;
}

.mf-resta11-save-status {
  display: inline-flex;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--mf-r11-primary-dark);
}

@keyframes mfR11Pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

@media (max-width: 1060px) {
  .mf-resta11-menu-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .mf-resta11-play,
  .mf-resta11-learn {
    grid-template-columns: 1fr;
  }

  .mf-resta11-side {
    position: static;
  }

  .mf-resta11-keypad {
    grid-template-columns: repeat(6, 1fr);
  }

  .mf-resta11-keypad button.wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .mf-resta11-app {
    padding: 10px;
    border-radius: 18px;
  }

  .mf-resta11-topbar {
    flex-wrap: wrap;
    border-radius: 20px;
  }

  .mf-resta11-theme-picker {
    width: 100%;
    justify-content: stretch;
  }

  .mf-resta11-theme-picker button {
    flex: 1;
  }

  .mf-resta11-menu-grid {
    grid-template-columns: 1fr;
  }

  .mf-resta11-card {
    min-height: auto;
  }

  .mf-resta11-challenge-head {
    grid-template-columns: 1fr;
  }

  .mf-resta11-visual {
    min-height: 180px;
    padding: 12px;
  }

  .mf-resta11-object-grid {
    gap: 8px;
  }

  .mf-resta11-object {
    border-radius: 18px;
  }

  .mf-resta11-hands {
    grid-template-columns: 1fr;
  }

  .mf-resta11-hand-label {
    display: none;
  }

  .mf-resta11-hand {
    gap: 7px;
  }

  .mf-resta11-finger {
    height: 72px;
  }

  .mf-resta11-keypad {
    grid-template-columns: repeat(5, 1fr);
  }

  .mf-resta11-keypad button {
    min-height: 58px;
    font-size: 24px;
  }

  .mf-resta11-keypad button.wide {
    grid-column: span 5;
  }

  .mf-resta11-compare-row,
  .mf-resta11-extra-row {
    grid-template-columns: 1fr;
  }
}
