/* 平台殼樣式（大廳 / 等待室 / 配對） — 與牌桌主題木紋協調 */
#gho-platform {
  position: absolute; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #3a2e1f 0%, #241a10 70%, #1a1209 100%);
  font-family: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #f0e6d2; padding: 20px; overflow: auto;
}
#gho-platform[hidden] { display: none; }   /* [hidden] 需壓過 display:flex */
.gho-screen { width: 100%; max-width: 520px; }
.gho-screen[hidden] { display: none; }

.gho-card {
  background: linear-gradient(160deg, #fdf6e3 0%, #f0e2bf 100%);
  color: #3a2a14; border-radius: 22px; padding: 28px 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.6);
}
.gho-card-sm { max-width: 380px; margin: 0 auto; text-align: center; }

.gho-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.gho-logo {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #fff;
  background: linear-gradient(150deg, #b5462f, #8a2f1d); box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.gho-title { font-size: 24px; font-weight: 800; }
.gho-sub { font-size: 14px; color: #7a6648; }
.gho-me-row { margin: 6px 0 18px; font-size: 15px; color: #5a4a30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gho-wallet { background: #fff4d6; border: 1px solid #e0c98a; border-radius: 999px; padding: 3px 12px; font-size: 14px; color: #8a6a1f; }
.gho-wallet b { color: #b5462f; }
.gho-link { background: none; border: none; color: #b5462f; font-weight: 700; cursor: pointer; font-size: 14px; margin-left: auto; }

.gho-modes { display: grid; gap: 12px; }
.gho-mode {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 14px; align-items: center; text-align: left;
  background: #fff; border: 2px solid #e3d3ab; border-radius: 16px; padding: 16px 18px;
  cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.gho-mode:hover { transform: translateY(-2px); border-color: #c9a84c; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.gho-mode-ico { grid-row: 1 / 3; font-size: 34px; }
.gho-mode-name { font-size: 18px; font-weight: 800; color: #3a2a14; }
.gho-mode-desc { font-size: 13px; color: #8a7250; }

.gho-input {
  width: 100%; font-size: 18px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid #d8c69c; margin: 16px 0; text-align: center; background: #fff;
}
.gho-btn {
  font-size: 15px; font-weight: 700; padding: 12px 18px; border-radius: 12px;
  border: 2px solid #d8c69c; background: #fff; color: #5a4632; cursor: pointer;
}
.gho-btn:hover { background: #f5ecd6; }
.gho-btn-primary { background: linear-gradient(150deg, #c9a84c, #a8852f); border-color: #a8852f; color: #fff; }
.gho-btn-primary:hover { filter: brightness(1.06); }

.gho-room-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.gho-room-code { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; border: 2px dashed #d0b878; }
.gho-room-code b { font-size: 26px; letter-spacing: 4px; color: #b5462f; }
.gho-share { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gho-btn-line { background: #06c755; border-color: #06c755; color: #fff; }
.gho-btn-line:hover { background: #05b34c; }
.gho-share-url { font-size: 12px; color: #8a7250; margin-top: 8px; word-break: break-all; }

.gho-btn-google { width: 100%; background: #fff; border-color: #d8c69c; }
.gho-btn-google:disabled { opacity: .6; cursor: default; }
.gho-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: #a8916c; font-size: 13px; }
.gho-or::before, .gho-or::after { content: ''; flex: 1; height: 1px; background: #e3d3ab; }

/* 一將結算（四人累積輸贏排行）*/
.gho-standings { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.gho-standing-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: #fff; border: 2px solid #e3d3ab;
}
.gho-standing-rank { font-size: 20px; width: 28px; text-align: center; }
.gho-standing-name { flex: 1; font-weight: 700; }
.gho-standing-total { font-weight: 800; font-size: 18px; }
.gho-standing-total.up { color: #1f8a3a; }
.gho-standing-total.down { color: #c23b3b; }
.gho-standing-total.zero { color: #8a7250; }
.gho-matchover-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.gho-tally-choice { display: flex; flex-direction: column; gap: 8px; font-size: 14px; text-align: left; }
.gho-tally-choice label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.gho-seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.gho-seat {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #fff; border: 2px solid #e3d3ab;
}
.gho-seat.empty { opacity: .55; border-style: dashed; }
.gho-seat.ai { background: #eef3e8; }
.gho-seat.me { border-color: #c9a84c; box-shadow: 0 0 0 2px rgba(201,168,76,.3); }
.gho-seat-wind {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: #3a2a14; color: #f0e6d2; font-weight: 800;
}
.gho-seat-name { font-size: 15px; font-weight: 600; color: #3a2a14; }

.gho-room-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.gho-room-actions .gho-btn { width: 100%; }
.gho-wait-hint { font-size: 13px; color: #8a7250; }

.gho-spinner { font-size: 48px; margin: 18px 0; animation: gho-pulse 1.2s ease-in-out infinite; }
@keyframes gho-pulse { 0%,100% { opacity: .4; transform: scale(.9);} 50% { opacity: 1; transform: scale(1.1);} }
.gho-queue-cancel, #gho-queue-cancel { margin-top: 16px; }

/* 代打按鈕：在自家卡片外、緊鄰右邊（絕對定位貼齊卡片右緣，與卡片垂直置中）*/
#mj-auto-btn {
  position: absolute; left: 232px; right: auto; bottom: 190px; top: auto; z-index: 60;
  width: auto; height: auto; white-space: nowrap;
  background: rgba(20,16,10,.82); color: #f0e6d2; border: 2px solid #8a7250;
  border-radius: 999px; padding: 9px 16px; font-size: 15px; font-weight: 700;
  font-family: system-ui, sans-serif; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
#mj-auto-btn:hover { border-color: #c9a84c; }
#mj-auto-btn.active { background: #6a4a1f; border-color: #c9a84c; color: #ffe9a8; }

/* 對局倒數提示（輪到我打牌/反應時，右下角顯示剩餘秒數） */
#mj-countdown {
  position: absolute; right: 18px; bottom: 90px; z-index: 60;
  background: rgba(20,16,10,.82); color: #ffe9a8; border: 2px solid #c9a84c;
  border-radius: 999px; padding: 6px 16px; font-size: 22px; font-weight: 800;
  font-family: system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.4);
  pointer-events: none;
}
#mj-countdown.urgent { color: #fff; background: #b5462f; border-color: #e06a4c; animation: gho-blink .5s ease-in-out infinite; }
@keyframes gho-blink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* 底台選擇 */
.gho-stakes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.gho-stake {
  text-align: left; background: #fff; border: 2px solid #e3d3ab; border-radius: 14px;
  padding: 16px; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s;
}
.gho-stake:hover { transform: translateY(-2px); border-color: #c9a84c; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.gho-stake-name { font-size: 18px; font-weight: 800; color: #3a2a14; }
.gho-stake-info { font-size: 14px; color: #b5462f; font-weight: 700; margin-top: 4px; }
.gho-stake-lv { font-size: 12px; color: #8a7250; margin-top: 2px; }

/* 邀請 QR（白底襯墊才好掃） */
.gho-qr { width: 148px; margin: 12px auto 2px; padding: 10px; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.gho-qr[hidden] { display: none; }
.gho-qr svg { display: block; width: 100%; height: auto; }

/* 進階設定摺疊（配對模式預設收合） */
#gho-adv { margin-top: 16px; }
#gho-adv summary { cursor: pointer; font-size: 14px; font-weight: 700; color: #8a7250; user-select: none; }
#gho-adv summary:hover { color: #5a4a30; }

/* 一鍵配對鈕 */
#gho-quick-match { width: 100%; margin-top: 14px; font-size: 17px; padding: 14px 18px; }
#gho-quick-match[hidden] { display: none; }

/* 全域 toast（大廳/等待室的斷線、重連、入座提示） */
#gho-toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 300;
  background: rgba(20,16,10,.88); color: #f0e6d2; border: 2px solid #8a7250;
  border-radius: 999px; padding: 9px 20px; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap; max-width: 90vw;
  overflow: hidden; text-overflow: ellipsis;
}
#gho-toast[hidden] { display: none; }

/* 思考時間選擇 */
.gho-think-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 15px; color: #5a4a30; }
.gho-seg { display: inline-flex; border: 2px solid #d8c69c; border-radius: 10px; overflow: hidden; }
.gho-seg button { border: none; background: #fff; color: #6a5636; padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 700; }
.gho-seg button.active { background: #c9a84c; color: #fff; }
