/* Bowling Poker - compatible CSS (no CSS variables) */

* { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  background: #0b1220;
  color:#e5e7eb;
}

/* helpers */
.hidden{ display:none !important; }

/* top bar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  background: rgba(11,18,32,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand{ display:flex; align-items:center; gap:10px; }

.logo{
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  font-weight:900;
}

.title{ font-weight:900; letter-spacing:0.2px; }
.subtitle{ font-size:12px; color:#9aa3b2; margin-top:2px; }

.actions{ display:flex; gap:8px; align-items:center; }

.wrap{ max-width:1100px; margin:0 auto; padding:14px; }

/* panels */
.panel{
  background: rgba(15,26,47,0.92);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  padding:14px;
}

.panelHead h2{ margin:0 0 6px; }
.panelHead p{ margin:0; color:#9aa3b2; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.between{ justify-content:space-between; width:100%; }

/* inputs */
.input{
  flex:1;
  min-width:220px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color:#e5e7eb;
  outline:none;
  font-weight:800;
}

.input::placeholder{ color: rgba(229,231,235,0.45); }

.select{
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color:#e5e7eb;
  font-weight:800;
}

/* buttons */
.btn{
  border:none;
  padding:12px 12px;
  border-radius:14px;
  background: rgba(255,255,255,0.08);
  color:#e5e7eb;
  font-weight:900;
  border:1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  cursor:pointer;
}
.btn:active{ transform: translateY(1px); }
.btn.primary{ background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.35); }
.btn.danger{ background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.35); }
.btn.ghost{ background: transparent; box-shadow:none; }
.btn.small{ padding:8px 10px; border-radius:12px; font-size:12px; }
.btn[disabled]{ opacity:0.45; cursor:not-allowed; }

/* pills/chips */
.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.chip{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  font-weight:900;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color:#9aa3b2;
  font-size:12px;
  font-weight:900;
}

.hint{ margin-top:12px; color:#9aa3b2; font-size:13px; line-height:1.35; }
.tiny{ color:#9aa3b2; font-size:12px; font-weight:800; }

/* turn bar */
.turnBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.turnLeft{ display:flex; gap:8px; flex-wrap:wrap; }
.turnRight{ display:flex; align-items:center; gap:10px; }

.countdown{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(59,130,246,0.28);
  background: rgba(59,130,246,0.10);
  color:#cfe1ff;
  font-weight:900;
}

/* player bar */
.playerBar{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.playerBtn{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color:#e5e7eb;
  font-weight:900;
  cursor:pointer;
}
.playerBtn.active{
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.35);
}

/* layout */
.layout{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap:14px;
}
@media (max-width: 900px){
  .layout{ grid-template-columns: 1fr; }
}

.col{
  background: rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  padding:12px;
}
.sectionTitle{
  margin:0 0 10px;
  font-size:13px;
  color:#9aa3b2;
  text-transform:uppercase;
  letter-spacing:0.3px;
}

.divider{ height:1px; background: rgba(255,255,255,0.08); margin:12px 0; }

/* suit grid */
.suitGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-bottom: 10px; /* gives room before Skip */
}

.suitCard{
  border:none;
  cursor:pointer;
  border-radius:18px;
  padding:14px 10px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.suitCard:active{ transform: translateY(1px); }
.suitSym{ font-size:30px; font-weight:900; }
.suitName{ font-weight:900; color:#9aa3b2; font-size:12px; }

.suitCard.hearts .suitSym,
.suitCard.diamonds .suitSym{ color:#ef4444; }
.suitCard.spades .suitSym,
.suitCard.clubs .suitSym{ color:#d1d5db; }

/* Skip spacing so it doesn't touch diamonds */
#skipBtn{
  margin-top: 8px;
}

/* rank picker */
.rankPanel{
  margin-top:10px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:18px;
  background: rgba(255,255,255,0.04);
  padding:10px;
}
.rankHead{ display:flex; align-items:center; justify-content:space-between; }
.rankGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap:8px;
}
.rankBtn{
  padding:10px 6px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color:#e5e7eb;
  font-weight:900;
  cursor:pointer;
}
.rankBtn:active{ transform: translateY(1px); }
.rankBtn.disabled{
  opacity:0.35;
  cursor:not-allowed;
  filter: grayscale(0.65);
}

/* cards rows: keep 5-in-a-row by preventing wrap + allowing horizontal scroll if needed */
.cardRow{
  display:flex;
  gap:10px;
  flex-wrap: nowrap;      /* IMPORTANT: no wrapping */
  overflow-x: auto;       /* if tiny screens, allow scroll rather than wrap */
  padding-bottom: 8px;    /* keeps hint text from touching cards */
  min-height: 106px;
  -webkit-overflow-scrolling: touch;
}

/* Make cards slightly more responsive so 5 fits better */
.card{
  width: clamp(56px, 12.5vw, 68px);
  height: clamp(82px, 18vw, 98px);
  border-radius:14px;
  background: #f9fafb;
  border:1px solid rgba(17,24,39,0.14);
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
  position:relative;
  user-select:none;
  cursor:pointer;
  overflow:hidden;
  flex: 0 0 auto; /* don't shrink weirdly */
}

.card.dim{ opacity:0.55; filter: grayscale(0.6); }
.card.suggested{ outline: 3px solid rgba(34,197,94,0.50); outline-offset:2px; }
.card.disabled{ cursor:not-allowed; }

.corner{
  position:absolute;
  left:8px;
  top:7px;
  display:flex;
  flex-direction:column;
  gap:2px;
  font-weight:900;
  font-size:14px;
  line-height:1;
  color:#111827;
}
.corner.bottom{
  left:auto;
  top:auto;
  right:8px;
  bottom:7px;
  transform: rotate(180deg);
}
.pip{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-size:32px;
  font-weight:900;
  opacity:0.92;
  transform: translateY(2px);
}
.redTxt{ color:#ef4444; }
.blkTxt{ color:#111827; }

/* Push the rule hint down so it doesn't touch cards */
#tossRuleHint{
  margin-top: 12px;
}

/* advice box */
.advice{
  border:1px solid rgba(255,255,255,0.08);
  border-radius:18px;
  padding:10px;
  background: rgba(34,197,94,0.06);
}
.adviceTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.adviceTitle{ font-weight:900; }
.adviceSub{
  margin-top:4px;
  color:#9aa3b2;
  font-size:12px;
  line-height:1.35;
}

.altList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.altItem{
  padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.altLeft{ display:flex; gap:10px; align-items:center; }
.altMeta{ font-size:12px; color:#9aa3b2; font-weight:800; }

#tossDecisionBar .btn { flex: 1; }
#tossDecisionBar { gap: 10px; }

/* modal */
.modal::backdrop{ background: rgba(0,0,0,0.7); }
.modalBox{
  width:min(560px, 92vw);
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(15,26,47,0.98);
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  padding:12px;
}
.modalHead{ display:flex; align-items:center; justify-content:space-between; }
.modalTitle{ font-weight:900; }
.modalBody{ margin-top:10px; }