/* The math islands (js/engines/math-island.js) and the bank islands (js/engines/bank-island.js): the map of their islands, the skill and topic
   levels, the number pad, the mistake notes and the workshop prompt.
   It builds on the classes of the page and of css/nature.css (.isle, .trail, .stop, .card, .qcard, .opt, .fb...). */

/* The map: a sea with the seven islands on a dotted trail */
.mmap { background: radial-gradient(ellipse at 30% 15%, #9fe6ff, #4fb6e8 55%, #2a86c6); }
.mmap .isle-head { background: rgba(255,255,255,.85); border-radius: 24px; padding: 8px 12px; margin: 0 auto 6px; max-width: 520px; }
html.nd .mmap .isle-head { background: rgba(13,59,102,.55); }
html.nd .mmap .isle-head .muted { color: #fff; }
.misle .disc { color: #2b2d42; }
.misle .lbl { max-width: 190px; }
.misle .lbl small { font-weight: 700; opacity: .7; }

/* A skill's level: easy, middle, hard */
.mlv { display: inline-block; font-size: 14px; font-weight: 800; padding: 2px 10px; border-radius: 99px; border: 2px solid var(--line); margin: 0 4px; white-space: nowrap; vertical-align: middle; }
.mlv.lv1 { background: #d8f7dc; }
.mlv.lv2 { background: #fff0c2; }
.mlv.lv3 { background: #ffd9d9; }
.mskills { display: grid; gap: 8px; margin: 10px 0; }
@media (min-width: 640px) { .mskills { grid-template-columns: 1fr 1fr; } }
.mskill { border: 3px solid var(--line); border-radius: 16px; padding: 8px 12px; background: var(--card); text-align: left; }
.mskill b { display: block; font-size: 18px; }
.mskill small { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.mlevels { display: grid; gap: 6px; margin: 12px auto; max-width: 520px; text-align: left; }
.mlevels > div { border: 2px solid var(--line); border-radius: 14px; padding: 6px 10px; background: var(--card); }

/* The question: an expression in big digits, the box ☐ that fills while typing, a drawing */
.mq .question.mexpr { font-size: 40px; letter-spacing: 1px; font-variant-numeric: tabular-nums; text-align: center; }
.mbox { display: inline-block; min-width: 1.4em; padding: 0 .2em; border: 3px dashed var(--berry); border-radius: 12px; color: var(--berry); text-align: center; }
.mfigbox { display: flex; justify-content: center; margin: 6px 0; }
.mfigbox svg, .mfig { max-width: 100%; height: auto; max-height: 220px; }
.mq .badge.mstep { background: #e0f0ff; }

/* The number pad */
.mpad { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.mans { min-width: 180px; padding: 8px 18px; border: 3px solid var(--line); border-radius: 18px; background: var(--card); font-size: 38px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.mans .mu { font-size: 22px; margin-left: 8px; color: var(--ink-soft); }
.mans.shown { background: #d8f7dc; }
.mkeys { display: grid; grid-template-columns: repeat(3, 74px); gap: 8px; }
.mkeys .mk { justify-content: center; font-size: 30px; font-weight: 800; padding: 10px 0; text-align: center; }
.mkeys .mk.ok { background: #d8f7dc; }

/* Compare: < = > */
.mcmp { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }
.mcmp .opt { justify-content: center; font-size: 38px; font-weight: 800; width: 88px; padding: 8px 0; text-align: center; }

/* What Моливчо found */
.mdiag { border: 3px solid var(--line); border-radius: 18px; background: #e5e0ff; padding: 10px 14px; margin: 10px 0; text-align: left; }
.mdiag b { display: block; margin-bottom: 4px; }
.mnote { font-weight: 700; margin: 8px 0; }

/* The workshop is needed: a warning on the lesson and the results, and the workshop button pulses */
.mwarn { border: 3px solid var(--line); border-radius: 18px; background: #ffe1e1; padding: 10px 14px; margin: 12px 0; text-align: left; font-weight: 700; }
.wsneed { position: relative; animation: wsPulse 1.4s ease-in-out infinite; }
.wsneed::after { content: "!"; position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--berry, #ef476f); color: #fff; font: 800 14px/22px system-ui, sans-serif; text-align: center; border: 2px solid #fff; }
@keyframes wsPulse { 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .wsneed { animation: none; } }
[data-theme=dark] .mwarn { background: #55283a; }

/* The statistics sheet */
table.mstat { width: 100%; border-collapse: collapse; font-size: 16px; }
table.mstat th, table.mstat td { padding: 6px 8px; border-bottom: 2px solid #e4e6ef; text-align: left; }

[data-theme=dark] .mlv.lv1, [data-theme=dark] .mans.shown, [data-theme=dark] .mkeys .mk.ok { background: #1f4d33; }
[data-theme=dark] .mlv.lv2 { background: #4d4420; }
[data-theme=dark] .mlv.lv3 { background: #5a2c26; }
[data-theme=dark] .mdiag { background: #3a3270; }
[data-theme=dark] .mq .badge.mstep { background: #1c3550; }
[data-theme=dark] table.mstat th, [data-theme=dark] table.mstat td { border-bottom-color: #3a4166; }

@media (max-width: 520px) {
  .mq .question.mexpr { font-size: 30px; }
  .mkeys { grid-template-columns: repeat(3, 64px); gap: 6px; }
  .mkeys .mk { font-size: 26px; padding: 8px 0; }
  .mans { font-size: 32px; min-width: 150px; }
  .mcmp .opt { width: 72px; font-size: 32px; }
  .misle .lbl { max-width: 130px; font-size: 14px; }
}
