:root {
  --ink: #1b1712;
  --paper: #f2ede1;
  --accent: #c94f2a;
  --panel: #26211a;
  --good: #3f8c4c;
  --bad: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--ink);
  color: var(--paper);
}

.screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.hidden { display: none !important; }

#room-scene-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 4px solid var(--accent);
  border-radius: 4px;
  background: #3a3128 center/cover no-repeat;
}

#room-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

#room-meta span {
  margin-left: 12px;
  font-weight: bold;
}

/* 手機直向（預設）：單欄堆疊 */
#room-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#question-box {
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 16px;
}

#question-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 1px solid var(--ink);
  border-radius: 4px;
}

#question-options button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  padding: 14px 14px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05em;
}

#question-options button.correct { background: #d7f0d7; border-color: var(--good); }
#question-options button.wrong { background: #f0d7d7; border-color: var(--bad); }
#question-options button:disabled { cursor: default; opacity: 0.85; }

#hint-btn, #start-btn, #retry-btn, #reflection-continue-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05em;
  margin-top: 10px;
}

#feedback { min-height: 1.4em; font-weight: bold; }

#door-animation {
  display: flex;
  height: 180px;
  margin: 20px 0;
  overflow: hidden;
  border: 4px solid var(--accent);
}
#door-left, #door-right {
  flex: 1;
  background: #2f261c;
  transition: transform 2s ease-in-out;
}
#door-animation.open #door-left { transform: translateX(-100%); }
#door-animation.open #door-right { transform: translateX(100%); }

textarea { width: 100%; padding: 10px; font-size: 1.05em; }

/* 電腦/平板橫向：寬螢幕時場景圖與題目並列，資訊密度提高 */
@media (min-width: 900px) {
  #room-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  #room-visual {
    flex: 0 0 42%;
    position: sticky;
    top: 20px;
  }
  #room-scene-img {
    max-height: 480px;
  }
  #question-box {
    flex: 1;
    padding: 24px;
  }
  #room-meta {
    font-size: 1.1em;
  }
  #question-options button {
    font-size: 1em;
    padding: 12px 16px;
  }
}
