/* 像素风整体样式：全屏黑底，画布居中，浮层在 canvas 之上 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #000; overflow: hidden; }
body { font-family: "Courier New", "Microsoft YaHei", monospace; color: #d8d4c0; }
#screen { display: block; touch-action: none; image-rendering: pixelated; }

#overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center;
  z-index: 10;
}
.ov-card {
  background: #14141a;
  border: 2px solid #3a3a44;
  padding: 18px 22px;
  max-width: 420px; width: 92%;
  box-shadow: 0 0 0 2px #000, 6px 6px 0 #000;
  /* 手机竖屏上长面板（开发者/规则/排行榜）不能撑出屏幕：限高 + 内部滚动 */
  max-height: 92vh;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ov-card.wide { max-width: 480px; }
.ov-card h2 { color: #e04040; font-size: 16px; margin-bottom: 4px; letter-spacing: 1px; }
.ov-sub { color: #888; font-size: 12px; margin-bottom: 12px; }
.ov-card p { font-size: 12px; line-height: 1.7; margin-bottom: 8px; color: #c8c4b0; }
.ov-warn { color: #c08040; font-size: 11px; }
.ov-msg { color: #e08080; min-height: 16px; font-size: 12px; }
.ov-mine { color: #ffe080; }

.ov-card input {
  width: 100%;
  background: #0a0a0e;
  border: 2px solid #3a3a44;
  color: #e8e4d0;
  padding: 8px 10px;
  font-family: inherit; font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.ov-card input:focus { border-color: #c04040; }
.ov-card input.ov-code { width: 120px; }

/* 音量滑条：暗色像素风，加大触控高度 */
.ov-card input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 26px; padding: 0; margin-bottom: 12px;
  background: transparent; border: none; cursor: pointer;
}
.ov-card input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; background: #0a0a0e; border: 2px solid #3a3a44;
}
.ov-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 22px; margin-top: -9px;
  background: #5a1010; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #802020;
}
.ov-card input[type="range"]::-moz-range-track {
  height: 8px; background: #0a0a0e; border: 2px solid #3a3a44;
}
.ov-card input[type="range"]::-moz-range-thumb {
  width: 18px; height: 20px; border-radius: 0;
  background: #5a1010; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #802020;
}

.ov-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ov-row input { margin: 0; }

.ov-actions { display: flex; gap: 10px; justify-content: flex-end; }

.pix-btn {
  background: #1a1a16;
  border: 2px solid #000;
  color: #d8d4c0;
  padding: 7px 16px;
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  box-shadow: inset -2px -2px 0 #0a0a08, inset 2px 2px 0 #2a2a25;
}
.pix-btn:hover { background: #2a2a25; color: #fff; }
.pix-btn:active { box-shadow: inset 2px 2px 0 #0a0a08; transform: translate(1px, 1px); }
.pix-btn.ghost { background: transparent; box-shadow: none; border-color: #3a3a44; }
.pix-btn.tab { padding: 5px 10px; font-size: 12px; margin-right: 6px; }
.pix-btn.tab.active { background: #5a1010; color: #fff; }

.ov-card table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.ov-card td { padding: 5px 8px; border-bottom: 1px solid #2a2a30; }
.ov-card td:nth-child(1) { width: 40px; color: #ffe080; }
.ov-card td:nth-child(3) { text-align: right; color: #80c080; }
/* 玩家名那一列：长名字允许省略，别把表格撑出卡片 */
.ov-card td:nth-child(2) {
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ov-rules p { font-size: 12px; }

/* 三连解锁：三项状态 */
.ov-triples { margin: 10px 0 4px; }
.ov-triple {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 9px; margin-bottom: 6px;
  background: #0f0f13; border: 1px solid #2a2a30;
  font-size: 13px;
}
.ov-triple-mark { width: 16px; text-align: center; color: #6a6a70; }
.ov-triple-name { flex: 1; }
.ov-triple-tag { font-size: 11px; color: #6a6a70; }
.ov-triple.done { border-color: #2f4a2f; }
.ov-triple.done .ov-triple-mark, .ov-triple.done .ov-triple-tag { color: #80c080; }
.ov-triple.todo .ov-triple-mark, .ov-triple.todo .ov-triple-tag { color: #c08040; }
.ov-card p.ov-ok { color: #80c080; }

/* 设置面板里的开关项 */
.ov-h3 { font-size: 12px; color: #c08040; margin: 14px 0 8px; letter-spacing: 1px; font-weight: normal; }
.ov-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  background: #0f0f13; border: 1px solid #2a2a30;
  font-size: 13px; cursor: pointer;
}
.ov-toggle input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex: 0 0 auto;
  accent-color: #c04040; cursor: pointer;
}
.ov-toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.ov-toggle-note { margin-left: auto; font-size: 11px; color: #6a6a70; text-align: right; }

/* 更新日志 */
.cl-wrap { max-height: 52vh; overflow-y: auto; margin-bottom: 12px; padding-right: 4px; }
.cl-entry { border-left: 2px solid #2a2a30; padding: 8px 0 8px 10px; margin-bottom: 6px; }
.cl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.cl-ver { color: #d8d4c0; font-size: 13px; letter-spacing: 1px; }
.cl-ver.cur { color: #ffe080; }
.cl-tag { font-size: 10px; padding: 1px 6px; border: 1px solid #3a3a44; color: #9a9aa4; }
.cl-tag.new { border-color: #2f4a2f; color: #80c080; }
.cl-tag.fix { border-color: #4a2a2a; color: #e08080; }
.cl-tag.tweak { border-color: #4a4020; color: #c0b060; }
.cl-tag.init { border-color: #2a3a4a; color: #80a0c0; }
.cl-cur { font-size: 10px; color: #c04040; }
.cl-date { margin-left: auto; font-size: 11px; color: #5a5a64; }
.cl-list { list-style: none; padding: 0; margin: 0; }
.cl-list li {
  font-size: 12px; line-height: 1.75; color: #b8b4a8;
  padding-left: 12px; position: relative;
}
.cl-list li::before { content: '·'; position: absolute; left: 2px; color: #5a5850; }

/* 联机大厅：房间列表 */
.ov-empty { color: #6a6a70; font-size: 12px; padding: 6px 0; }
.ov-room {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; margin-bottom: 6px;
  background: #1a1a18; color: #c8c4b0; font-family: inherit; font-size: 12px;
  border: 2px solid #3a3a44; box-shadow: inset 2px 2px 0 #0a0a08; cursor: pointer;
  text-align: left;
}
.ov-room:hover { background: #2a2a25; color: #fff; border-color: #6a1010; }
.ov-room-code { color: #ffe080; letter-spacing: 1px; min-width: 58px; }
.ov-room-names { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-room-count { color: #80c080; }
.ov-off { color: #e08080; font-size: 11px; }

/* 手机端收紧：窄屏减内边距，输入框 ≥16px 防 iOS 聚焦自动放大把面板顶出屏 */
@media (max-width: 520px) {
  .ov-card { padding: 12px 14px; }
  .ov-card h2 { font-size: 14px; }
  .ov-card input, .ov-card select { font-size: 16px; padding: 7px 9px; }
  .ov-card input.ov-code { width: 110px; }
  .pix-btn { padding: 7px 12px; font-size: 12px; }
}

