/* style.css — 云港大富翁 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #0e1620 radial-gradient(1200px 600px at 50% -10%, #1c2833 0%, #0e1620 60%);
  color: #e8e4d8;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
#app { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select {
  font-family: inherit;
  background: #16222e;
  color: #e8e4d8;
  border: 1px solid #33475c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: #f7dc6f; }

/* ---------- 屏幕通用 ---------- */
.screen { width: 100%; max-width: 1180px; padding: 20px; display: flex; flex-direction: column; align-items: center; }

/* ---------- 主菜单 ---------- */
.game-title {
  font-size: 52px;
  letter-spacing: 8px;
  color: #f7dc6f;
  text-shadow: 0 3px 0 #b7950b, 0 8px 24px rgba(0,0,0,.6);
  margin-top: 10px;
}
.game-sub { color: #93a5b5; margin: 8px 0 22px; letter-spacing: 2px; font-size: 13px; }
.menu-art { width: 100%; max-width: 520px; height: 90px; display: flex; align-items: flex-end; justify-content: center; }
.skyline { display: flex; align-items: flex-end; gap: 8px; }
.skyline i { display: block; width: 34px; background: linear-gradient(#2e4053, #1c2833); border: 1px solid #33475c; border-bottom: none; border-radius: 4px 4px 0 0; }
.skyline i:nth-child(1) { height: 38px; }
.skyline i:nth-child(2) { height: 66px; }
.skyline i:nth-child(3) { height: 30px; }
.skyline i:nth-child(4) { height: 78px; }
.skyline i:nth-child(5) { height: 46px; }
.skyline i:nth-child(6) { height: 60px; }
.skyline i:nth-child(7) { height: 26px; }
.menu-box {
  width: 100%; max-width: 380px;
  background: rgba(22,34,46,.9);
  border: 1px solid #33475c;
  border-radius: 16px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.menu-row { display: flex; gap: 10px; }
.menu-row.two > * { flex: 1; }
.menu-row input { flex: 1; width: 100%; }
.join-row input { flex: 1; }
.menu-btn {
  background: #24384c;
  color: #e8e4d8;
  border: 1px solid #3d566e;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 16px;
  transition: transform .08s, background .15s;
}
.menu-btn:hover:not(:disabled) { background: #2e4a63; transform: translateY(-1px); }
.menu-btn.primary { background: #b7950b; border-color: #f7dc6f; color: #1c2833; font-weight: bold; }
.menu-btn.primary:hover:not(:disabled) { background: #d4ac0d; }
.menu-btn.small { font-size: 14px; padding: 10px 12px; }
.menu-btn.inline { flex: 0 0 auto; font-size: 14px; }
.menu-divider { text-align: center; color: #5d7285; font-size: 12px; border-top: 1px dashed #33475c; padding-top: 12px; }
.menu-divider:empty { padding-top: 0; }
.menu-foot { margin-top: 18px; color: #5d7285; font-size: 12px; }
.menu-foot code { background: #16222e; padding: 2px 8px; border-radius: 6px; color: #f7dc6f; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #93a5b5; }
h2 { color: #f7dc6f; margin: 16px 0; letter-spacing: 4px; }
.hint { color: #5d7285; font-size: 12px; line-height: 1.6; }

/* ---------- 大厅 ---------- */
.lobby-code-row { font-size: 16px; display: flex; align-items: center; gap: 10px; justify-content: center; }
.lobby-code {
  font-size: 28px; font-weight: bold; letter-spacing: 6px; color: #f7dc6f;
  background: #0e1620; padding: 4px 14px; border-radius: 10px; border: 1px dashed #b7950b;
}
.lobby-count { color: #93a5b5; font-size: 13px; }
.lobby-players { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lobby-players li {
  display: flex; align-items: center; gap: 8px;
  background: #0e1620; border: 1px solid #33475c; border-radius: 8px; padding: 9px 12px;
}
.pdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.ptag { font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: auto; }
.ptag.host { background: #b7950b; color: #1c2833; }
.ptag.me { background: #2471a3; color: #fff; }
.ptag.off { background: #5d6d7e; color: #fff; }
.ptag.jail { background: #884ea0; color: #fff; }
.ptag.dead { background: #641e16; color: #fff; }

/* ---------- 游戏布局 ---------- */
#screen-game { max-width: 1180px; }
.game-layout { display: flex; gap: 18px; width: 100%; align-items: flex-start; }
.board-side { flex: 0 1 760px; min-width: 0; }
.board-wrap { position: relative; width: 100%; }
#board { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.55); }
#turn-timer {
  position: absolute; top: 10px; right: 14px;
  background: rgba(14,22,32,.85); border: 1px solid #33475c; border-radius: 8px;
  padding: 4px 10px; font-size: 13px; color: #f7dc6f;
}
#turn-timer.urgent { color: #ff6b5e; border-color: #ff6b5e; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
#status-line { min-height: 26px; padding: 8px 4px 2px; color: #f0e6c8; font-size: 15px; }
#action-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 0 0; min-height: 52px; }
.act-btn {
  background: #24384c; color: #e8e4d8; border: 1px solid #3d566e;
  border-radius: 10px; padding: 11px 18px; font-size: 15px;
  transition: transform .08s, background .15s;
}
.act-btn:hover:not(:disabled) { background: #2e4a63; transform: translateY(-1px); }
.act-btn.primary { background: #b7950b; border-color: #f7dc6f; color: #1c2833; font-weight: bold; }
.act-btn.primary:hover:not(:disabled) { background: #d4ac0d; }
.act-btn.warn { background: #9c640c; border-color: #f0b27a; color: #fff; }
.act-btn.danger { background: #922b21; border-color: #e74c3c; color: #fff; }
.bar-hint { color: #5d7285; font-size: 12px; }

.panel-side { flex: 1 1 340px; min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
#players-panel { display: flex; flex-direction: column; gap: 8px; }
.pcard {
  background: rgba(22,34,46,.92); border: 1px solid #33475c; border-radius: 10px; padding: 8px 12px;
  transition: box-shadow .2s, border-color .2s;
}
.pcard.active { border-color: #f7dc6f; box-shadow: 0 0 0 1px #f7dc6f, 0 0 18px rgba(247,220,111,.25); }
.pcard.dead { opacity: .5; filter: grayscale(.8); }
.pcard.flash { animation: cashflash .6s; }
@keyframes cashflash { 0% { background: #4a6b2f; } 100% { background: rgba(22,34,46,.92); } }
.pcard-head { display: flex; align-items: center; gap: 8px; }
.pname { font-weight: bold; font-size: 14px; }
.pcard-row { display: flex; gap: 14px; margin-top: 4px; font-size: 13px; color: #b9c6cf; }
.pcash { color: #f7dc6f; font-weight: bold; }
.pworth { margin-left: auto; font-size: 12px; color: #5d7285; }

.tabs { display: flex; gap: 6px; }
.tab-btn {
  flex: 1; background: #16222e; color: #93a5b5; border: 1px solid #33475c;
  border-radius: 8px 8px 0 0; padding: 9px 0; font-size: 14px;
}
.tab-btn.active { background: #24384c; color: #f7dc6f; border-bottom-color: #24384c; }
.tab-page {
  background: rgba(22,34,46,.92); border: 1px solid #33475c; border-radius: 0 0 10px 10px;
  min-height: 260px; max-height: 380px; overflow-y: auto; padding: 10px;
}
#tab-chat { display: flex; flex-direction: column; }
#tab-chat.hidden { display: none !important; }
#chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.chat-row { font-size: 13px; line-height: 1.5; word-break: break-all; }
.chat-row .chat-name { color: #7fb3d5; font-weight: bold; }
.chat-row.mine .chat-name { color: #f7dc6f; }
.chat-bar { display: flex; gap: 8px; }
.chat-bar input { flex: 1; padding: 8px 10px; font-size: 13px; }
.chat-bar button { background: #2471a3; color: #fff; border: none; border-radius: 8px; padding: 0 16px; }

.asset-row {
  display: flex; align-items: center; gap: 10px;
  background: #0e1620; border: 1px solid #2c3e50; border-radius: 8px;
  padding: 7px 10px; margin-bottom: 8px;
}
.asset-band { width: 10px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; }
.asset-info { flex: 1; min-width: 0; }
.asset-name { font-size: 14px; }
.asset-sub { font-size: 11px; color: #7a8b99; margin-top: 2px; }
.asset-ops { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn {
  background: #24384c; color: #e8e4d8; border: 1px solid #3d566e;
  border-radius: 6px; padding: 4px 8px; font-size: 12px;
}
.mini-btn:hover:not(:disabled) { background: #2e4a63; }

.log-list { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; line-height: 1.55; color: #b9c6cf; }
.log-list li { border-bottom: 1px dashed #22303e; padding-bottom: 4px; }

.leave { margin-top: 4px; }

/* ---------- 卡片提示 ---------- */
#card-toast {
  position: absolute; left: 50%; top: 18%; transform: translate(-50%, -30px) scale(.9);
  width: 240px; background: #fdf6e3; color: #3b3325;
  border-radius: 12px; border: 3px solid #b7950b;
  box-shadow: 0 14px 40px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: all .3s;
  text-align: center; padding: 0 0 14px; z-index: 5;
}
#card-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.card-deck {
  font-size: 18px; font-weight: bold; letter-spacing: 6px; padding: 10px 0;
  border-radius: 9px 9px 0 0; color: #fff;
}
.card-deck.chance { background: #d35400; }
.card-deck.event { background: #8e44ad; }
.card-text { padding: 12px 14px 0; font-size: 14px; line-height: 1.6; }

/* ---------- 浮层 / 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(5,10,15,.72);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.overlay.show { display: flex; }
.modal {
  background: #16222e; border: 1px solid #3d566e; border-radius: 16px;
  padding: 22px; width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal h3 { color: #f7dc6f; margin-bottom: 12px; }
.modal p { font-size: 14px; line-height: 1.7; margin: 8px 0; }
.modal-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.modal-row.btns { justify-content: flex-end; }
.modal-row.btns.center { justify-content: center; }
.modal.help ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; line-height: 1.6; color: #cfd8dc; }
.trade-cols { display: flex; gap: 12px; }
.trade-col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.trade-col h4 { color: #93a5b5; font-size: 13px; border-bottom: 1px solid #33475c; padding-bottom: 4px; }
.trade-col label { font-size: 12px; color: #7a8b99; }
.trade-col input[type=number] { padding: 6px 8px; font-size: 13px; }
.trade-props { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.trade-prop { display: flex; align-items: center; gap: 6px; font-size: 12.5px; background: #0e1620; border-radius: 6px; padding: 5px 8px; }
.trade-prop .asset-band { width: 8px; height: 14px; align-self: auto; }

#toast-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(22,34,46,.96); border: 1px solid #f7dc6f; color: #f0e6c8;
  border-radius: 10px; padding: 9px 18px; font-size: 14px;
  opacity: 0; transform: translateY(-8px); transition: all .25s;
  max-width: 82vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 结算 ---------- */
#win-overlay { z-index: 60; }
.win-box {
  background: linear-gradient(160deg, #1c2833, #0e1620);
  border: 2px solid #f7dc6f; border-radius: 20px;
  padding: 40px 48px; text-align: center;
  box-shadow: 0 0 80px rgba(247,220,111,.25);
}
.win-title { font-size: 34px; color: #f7dc6f; margin-bottom: 12px; }
.win-sub { color: #93a5b5; margin-bottom: 24px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 900px) {
  .game-layout { flex-direction: column; }
  .board-side, .panel-side { width: 100%; flex: none; }
  .game-title { font-size: 38px; letter-spacing: 4px; }
  .tab-page { max-height: 300px; }
}
