/* ---------------------------------------------------------------- Spanish 21 UI (#s21-ui) */
/* Sits above #hud (z 10), below #screen (20), #modal (30) and #loading (100). */
#s21-ui {
  position: fixed; inset: 0; z-index: 12; pointer-events: none;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
}
#s21-ui button { pointer-events: auto; }
#s21-ui .hidden { display: none !important; }
#s21-ui .s21-k { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }

/* ---- status strip (top-left) */
.s21-status {
  position: absolute; top: 12px; left: 12px; pointer-events: auto;
  display: flex; flex-direction: column; gap: 6px; min-width: 200px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(8px); box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.s21-stat { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.s21-stat.hidden { display: none !important; }
.s21-v { font: 700 15px Georgia, serif; color: var(--gold-2); white-space: nowrap; }
.s21-progress {
  flex-basis: 100%; height: 4px; margin-top: 4px; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.1);
}
.s21-progress i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .4s ease;
}

/* ---- bottom panels (insurance / actions / bet share one column) */
.s21-bottom {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px)); display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.s21-panel {
  pointer-events: auto; width: 100%; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 18px;
  backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: s21PanelIn .3s cubic-bezier(.2,1.3,.4,1);
}
.s21-panel.hidden { display: none !important; }
@keyframes s21PanelIn { from { opacity: 0; transform: translateY(24px); } }
.s21-panel-title { font: 700 16px Georgia, serif; color: var(--gold-2); letter-spacing: .5px; }
.s21-question { font-size: 14px; color: var(--muted); text-align: center; }
.s21-question b { color: var(--gold-2); }
.s21-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }

/* generic s21 button: builds on .btn (styles.css) */
.s21-btn { min-width: 0; padding: 10px 16px; flex-direction: row; gap: 8px; font-size: 14px; }
.s21-btn span { white-space: nowrap; }
.s21-btn kbd { margin-left: 0; }
.s21-btn.big { padding: 14px 34px; font-size: 18px; }
.s21-btn.s21-tool { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

/* action buttons: colours mirror .act in styles.css */
.s21-btn.s21-act { min-width: 110px; flex: 1 1 110px; padding: 14px 16px; border: none; color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.2); }
.s21-btn.s21-act:hover:not(:disabled) { filter: brightness(1.15); }
.s21-btn.s21-hit { background: linear-gradient(180deg, #2f7d4c, #1b4f2f); }
.s21-btn.s21-stand { background: linear-gradient(180deg, #6b2b33, #44161c); }
.s21-btn.s21-double { background: linear-gradient(180deg, #c48a23, #85590f); }
.s21-btn.s21-split { background: linear-gradient(180deg, #3b62a8, #213a66); }
.s21-btn.s21-surrender { background: linear-gradient(180deg, #6a6a74, #3a3a42); }
.s21-btn.s21-act:disabled { opacity: .35; filter: grayscale(.6); }

/* bet panel */
.s21-bet-head { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
.s21-bet-amount { font: 700 26px Georgia, serif; color: var(--gold-2); text-shadow: 0 2px 10px rgba(0,0,0,.6); min-width: 90px; text-align: center; }
.s21-chip-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.s21-chip {
  position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; font: 800 13px/1 Consolas, monospace; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.85);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--chip) 70%, white), var(--chip));
  box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 4px var(--chip), 0 0 0 6px rgba(255,255,255,.12), 0 8px 16px rgba(0,0,0,.5);
  transition: transform .12s, filter .15s;
}
.s21-chip:hover:not(:disabled) { transform: translateY(-3px) scale(1.06); filter: brightness(1.1); }
.s21-chip:active:not(:disabled) { transform: translateY(0) scale(.97); }
.s21-chip:disabled { opacity: .35; cursor: default; filter: grayscale(.5); }
.s21-chip-key {
  position: absolute; right: -4px; top: -4px; margin: 0; font-size: 9px; padding: 2px 4px; border-radius: 4px;
  background: rgba(0,0,0,.75); color: var(--muted); opacity: 1;
}
.s21-deal { min-width: 180px; }

/* ---- chip and card labels placed by the 3D presenter */
.s21-total {
  position: absolute; left: 0; top: 0; font: 700 13px Georgia, serif; padding: 2px 9px; border-radius: 12px;
  background: rgba(0,0,0,.7); color: var(--gold-2); white-space: nowrap; pointer-events: none;
}
.s21-total.dealer { color: var(--text); border: 1px solid rgba(255,255,255,.18); }
.s21-total.bust { color: #fff; background: linear-gradient(90deg, #8c1b16, #d4413a); border: 1px solid #ff8a80; }
.s21-total.s21 { color: #1d1404; background: linear-gradient(90deg, #b8902c, #e9c869); border: 1px solid #f3d77a; }
.s21-total.win { color: #b9ffd4; border: 1px solid var(--green); }
.s21-total.lose { color: #ffc2c8; border: 1px solid var(--red); }
.s21-total.push { color: #9fd8ff; border: 1px solid var(--blue); }

/* ---- small screens */
@media (max-width: 760px) {
  .s21-status { top: 8px; left: 8px; right: 8px; min-width: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding: 7px 10px; }
  .s21-stat { gap: 4px; }
  .s21-stat .s21-k { font-size: 10px; }
  .s21-progress { order: 10; }
  .s21-v { font-size: 13px; }
  .s21-bottom { bottom: 10px; width: calc(100% - 16px); }
  .s21-panel { padding: 12px 12px 14px; border-radius: 16px; }
  .s21-chip { width: 46px; height: 46px; font-size: 11px; }
  .s21-chip-row { gap: 8px; }
  .s21-bet-amount { font-size: 22px; }
  .s21-deal { min-width: 0; flex: 1 1 100%; }
  .s21-btn.s21-act { min-width: 0; flex: 1 1 40%; padding: 12px 8px; font-size: 14px; }
  .s21-btn.s21-tool { flex: 1 1 0; padding: 8px 6px; }
}
