/* Styles spécifiques pour Table de Multiplication Wiki */
:root {
  --mult-bg: #fffdfa;
  --mult-accent: #ff8fca;
  --mult-accent-dark: #e865aa;
  --mult-gold: #ffd45f;
  --mult-green: #4edfa6;
  --mult-blue: #79dfff;
  --mult-purple: #9a80ff;
}

/* Selector buttons */
.table-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.table-chip {
  appearance: none;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 850;
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .18s var(--bounce), box-shadow .18s var(--bounce), background-color .15s ease;
}

.table-chip:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--line);
  background: var(--sun);
}

.table-chip.active {
  background: var(--violet);
  color: #fff;
  border-color: var(--line);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 3px 3px 0 var(--line);
  transform: translateY(-1px);
}

.table-chip.mix-chip {
  background: var(--sun);
  color: var(--ink);
  font-weight: 950;
}

.table-chip.mix-chip.active {
  background: var(--mint);
  color: #10281c;
}

/* Tool Interactive Layout */
.trainer-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: stretch;
  width: 100%;
}

@media (max-width: 860px) {
  .trainer-wrapper {
    grid-template-columns: 1fr;
  }
}

.memo-column {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memo-head {
  padding: 14px 18px;
  background: var(--wash);
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.memo-head strong {
  font-size: 16px;
  font-weight: 950;
  color: var(--ink);
}

.memo-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
}

.memo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 850;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(55, 39, 51, 0.12);
  transition: transform .15s ease, background .15s ease;
}

.memo-row:hover {
  background: var(--cream);
  transform: translateX(3px);
}

.memo-row .calc-res {
  color: var(--violet);
  font-size: 16px;
}

.quiz-column {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 440px;
}

.mode-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px dashed rgba(55, 39, 51, 0.16);
}

.mode-btn {
  appearance: none;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 850;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
}

.mode-btn:hover {
  background: var(--wash);
  transform: translateY(-1px);
}

.mode-btn.active {
  background: var(--sun);
  box-shadow: 2px 2px 0 var(--line);
}

.quiz-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 16px;
}

.quiz-badge {
  background: var(--wash);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.quiz-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0 24px;
  text-align: center;
}

.math-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 36px;
  background: linear-gradient(135deg, #fff7d6, #eafff6);
  border: 3px solid var(--line);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--line);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 950;
  font-family: var(--mono);
  color: var(--ink);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.input-area {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.calc-input {
  width: 130px;
  height: 52px;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 950;
  text-align: center;
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(55,39,51,0.12);
  outline: none;
}

.calc-input:focus {
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--violet);
}

.mcq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 16px;
}

.mcq-btn {
  appearance: none;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 950;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
  transition: transform .15s ease, background .15s ease;
}

.mcq-btn:hover {
  background: var(--cream);
  transform: translateY(-2px);
}

.feedback-msg {
  min-height: 32px;
  font-size: 16px;
  font-weight: 900;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-msg.correct {
  color: #0d8050;
}

.feedback-msg.incorrect {
  color: #d12c2c;
}

/* Touch keypad for mobile */
.keypad {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 480px;
  margin: 18px auto 0;
  width: 100%;
}

.key-btn {
  appearance: none;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 900;
  padding: 10px 4px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--line);
  cursor: pointer;
  text-align: center;
}

.key-btn:hover {
  background: var(--wash);
}

.key-btn.action-key {
  grid-column: span 2;
  font-size: 13px;
  background: var(--soft);
}

.progress-strip {
  width: 100%;
  height: 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  margin-top: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sun), var(--mint));
  transition: width .25s ease;
  width: 0%;
}

/* Table de Pythagore Section */
.pythagore-wrapper {
  overflow-x: auto;
  padding: 10px 0;
}

.pythagore-grid {
  border-collapse: separate;
  border-spacing: 4px;
  margin: 0 auto;
  font-family: var(--mono);
  text-align: center;
}

.pythagore-grid th, .pythagore-grid td {
  width: 48px;
  height: 48px;
  min-width: 44px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 850;
  vertical-align: middle;
  transition: all .15s ease;
  user-select: none;
}

.pythagore-grid th {
  background: var(--sun);
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.pythagore-grid td {
  background: #fff;
  cursor: pointer;
}

.pythagore-grid td:hover {
  background: var(--pink) !important;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 3px 3px 0 var(--line);
  z-index: 10;
  position: relative;
}

.pythagore-grid td.diagonal {
  background: #fff0b8;
  font-weight: 950;
  border-color: #d8a64e;
}

.pythagore-grid td.highlight {
  background: #f0e9ff;
}

.pythagore-grid th.highlight {
  background: var(--violet);
  color: #fff;
}

/* Fiches and Diploma Cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.resource-card {
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: 24px;
  box-shadow: 4px 4px 0 var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform .2s var(--bounce), box-shadow .2s ease;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 7px 7px 0 var(--line);
}

.resource-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.resource-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}
