/*
 * MateFacilito Games - Decimales111
 * Mundo Decimal
 * Version: 1.0.0
 */

.mf-dec111-app,
.mf-dec111-app * {
  box-sizing: border-box;
}

.mf-dec111-app {
  --mf-bg: #f6f7fb;
  --mf-card: #ffffff;
  --mf-card-2: #f8fafc;
  --mf-text: #162033;
  --mf-muted: #61708a;
  --mf-primary: #2563eb;
  --mf-primary-dark: #1d4ed8;
  --mf-secondary: #f59e0b;
  --mf-good: #16a34a;
  --mf-danger: #dc2626;
  --mf-warning: #f97316;
  --mf-border: #dbe4f0;
  --mf-shadow: 0 20px 50px rgba(15, 23, 42, 0.13);
  --mf-soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  --mf-radius: 24px;
  width: 100%;
  min-height: 620px;
  color: var(--mf-text);
  font-family: "Nunito", "Atkinson Hyperlegible", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

.mf-dec111-theme-cuaderno {
  --mf-bg: #f5f7ff;
  --mf-card: #ffffff;
  --mf-card-2: #eef4ff;
  --mf-text: #10233f;
  --mf-muted: #5d6b82;
  --mf-primary: #2563eb;
  --mf-primary-dark: #1e40af;
  --mf-secondary: #f4b740;
  --mf-border: #d5e3ff;
}

.mf-dec111-theme-pastel {
  --mf-bg: #fff8f0;
  --mf-card: #fffdfb;
  --mf-card-2: #fff0df;
  --mf-text: #37251a;
  --mf-muted: #7a6254;
  --mf-primary: #8b5cf6;
  --mf-primary-dark: #6d28d9;
  --mf-secondary: #fb7185;
  --mf-border: #f4d7c2;
}

.mf-dec111-theme-arcade {
  --mf-bg: #0f172a;
  --mf-card: #17203a;
  --mf-card-2: #111827;
  --mf-text: #f8fafc;
  --mf-muted: #cbd5e1;
  --mf-primary: #22d3ee;
  --mf-primary-dark: #0891b2;
  --mf-secondary: #facc15;
  --mf-border: #334155;
  --mf-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.mf-dec111-loading,
.mf-dec111-noscript {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--mf-bg);
  border-radius: var(--mf-radius);
}

.mf-dec111-loading-card,
.mf-dec111-noscript {
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--mf-soft-shadow);
}

.mf-dec111-loader {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 5px solid var(--mf-border);
  border-top-color: var(--mf-primary);
  border-radius: 50%;
  animation: mf-dec111-spin 0.8s linear infinite;
}

@keyframes mf-dec111-spin {
  to { transform: rotate(360deg); }
}

.mf-dec111-shell {
  width: 100%;
  min-height: 620px;
  padding: 18px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--mf-primary), transparent 78%), transparent 40%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--mf-secondary), transparent 76%), transparent 42%),
    var(--mf-bg);
  border-radius: var(--mf-radius);
  overflow: hidden;
}

.mf-dec111-topbar,
.mf-dec111-game-header,
.mf-dec111-learn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mf-dec111-topbar {
  margin-bottom: 12px;
}

.mf-dec111-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mf-text);
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  padding: 10px 16px 10px 10px;
  cursor: pointer;
  box-shadow: var(--mf-soft-shadow);
  text-align: left;
}

.mf-dec111-brand strong,
.mf-dec111-brand small {
  display: block;
}

.mf-dec111-brand small {
  color: var(--mf-muted);
  font-size: 12px;
}

.mf-dec111-logo,
.mf-dec111-card-icon,
.mf-dec111-result-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--mf-primary), white 82%);
  font-size: 26px;
  flex: 0 0 auto;
}

.mf-dec111-theme-arcade .mf-dec111-logo,
.mf-dec111-theme-arcade .mf-dec111-card-icon,
.mf-dec111-theme-arcade .mf-dec111-result-icon {
  background: rgba(34, 211, 238, 0.18);
}

.mf-dec111-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mf-dec111-theme-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mf-muted);
  font-weight: 800;
  font-size: 13px;
}

.mf-dec111-theme-picker select {
  appearance: none;
  border: 1px solid var(--mf-border);
  background: var(--mf-card);
  color: var(--mf-text);
  border-radius: 999px;
  padding: 9px 34px 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

.mf-dec111-session-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-left: 8px solid var(--mf-primary);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: var(--mf-soft-shadow);
}

.mf-dec111-session-pill.is-free {
  border-left-color: var(--mf-secondary);
}

.mf-dec111-session-pill span {
  color: var(--mf-muted);
}

.mf-dec111-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mf-primary), var(--mf-card) 86%), var(--mf-card));
  border: 1px solid var(--mf-border);
  border-radius: 32px;
  padding: 26px;
  box-shadow: var(--mf-shadow);
  margin-bottom: 18px;
}

.mf-dec111-kicker {
  margin: 0 0 6px;
  color: var(--mf-primary);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
}

.mf-dec111-hero h1,
.mf-dec111-game-header h1,
.mf-dec111-learn-card h1,
.mf-dec111-result-card h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.mf-dec111-hero p,
.mf-dec111-game-header p,
.mf-dec111-learn-header p {
  color: var(--mf-muted);
  font-size: 17px;
  margin: 10px 0 0;
}

.mf-dec111-hero-grid {
  display: flex;
  justify-content: center;
}

.mf-dec111-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mf-dec111-activity-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 286px;
  gap: 14px;
  padding: 18px;
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: 28px;
  box-shadow: var(--mf-soft-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mf-dec111-activity-card:not(.is-locked):hover {
  transform: translateY(-3px);
  box-shadow: var(--mf-shadow);
  border-color: color-mix(in srgb, var(--mf-primary), var(--mf-border));
}

.mf-dec111-activity-card.is-locked {
  opacity: 0.72;
  filter: grayscale(0.18);
}

.mf-dec111-card-badge {
  display: inline-flex;
  width: fit-content;
  background: color-mix(in srgb, var(--mf-secondary), transparent 78%);
  color: var(--mf-text);
  border: 1px solid color-mix(in srgb, var(--mf-secondary), transparent 40%);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.mf-dec111-card-body h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.mf-dec111-card-body p {
  color: var(--mf-muted);
  margin: 8px 0;
  font-weight: 800;
}

.mf-dec111-card-body small {
  display: block;
  color: var(--mf-muted);
  font-size: 14px;
}

.mf-dec111-locked-msg {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--mf-warning), transparent 88%);
  color: var(--mf-text);
  font-size: 13px;
  font-weight: 800;
}

.mf-dec111-card-actions,
.mf-dec111-result-actions,
.mf-dec111-learn-actions,
.mf-dec111-game-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mf-dec111-btn,
.mf-dec111-choice,
.mf-dec111-key {
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  font-family: inherit;
}

.mf-dec111-btn:disabled,
.mf-dec111-choice:disabled,
.mf-dec111-key:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.mf-dec111-btn:not(:disabled):hover,
.mf-dec111-choice:not(:disabled):hover,
.mf-dec111-key:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.mf-dec111-btn.primary {
  background: var(--mf-primary);
  color: #fff;
}

.mf-dec111-btn.secondary {
  background: color-mix(in srgb, var(--mf-secondary), white 12%);
  color: #1f2937;
}

.mf-dec111-btn.ghost {
  background: var(--mf-card-2);
  color: var(--mf-text);
  border: 1px solid var(--mf-border);
}

.mf-dec111-game {
  display: grid;
  gap: 14px;
}

.mf-dec111-game-header {
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: 28px;
  padding: 20px;
  box-shadow: var(--mf-soft-shadow);
}

.mf-dec111-game-header h1 {
  font-size: clamp(22px, 3vw, 34px);
}

.mf-dec111-hud {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 260px;
}

.mf-dec111-hud span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
}

.mf-dec111-timebar {
  height: 12px;
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  overflow: hidden;
}

.mf-dec111-timebar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mf-primary), var(--mf-secondary));
  width: 0;
  transition: width 0.3s ease;
}

.mf-dec111-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.mf-dec111-exercise-card,
.mf-dec111-side-panel,
.mf-dec111-learn-card,
.mf-dec111-result-card {
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: 30px;
  padding: 22px;
  box-shadow: var(--mf-soft-shadow);
}

.mf-dec111-progress-mini {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 12px;
  background: color-mix(in srgb, var(--mf-primary), transparent 86%);
  color: var(--mf-text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.mf-dec111-exercise-visual {
  margin: 8px 0 18px;
}

.mf-dec111-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mf-dec111-choice {
  min-height: 74px;
  background: var(--mf-card-2);
  color: var(--mf-text);
  border: 2px solid var(--mf-border);
  font-size: clamp(19px, 2vw, 25px);
  text-align: center;
}

.mf-dec111-choice.is-answer {
  border-color: var(--mf-good);
  background: color-mix(in srgb, var(--mf-good), transparent 84%);
}

.mf-dec111-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.mf-dec111-answer-input {
  flex: 1;
  min-height: 58px;
  border: 2px solid var(--mf-border);
  border-radius: 16px;
  background: var(--mf-card-2);
  color: var(--mf-text);
  padding: 12px 14px;
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  outline: none;
}

.mf-dec111-answer-input:focus {
  border-color: var(--mf-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mf-primary), transparent 84%);
}

.mf-dec111-place-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.mf-dec111-pos-cell {
  min-height: 84px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 4px;
  background: var(--mf-card-2);
  border: 2px solid var(--mf-border);
  border-radius: 18px;
  padding: 8px 4px;
  position: relative;
  overflow: hidden;
}

.mf-dec111-cell-label {
  font-size: 15px;
  font-weight: 1000;
  color: var(--mf-primary);
}

.mf-dec111-cell-value {
  display: grid;
  place-items: center;
  min-height: 34px;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 1000;
  line-height: 1;
}

.mf-dec111-cell-name {
  font-size: 10px;
  color: var(--mf-muted);
  font-weight: 900;
  text-align: center;
}

.mf-dec111-pos-cell.is-comma {
  background: color-mix(in srgb, var(--mf-secondary), transparent 72%);
  border-color: color-mix(in srgb, var(--mf-secondary), transparent 20%);
}

.mf-dec111-pos-cell.is-empty {
  opacity: 0.47;
  background: transparent;
  border-style: dashed;
}

.mf-dec111-pos-cell.is-active {
  border-color: var(--mf-primary);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--mf-primary), transparent 82%);
  animation: mf-dec111-pulse 1s ease-in-out infinite;
}

.mf-dec111-pos-cell.is-correct {
  border-color: var(--mf-good);
  background: color-mix(in srgb, var(--mf-good), transparent 84%);
}

.mf-dec111-pos-cell.is-wrong {
  border-color: var(--mf-danger);
  background: color-mix(in srgb, var(--mf-danger), transparent 82%);
  animation: mf-dec111-shake 0.28s linear 1;
}

.mf-dec111-pos-cell.is-answer {
  border-color: var(--mf-good);
  background: color-mix(in srgb, var(--mf-good), transparent 86%);
}

@keyframes mf-dec111-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes mf-dec111-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mf-dec111-side-panel {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}

.mf-dec111-rule-card {
  padding: 16px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 22px;
}

.mf-dec111-rule-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.mf-dec111-rule-card p {
  margin: 0 0 12px;
  color: var(--mf-muted);
}

.mf-dec111-mini-grid {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  background: var(--mf-card);
  border-radius: 14px;
  border: 1px solid var(--mf-border);
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.mf-dec111-mini-grid span {
  color: var(--mf-secondary);
  font-size: 22px;
  line-height: 1;
}

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

.mf-dec111-key {
  min-height: 58px;
  background: var(--mf-card-2);
  color: var(--mf-text);
  border: 2px solid var(--mf-border);
  font-size: 24px;
}

.mf-dec111-feedback {
  margin-top: 18px;
  min-height: 62px;
}

.mf-dec111-feedback > p,
.mf-dec111-warning,
.mf-dec111-ok,
.mf-dec111-solution {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  color: var(--mf-muted);
}

.mf-dec111-warning {
  background: color-mix(in srgb, var(--mf-warning), transparent 88%);
  border-color: color-mix(in srgb, var(--mf-warning), transparent 55%);
  color: var(--mf-text);
}

.mf-dec111-ok,
.mf-dec111-solution {
  background: color-mix(in srgb, var(--mf-good), transparent 88%);
  border-color: color-mix(in srgb, var(--mf-good), transparent 55%);
  color: var(--mf-text);
}

.mf-dec111-solution > div {
  margin: 12px 0;
}

.mf-dec111-fraction-card,
.mf-dec111-number-strip,
.mf-dec111-big-comma,
.mf-dec111-number-list,
.mf-dec111-visual-card {
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 24px;
  padding: 18px;
  text-align: center;
}

.mf-dec111-fraction-card span,
.mf-dec111-number-strip,
.mf-dec111-big-comma,
.mf-dec111-number-list {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 1000;
}

.mf-dec111-big-comma span {
  color: var(--mf-secondary);
  display: inline-block;
  transform: scale(1.2);
  margin: 0 4px;
}

.mf-dec111-vs {
  width: fit-content;
  margin: 10px auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--mf-primary);
  color: #fff;
  font-weight: 1000;
}

.mf-dec111-model {
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 10px;
}

.mf-dec111-model-10 {
  grid-template-columns: repeat(10, 1fr);
}

.mf-dec111-model-100 {
  grid-template-columns: repeat(10, 1fr);
}

.mf-dec111-model-cell {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 1px solid var(--mf-border);
  background: var(--mf-card);
}

.mf-dec111-model-cell.is-filled {
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-secondary));
  border-color: transparent;
}

.mf-dec111-model.is-compact .mf-dec111-model-cell {
  border-radius: 3px;
}

.mf-dec111-visual-card p {
  color: var(--mf-muted);
  font-weight: 900;
  margin: 8px 0 0;
}

.mf-dec111-learn,
.mf-dec111-result {
  display: grid;
  place-items: center;
  min-height: 460px;
}

.mf-dec111-learn-card,
.mf-dec111-result-card {
  width: min(920px, 100%);
}

.mf-dec111-learn-header {
  justify-content: flex-start;
}

.mf-dec111-learn-progress {
  margin: 20px 0;
  display: grid;
  gap: 8px;
  color: var(--mf-muted);
  font-weight: 900;
}

.mf-dec111-learn-progress div {
  height: 12px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  overflow: hidden;
}

.mf-dec111-learn-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mf-primary), var(--mf-secondary));
}

.mf-dec111-learn-step {
  padding: 22px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 24px;
  margin-bottom: 18px;
}

.mf-dec111-learn-step h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.mf-dec111-learn-step p {
  color: var(--mf-muted);
  font-size: 18px;
  margin: 0 0 14px;
}

.mf-dec111-example-box {
  padding: 16px;
  border-radius: 18px;
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  font-size: 26px;
  font-weight: 1000;
  text-align: center;
}

.mf-dec111-result-card {
  text-align: center;
}

.mf-dec111-result-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  font-size: 42px;
  border-radius: 28px;
}

.mf-dec111-stars {
  font-size: clamp(32px, 6vw, 58px);
  margin: 12px 0 18px;
  letter-spacing: 4px;
}

.mf-dec111-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.mf-dec111-summary-grid div {
  padding: 16px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 20px;
}

.mf-dec111-summary-grid dt {
  color: var(--mf-muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.mf-dec111-summary-grid dd {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 1000;
}

.mf-dec111-save-status {
  display: inline-flex;
  padding: 10px 14px;
  background: var(--mf-card-2);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
  color: var(--mf-muted);
  font-weight: 900;
}

.mf-dec111-result-actions {
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 1024px) {
  .mf-dec111-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mf-dec111-workspace {
    grid-template-columns: 1fr;
  }
  .mf-dec111-side-panel {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .mf-dec111-shell {
    padding: 12px;
    border-radius: 18px;
  }
  .mf-dec111-topbar,
  .mf-dec111-game-header,
  .mf-dec111-learn-header,
  .mf-dec111-session-pill {
    align-items: flex-start;
    flex-direction: column;
  }
  .mf-dec111-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .mf-dec111-card-grid,
  .mf-dec111-choices,
  .mf-dec111-summary-grid {
    grid-template-columns: 1fr;
  }
  .mf-dec111-place-grid {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    gap: 5px;
  }
  .mf-dec111-pos-cell {
    min-height: 72px;
    border-radius: 14px;
    padding: 6px 2px;
  }
  .mf-dec111-cell-label {
    font-size: 13px;
  }
  .mf-dec111-cell-value {
    font-size: 28px;
  }
  .mf-dec111-cell-name {
    display: none;
  }
  .mf-dec111-input-row {
    flex-direction: column;
  }
  .mf-dec111-hud {
    justify-content: flex-start;
    min-width: 0;
  }
  .mf-dec111-hud span {
    font-size: 14px;
  }
}
