* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: "Garamond", "Times New Roman", serif;
  background: #fdfcf9;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  border-bottom: 3px solid goldenrod;
  padding: 16px 0;
  text-align: center;
}

h1 {
  color: #4b0082;
  font-size: 2.6em;
  margin: 0;
}

main {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.card {
  background: #f7f3ff;
  border: 2px solid #4b0082;
  border-radius: 12px;
  padding: 24px;
  width: min(900px, 92vw);
  margin: 0 auto;
  text-align: center;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

/* Question box: fixed height, scrolls internally, text starts from left */
.question {
  font-size: 24px;
  line-height: 1.5;
  height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  color: #2f1a47;
  margin-bottom: 8px;
  word-break: break-word;

  display: block;             /* IMPORTANT: remove flex bottom anchoring */
  text-align: left;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.55);
}

#question-text {
  display: block;
  width: 100%;
}

.message {
  font-size: 18px;
  font-weight: bold;
  color: #4b0082;
  min-height: 24px;
  margin: 8px 0 4px 0;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 18px 0;
}

.answer-card {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#answer-box input {
  padding: 10px;
  font-size: 16px;
  border: 2px solid #4b0082;
  border-radius: 6px;
  flex: 1;
  min-width: 260px;
}

.post-reveal {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

button {
  margin: 5px;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: #4b0082;
  color: white;
  transition: 0.25s ease;
  box-shadow: 0 3px 0 rgba(75,0,130,0.35);
}

button:hover {
  background: goldenrod;
  color: #2f1a47;
}

#speed {
  width: min(520px, 80%);
  margin-top: 8px;
}

#speed-label {
  margin-top: 6px;
  font-weight: bold;
  color: #4b0082;
}

.timer-card { display: none; }

#timer-text {
  font-size: 20px;
  font-weight: bold;
  color: #b22222;
}

.bottombar {
  text-align: center;
  padding: 18px 0;
  background: #f7f3ff;
  border-top: 2px solid #4b0082;
}

.bottombar button {
  font-size: 18px;
  padding: 12px 22px;
}

/* Review screen */
.review-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 18px 0;
}

.review-list {
  text-align: left;
  display: grid;
  gap: 14px;
}

.review-item {
  background: #ffffff;
  border: 1px solid rgba(75,0,130,0.35);
  border-radius: 10px;
  padding: 14px 14px;
}

.review-meta {
  font-weight: bold;
  color: #4b0082;
  margin-bottom: 6px;
}

.review-q {
  color: #2f1a47;
  margin-bottom: 8px;
}

.review-a-label {
  font-weight: bold;
  color: #4b0082;
}

.review-empty {
  text-align: center;
  font-weight: bold;
  color: #4b0082;
}

@media (max-width: 560px) {
  .question { font-size: 20px; height: 140px; }
  #timer-text { font-size: 18px; }
}
