/* 手机 H5 版 · 竖屏手机框与像素风覆盖层 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #07090d;
  background-image: radial-gradient(circle at 50% 0%, #1b2130, #07090d 62%);
  font-family: "Microsoft YaHei", "PingFang SC", monospace;
  color: #ece0bc; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
body { display: flex; align-items: center; justify-content: center; }

.phone {
  position: relative;
  width: min(100vw, 420px);
  height: min(100vh, 746px);
  aspect-ratio: 9 / 16;
  max-height: 100vh;
  overflow: hidden;
  background: #090b10;
  border: 3px solid #3a4252;
  box-shadow: 0 0 0 3px #0a0c10, 0 18px 60px rgba(0, 0, 0, .8);
}
@media (min-width: 460px) { .phone { border-radius: 10px; } }
#screen {
  display: block; width: 100%; height: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
  touch-action: none; cursor: crosshair;
}

/* ---------- 覆盖层 ---------- */
.ov {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px; text-align: center;
  background: rgba(6, 8, 13, .9);
}
.ov.hidden { display: none !important; }
.panel {
  width: 100%; max-height: 100%; overflow: auto;
  padding: 14px 12px;
  background: #171b25;
  border: 2px solid #c9a659;
  box-shadow: 0 0 0 2px #090b10, inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.pt { color: #f0cc68; font-size: 22px; font-weight: 800; letter-spacing: 6px; text-shadow: 2px 2px 0 #6a4a18; }
.ps { color: #8b8571; font-size: 11px; letter-spacing: 3px; margin: 4px 0 14px; }
.plead { color: #c8bda0; font-size: 11px; line-height: 1.8; margin-bottom: 12px; }

/* 职业选择 */
.job-row { display: flex; gap: 8px; justify-content: center; }
.job-card {
  flex: 1 1 0; max-width: 112px; padding: 10px 5px;
  background: #0e1119; border: 2px solid #5b4a2e;
  cursor: pointer; transition: border-color .12s, transform .12s, background .12s;
}
.job-card:hover, .job-card.on { border-color: #f0cc68; background: #1e2432; transform: translateY(-3px); }
.job-card canvas { display: block; width: 60px; height: 66px; margin: 0 auto 6px; image-rendering: pixelated; }
.jc-name { color: #f0cc68; font-size: 16px; font-weight: 700; letter-spacing: 3px; }
.jc-tag { color: #8b8571; font-size: 10px; margin: 3px 0 6px; }
.jc-desc { color: #c8bda0; font-size: 10px; line-height: 1.6; }

.gbtn {
  padding: 9px 22px; margin: 5px 3px 0; cursor: pointer;
  font: inherit; font-size: 13px; letter-spacing: 3px; font-weight: 700;
  color: #17130a; background: #e8c060;
  border: 2px solid #a8894a; box-shadow: 0 3px 0 #090b10;
}
.gbtn:hover { background: #ffd878; }
.gbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #090b10; }
.gbtn.alt { color: #ece0bc; background: #2a3140; border-color: #5b4a2e; }
.hint { color: #7c7664; font-size: 10px; line-height: 1.8; margin-top: 12px; }

/* 列表型面板（背包 / 技能 / 对话） */
.list-head { display: flex; gap: 4px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.tab { padding: 4px 10px; font-size: 11px; color: #8b8571; background: #0e1119; border: 1px solid #5b4a2e; cursor: pointer; }
.tab.on { color: #17130a; background: #e8c060; border-color: #a8894a; }
.rows { text-align: left; max-height: 400px; overflow-y: auto; }
.row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin-bottom: 5px;
  background: #0e1119; border: 1px solid #333c4c; font-size: 11px; line-height: 1.6;
}
.row canvas { flex: 0 0 28px; width: 28px; height: 28px; image-rendering: pixelated; }
.row .rname { color: #f0cc68; font-size: 12px; font-weight: 700; }
.row .rdesc { color: #8b8571; font-size: 10px; }
.row .rnum { margin-left: auto; color: #ece0bc; font-size: 11px; white-space: nowrap; }
.talk-line { text-align: left; color: #d8ccb0; font-size: 12px; line-height: 1.9; padding: 8px 10px; margin-bottom: 8px; background: #0e1119; border-left: 3px solid #c9a659; }
.talk-who { color: #f0cc68; font-weight: 700; letter-spacing: 2px; }

/* 领悟技能弹窗 */
.learn-panel { max-width: 310px; }
.learn-body { display: flex; align-items: center; gap: 12px; text-align: left; margin: 12px 0 16px; }
.learn-icon {
  flex: 0 0 62px; width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  background: #0d1018; border: 2px solid #f0cc68;
  box-shadow: inset 0 0 0 2px #090b10;
}
.learn-icon canvas { width: 54px; height: 54px; image-rendering: pixelated; }
.learn-name { color: #f0cc68; font-size: 17px; font-weight: 800; letter-spacing: 2px; }
.learn-lv { color: #78c878; font-size: 11px; margin: 4px 0 6px; }
.learn-desc { color: #c8bda0; font-size: 11px; line-height: 1.6; }

/* 装备栏：人物居中，六格围绕（参考经典传奇纸娃娃布局） */
.eq-board {
  position: relative; height: 214px; margin: 2px auto 10px;
  max-width: 250px; background: radial-gradient(circle at 50% 42%, #27303c, #0d1018 72%);
  border: 2px solid #5b4a2e; box-shadow: inset 0 0 0 2px #090b10;
}
.eq-char {
  position: absolute; left: 82px; top: 46px; width: 86px; height: 96px;
  display: flex; align-items: flex-end; justify-content: center; pointer-events: none;
}
.eq-char canvas { width: 86px; height: 96px; image-rendering: pixelated; }
.eq-slot {
  position: absolute; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #0d1018; border: 2px solid #5b4a2e; box-shadow: inset 0 0 0 1px #090b10;
}
.eq-slot.on { border-color: #f0cc68; background: #1c2230; }
.eq-slot.sel { box-shadow: inset 0 0 0 1px #090b10, 0 0 0 2px #78c878; }
.eq-slot canvas { width: 30px; height: 30px; image-rendering: pixelated; }
.eq-slot .eq-label {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  color: #8b8571; font-size: 9px; white-space: nowrap;
}
.eq-slot.on .eq-label { color: #f0cc68; }
.eq-slot.weapon { width: 46px; height: 54px; }
.eq-info {
  min-height: 28px; margin: 4px 0 10px; padding: 5px 8px;
  color: #c8bda0; font-size: 10px; line-height: 1.5; text-align: left;
  background: #0e1119; border: 1px solid #333c4c;
}
.eq-info b { color: #f0cc68; }

/* 横屏提示 */
.rotate-tip {
  display: none; position: absolute; inset: 0; z-index: 20;
  align-items: center; justify-content: center; text-align: center;
  background: #090b10; color: #f0cc68; font-size: 15px; letter-spacing: 3px; line-height: 2;
}
@media (orientation: landscape) and (max-height: 480px) {
  .rotate-tip { display: flex; }
}
