/* Teen Patti operator console. Deliberately plain: this is a harness for driving
   the backend, not a player-facing front end. */

:root {
  --bg: #12161d;
  --panel: #1a202a;
  --panel-2: #222a36;
  --line: #2e3745;
  --text: #e6eaf0;
  --dim: #8b97a8;
  --accent: #4da3ff;
  --good: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #ffbe4d;
  --gold: #ffd166;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.dim { color: var(--dim); }

/* ---------- top bar ---------- */

.topbar {
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar h1 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.topbar .sub { color: var(--dim); font-weight: 400; margin-left: 6px; }

.conn { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.conn label { display: flex; gap: 6px; align-items: center; color: var(--dim); }

input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 7px; font: inherit;
}
input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

button {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 6px 12px; font: inherit; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #05121f; font-weight: 600; }
button.danger  { background: var(--bad); border-color: var(--bad); color: #2a0808; font-weight: 600; }
button.ghost   { background: transparent; }
button.tiny    { padding: 2px 8px; font-size: 11px; }
button.big     { padding: 12px 20px; font-size: 15px; letter-spacing: .4px; }

.pill { padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.pill-on  { background: rgba(62,207,142,.15); color: var(--good); }
.pill-off { background: rgba(139,151,168,.15); color: var(--dim); }

/* ---------- layout ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

@media (max-width: 980px) { main { grid-template-columns: 1fr; } }

.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 650; font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--dim);
  margin-bottom: 10px;
}

/* ---------- table meta ---------- */

.table-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 14px; margin-bottom: 10px;
}
.table-meta .k { display: block; color: var(--dim); font-size: 11px; }
.table-meta .v { display: block; font-weight: 600; }

.tables-list { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tables-list label { display: flex; gap: 6px; align-items: center; color: var(--dim); }

.tables { list-style: none; margin: 8px 0 0; padding: 0; }
.tables li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px;
  margin-bottom: 4px; cursor: pointer;
}
.tables li:hover { border-color: var(--accent); }

/* ---------- hands and cards ---------- */

.hands { display: grid; gap: 14px; }

.hand-title {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--dim);
  margin-bottom: 6px;
}
.hand-name { color: var(--gold); letter-spacing: 0; font-size: 13px; text-transform: none; }
.qual { font-size: 11px; letter-spacing: 0; text-transform: none; }
.qual.yes { color: var(--good); }
.qual.no  { color: var(--warn); }

.cards { display: flex; gap: 8px; min-height: 76px; }

.card {
  width: 54px; height: 76px;
  border-radius: 6px;
  background: #f4f6fa; color: #11151c;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  border: 1px solid #c9d2e0;
}
.card .suit { font-size: 18px; line-height: 1; }
.card.red { color: #cf2b3a; }
.card.back {
  background: repeating-linear-gradient(45deg, #263243 0 6px, #2f3d51 6px 12px);
  border-color: var(--line);
  color: transparent;
}

.six-card { margin-top: 12px; font-size: 12px; color: var(--dim); }
.six-card b { color: var(--gold); font-weight: 600; }

.banner { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 700; }
.banner.win  { color: var(--good); }
.banner.lose { color: var(--bad); }
.banner.push { color: var(--warn); }

/* ---------- decision ---------- */

.hint {
  background: rgba(255,209,102,.12);
  border: 1px solid rgba(255,209,102,.4);
  color: var(--gold);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 10px;
  font-weight: 600;
}

.strength { margin-bottom: 12px; }
.strength-title {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--dim); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 5px;
}
.segments { display: flex; gap: 4px; }
.segments i {
  flex: 1; height: 10px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.segments i.on-1 { background: #c0392b; border-color: #c0392b; }
.segments i.on-2 { background: #e07b39; border-color: #e07b39; }
.segments i.on-3 { background: var(--warn); border-color: var(--warn); }
.segments i.on-4 { background: #9ccf5a; border-color: #9ccf5a; }
.segments i.on-5 { background: var(--good); border-color: var(--good); }

.breakdown { font-size: 11px; margin-top: 5px; }

.decide-buttons { display: flex; gap: 10px; margin: 12px 0 8px; }
.decide-buttons button { flex: 1; }

.my-decision { min-height: 20px; font-weight: 700; }
.my-decision.played { color: var(--good); }
.my-decision.folded { color: var(--bad); }
.my-decision.auto   { color: var(--warn); }

.decision-stats { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.stat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.stat-label { width: 40px; font-size: 11px; color: var(--dim); }
.bar { flex: 1; height: 9px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; transition: width .2s; }
.fill-play { background: var(--good); }
.fill-fold { background: var(--bad); }

/* ---------- betting ---------- */

.balance { font-size: 15px; color: var(--good); letter-spacing: 0; text-transform: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px dashed var(--line); background: var(--panel-2);
  font-weight: 700; font-size: 12px; cursor: pointer; padding: 0;
}
.chip.sel { border-style: solid; border-color: var(--gold); color: var(--gold); }

.spots { display: flex; flex-direction: column; gap: 6px; }
.spot {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; cursor: pointer;
}
.spot:hover:not(.spot-readonly) { border-color: var(--accent); }
.spot-readonly { opacity: .65; cursor: default; }
.spot-name { font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.spot-name .pay { color: var(--dim); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.spot-amount { font-size: 18px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.spot-limits { font-size: 10px; }

.bet-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.bet-actions button { padding: 6px 4px; font-size: 11px; }

.total-bet { margin-top: 8px; text-align: right; color: var(--dim); }
.total-bet span { color: var(--text); font-size: 15px; font-weight: 700; }

/* ---------- settlement ---------- */

.lines { width: 100%; border-collapse: collapse; font-size: 12px; }
.lines th {
  text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--dim); font-weight: 600;
  padding: 3px 4px; border-bottom: 1px solid var(--line);
}
.lines td { padding: 4px; border-bottom: 1px solid rgba(46,55,69,.5); }
.lines td.won  { color: var(--good); }
.lines td.lost { color: var(--bad); }
.lines td.push { color: var(--warn); }
.lines tr.bonus td { color: var(--gold); }

/* ---------- results and stats ---------- */

.strip { display: flex; flex-wrap: wrap; gap: 3px; }
.strip i {
  width: 20px; height: 20px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; font-style: normal;
}
.strip i.P { background: rgba(62,207,142,.2); color: var(--good); }
.strip i.D { background: rgba(255,107,107,.2); color: var(--bad); }
.strip i.T { background: rgba(255,190,77,.2); color: var(--warn); }

.betstats { display: flex; flex-direction: column; gap: 4px; }
.betstats .stat-row .stat-label { width: 86px; }
.betstats .fill { background: var(--accent); }

/* ---------- log ---------- */

.log {
  height: 220px; overflow-y: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 6px;
}
.log div { padding: 1px 0; border-bottom: 1px solid rgba(46,55,69,.35); word-break: break-word; }
.log .t { color: var(--dim); margin-right: 6px; }
.log .err  { color: var(--bad); }
.log .warn { color: var(--warn); }
.log .ok   { color: var(--good); }
