/* Intégration du Sprint Mental avec le style principal du site */
#sprint-mental-section {
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

#btn-quitter-sm {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  z-index: 100;
  transition: all 0.2s;
}

#btn-quitter-sm:hover {
  background: var(--line);
}

.sm-machine {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  position: relative;
  font-family: inherit;
  color: var(--ink);
}

.sm-pad {
  padding: 40px;
}

/* En-tête */
.sm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sm-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -.02em;
  line-height: 1;
}

.sm-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: .05em;
}

.sm-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Écran d'accueil */
.sm-levels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.sm-lvl {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
}

.sm-lvl:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--line);
}

.sm-lvl:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--line);
}

.sm-lvl[data-c="1"]:hover { border-color: var(--green, #27ae60); box-shadow: 0 6px 0 var(--green, #27ae60); }
.sm-lvl[data-c="2"]:hover { border-color: var(--blue, #3b82f6); box-shadow: 0 6px 0 var(--blue, #3b82f6); }
.sm-lvl[data-c="3"]:hover { border-color: var(--accent); box-shadow: 0 6px 0 var(--accent); }
.sm-lvl[data-c="4"]:hover { border-color: var(--red, #e74c3c); box-shadow: 0 6px 0 var(--red, #e74c3c); }

.sm-lvl-num {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
}

.sm-lvl-txt b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.sm-lvl-txt span {
  font-size: 13px;
  color: var(--ink-soft);
}

.sm-lvl[data-c="1"] .sm-lvl-num { background: rgba(39, 174, 96, 0.1); color: var(--green, #27ae60); border-color: var(--green, #27ae60); }
.sm-lvl[data-c="2"] .sm-lvl-num { background: rgba(59, 130, 246, 0.1); color: var(--blue, #3b82f6); border-color: var(--blue, #3b82f6); }
.sm-lvl[data-c="3"] .sm-lvl-num { background: rgba(243, 156, 18, 0.1); color: var(--accent); border-color: var(--accent); }
.sm-lvl[data-c="4"] .sm-lvl-num { background: rgba(231, 76, 60, 0.1); color: var(--red, #e74c3c); border-color: var(--red, #e74c3c); }

.sm-best {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
}

.sm-best b {
  color: var(--ink);
}

/* Écran de jeu */
.sm-game {
  display: none;
}

.sm-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sm-stat {
  text-align: center;
}

.sm-stat .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  font-weight: 600;
}

.sm-stat .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.sm-timerwrap {
  flex: 1;
  margin: 0 20px;
}

.sm-timerbar {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.sm-timerfill {
  height: 100%;
  width: 100%;
  background: var(--green, #27ae60);
  transition: width 1s linear, background .3s;
}

.sm-question {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 48px;
  text-align: center;
  margin: 30px 0 20px;
  letter-spacing: -.01em;
  min-height: 60px;
}

.sm-combo {
  text-align: center;
  height: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  transition: opacity .2s;
}

.sm-combo.show {
  opacity: 1;
}

.sm-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.sm-opt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  padding: 24px 0;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease, background .2s ease;
  color: var(--ink);
}

.sm-opt:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--line);
  background: #ffffff;
}

.sm-opt:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--line);
}

.sm-opt.good {
  background: var(--green, #27ae60) !important;
  color: #fff !important;
  border-color: var(--green, #27ae60) !important;
  box-shadow: 0 6px 0 #1e6135 !important;
}

.sm-opt.bad {
  background: var(--red, #e74c3c) !important;
  color: #fff !important;
  border-color: var(--red, #e74c3c) !important;
  box-shadow: 0 6px 0 #a33226 !important;
}

.sm-opt:disabled {
  cursor: default;
}

/* Écran de fin */
.sm-end {
  display: none;
  text-align: center;
}

.sm-end .score {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
  margin: 12px 0;
  color: var(--accent);
}

.sm-end .label {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.sm-recap {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 24px 0 32px;
  flex-wrap: wrap;
}

.sm-recap div {
  font-family: 'JetBrains Mono', monospace;
}

.sm-recap .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.sm-recap .v {
  font-size: 24px;
  font-weight: 700;
}

.sm-msg {
  font-family: inherit;
  font-style: italic;
  font-size: 16px;
  margin-bottom: 32px;
  color: var(--ink-soft);
}

.sm-newbest {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  font-family: inherit;
  letter-spacing: .04em;
}

.sm-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 18px;
  width: 100%;
  padding: 18px;
  background: var(--accent);
  color: white;
  border: 2px solid var(--accent);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 6px 0 #9e5f00;
  transition: all .1s ease;
  margin-bottom: 12px;
}

.sm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #9e5f00;
}

.sm-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #9e5f00;
}

.sm-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 var(--line);
}

.sm-btn.ghost:hover {
  background: var(--card);
  box-shadow: 0 8px 0 var(--line);
}

.sm-btn.ghost:active {
  box-shadow: 0 0 0 var(--line);
}

.sm-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  border-radius: var(--r-lg);
}

.sm-flash.g {
  background: rgba(39, 174, 96, .12);
}

.sm-flash.r {
  background: rgba(231, 76, 60, .12);
}

@keyframes sm-fl {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.sm-flash.run {
  animation: sm-fl .35s ease;
}
