.nssq {
  position: absolute;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 236, 179, 0.18), transparent 62%),
    rgba(8, 16, 28, 0.42);
  font-family: ComfortaaOkul, Comfortaa, "Segoe UI", sans-serif;
  pointer-events: auto;
}
.nssq.is-intro .nssq-tile,
.nssq.is-intro .nssq-listen {
  pointer-events: none;
  cursor: default;
}
.nssq.is-intro .nssq-tile {
  filter: saturate(0.92);
}
.nssq-shell {
  flex: 0 0 auto;
  overflow: hidden;
  line-height: 0;
}
.nssq-board {
  width: min(640px, calc(100vw - 12px));
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 16px 18px 18px;
  border-radius: 28px;
  color: #3b2410;
  text-align: center;
  line-height: normal;
  background:
    linear-gradient(180deg, #fff8e7 0%, #f6e2b8 42%, #efd09a 100%);
  border: 4px solid #c47a2b;
  box-shadow:
    0 18px 0 #8a4b16,
    0 28px 40px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 #fff3c4;
  transform-origin: top left;
  animation: nssq-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes nssq-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.nssq-kicker {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b45309;
}
.nssq-title {
  margin: 0 0 10px;
  font-size: clamp(20px, 3.2vw, 30px);
  letter-spacing: -0.03em;
  color: #5b2c0a;
  text-shadow: 0 1px 0 #fff6d6;
}
.nssq-listen {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 14px;
  padding: 10px 18px 10px 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #1e3a5f;
  background: linear-gradient(180deg, #9ae6ff, #38bdf8);
  box-shadow: 0 6px 0 #0284c7, 0 10px 16px rgba(14, 116, 144, 0.35);
  font-weight: 800;
}
.nssq-listen strong {
  font-size: 16px;
}
.nssq-listen-wave {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #fff;
  box-shadow: inset 0 0 0 3px #bae6fd;
}
.nssq-listen-wave i {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: #0284c7;
  animation: nssq-eq 0.9s ease-in-out infinite;
}
.nssq-listen-wave i:nth-child(1) { height: 10px; animation-delay: 0s; }
.nssq-listen-wave i:nth-child(2) { height: 18px; animation-delay: 0.12s; }
.nssq-listen-wave i:nth-child(3) { height: 12px; animation-delay: 0.24s; }
.nssq-listen.is-pulse .nssq-listen-wave i {
  animation-duration: 0.45s;
}
@keyframes nssq-eq {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}
.nssq-listen:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0284c7;
}
.nssq-choices {
  display: grid;
  gap: 12px;
}
.nssq-choices--words,
.nssq-choices--photos {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.nssq-word {
  min-height: 64px;
  border: 3px solid #f59e0b;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fff7ed);
  color: #9a3412;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 0 #d97706;
}
.nssq-word:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #d97706;
}
.nssq-photo {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nssq-photo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  padding: 8px;
  background: linear-gradient(180deg, #fff, #fde68a);
  box-shadow: 0 8px 0 #c2410c, 0 14px 18px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  min-height: 0;
}
.nssq-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(42vh, 240px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
  background: #fff8e7;
}
.nssq-photo:active .nssq-photo-frame {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #c2410c;
}
.nssq-word.is-ok,
.nssq-photo.is-ok .nssq-photo-frame {
  box-shadow: 0 0 0 4px #22c55e, 0 8px 0 #15803d;
}
.nssq-word.is-bad,
.nssq-photo.is-bad .nssq-photo-frame {
  box-shadow: 0 0 0 4px #f43f5e, 0 8px 0 #be123c;
}
.nssq-nests,
.nssq-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.nssq-nests {
  min-height: 88px;
  margin: 4px 0 16px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(120, 53, 15, 0.12);
  border: 3px dashed rgba(180, 83, 9, 0.35);
}
.nssq-nest,
.nssq-tile,
.nssq-tile-ph {
  box-sizing: border-box;
  width: 96px;
  height: 80px;
}
.nssq-nest {
  position: relative;
  overflow: visible;
  padding: 0;
  border-radius: 18px;
  border: 3px dashed #d97706;
  background: rgba(255, 247, 230, 0.55);
}
.nssq-nest.is-hover {
  background: rgba(253, 224, 71, 0.55);
  border-style: solid;
}
.nssq-nest.is-filled {
  border-color: transparent;
  background: transparent;
}
.nssq-nests.is-ok .nssq-nest {
  border-color: transparent;
}
.nssq-nests.is-bad .nssq-nest {
  border-color: transparent;
}
.nssq-nests.is-ok .nssq-nest .nssq-tile {
  box-shadow: 0 0 0 3px #22c55e;
}
.nssq-nests.is-bad .nssq-nest .nssq-tile {
  box-shadow: 0 0 0 3px #f43f5e;
}
.nssq-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  cursor: grab;
  touch-action: none;
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  box-shadow: 0 6px 0 #075985;
  user-select: none;
  -webkit-user-select: none;
}
.nssq-tile-ph {
  flex: 0 0 96px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
}
.nssq-tile.is-dragging {
  margin: 0;
  cursor: grabbing;
}
.nssq-nest .nssq-tile {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 18px;
  box-shadow: none;
  transform: none;
}
.nssq-board--wide .nssq-nest,
.nssq-board--wide .nssq-tile,
.nssq-board--wide .nssq-tile-ph {
  width: 120px;
  min-width: 120px;
  height: 80px;
}
.nssq-board--wide .nssq-nest {
  padding: 0;
}
.nssq-board--wide .nssq-tile-ph {
  flex-basis: 120px;
}
.nssq-board--wide .nssq-tile {
  font-size: 18px;
}
.nssq.is-ok .nssq-board {
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.55), 0 18px 0 #8a4b16;
}
.nssq.is-bad .nssq-board {
  animation: nssq-shake 0.42s ease;
}
@keyframes nssq-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  75% { transform: translateX(9px); }
}
@media (max-width: 700px) {
  .nssq-photo img {
    max-height: min(34vh, 180px);
  }
  .nssq-nest,
  .nssq-tile,
  .nssq-tile-ph {
    width: 76px;
    min-width: 76px;
    height: 68px;
    font-size: 18px;
  }
  .nssq-tile-ph {
    flex-basis: 76px;
  }
}
@media (max-width: 520px) {
  .nssq-choices--words,
  .nssq-choices--photos {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .nssq-title {
    font-size: 18px;
  }
}
@media (max-height: 480px) {
  .nssq { padding: 4px; }
  .nssq-board { padding: 8px 10px 10px; border-radius: 20px; }
  .nssq-photo img { max-height: min(26vh, 120px); }
  .nssq-title { font-size: 16px; }
  .nssq-word { min-height: 48px; font-size: 16px; }
}
