/* ============ 环球大富翁 · Q版卡通休闲风 ============ */
:root {
  --gold: #f5b301;
  --gold-deep: #d99a00;
  --blue: #3d7bd6;
  --blue-deep: #2a5da8;
  --green: #3fae5a;
  --ink: #2b3440;
  --bg: #f3ede0;
  --card: #fffaf0;
  --line: #e6dcc6;
  --shadow: 0 6px 18px rgba(80, 60, 20, .15);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(245,179,1,.12), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(61,123,214,.12), transparent 32%);
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue));
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar .logo { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.topbar .logo span { color: var(--gold); }
.topbar .spacer { flex: 1; }
.topbar .me { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avatar-chip {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 18px;
}

.btn {
  border: none; border-radius: 12px; padding: 10px 18px;
  font-size: 15px; font-weight: 700; color: #fff;
  background: var(--gold); box-shadow: 0 4px 0 var(--gold-deep);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn.secondary { background: var(--blue); box-shadow: 0 4px 0 var(--blue-deep); }
.btn.ghost { background: rgba(255,255,255,.18); box-shadow: none; }
.btn.danger { background: #e74c3c; box-shadow: 0 4px 0 #b93a2d; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px; }

/* ---------- 卡片 / 表单 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; background: #fff;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--blue); }

.title-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.title-option {
  border: 2px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; cursor: pointer;
  background: #fff;
}
.title-option.active { border-color: var(--gold); background: #fff7e0; }
.title-option .emoji { font-size: 28px; }
.title-option .name { font-weight: 700; margin-top: 4px; }
.title-option .desc { font-size: 12px; color: #7a8494; }

.page-title { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.muted { color: #7a8494; font-size: 13px; }
.error { color: #e74c3c; font-size: 13px; margin-top: 8px; }
.link { color: var(--blue); cursor: pointer; font-weight: 700; }

/* ---------- 大厅 ---------- */
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.room-card { display: flex; flex-direction: column; gap: 10px; }
.room-card .meta { display: flex; justify-content: space-between; color: #7a8494; font-size: 13px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag.waiting { background: #fff3d6; color: var(--gold-deep); }
.tag.playing { background: #dff3e3; color: var(--green); }
.tag.finished { background: #eceff3; color: #7a8494; }

/* ---------- 游戏主界面 ---------- */
.game-layout { display: grid; grid-template-columns: 240px 1fr 260px; gap: 16px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }

.player-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.player-row:last-child { border-bottom: none; }
.player-row .dot { width: 12px; height: 12px; border-radius: 50%; }
.player-row .pname { flex: 1; font-weight: 700; font-size: 14px; }
.player-row .pcash { font-size: 13px; color: var(--gold-deep); }
.player-row.bankrupt { opacity: .45; text-decoration: line-through; }

/* 地图 */
.map-wrap {
  background: linear-gradient(180deg, #eaf4ff, #f7ffe9);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; overflow: hidden;
}
.map-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 10px 4px; }
.space {
  min-width: 74px; height: 92px; border-radius: 12px; border: 2px solid #fff;
  background: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 6px; font-size: 11px; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.08);
  flex-shrink: 0;
}
.space .sname { font-weight: 700; line-height: 1.2; }
.space .sprice { color: #7a8494; }
.space.tier-S { background: #fff3cf; border-color: var(--gold); }
.space.tier-A { background: #e3eefc; }
.space.tier-B { background: #e4f6e9; }
.space.tier-C { background: #fbf3d4; }
.space.tier-D { background: #eef1f4; }
.space.s-chance { background: #efe6ff; }
.space.s-fate { background: #ffe6e0; }
.space.s-bonus { background: #fff7d6; }
.space.s-tax { background: #f0f0f0; }
.space.s-rail, .space.s-utility { background: #e6f2f2; }
.space.s-jail { background: #d9d9d9; }
.space.s-auction { background: #ffe9d6; }
.space.s-challenge { background: #ffe0ec; }
.space.owned { outline: 2px solid var(--green); }
.space .pawn { position: absolute; top: -8px; right: -6px; font-size: 16px; }
.space .level-badge { font-size: 10px; color: var(--gold-deep); font-weight: 700; }

/* 操作面板 */
.action-panel { display: flex; flex-direction: column; gap: 12px; }
.cash-box { text-align: center; padding: 14px; background: #fff7e0; border-radius: 12px; }
.cash-box .label { font-size: 13px; color: #7a8494; }
.cash-box .value { font-size: 24px; font-weight: 800; color: var(--gold-deep); }
.dice-row { display: flex; justify-content: center; gap: 10px; font-size: 30px; }
.log-box { max-height: 180px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.log-box .l-bonus { color: var(--green); }
.log-box .l-rent, .log-box .l-tax { color: #b93a2d; }
.log-box .l-encounter { color: #9b59b6; }
.log-box .l-system { color: var(--blue); font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30,30,40,.5);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; max-width: 420px; width: 100%; }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 石头剪刀布 */
.rps-choice { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.rps-choice button { font-size: 30px; width: 64px; height: 64px; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
.rps-choice button.active { border-color: var(--gold); background: #fff3cf; }

/* 拍卖列表 */
.auction-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* 结算榜 */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rank-row .rank-no { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 800; }
.rank-row .rname { flex: 1; font-weight: 700; }
.rank-row .rworth { color: var(--gold-deep); font-weight: 800; }

.empty { text-align: center; color: #7a8494; padding: 40px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; }
  .title-grid { grid-template-columns: repeat(2, 1fr); }
}
