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

.np-question {
  margin: 0;
}

.np-machine {
  display: grid;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #ccd5e1;
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(243, 247, 250, 0.92)),
    repeating-linear-gradient(90deg, rgba(33, 48, 67, 0.04) 0, rgba(33, 48, 67, 0.04) 1px, transparent 1px, transparent 16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(19, 34, 53, 0.08);
}

.np-dashboard,
.np-case {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.np-case {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.np-meter,
.np-plate {
  min-width: 0;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(24, 38, 57, 0.06);
}

.np-meter span,
.np-plate span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.2;
}

.np-meter strong,
.np-plate strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: #152033;
  font-size: 14px;
  line-height: 1.25;
}

.np-shaft {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
  border-radius: 8px;
  padding: 10px 8px;
  background: linear-gradient(180deg, #d8e0e8 0, #eef3f7 46%, #c9d3dd 100%);
  box-shadow: inset 0 2px 5px rgba(38, 52, 74, 0.18);
}

.np-gear {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 54px;
  border: 1px solid #8292a8;
  border-radius: 999px;
  padding: 5px 2px;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 23%, transparent 24%),
    conic-gradient(from 10deg, #dfe6ee 0 8%, #9aa8ba 8% 15%, #f8fafc 15% 24%, #aeb9c7 24% 34%, #edf2f7 34% 45%, #8798ad 45% 55%, #f7fafc 55% 67%, #a5b2c1 67% 79%, #e6edf3 79% 90%, #8d9db1 90% 100%);
  color: #152033;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.np-gear::after {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.86), rgba(194, 206, 220, 0.86));
  box-shadow: inset 0 2px 6px rgba(28, 42, 61, 0.24);
}

.np-gear-value {
  display: block;
  color: #111827;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.np-gear-index {
  display: block;
  margin-top: 3px;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.np-gear.np-armed {
  border-color: #b7791f;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 0 8px 14px rgba(80, 57, 19, 0.12);
}

.np-gear.np-pivot {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.24), 0 8px 14px rgba(15, 118, 110, 0.16);
}

.np-gear.np-suffix {
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 23%, transparent 24%),
    conic-gradient(from 10deg, #e8eff7 0 8%, #93a7bd 8% 15%, #ffffff 15% 24%, #a9c5df 24% 34%, #edf7ff 34% 45%, #7f9bb5 45% 55%, #f8fbff 55% 67%, #b2c6d9 67% 79%, #e9f2fa 79% 90%, #8ea6bb 90% 100%);
}

.np-gear.np-swap {
  border-color: #2563eb;
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22), 0 8px 14px rgba(37, 99, 235, 0.16);
}

.np-gear.np-swapped {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16), 0 8px 14px rgba(37, 99, 235, 0.12);
}

.np-gear.np-sorted {
  border-color: #147d4f;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 23%, transparent 24%),
    conic-gradient(from 10deg, #e6f6ee 0 8%, #74a98d 8% 15%, #ffffff 15% 24%, #90c9a7 24% 34%, #eefaf3 34% 45%, #5f9a7a 45% 55%, #f8fffb 55% 67%, #9fcfb3 67% 79%, #e8f8ef 79% 90%, #6fa583 90% 100%);
}

.np-tooth-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.np-tooth {
  min-width: 0;
  min-height: 48px;
  border: 1px solid #cad4e2;
  border-radius: 8px;
  padding: 6px 3px;
  background: linear-gradient(180deg, #ffffff, #eef3f8);
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 -1px 0 rgba(30, 41, 59, 0.08);
}

.np-tooth span {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.np-tooth.np-next {
  border-color: #b7791f;
  background: #fff7ed;
  color: #92400e;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.np-tooth.np-drop {
  border-color: #64748b;
  background: #edf2f7;
  color: #475467;
}

.np-tooth.np-rise {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #0f766e;
}

.np-suffix-panel,
.np-status {
  min-height: 48px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: #344054;
  font-size: 14px;
  line-height: 1.45;
}

.np-status.good {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #0f514b;
}

.np-status.warn {
  border-color: #b45309;
  background: #fff7ed;
  color: #8a3b07;
}

.np-lever {
  min-height: 52px;
  border: 1px solid #aab7c7;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(180deg, #f8fafc, #dbe4ee);
  color: #243247;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 7px 12px rgba(30, 41, 59, 0.1);
}

.np-lever.np-ready {
  border-color: #0f766e;
  background: linear-gradient(180deg, #f0fdfa, #b8eee5);
  color: #0f514b;
}

.np-wrong {
  animation: np-shake 0.36s ease;
  border-color: #b42318 !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16) !important;
}

.np-busy .np-gear.np-pivot,
.np-busy .np-gear.np-swap {
  animation: np-turn 0.52s ease-in-out;
}

.np-reversing .np-gear.np-suffix {
  animation: np-lift 0.62s ease-in-out;
}

@keyframes np-turn {
  0% { transform: rotate(0deg) scale(1); }
  45% { transform: rotate(28deg) scale(1.08); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes np-lift {
  0% { transform: translateY(0); }
  45% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

@keyframes np-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

@media (max-width: 520px) {
  .np-machine {
    padding: 8px;
    gap: 10px;
  }

  .np-dashboard {
    grid-template-columns: 1fr;
  }

  .np-case {
    grid-template-columns: 1fr;
  }

  .np-shaft {
    gap: 2px;
    padding: 8px 4px;
  }

  .np-gear {
    min-height: 50px;
  }

  .np-gear-value {
    font-size: 18px;
  }

  .np-gear-index {
    font-size: 9px;
  }

  .np-tooth-row {
    gap: 5px;
  }

  .np-tooth {
    min-height: 46px;
    font-size: 11px;
  }
}
