* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1400px 900px at 50% 12%, #17293c 0%, #0e1822 55%, #0a111a 100%) fixed;
  color: #e8eef4; -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.muted { color: #8aa0b4; font-size: 13px; }

.screen { max-width: 860px; margin: 0 auto; padding: 24px 16px; }
.back-hub { display: inline-block; color: #6fc2ff; text-decoration: none; font-size: 14px; margin-bottom: 6px; }
.screen h1 { text-align: center; margin-bottom: 20px; font-size: 26px; }
.screen h2 { font-size: 16px; margin-bottom: 10px; color: #cfe0ee; }

.panel { background: #18242f; border: 1px solid #263845; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.panel.rules .muted { line-height: 1.8; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .home-cols { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; color: #8aa0b4; margin: 8px 0 4px; }
input, select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #34495c; background: #0f1923; color: #e8eef4; font-size: 15px; outline: none;
}
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 10px;
  border: 1px solid #3c5268; background: #24364a; color: #e8eef4; font-size: 15px; cursor: pointer; margin-top: 10px;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(#35ad6c, #1e7a4b); border: none; }
.btn.danger { background: linear-gradient(#d95463, #a92f3e); border: none; }
.btn.warn { background: linear-gradient(#c9964a, #9c6d25); border: none; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.small { padding: 5px 10px; font-size: 13px; margin-top: 0; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; }
.row select { flex: 1; }

.room-list { max-height: 200px; overflow-y: auto; }
.room-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #263845; gap: 8px; }
.room-item .btn { margin-top: 0; padding: 6px 14px; }
.join-code { display: flex; gap: 8px; margin-top: 12px; }
.join-code .btn { margin-top: 0; }
.footer { text-align: center; margin-top: 10px; }
.share { font-size: 15px; word-break: break-all; margin-bottom: 6px; }
.share b { color: #6fc2ff; }

.player-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid #263845; font-size: 15px; }
.player-row:last-child { border-bottom: none; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #2c3f53; color: #9fc1dd; margin-left: 6px; }
.tag.host { background: #6b5424; color: #ffd97a; }
.tag.easy { background: #1f4d33; color: #8fe6b4; }
.tag.medium { background: #54481f; color: #f0d77c; }
.tag.hard { background: #5c2730; color: #ff9aa8; }

/* ===== 对局界面 ===== */
.screen-game {
  max-width: 700px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; padding: 8px 12px 12px;
}
#g-topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; color: #8aa0b4; font-size: 13px; }

#players-row { display: flex; gap: 8px; justify-content: center; padding: 8px 0; flex-wrap: wrap; }
.pcard {
  background: linear-gradient(180deg, rgba(24,37,52,.96), rgba(12,20,30,.94));
  border: 1.5px solid #3d5266; border-radius: 12px;
  padding: 7px 10px; min-width: 148px; position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 8px;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(255,211,77,.3), 0 0 10px rgba(255,211,77,.4); }
  50%     { box-shadow: 0 0 0 2px rgba(255,211,77,.55), 0 0 20px rgba(255,211,77,.8); }
}
.pcard.turn { border-color: #ffd34d; animation: pulse 1.6s ease-in-out infinite; }
.pcard.me { border-color: #5aa7e0; }
.pcard .plane-ico {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.pcard .pinfo { min-width: 0; }
.pcard .pname { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pchips { font-size: 12px; color: #ffd97a; white-space: nowrap; }
.pcard .timer-badge {
  position: absolute; top: -10px; right: -8px;
  display: inline-flex; width: 32px; height: 32px; border-radius: 50%;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 50% 40%, #ffcf5a, #e8961f); border: 2px solid #fff;
}

/* 棋盘:深蓝边框 + 米色盘面,和深色页面形成对比 */
#board-wrap {
  margin: 4px auto; padding: 10px;
  background: linear-gradient(150deg, #22456b, #142a45);
  border-radius: 16px;
  box-shadow: 0 10px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(150,200,255,.25);
}
#board { display: block; border-radius: 8px; touch-action: manipulation; }

/* 骰子区 */
#dice-area { display: flex; gap: 16px; align-items: center; justify-content: center; padding: 8px 0 2px; min-height: 70px; }
#dice-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#btn-roll { margin-top: 0; font-size: 17px; font-weight: 700; padding: 12px 26px; border-radius: 24px; }
#turn-hint { text-align: center; min-height: 20px; font-size: 14px; }
#turn-hint b { color: #ffd34d; }

/* 骰子(CSS 点数;1、4 红点,与牛牛同款) */
.die {
  position: relative; width: 54px; height: 54px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(160deg, #ffffff, #e9ebe2);
  box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.06);
}
.die .pip {
  position: absolute; width: 18%; height: 18%; border-radius: 50%;
  background: #26292e; transform: translate(-50%, -50%);
}
.die.red-pips .pip { background: #d8252f; }
.die.ghost { opacity: .22; }
@keyframes dieSettle {
  0% { transform: scale(1.25); }
  55% { transform: scale(.94); }
  100% { transform: scale(1); }
}
.die.settle { animation: dieSettle .28s ease both; }

/* 选飞机按钮(点棋盘不方便时的备用入口) */
#move-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 2px 0 4px; }
#move-btns .btn { margin-top: 0; font-weight: 700; }

#log-panel {
  margin-top: 8px; background: rgba(15,25,36,.8); border: 1px solid #2a3d50;
  border-radius: 12px; padding: 8px 12px; height: 92px; overflow: hidden;
}
#log-lines { height: 100%; overflow-y: auto; font-size: 12px; line-height: 1.7; color: #b8cadb; }

#reveal-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(4,8,12,.72);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
#reveal-box {
  background: rgba(10,17,26,.97); border: 1px solid #ffd34d; border-radius: 16px;
  padding: 20px 24px; max-width: 440px; width: 100%;
  box-shadow: 0 0 0 4px rgba(255,211,77,.1), 0 12px 44px rgba(0,0,0,.7);
  text-align: center;
}
#reveal-box h3 { font-size: 20px; margin-bottom: 8px; }
#reveal-box .verdict { font-size: 14px; color: #ffd97a; line-height: 1.9; }

#toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: #6b2530; border: 1px solid #8d3441; color: #fff; padding: 9px 18px; border-radius: 9px;
  font-size: 14px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s;
}
#toast.show { opacity: 1; }
#disconnected { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; display: flex; align-items: center; justify-content: center; }

@media (max-width: 560px) {
  .pcard { min-width: 138px; padding: 6px 8px; }
  .pcard .plane-ico { width: 24px; height: 24px; font-size: 13px; }
  #die-box .die { width: 46px; height: 46px; }
}
