/* layout.css — 各屏幕与组件的结构布局（定位、网格、响应式）
   来源：原站内联 <style>。仅做文件拆分，未改任何取值与行为。 */

/* ── 标题画面 ── */
#titleScreen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(220, 190, 130, .5), transparent 60%),
    var(--parchment);
  text-align: center; padding: 2rem;
}
#titleScreen .subtitle {
  font-size: 1rem; color: var(--ink-soft); letter-spacing: .3em; margin-bottom: 2.5rem;
}

/* ── 游戏主界面 ── */
#gameScreen { display: none; position: fixed; inset: 0; }
#topbar {
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem;
  background: linear-gradient(180deg, rgba(74, 55, 40, .12), transparent);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 10;
}
#topbar .game-title { font-size: 1.05rem; letter-spacing: .25em; color: var(--ember-dark); font-weight: bold; }
#topbar .controls { display: flex; gap: .4rem; }
#main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  height: calc(100% - 52px);
}
@media (max-width: 820px) {
  #main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #sidebar { border-left: none; border-top: 1px solid var(--line); max-height: 34vh; overflow-y: auto; }
}
/* 左侧：故事 */
#storyPane { position: relative; display: flex; flex-direction: column; padding: 1.6rem 2.2rem 1.2rem; overflow: hidden; }
#sceneTitle {
  font-size: 1.25rem; letter-spacing: .2em; color: var(--ember-dark);
  border-bottom: 1px solid var(--line); padding-bottom: .6rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .6rem;
}
#sceneTitle .candle { font-size: 1rem; }
#storyText {
  flex: 1; overflow-y: auto;
  font-size: 1.08rem; line-height: 1.9;
  color: var(--ink);
  padding-right: .6rem;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
#choices {
  margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem;
  padding-top: 1rem; border-top: 1px solid var(--line);
}
#choices .btn { text-align: left; width: 100%; }
#choices .btn .cost { float: right; color: var(--gold); font-size: .85rem; letter-spacing: 0; }
#choices .btn:disabled .cost { color: var(--ink-soft); }
/* 右侧栏 */
#sidebar {
  background: rgba(230, 213, 171, .35);
  border-left: 1px solid var(--line);
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 1rem;
  overflow-y: auto;
}
.panel {
  background: rgba(248, 239, 216, .7);
  border: 1px solid var(--line);
  border-radius: 10px; padding: .9rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.panel h3 {
  font-size: .8rem; letter-spacing: .25em; color: var(--ink-soft);
  border-bottom: 1px dashed var(--line); padding-bottom: .4rem; margin-bottom: .6rem;
}
/* 战斗横幅 */
#battleBanner {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #3a2a1e, var(--night));
  color: #e8d9b8; padding: .8rem 2rem; border-radius: 0 0 12px 12px;
  border: 1px solid var(--gold); border-top: none;
  font-size: 1.05rem; letter-spacing: .15em; z-index: 20;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  display: none; text-align: center;
}
/* 结局覆盖层 */
#endingOverlay {
  position: fixed; inset: 0; z-index: 60;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(60, 45, 30, .92), rgba(20, 16, 12, .97));
  color: #e8d9b8; text-align: center; padding: 3rem;
  overflow-y: auto;
}
#endingOverlay.show { display: flex; }
#endingTitle { font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: .4em; text-indent: .4em; margin-bottom: 1.5rem; }
#endingText { max-width: 640px; line-height: 2; font-size: 1.05rem; margin-bottom: 2rem; }
/* toast 定位 */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--night); color: #e8d9b8;
  padding: .6rem 1.6rem; border-radius: 20px; font-size: .9rem;
  opacity: 0; transition: opacity .4s; pointer-events: none; z-index: 70;
  letter-spacing: .1em;
}
