/* ---------------------------------------------------------------- dice games UI (#crp-ui, #sbo-ui) */
/* Full-screen overlay below #hud (z 10 is above it) so the menu button stays reachable. */
.dice-ui {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 8px 6px; box-sizing: border-box; gap: 4px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
}
.dice-ui.hidden, .dice-ui .hidden { display: none !important; }
.dice-ui button { pointer-events: auto; }
.dice-bg { display: none; }
.dice-k { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }

.dice-status {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); pointer-events: auto; white-space: nowrap;
  display: flex; flex-direction: row; gap: 4px 18px; padding: 4px 16px;
  background: rgba(0,0,0,.6); border: 1px solid var(--panel-border); border-radius: 12px;
}
.dice-stat { display: flex; flex-direction: column; align-items: center; position: relative; padding-bottom: 4px; }
.dice-k { font-size: 10px !important; line-height: 1.1; }
.dice-v { font: 700 14px Georgia, serif; color: var(--gold-2); white-space: nowrap; line-height: 1.2; }
.dice-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.1); }
.dice-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .4s ease; }

.dice-center { display: contents; }
.dice-stage {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(50vh - clamp(60px, 19vh, 130px) / 2 - 24px); width: clamp(150px, 30vw, 360px); display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 6px; box-sizing: border-box; border-radius: 12px; background: rgba(0,0,0,.4); pointer-events: none;
}
.dice-canvas { width: auto !important; height: clamp(60px, 19vh, 130px) !important; max-width: 100%; object-fit: contain; }
.dice-msg { font: 700 clamp(14px, 2.6vh, 20px) Georgia, serif; color: var(--gold-2); min-height: 0; text-align: center; }
.dice-msg.win { color: #7dff9c; }
.dice-msg.lose { color: #ff8a80; }
.dice-log { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; max-width: 100%; font-size: 12px; }
.dice-line.win { color: #7dff9c; }
.dice-line.lose { color: #ff9b94; }
.dice-line.info { color: var(--gold-2); }
.dice-info { text-align: center; font-size: 12px; color: var(--muted); background: rgba(0,0,0,.55); border-radius: 10px; padding: 2px 10px; max-width: 100%; }
.dice-info:empty { display: none; }
.dice-head { font: 700 15px Georgia, serif; color: var(--text); margin-bottom: 2px; }
.dice-tline { display: inline-block; margin: 0 8px; }

.dice-board { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; max-width: min(1100px, 100%); max-height: 40vh; overflow: auto; pointer-events: auto; padding: 4px; border-radius: 12px; background: rgba(4,30,18,.7); }
.dice-board:empty { display: none; }
.dice-group {
  padding: 4px 6px; border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.12);
}
.dice-gtitle { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 3px; }
.dice-spots { display: flex; flex-wrap: wrap; gap: 4px; max-width: 640px; }
.dice-spot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; min-height: clamp(32px, 6vh, 50px); padding: 2px 8px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.22);
  font: 700 clamp(12px, 2.2vh, 14px) 'Segoe UI', system-ui, sans-serif;
}
.dice-spot:hover:not(:disabled) { border-color: var(--gold); background: rgba(255,255,255,.14); }
.dice-spot:disabled { opacity: .35; cursor: default; }
.dice-spot.wide { min-width: 100px; }
.dice-spot.has { border-color: var(--gold); }
.dice-spot.pend { background: rgba(212,175,55,.22); }
.dice-ss { font-weight: 400; font-size: 10px; color: var(--muted); }
.dice-amt {
  position: absolute; top: -8px; right: -6px; font-style: normal; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 9px; background: var(--gold); color: #1a1405;
}
.dice-amt:empty { display: none; }

.dice-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; padding: 5px 14px; width: fit-content; max-width: 100%; box-sizing: border-box;
  background: rgba(4,30,18,.78); border: 1px solid var(--panel-border); border-radius: 14px; pointer-events: auto;
}
.dice-chips { display: flex; gap: 6px; }
.dice-chip {
  width: clamp(32px, 7vh, 46px); height: clamp(32px, 7vh, 46px); border-radius: 50%; cursor: pointer; font: 700 13px Georgia, serif;
  color: #1a1405; background: radial-gradient(circle, #f3d77a 55%, #d4af37 56%); border: 3px dashed rgba(255,255,255,.7);
}
.dice-chip.sel { transform: translateY(-4px); box-shadow: 0 0 14px rgba(243,215,122,.8); }
.dice-pend { font-size: 13px; color: var(--muted); min-width: 110px; }
.dice-btns { display: flex; gap: 8px; }
.dice-btn { padding: clamp(6px, 1.4vh, 10px) 16px; }
.dice-btn:disabled { opacity: .4; }


/* compact layout: dice up top, board docked at the bottom, table stays visible */
.dice-stage { top: clamp(52px, 12vh, 110px); background: rgba(0,0,0,.3); }
.dice-canvas { height: clamp(56px, 15vh, 120px) !important; }
.dice-board { max-height: 36vh; max-width: min(980px, 100%); gap: 3px 5px; padding: 3px; background: rgba(4,30,18,.6); }
.dice-group { padding: 3px 5px; }
.dice-spot { min-width: 46px; min-height: clamp(28px, 5vh, 42px); padding: 1px 6px; }
.dice-spot.wide { min-width: 84px; }
.dice-board { max-width: min(1300px, 100%); max-height: 42vh; }
.dice-spots { max-width: 820px; }
