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

.prod-brief,
.prod-status,
.prod-formula {
  min-width: 0;
  border: 1px solid #d2dbe7;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.prod-brief {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: #f8fafc;
}

.prod-brief span {
  min-height: 30px;
  border-radius: 999px;
  background: #17202a;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.prod-brief strong {
  min-width: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.prod-workshop {
  display: grid;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 249, 0.94)),
    repeating-linear-gradient(90deg, rgba(20, 31, 50, 0.05) 0, rgba(20, 31, 50, 0.05) 1px, transparent 1px, transparent 18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(20, 31, 50, 0.08);
}

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

.prod-stat {
  min-width: 0;
  border: 1px solid #d7dfeb;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
  box-shadow: 0 8px 18px rgba(20, 31, 50, 0.05);
}

.prod-stat span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.prod-stat strong {
  display: block;
  min-height: 24px;
  margin-top: 3px;
  color: #17202a;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.prod-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.prod-rule span {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #f4b183;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.prod-rule strong {
  min-width: 0;
  border: 1px solid #b7d7ce;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f514b;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.prod-array {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.prod-cell {
  position: relative;
  min-width: 0;
  min-height: 150px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto auto minmax(46px, 1fr);
  gap: 8px;
  background: linear-gradient(180deg, #ffffff, #f6f8fb);
  color: #17202a;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(20, 31, 50, 0.06);
}

.prod-cell-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.prod-cell-head span {
  min-width: 0;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.prod-cell-head strong {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #17202a;
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
}

.prod-pass-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
}

.prod-pass {
  min-width: 0;
  min-height: 42px;
  border: 1px dashed #aab7c7;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 5px 3px;
  background: #fbfcfe;
}

.prod-pass span {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.prod-pass strong {
  color: #344054;
  font-size: 15px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.prod-answer {
  min-width: 0;
  min-height: 48px;
  border: 1px solid #d7dfeb;
  border-radius: 8px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 6px 4px;
  background: #eef2f6;
}

.prod-answer span {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.prod-answer strong {
  margin-top: 3px;
  color: #17202a;
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.prod-has-left .prod-pass-left {
  border-style: solid;
  border-color: #2563eb;
  background: #eff6ff;
}

.prod-has-left .prod-pass-left strong {
  color: #1d4ed8;
}

.prod-has-right .prod-pass-right {
  border-style: solid;
  border-color: #d97706;
  background: #fff7ed;
}

.prod-has-right .prod-pass-right strong {
  color: #b45309;
}

.prod-has-right .prod-answer {
  border-color: #0f766e;
  background: #d7f4ef;
}

.prod-active-left {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), inset 0 -1px 0 rgba(20, 31, 50, 0.06);
}

.prod-active-right {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18), inset 0 -1px 0 rgba(20, 31, 50, 0.06);
}

.prod-finished {
  border-color: #0f766e;
}

.prod-runner {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(20, 31, 50, 0.18);
  pointer-events: none;
}

.prod-runner-left {
  background: #2563eb;
}

.prod-runner-right {
  background: #d97706;
}

.prod-pulse-left {
  animation: prod-stamp-left 0.5s ease;
}

.prod-pulse-right {
  animation: prod-stamp-right 0.5s ease;
}

.prod-formula {
  min-height: 48px;
  background: #fbfcfe;
}

.prod-status {
  min-height: 54px;
}

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

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

.prod-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(88px, 0.55fr) minmax(88px, 0.55fr);
  gap: 8px;
}

.prod-sweep,
.prod-tool {
  min-width: 0;
  min-height: 48px;
  border: 1px solid #aab7c7;
  border-radius: 8px;
  padding: 9px 10px;
  color: #17202a;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 7px 12px rgba(20, 31, 50, 0.08);
}

.prod-sweep:active,
.prod-tool:active {
  transform: scale(0.98);
}

.prod-sweep-left {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #cfe0ff);
  color: #1d4ed8;
}

.prod-sweep-right {
  border-color: #d97706;
  background: linear-gradient(180deg, #fff7ed, #fed7aa);
  color: #9a3412;
}

.prod-tool {
  background: linear-gradient(180deg, #ffffff, #e7edf5);
}

.prod-tool-primary {
  border-color: #0f766e;
  background: linear-gradient(180deg, #f0fdfa, #b8eee5);
  color: #0f514b;
}

.prod-inactive {
  opacity: 0.58;
}

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

@keyframes prod-stamp-left {
  0% { transform: translateX(-10px) scale(0.98); }
  45% { transform: translateX(0) scale(1.04); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes prod-stamp-right {
  0% { transform: translateX(10px) scale(0.98); }
  45% { transform: translateX(0) scale(1.04); }
  100% { transform: translateX(0) scale(1); }
}

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

@media (max-width: 620px) {
  .prod-brief {
    grid-template-columns: 1fr;
  }

  .prod-workshop {
    padding: 10px;
  }

  .prod-dashboard {
    gap: 6px;
  }

  .prod-stat {
    padding: 8px 7px;
  }

  .prod-stat strong {
    font-size: 17px;
  }

  .prod-rule {
    grid-template-columns: 1fr;
  }

  .prod-array {
    gap: 5px;
  }

  .prod-cell {
    min-height: 138px;
    padding: 6px 5px;
    gap: 6px;
  }

  .prod-cell-head strong {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 16px;
  }

  .prod-pass-row {
    gap: 4px;
  }

  .prod-pass {
    min-height: 38px;
    padding: 4px 2px;
  }

  .prod-pass strong {
    font-size: 14px;
  }

  .prod-answer {
    min-height: 44px;
  }

  .prod-answer strong {
    font-size: 18px;
  }

  .prod-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .prod-workshop {
    padding: 8px;
  }

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

  .prod-cell {
    min-height: 132px;
    padding: 6px 4px;
  }

  .prod-cell-head span,
  .prod-answer span {
    font-size: 10px;
  }

  .prod-pass span {
    font-size: 9px;
  }
}
