/* Logic Deduction — sub-game styles
 * Spec:
 *   docs/PRD.md §11.2.4 (aspect-ratio: 1/1 letterbox)
 *   docs/Visual-Guidelines.md §5 (touch lockout rules)
 *   docs/Constraints.md (44x44px targets, no zoom, no user-select)
 *   Visual-Guidelines.md §2.2 (Logic Accent: Purple Logic hsl(270, 100%, 65%))
 */

* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: hsl(222, 24%, 7%);
  color: hsl(210, 40%, 98%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  overflow: hidden;
}

.ld-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ld-stage {
  width: min(100%, 600px);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: hsl(223, 20%, 12%);
  border: 1px solid hsl(223, 14%, 20%);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ld-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ld-status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
}

.ld-status {
  font-size: 1rem;
  font-weight: 500;
  color: hsl(210, 40%, 98%);
  text-align: center;
}

.ld-score-row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: hsl(215, 15%, 70%);
}

.ld-timer-track {
  width: 100%;
  height: 4px;
  background: hsl(223, 14%, 20%);
  border-radius: 2px;
  overflow: hidden;
}

.ld-timer-bar {
  height: 100%;
  width: 100%;
  background: hsl(270, 100%, 65%);
  box-shadow: 0 0 8px hsl(270, 100%, 65%);
  transform-origin: left;
  transition: transform 0.1s linear;
}

.ld-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  background: hsl(222, 24%, 6%);
  border: 1px solid hsl(223, 14%, 15%);
  border-radius: 8px;
  padding: 1.25rem;
}

.ld-question-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.ld-question-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: hsl(270, 100%, 65%);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
  letter-spacing: 0.05em;
  text-align: center;
}

.ld-relations {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 280px;
  min-height: 150px;
  justify-content: center;
}

.ld-relation-card {
  background: hsl(223, 20%, 12%);
  border: 1px solid hsl(223, 14%, 20%);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: hsl(210, 40%, 98%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.ld-placeholder {
  color: hsl(215, 15%, 40%);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
}

.ld-choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.ld-choice-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(210, 40%, 98%);
  background: hsl(223, 20%, 12%);
  border: 1px solid hsl(223, 14%, 20%);
  border-radius: 6px;
  min-width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease-out;
  touch-action: none;
}

.ld-choice-btn:focus-visible {
  outline: 2px dashed hsl(270, 100%, 65%);
  outline-offset: 2px;
}

@media (hover: hover) {
  .ld-choice-btn:hover:not(:disabled) {
    border-color: hsl(270, 100%, 65%);
    background: hsl(270, 100%, 8%, 0.3);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
  }
}

.ld-choice-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ld-choice-btn--correct {
  background: hsl(145, 100%, 10%) !important;
  border-color: hsl(145, 100%, 50%) !important;
  color: hsl(145, 100%, 50%) !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3) !important;
  text-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}

.ld-choice-btn--wrong {
  background: hsl(355, 100%, 10%) !important;
  border-color: hsl(355, 100%, 60%) !important;
  color: hsl(355, 100%, 60%) !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
  text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

.ld-controls {
  display: flex;
  gap: 0.5rem;
}

.ld-btn {
  flex: 1;
  height: 44px;
  min-width: 44px;
  background: transparent;
  border: 1px solid hsl(223, 14%, 20%);
  border-radius: 6px;
  color: hsl(215, 15%, 70%);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ld-btn:focus-visible {
  outline: 2px dashed hsl(270, 100%, 65%);
  outline-offset: 2px;
}

.ld-btn--primary {
  background: hsl(270, 100%, 12%);
  border-color: hsl(270, 100%, 65%);
  color: hsl(210, 40%, 98%);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

@media (hover: hover) {
  .ld-btn:hover:not(:disabled) {
    border-color: hsl(210, 40%, 98%);
    color: hsl(210, 40%, 98%);
  }
  .ld-btn--primary:hover:not(:disabled) {
    border-color: hsl(270, 100%, 55%);
    background: hsl(270, 100%, 15%);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
  }
}

.ld-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ld-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
