* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font: 13px/1.35 "Segoe UI", Tahoma, sans-serif;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  min-height: 780px;
}

/* —— Left: WDTS AI Powered Table —— */
.cv-app {
  display: flex;
  min-width: 0;
  background: #ececec;
  border-right: 1px solid #222;
}
.cv-nav {
  width: 188px;
  flex-shrink: 0;
  background: #2b2b2b;
  color: #fff;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-logo {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  color: #111;
  padding: 8px;
}
.cv-diamond {
  width: 14px;
  height: 14px;
  background: #c41230;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.cv-logo strong { display: block; font-size: 15px; letter-spacing: 0.04em; }
.cv-logo small { display: block; color: #c41230; font-size: 8px; letter-spacing: 0.04em; }
.cv-nav-label {
  margin: 10px 0 0;
  font-size: 11px;
  color: #c8c8c8;
}
.cv-nav-btn {
  width: 100%;
  text-align: left;
  background: #3a3a3a;
  color: #fff;
  border: 0;
  padding: 9px 10px;
  cursor: default;
}
.cv-nav-btn.active { background: #505050; font-weight: 650; }
.preset-list { display: flex; flex-direction: column; gap: 6px; }
.preset-btn {
  width: 100%;
  text-align: left;
  background: #3a3a3a;
  color: #eee;
  border: 0;
  padding: 8px 9px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.3;
}
.preset-btn small { display: block; color: #b4b4b4; font-size: 10px; font-weight: 400; }
.preset-btn.active { background: #6b2a2a; color: #fff; }
.cv-download {
  height: 22px;
  border: 1px solid #555;
  background: #1f1f1f;
}
.cv-main {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cv-head-actions { display: flex; gap: 10px; align-items: center; }
.proposal-link {
  color: #6b2a2a;
  font-weight: 650;
  font-size: 13px;
}
.cv-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #111;
}
.mark-error {
  background: #9ccc8a;
  border: 0;
  border-radius: 16px;
  padding: 7px 14px;
  color: #143014;
  font-weight: 650;
  cursor: default;
}

.felt {
  position: relative;
  flex: 1;
  min-height: 420px;
  background: #1c4f9c;
  border: 1px solid #163a72;
  overflow: hidden;
}
.felt::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 17.5%, rgba(80, 220, 80, 0.35) 18%, transparent 18.4%),
    linear-gradient(90deg, transparent 35.5%, rgba(80, 220, 80, 0.35) 36%, transparent 36.4%),
    linear-gradient(90deg, transparent 49.5%, rgba(80, 220, 80, 0.35) 50%, transparent 50.4%),
    linear-gradient(90deg, transparent 63.5%, rgba(80, 220, 80, 0.35) 64%, transparent 64.4%),
    linear-gradient(90deg, transparent 81.5%, rgba(80, 220, 80, 0.35) 82%, transparent 82.4%);
  pointer-events: none;
}
.cv-overlay {
  position: absolute;
  left: 10px;
  top: 8px;
  margin: 0;
  z-index: 2;
  color: #39ff4a;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
  text-shadow: 0 0 2px #062;
}
.felt-center-box {
  position: absolute;
  left: 38%;
  top: 26px;
  width: 24%;
  height: 52px;
  border: 2px solid #2f7dff;
}
.felt-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  margin: 0;
  text-align: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.felt-dealer {
  position: absolute;
  left: 50%;
  top: 88px;
  transform: translateX(-50%);
  z-index: 2;
}
.felt-seats {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  z-index: 2;
}
.felt-seat {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px;
}
.felt-seat.miss { border-color: #e39a3c; }
.felt-seat.ok { border-color: #39ff4a; }
.felt-seat h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf5a;
}
.felt-seat.miss .dot { background: #e39a3c; }
.hand-label { color: #d7e6ff; font-size: 10px; margin: 3px 0 2px; }
.cards { display: flex; gap: 3px; flex-wrap: wrap; }
.cv-note { margin: 4px 0 0; color: #ffe7b0; font-size: 10px; }

.pcard {
  width: 34px;
  height: 48px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #222;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #111;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.pcard.red { color: #c41230; }
.pcard.dim { opacity: 0.4; }

.cv-banner {
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
}
.cv-banner.bad { background: #f3d2d2; color: #5a1d1d; }
.cv-banner.good { background: #d7edd4; color: #1d3d1a; }
.cv-log {
  margin: 0;
  padding-left: 18px;
  max-height: 88px;
  overflow: auto;
  color: #333;
  font-size: 12px;
}
.cv-log li:last-child { font-weight: 650; }
.cv-actions { display: flex; gap: 8px; }
.cv-actions button {
  background: #fff;
  border: 1px solid #888;
  padding: 7px 12px;
  cursor: pointer;
}
.cv-actions button.primary {
  background: #2f6fbf;
  color: #fff;
  border-color: #2f6fbf;
}
.cv-actions button:disabled { opacity: 0.45; cursor: default; }

/* —— Right: Table Dashboard Override —— */
.td-app {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f3eee4;
  color: #1a1a1a;
}
.td-top, .td-foot {
  background: #1b1b1b;
  color: #eee;
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 650;
}
.td-top-left, .td-top-right, .td-top-mid { display: flex; gap: 14px; align-items: center; }
.td-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf5a;
  display: inline-block;
}
.td-body {
  flex: 1;
  min-height: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.td-panel {
  display: flex;
  border: 1px solid #8a6f4a;
  background: #f7f3ea;
  min-height: 0;
}
.td-side {
  width: 26px;
  flex-shrink: 0;
  background: #e6d8c2;
  border-right: 1px solid #8a6f4a;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #4a3b28;
}
.td-panel-body { flex: 1; padding: 8px 10px; min-width: 0; }
.result-panel { flex: 1; }
.td-hint { margin: 0 0 8px; color: #5a4a38; font-size: 12px; }
.result-dealer { display: flex; justify-content: center; }
.result-rule { height: 1px; background: #8a6f4a; margin: 8px 0; }
.result-seats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seat-block h4 {
  margin: 0 0 4px;
  font-size: 12px;
}
.seat-block .meta { color: #6a5844; font-weight: 500; }
.slot-row { display: flex; gap: 5px; }
.slot {
  width: 52px;
  height: 70px;
  background: #cfcfcf;
  border: 1px solid #9a9a9a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}
.slot.empty { cursor: pointer; }
.slot.selected { outline: 2px solid #2f6fbf; }
.slot.miss { outline: 2px solid #d27a20; }
.slot .pcard { width: 40px; height: 58px; }
.seat-actions { display: flex; gap: 6px; margin-top: 5px; }
.seat-actions button, .result-btns button, .bet-body button, .buffer-btns button, .burn-body button {
  background: #d8d8d8;
  border: 1px solid #8a8a8a;
  padding: 5px 10px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
}
.seat-actions button:disabled,
.result-btns button:disabled,
.bet-body button:disabled,
.buffer-btns button:disabled {
  color: #888;
  cursor: default;
}
.result-btns { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
#applyBtn:not(:disabled) {
  background: #6b2a2a;
  color: #fff;
  border-color: #6b2a2a;
}
.edit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-top: 6px;
}
.edit-row select { padding: 3px 6px; }

.td-lower { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 8px; min-height: 148px; }
.td-lower-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bet-body, .buffer-body { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.bet-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.bet-list label { display: flex; gap: 5px; align-items: center; }
.buffer-body { flex-direction: row; justify-content: space-between; }
.buffer-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.buffer-btns, .burn-body { display: flex; flex-direction: column; gap: 6px; }
.burn-body { flex-direction: row; align-items: center; }
.burn-outline {
  background: #fff !important;
  border: 1px solid #6b4e3d !important;
}
.td-tabs {
  display: flex;
  background: #6b4e3d;
  color: #f3eee4;
}
.td-tabs span { padding: 8px 14px; }
.td-tabs .active { background: #7a1f24; color: #fff; font-weight: 700; }
.td-foot { font-weight: 500; color: #ccc; }

@media (max-width: 1280px) {
  .split { grid-template-columns: 1fr; height: auto; overflow: auto; }
  .cv-app, .td-app { min-height: 100vh; }
}
