/* 罗马余烬 ROMA EMBERS —— 界面样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0e130b;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  color: #eadfc3;
  user-select: none;
}

#game { position: fixed; inset: 0; display: block; }

.panel {
  background: rgba(28, 21, 13, 0.88);
  border: 1px solid #b9975b66;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}

/* ---------- 顶栏 ---------- */
#topbar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 7px 16px; font-size: 15px; z-index: 20; white-space: nowrap;
}
#topbar b { color: #ffd98a; font-size: 16px; }
#topbar .sep { width: 1px; height: 18px; background: #b9975b44; }
#topbar .flex1 { flex: 1; }
#clockbar {
  width: 110px; height: 8px; border-radius: 4px; overflow: hidden;
  background: #00000066; border: 1px solid #b9975b44;
}
#clockfill { height: 100%; width: 0%; background: linear-gradient(90deg,#f5c95c,#e07b39); }
#topbar button {
  background: none; border: 1px solid #b9975b66; color: #eadfc3;
  border-radius: 4px; width: 28px; height: 26px; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
#topbar button:hover { background: #b9975b33; }

/* ---------- 标题页难度选择 ---------- */
#diffrow { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.diff {
  font-family: inherit; background: #3a2c1a; color: #cbbd9a;
  border: 1px solid #b9975b66; border-radius: 5px; padding: 7px 20px;
  cursor: pointer; font-size: 14px;
}
.diff:hover { background: #4a3a22; }
.diff.active { background: #b9975b33; color: #ffd98a; border-color: #ffd98a; }

/* ---------- 存档槽 / 设置行 ---------- */
#slotList { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.slotbtn {
  font-family: inherit; font-size: 14px; color: #f5e6c8;
  background: #3a2c1a; border: 1px solid #b9975b88; border-radius: 5px;
  padding: 8px 20px; cursor: pointer; min-width: 260px;
}
.slotbtn:hover { background: #4a3a22; border-color: #ffd98a; }
.settingsRow, .saveMgr { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; }
.saveMgr { flex-direction: column; border-top: 1px solid #b9975b33; padding-top: 10px; }
.slotrow { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #cbbd9a; }
.slotrow span { min-width: 150px; text-align: left; }
.slotrow button {
  font-family: inherit; font-size: 11px; color: #eadfc3;
  background: #3a2c1a; border: 1px solid #b9975b66; border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
}
.slotrow button:hover:not(:disabled) { background: #4a3a22; }
.slotrow button:disabled { opacity: .4; cursor: default; }

/* ---------- 帮助 ---------- */
.helpsec h4 { color: #d8b25f; margin: 12px 0 4px; font-weight: normal; font-size: 15px; }
.helpsec p { color: #cfc3a4; line-height: 1.65; font-size: 13px; }
.helpsec b { color: #eadfc3; }

/* ---------- 目标 ---------- */
#objectives {
  position: fixed; top: 64px; right: 12px; width: 240px;
  padding: 10px 12px; z-index: 20; font-size: 13px;
}
#objectives h3 {
  font-size: 13px; color: #d8b25f; margin-bottom: 7px; font-weight: normal;
  letter-spacing: 2px; border-bottom: 1px solid #b9975b33; padding-bottom: 5px;
}
.obj { padding: 3px 0; color: #cfc3a4; }
.obj.done { color: #8fbf6f; text-decoration: line-through; opacity: .75; }
.obj .mark { margin-right: 6px; }

/* ---------- 信息面板 ---------- */
#infopanel {
  position: fixed; top: 64px; left: 12px; width: 250px;
  padding: 10px 12px; z-index: 20; font-size: 13px;
}
#infopanel h3 { color: #ffd98a; font-size: 15px; margin-bottom: 6px; font-weight: normal; }
#infopanel .desc { color: #bfb295; line-height: 1.5; margin: 6px 0; }
#infopanel .hpbar {
  height: 8px; background: #00000066; border-radius: 4px; overflow: hidden;
  border: 1px solid #b9975b44; margin: 6px 0;
}
#infopanel .hpfill { height: 100%; background: #8fbf6f; }
#infopanel button {
  background: #6e3a2c; color: #f5e6c8; border: 1px solid #b9975b66;
  border-radius: 4px; padding: 5px 10px; cursor: pointer; font-size: 12px;
  font-family: inherit; margin-top: 6px; margin-right: 6px;
}
#infopanel button:hover { background: #8a4a38; }
#infopanel button:disabled { opacity: .45; cursor: default; }
#infopanel .offer { display: block; width: 100%; text-align: left; }
#infopanel .god { color: #d8b25f; }

/* ---------- 建造栏 ---------- */
#buildbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; max-width: 96vw;
  gap: 6px; z-index: 20; padding: 6px;
  background: rgba(28, 21, 13, 0.88);
  border: 1px solid #b9975b66; border-radius: 8px;
}
.btabs { flex-basis: 100%; display: flex; justify-content: center; gap: 4px; margin-bottom: 2px; }
.btab {
  padding: 2px 14px; font-size: 12px; color: #bfae87; cursor: pointer;
  border: 1px solid #b9975b44; border-radius: 10px; user-select: none;
}
.btab:hover { color: #eadfc3; background: #b9975b26; }
.btab.active { color: #1c150d; background: #b9975b; border-color: #ffd98a; }
.bcard {
  width: 76px; padding: 6px 4px 5px; text-align: center; cursor: pointer;
  border: 1px solid transparent; border-radius: 6px; position: relative;
}
.bcard:hover { background: #b9975b26; }
.bcard.active { border-color: #ffd98a; background: #b9975b40; }
.bcard .bicon { font-size: 21px; line-height: 1.2; }
.bcard .bname { font-size: 12px; margin: 2px 0; color: #eadfc3; }
.bcard .bcost { font-size: 11px; color: #bfae87; line-height: 1.35; }
.bcard .bhot {
  position: absolute; top: 2px; left: 4px; font-size: 10px; color: #b9975b99;
}
.bcard.locked { opacity: .45; cursor: default; }
.bcard.poor .bcost { color: #d0705a; }

/* ---------- 主角血条 ---------- */
#herobar {
  position: fixed; bottom: 118px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 14px; z-index: 20;
  background: rgba(28,21,13,.88); border: 1px solid #b9975b66; border-radius: 7px;
  overflow: hidden;
}
#herofill { height: 100%; width: 100%; background: linear-gradient(90deg,#c94f42,#e08a3a); transition: width .15s; }
#herotext {
  position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 14px;
  color: #fff; text-shadow: 0 1px 2px #000;
}
#herobar.hidden { display: none; }

/* ---------- 小地图 ---------- */
#minimap {
  position: fixed; right: 12px; bottom: 12px; z-index: 20;
  image-rendering: pixelated; border-radius: 4px;
}

/* ---------- 提示 / 浮动信息 ---------- */
#hint {
  position: fixed; bottom: 12px; left: 12px; z-index: 20; font-size: 11px;
  color: #a5967a; background: rgba(20,15,9,.6); padding: 5px 9px; border-radius: 4px;
}
#dbg {
  position: fixed; top: 12px; left: 12px; z-index: 40; font-size: 11px; line-height: 1.55;
  color: #b7f5a8; background: rgba(10,14,8,.82); padding: 7px 10px; border-radius: 4px;
  white-space: pre; pointer-events: none; font-family: Consolas, monospace;
}
#toasts {
  position: fixed; top: 56px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: none;
}
.toast {
  background: rgba(28, 21, 13, .92); border: 1px solid #b9975b88;
  color: #f0e2bd; padding: 6px 16px; border-radius: 5px; font-size: 13px;
  animation: toastIn .25s ease-out; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  white-space: nowrap;
}
.toast.warn { border-color: #d0705a; color: #f5c9b0; }
.toast.fade { opacity: 0; transition: opacity .5s; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 覆盖层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 6, 3, .78);
  display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }
.dialog {
  max-width: 520px; padding: 34px 42px; text-align: center;
  background: linear-gradient(170deg, #2b2115, #1c150c);
  border: 1px solid #b9975b; border-radius: 10px;
  box-shadow: 0 0 40px rgba(0,0,0,.7), inset 0 0 60px rgba(185,151,91,.07);
}
.dialog h1 { font-size: 30px; color: #ffd98a; font-weight: normal; letter-spacing: 3px; }
.dialog h1 small { display: block; font-size: 12px; color: #b9975b; letter-spacing: 6px; margin-top: 4px; }
.dialog .sub { color: #c7b489; margin: 12px 0 16px; font-size: 14px; }
.dialog ul { list-style: none; text-align: left; margin: 0 auto 14px; max-width: 420px; }
.dialog li { padding: 5px 0; font-size: 14px; color: #ddd0ae; line-height: 1.55; }
.dialog .keys { font-size: 12px; color: #96876b; margin-bottom: 20px; }
.dialog button {
  font-family: inherit; font-size: 17px; color: #2b1c0e;
  background: linear-gradient(180deg, #e8c87a, #c99a4a);
  border: 1px solid #8a6a30; border-radius: 6px;
  padding: 10px 34px; cursor: pointer; letter-spacing: 2px;
}
.dialog button:hover { filter: brightness(1.1); }
.hidden { display: none !important; }

/* ---------- T3.9 回忆三选一 ---------- */
#memoryChoices .memcard {
  font-family: inherit; font-size: 15px; color: #f0e2bd; text-align: left; letter-spacing: 1px;
  background: rgba(185, 151, 91, .08); border: 1px solid #b9975b88; border-radius: 6px;
  padding: 12px 16px; cursor: pointer; transition: background .15s, border-color .15s;
}
#memoryChoices .memcard:hover { background: rgba(232, 200, 122, .16); border-color: #e8c87a; }

/* ---------- T2.9 香火 / T2.8 黄历 / T2.7 市集 ---------- */
#infopanel .favorlist { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
#infopanel .favorrow { position: relative; }
#infopanel .favorbar {
  position: absolute; top: 6px; right: 8px; width: 54px; height: 5px;
  background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; z-index: 1;
}
#infopanel .favorfill { height: 100%; background: linear-gradient(90deg,#e8913a,#ffd98a); }
#infopanel .pas30 { color: #9fd08a; }
#infopanel .offer.trade { font-size: 12px; padding: 5px 8px; }
.alday { border-top: 1px dashed #b9975b55; padding: 8px 4px; text-align: left; }
.alday.today { background: rgba(216,178,95,.08); border-radius: 6px; }
.aldate { color: #ffd98a; font-size: 14px; margin-bottom: 3px; }
.alitem { color: #ddd0ae; font-size: 13px; line-height: 1.5; }
.alitem.dim { color: #96876b; }
.chgoals .done, .alitem.done { color: #8fbf6f; text-decoration: line-through; }
#chPoem span { display: block; }

/* ---------- T3.11 成就列表（暂停菜单） ---------- */
#achList { max-height: 180px; overflow: auto; text-align: left; }
#achList .achrow { color: #96876b; font-size: 13px; line-height: 1.7; padding: 1px 0; display: flex; align-items: center; gap: 8px; }
#achList .achrow.got { color: #d8c79a; }
#achList .achrow.fresh { color: #ffd98a; background: rgba(216,178,95,.12); border-radius: 4px; padding: 1px 6px; }
#achList .achrow canvas { image-rendering: pixelated; flex: none; }
