/* Start custom CSS for html, class: .elementor-element-2150388 *//* === MATTEMATCH – REN, OPTIMALISERT CSS (RYDDET) === */

/* ---------- GRUNNSTIL ---------- */
.mattematch-container {
  font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #312e81);
  text-align: center;
  margin: 0;
  padding: 0;
}

/* ---------- HOVEDKONTAINER ---------- */
.mattematch-container #app {
  width: 100%;
  max-width: 900px;
  min-height: 90vh;
  margin: 2.5rem auto 3rem auto;
  padding: 2rem 1rem;
  background: rgba(30, 27, 75, 0.95);
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.7);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ---------- KNAPPER (generelt) ---------- */
.mm-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin: 0.5rem;
  border: none;
  text-align: center;
  box-shadow: 0 0 8px rgba(6,182,212,0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Ensartet stil for alle treningsknapper og modalknapper */
.mm-btn,
button.mm-btn,
.mattematch-container button.mm-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin: 0.5rem;
  border: none;
  text-align: center;
  box-shadow: 0 0 8px rgba(6,182,212,0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}

.mm-btn:hover,
button.mm-btn:hover,
.mattematch-container button.mm-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(6,182,212,0.9);
}

.mm-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(6,182,212,0.9);
}

/* ---------- GRID-BASIS ---------- */
.grid {
  display: grid;
  justify-content: center;
  align-content: start;
  margin: 1rem auto;
  width: max-content;
  transform-origin: center top;
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: bold;
  background: #f59e0b;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s;
}
.cell.correct { background: #22c55e !important; }
.cell.wrong   { background: #ef4444 !important; }

/* ---------- REGNESTYKKE ---------- */
.task {
  font-size: clamp(28px, 6vw, 60px);
  font-weight: bold;
  color: #93c5fd;
  letter-spacing: 1px;
  text-align: center;
  text-shadow: 0 0 12px rgba(147,197,253,0.6);
  margin: 1.5rem 0;
  animation: flashEffect 0.25s ease-in-out;
}

/* ---------- REGNEART-KNAPPER (valg av + - × ÷) ---------- */
.opGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  justify-items: center;
  max-width: 420px;
  margin: 2rem auto;
}
.opBtn {
  font-size: 40px;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6,182,212,0.7);
  transition: transform 0.15s, box-shadow 0.2s;
}
.opBtn:hover  { transform: scale(1.08); box-shadow: 0 0 18px rgba(6,182,212,0.9); }
.opBtn.active { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 0 16px rgba(34,197,94,0.9); }

/* ---------- FORSIDE: knapper/valg ---------- */
.optionGrid {
  display: grid;
  grid-template-columns: 1fr; /* én knapp per rad */
  gap: 1.2rem;
  justify-items: center;
  width: 100%;
  margin-top: 1.5rem;
}
.optionGrid .mm-btn {
  width: 80%;
  max-width: 320px;
  min-width: 180px;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  box-shadow: 0 0 8px rgba(6,182,212,0.6);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.optionGrid .mm-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(6,182,212,0.9);
}

/* ---------- GANGETABELL-KNAPPER (1–12) ---------- */
.tableButtons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  justify-items: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 700px;
}
.tableBtn {
  width: 130px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6,182,212,0.6);
  transition: transform 0.15s, box-shadow 0.2s;
}
.tableBtn:hover { transform: scale(1.05); box-shadow: 0 0 14px rgba(6,182,212,0.9); }

/* ---------- KONFETTI ---------- */
.confetti {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  animation: pop 700ms ease-out forwards;
}
@keyframes pop {
  from { transform: translate(0,0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(0.5); opacity: 0; }
}

/* ---------- SERTIFIKATER ---------- */
.cert-text {
  font-size: 2rem;
  margin: 0.4rem 0;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}
.cert-earned .cert-text {
  color: #fcd34d;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(252,211,77,0.7);
}
.cert-missing .cert-text {
  color: #6b7280;
  opacity: 0.6;
}

/* ---------- TRENING: små/mellomstore grids ---------- */
.mattematch-container .grid.small,
.mattematch-container .grid.medium {
  display: grid;
  justify-content: center;
  align-content: start;
  margin: 1rem auto;
  padding: 0.3rem;
  max-width: 95vw;
}
.mattematch-container .grid.small  { grid-template-columns: repeat(5, 1fr);  gap: 0.25rem; }
.mattematch-container .grid.medium { grid-template-columns: repeat(10, 1fr); gap: 0.2rem; }
.mattematch-container .grid.small .cell,
.mattematch-container .grid.medium .cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: #f59e0b;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 0.1s;
}

/* ---------- TILBAKEKNAPP ---------- */
.mm-btn.back-btn {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  margin: 1rem auto;
  cursor: pointer;
  display: block;
  text-align: center;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mm-btn.back-btn:hover { transform: scale(1.05); box-shadow: 0 0 14px rgba(6, 182, 212, 0.9); }

/* ---------- STORE GRIDS I TRENING ---------- */
.mattematch-container .grid.large {
  display: grid;
  justify-content: center;
  align-content: start;
  margin: 1rem auto;
  padding: 0.25rem;
  max-width: 95vw;
  grid-template-columns: repeat(10, 1fr); /* 10 per rad som standard */
  gap: 0.2rem;
}
.mattematch-container .grid.large .cell {
  aspect-ratio: 1 / 1;
  font-size: clamp(16px, 3vw, 22px);
  border-radius: 6px;
  background: #f59e0b;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 0.1s;
}

/* ---------- FASTE GRIDKORRIGERINGER (uavh. av skjerm) ---------- */
.grid[data-cols] { justify-content: center; width: max-content; margin: 0 auto; }
.mattematch-container .grid[data-cols="10"] { grid-template-columns: repeat(10, 1fr); }
.mattematch-container .grid[data-cols="11"],
.mattematch-container .grid[data-table="11"] { grid-template-columns: repeat(11, 1fr) !important; }
.mattematch-container .grid[data-cols="12"],
.mattematch-container .grid[data-table="12"] { grid-template-columns: repeat(12, 1fr) !important; }

.mattematch-container .grid[data-table="11"] { gap: 0.12rem !important; }
.mattematch-container .grid[data-table="11"] .cell { font-size: clamp(18px, 2.6vw, 24px) !important; }
.mattematch-container .grid[data-table="12"] { gap: 0.10rem !important; }
.mattematch-container .grid[data-table="12"] .cell { font-size: clamp(16px, 2.5vw, 22px) !important; }

/* 1× og 2×: 5 per rad */
.mattematch-container .grid[data-table="1"],
.mattematch-container .grid[data-table="2"] { grid-template-columns: repeat(5, 1fr) !important; gap: 0.25rem !important; }

/* ---------- FLASH-EFFEKT (anim) ---------- */
@keyframes flashEffect {
  0%   { filter: brightness(2.5); text-shadow: 0 0 25px #60a5fa, 0 0 45px #3b82f6; }
  50%  { filter: brightness(1.5); text-shadow: 0 0 15px #3b82f6, 0 0 30px #2563eb; }
  100% { filter: brightness(1);   text-shadow: 0 0 12px rgba(147,197,253,0.6); }
}

/* ---------- "Gå til forsiden" / Back-knapp varianter ---------- */
.mattematch-container button.mm-btn[href*="showStart"],
.mattematch-container button.mm-btn[onclick*="showStart"],
.mattematch-container .back-btn.mm-btn {
  display: inline-block;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  padding: 1rem 2.2rem;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6,182,212,0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mattematch-container button.mm-btn[href*="showStart"]:hover,
.mattematch-container button.mm-btn[onclick*="showStart"]:hover,
.mattematch-container .back-btn.mm-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(6,182,212,0.9);
}


/* =========================================================================
   📺  DESKTOP / STORE SKJERMER (≥900px) — ALLE TILPASNINGER HER
   ========================================================================= */
@media (min-width: 900px) {

  /* Celle-størrelser for små/stor grid */
  .grid.small .cell { width: 70px; height: 70px; font-size: clamp(24px, 2.5vw, 40px); }
  .grid.large .cell { width: 55px; height: 55px; font-size: clamp(18px, 2vw, 26px); }

  /* Kolonnetall per tabell (symmetrisk grid) */
  .mattematch-container .grid { gap: 0.18rem; padding: 0.4rem; }
  .mattematch-container .grid .cell {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
  }

  /* 1× og 2× */
  .mattematch-container .grid[data-table="1"],
  .mattematch-container .grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
  .mattematch-container .grid[data-table="2"] { grid-template-columns: repeat(5, 1fr); }

  /* 3× */
  .mattematch-container .grid[data-table="3"],
  .mattematch-container .grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

  /* 4×–10× */
  .mattematch-container .grid[data-table="4"],
  .mattematch-container .grid[data-table="5"],
  .mattematch-container .grid[data-table="6"],
  .mattematch-container .grid[data-table="7"],
  .mattematch-container .grid[data-table="8"],
  .mattematch-container .grid[data-table="9"],
  .mattematch-container .grid[data-table="10"],
  .mattematch-container .grid[data-cols="10"] { grid-template-columns: repeat(10, 1fr); }

  /* 11× og 12× skal i tillegg skaleres litt ned på desktop */
  .grid[data-cols="11"] { transform: scale(0.9); }
  .grid[data-cols="12"] { transform: scale(0.85); }

  .mattematch-container .grid[data-table="11"],
  .mattematch-container .grid[data-cols="11"] {
    transform: scale(0.88);
    transform-origin: center top;
  }
  .mattematch-container .grid[data-table="12"],
  .mattematch-container .grid[data-cols="12"] {
    transform: scale(0.82);
    transform-origin: center top;
  }

  /* Tekstplass over grid */
  .mattematch-container .task { margin-top: 1.5rem; }

  /* Ekstra kompakt for mester-nivå (store grids) */
  .mattematch-container .grid.large .cell { font-size: clamp(14px, 1.8vw, 20px); gap: 0.15rem; }

  /* Finjustering per data-cols */
  .grid[data-cols="10"] { gap: 0.12rem; }
  .grid[data-cols="11"] { gap: 0.10rem; }
  .grid[data-cols="12"] { gap: 0.08rem; }

  .grid[data-cols="10"] .cell { font-size: clamp(20px, 2.8vw, 30px); }
  .grid[data-cols="11"] .cell { font-size: clamp(21px, 2.9vw, 31px); }
  .grid[data-cols="12"] .cell { font-size: clamp(22px, 3vw, 32px); }
}

/* === FORSIDEBAKGRUNN MED FIGUR === */
.mattematch-container {
  background: linear-gradient(135deg, #0f172a, #312e81);
  position: relative;
  overflow: hidden;
}

/* Figur på forsiden */
.front-figure {
  position: relative;
  margin-top: 1rem;
  margin-bottom: -3rem; /* slik at knappene overlapper litt */
  z-index: 1;
}

.front-figure img {
  width: 80%;
  max-width: 500px;
  opacity: 0.35;          /* dus */
  filter: brightness(1.1);
}

/* Flytt knappene litt opp, slik at de overlapper bildet */
.mattematch-container .optionGrid {
  position: relative;
  z-index: 2;
  margin-top: 1rem; /* overlapper figuren litt */
}

/* Juster topptekst */
.mattematch-container #app h2 {
  position: relative;
  z-index: 2;
  margin-top: -5rem;
}


/* =========================================================================
   📱  MOBIL / SMÅ SKJERMER (≤600px) — ALLE TILPASNINGER HER
   ========================================================================= */
@media (max-width: 600px) {

  /* Gridgenerelt (små/mellom/store) */
  .grid.small  { grid-template-columns: repeat(5, 1fr);  gap: 0.3rem;  padding: 0.3rem; }
  .grid.medium { grid-template-columns: repeat(10, 1fr); gap: 0.25rem; padding: 0.25rem; }
  .grid.large  { grid-template-columns: repeat(12, 1fr); gap: 0.1rem; }
  .grid .cell  { aspect-ratio: 1 / 1; border-radius: 7px; font-size: clamp(18px, 4.5vw, 28px); }

  /* Finjustering per data-cols */
  .grid[data-cols="10"], .grid[data-cols="11"], .grid[data-cols="12"] { gap: 0.08rem; }

  /* Forsideknapper */
  .optionGrid .mm-btn {
    font-size: 16px;
    padding: 0.9rem 1.6rem;
    width: 90%;
    max-width: 280px;
  }

  /* "Gå til forsiden" / tilbake-knapper */
  .mattematch-container button.mm-btn[href*="showStart"],
  .mattematch-container button.mm-btn[onclick*="showStart"],
  .mattematch-container .back-btn.mm-btn {
    font-size: 16px;
    padding: 0.9rem 1.8rem;
    width: 85%;
    max-width: 300px;
  }

  /* Gange-tabell valg-grid */
  .mattematch-container .tableButtons {
    grid-template-columns: repeat(2, 1fr); /* 2 kolonner på mobil */
    gap: 0.8rem;
    max-width: 95vw; /* hindrer overflow */
  }
  .mattematch-container .tableBtn {
    width: 100%;
    max-width: 140px;
    height: 70px;
    font-size: 16px;
  }
}

/* Ekstra små (≤480px) */
@media (max-width: 480px) {
  .optionGrid .mm-btn {
    font-size: 16px;
    padding: 0.9rem 1.6rem;
    width: 90%;
    max-width: 280px;
  }
  .mattematch-container button.mm-btn[href*="showStart"],
  .mattematch-container button.mm-btn[onclick*="showStart"],
  .mattematch-container .back-btn.mm-btn {
    font-size: 16px;
    padding: 0.9rem 1.8rem;
    width: 85%;
    max-width: 300px;
  }
}

/* Ekstra små (≤420px) */
@media (max-width: 420px) {
  .grid.large .cell { font-size: clamp(12px, 3vw, 16px); }
}

/* Ekstra små (≤400px) */
@media (max-width: 400px) {
  .mattematch-container .tableButtons { grid-template-columns: 1fr; } /* 1 per rad */
  .mattematch-container .tableBtn { max-width: 220px; height: 65px; font-size: 15px; }
}/* End custom CSS */