/* ルーレット3D（β版）— UI（SPEC.md §8） */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0b12;
  font-family: "Segoe UI", Meiryo, sans-serif;
  font-size: 16px;
  color: #fff;
}

#three {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#stage {
  position: fixed;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  z-index: 1;
  pointer-events: none;
  transform-origin: 0 0;
}

/* 共通パネル見た目（各 id へ個別に position/size を指定） */
#balance, #totalbet, #lastwin, #round, #history,
#cursor, #chip, #msg, #bets, #tut, #keys,
#result, #complete, #gameover, #help, #hint {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  color: #fff;
  font-family: "Segoe UI", Meiryo, sans-serif;
  padding: 8px;
}

/* ---- 上帯（§8） ---- */
#balance {
  left: 20px; top: 16px; width: 240px; height: 40px;
  font-size: 20px; font-weight: bold;
  display: flex; align-items: center;
}

#totalbet {
  left: 270px; top: 16px; width: 220px; height: 40px;
  font-size: 16px;
  display: flex; align-items: center;
}

#lastwin {
  left: 500px; top: 16px; width: 220px; height: 40px;
  font-size: 16px;
  display: flex; align-items: center;
}
#lastwin.pos { color: #8bc34a; }
#lastwin.neg { color: #ef5350; }

#round {
  left: 730px; top: 16px; width: 220px; height: 40px;
  font-size: 16px;
  display: flex; align-items: center;
}

#history {
  left: 960px; top: 16px; width: 300px; height: 40px;
  display: flex; align-items: center; gap: 6px;
  font-size: 0; /* 中身は historyChip の span のみ */
}

/* 当たり数字の色チップ（§8: 24×24 角丸・赤/黒/緑・白文字14px bold） */
.hist-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}
.hist-chip.red, .num-badge.red { background: #b3202b; }
.hist-chip.black, .num-badge.black { background: #1c1c1c; }
.hist-chip.green, .num-badge.green { background: #0a7a3a; }

/* ---- 選択・チップ額（§8） ---- */
#cursor {
  left: 20px; top: 64px; width: 460px; height: 36px;
  font-size: 16px;
  display: flex; align-items: center;
}

#chip {
  left: 20px; top: 108px; width: 460px; height: 36px;
  font-size: 16px;
  display: flex; align-items: center;
}
#chip .sel {
  border: 2px solid #ffd54f;
  border-radius: 3px;
  padding: 0 4px;
}

/* ---- メッセージ・賭け一覧（§8） ---- */
#msg {
  left: 340px; top: 150px; width: 600px; height: 36px;
  font-size: 18px;
  display: flex; align-items: center;
}

#bets {
  left: 1040px; top: 120px; width: 220px; height: 240px;
  font-size: 14px;
  line-height: 1.6;
  overflow: auto;
}

/* ---- チュートリアル（§8） ---- */
#tut {
  left: 40px; top: 384px; width: 400px; height: 170px;
  font-size: 18px;
  padding: 12px;
  overflow: auto;
}
#tut[hidden] { display: none !important; }

#tut.waiting::after {
  content: "Z / Enter で次へ";
  display: block;
  margin-top: 12px;
  color: #ffd54f;
  font-size: 14px;
}

/* ---- キー案内（§8） ---- */
#keys {
  left: 20px; top: 660px; width: 640px; height: 40px;
  font-size: 14px;
  display: flex; align-items: center;
}

/* ---- 結果パネル（§8） ---- */
#result {
  left: 340px; top: 200px; width: 600px; height: 300px;
  padding: 16px;
  overflow: auto;
  pointer-events: auto;
}
#result[hidden] { display: none !important; }

.result-title { font-size: 16px; margin-bottom: 6px; }
.result-num {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.result-num .num-badge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  font-weight: bold;
  color: #fff;
}
.result-color { font-size: 18px; margin-bottom: 8px; }
.result-rows { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.result-total { font-size: 20px; font-weight: bold; margin-bottom: 8px; }
.result-next { font-size: 14px; color: #ffd54f; }

/* ---- カットイン帯（§8。off-screen → transition で表示） ---- */
#cutin {
  left: 0; top: 280px; width: 1280px; height: 160px;
  border-radius: 0;
  background: rgba(30, 136, 229, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: bold;
  transform: translateX(-1280px);
  transition: transform 0.25s ease-out;
}
#cutin.show {
  transform: translateX(0);
  transition: transform 0.25s ease-out, opacity 0.25s ease-out 0.7s;
}
#cutin.hide {
  opacity: 0;
}
#cutin.bigwin {
  background: rgba(255, 179, 0, 0.85);
}

/* ---- 完了・ゲームオーバー画面（§8） ---- */
#complete, #gameover {
  left: 240px; top: 100px; width: 800px; height: 500px;
  padding: 24px;
  text-align: center;
  pointer-events: auto;
}
#complete[hidden], #gameover[hidden] { display: none !important; }

#complete .title, #gameover .title {
  font-size: 28px;
  font-weight: bold;
  color: #ffd54f;
  margin-bottom: 24px;
}
#complete .line, #gameover .line {
  font-size: 18px;
  padding: 8px 0;
}
#complete .next, #gameover .next {
  font-size: 14px;
  margin-top: 24px;
}

/* ---- 配当表・ヘルプ（§8） ---- */
#help {
  left: 240px; top: 80px; width: 800px; height: 560px;
  padding: 16px;
  overflow: auto;
  pointer-events: auto;
}
#help[hidden] { display: none !important; }

#help .help-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
}
#help .help-body {
  font-size: 14px;
  line-height: 1.8;
}

/* ---- ヒント（§8） ---- */
#hint {
  left: 1080px; top: 690px; width: 180px; height: 24px;
  background: transparent;
  font-size: 14px;
  display: flex; align-items: center;
}
