/* === Problem Screen === */

#screen-problem {
  background: rgba(13,10,6,.95);
  align-items: center;
  justify-content: center;
  z-index: 60;
  backdrop-filter: blur(6px);
}

.problem-container {
  max-width: 860px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2em;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,.7);
}

/* Header */
.problem-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8em;
}

.problem-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.problem-week {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.problem-op {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--amber2);
}

.problem-topic {
  font-size: 0.95rem;
  color: var(--parch2);
  opacity: 0.6;
}

/* Ptoughneigh's text */
.problem-pt {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parch2);
  padding: 0.8em 1em;
  margin-bottom: 1.2em;
  background: rgba(200,144,58,.04);
  border-left: 3px solid var(--amber-dim);
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}

/* Interactive scene area */
.problem-scene {
  margin-bottom: 1.2em;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.problem-scene svg {
  width: 100%;
  height: auto;
  display: block;
}

.problem-scene-placeholder {
  padding: 1.5em;
  text-align: center;
  font-style: italic;
  color: var(--parch2);
  opacity: 0.5;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.problem-scene-placeholder .scene-desc {
  font-size: 0.9rem;
  max-width: 500px;
  line-height: 1.5;
  opacity: 0.7;
}

.problem-scene-placeholder .scene-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--amber-dim);
}

/* Question */
.problem-question {
  font-size: 1.15rem;
  color: var(--parch);
  line-height: 1.7;
  margin-bottom: 1.2em;
  white-space: pre-line;
}

/* Choices (shown as reference) */
.problem-choices {
  margin-bottom: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.problem-choice {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.8em;
  background: rgba(200,144,58,.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.problem-choice:hover {
  background: rgba(200,144,58,.1);
  border-color: var(--border2);
}

.problem-choice.selected {
  background: rgba(200,144,58,.15);
  border-color: var(--amber);
}

.problem-choice.correct-reveal {
  background: rgba(64,128,64,.2);
  border-color: #60a060;
}

.problem-choice.incorrect-reveal {
  background: rgba(160,64,64,.15);
  border-color: #a04040;
}

.choice-letter {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--amber);
  min-width: 1.5em;
  text-align: center;
}

.choice-text {
  color: var(--parch2);
}

/* Answer input */
.problem-answer {
  display: flex;
  gap: 0.8em;
  align-items: center;
  margin-bottom: 1em;
}

.problem-answer input {
  flex: 1;
  max-width: 400px;
  padding: 0.6em 1em;
  font-family: var(--serif);
  font-size: 1rem;
  background: var(--bg);
  color: var(--parch);
  border: 1px solid var(--border2);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s;
}

.problem-answer input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 8px rgba(200,144,58,.15);
}

.problem-answer input::placeholder {
  color: rgba(242,232,208,.25);
  font-style: italic;
}

.btn-submit {
  font-family: var(--display);
  font-size: 0.9rem;
  padding: 0.55em 1.4em;
  background: linear-gradient(180deg, var(--amber) 0%, var(--glow) 100%);
  color: var(--bg);
  border: 1px solid var(--amber2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.btn-submit:hover {
  background: linear-gradient(180deg, var(--amber2) 0%, var(--amber) 100%);
  box-shadow: 0 0 12px rgba(200,144,58,.3);
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Strike pips */
.problem-strikes {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-bottom: 1em;
}

.strike-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber-dim);
  margin-right: 0.3em;
}

.strike-pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent;
  transition: all 0.3s;
}

.strike-pip.filled {
  background: #a04040;
  border-color: #cc5050;
  box-shadow: 0 0 6px rgba(160,64,64,.4);
}

/* Hint area */
.problem-hint {
  padding: 0.8em 1em;
  margin-bottom: 1em;
  background: rgba(200,144,58,.06);
  border-left: 3px solid var(--amber);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--parch2);
  font-size: 1rem;
  line-height: 1.6;
  animation: fade-in 0.4s ease;
  display: none;
}

.problem-hint.visible {
  display: block;
}

/* Explosion area */
.problem-explosion {
  padding: 1em;
  margin-bottom: 1em;
  background: rgba(160,64,64,.1);
  border: 1px solid rgba(160,64,64,.3);
  border-radius: 4px;
  font-style: italic;
  color: var(--parch2);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-line;
  animation: fade-in 0.4s ease;
  display: none;
}

.problem-explosion.visible {
  display: block;
}

/* Result area */
.problem-result {
  padding: 1em;
  margin-bottom: 1em;
  background: rgba(64,128,64,.1);
  border: 1px solid rgba(64,128,64,.3);
  border-radius: 4px;
  color: var(--parch);
  font-size: 1.05rem;
  line-height: 1.6;
  animation: fade-in 0.4s ease;
  display: none;
}

.problem-result.visible {
  display: block;
}

/* Action buttons */
.problem-actions {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
  margin-top: 1em;
}

.problem-actions .btn-parchment {
  font-size: 0.95rem;
  padding: 0.5em 1.2em;
}

.btn-reveal {
  background: linear-gradient(180deg, #5a2020 0%, #3a1010 100%) !important;
  border-color: rgba(160,64,64,.4) !important;
  color: rgba(242,232,208,.7) !important;
}

.btn-reveal:hover {
  background: linear-gradient(180deg, #7a3030 0%, #5a2020 100%) !important;
  border-color: rgba(160,64,64,.6) !important;
  color: var(--parch) !important;
}

/* Feedback flash */
.feedback-correct {
  animation: flash-correct 0.6s ease;
}

.feedback-incorrect {
  animation: flash-incorrect 0.4s ease;
}

@keyframes flash-correct {
  0% { box-shadow: 0 0 0 rgba(64,128,64,0); }
  50% { box-shadow: 0 0 30px rgba(64,128,64,.4); }
  100% { box-shadow: 0 0 0 rgba(64,128,64,0); }
}

@keyframes flash-incorrect {
  0%, 100% { border-color: var(--border2); }
  50% { border-color: #a04040; }
}
