/* probability-poker-tool.css */

/* ---------- Base reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

:root{
  --table-bg: #0a1326;     /* dark blue table */
  --rim: #2c2c34;          /* dark gray rim */
  --accent: #f59e0b;       /* amber highlight */
  --white-20: rgba(255,255,255,.2);
  --white-30: rgba(255,255,255,.3);
  --shadow: 0 4px 10px rgba(0,0,0,.3);

  /* suit colors */
  --red: #ef4444;
  --black: #111827;
}

/* ---------- Table surface ---------- */
.poker-table-tool{
  background: var(--table-bg);
  border: 6.8px solid var(--rim);   /* 20% smaller, then -15% */
  border-radius: 27px;              /* down from 32px */
  padding: 10px;                    /* down from 12px */
  color: #e5e5e5;
}

/* ---------- Board / rows ---------- */
.card-grid,
.card-row,
.board{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); /* smaller again */
  gap: 7px;
}

/* ---------- Card slots ---------- */
.card-slot{
  background: rgba(255,255,255,.04);
  border: 2px dashed var(--white-30);
  color: #d4d4d8;
  aspect-ratio: 5 / 7;
  width: 100%;
  max-width: 123px;   /* smaller than 145px */
  min-width: 68px;    /* smaller than 80px */
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.card-slot:hover{ border-color: var(--accent); }

.card-slot.filled{
  background: #fff;
  color: #000;
  border: 2px solid #d4d4d8;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: clamp(.8rem, 1.6vw, 1rem); /* smaller font */
}

.card-slot .rank{ font-weight: 800; letter-spacing: .4px; }
.card-slot .suit{ font-size: 1em; }

/* ---------- Suit colors ---------- */
.suit-h, .suit-d{ color: var(--red); }
.suit-s, .suit-c{ color: var(--black); }

.card-slot[data-suit="H"],
.card-slot[data-suit="D"],
.picker-card[data-suit="H"],
.picker-card[data-suit="D"]{ color: var(--red); }

.card-slot[data-suit="S"],
.card-slot[data-suit="C"],
.picker-card[data-suit="S"],
.picker-card[data-suit="C"]{ color: var(--black); }

/* ---------- Picker modal ---------- */
dialog.card-picker-modal,
.modal.card-picker-modal,
.picker-modal-container{
  max-width: min(86vw, 544px); /* 15% smaller than 640px */
  max-height: 54vh;
  overflow: hidden;
  padding: 7px;
  border: none;
  border-radius: 10px;
  background: #0d1b33;
  color: #e5e7eb;
  box-shadow: var(--shadow);
}

/* ---------- Picker grid ---------- */
.picker,
.card-picker,
.picker-grid,
.deck-picker{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 5px;
  max-height: 48vh;
  overflow: auto;
  padding: 5px;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
}

/* ---------- Picker cards ---------- */
.picker-card{
  background: #fff;
  color: #000;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 7;
  width: clamp(27px, 3.9vw, 42px); /* smaller again */
  height: auto;
  font-weight: 700;
  font-size: clamp(.58rem, 1.2vw, .75rem);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.picker-card:hover{ transform: translateY(-1px); border-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 520px){
  .poker-table-tool{ padding: 9px; }
  .card-grid, .card-row, .board{
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 6px;
  }
  dialog.card-picker-modal,
  .modal.card-picker-modal,
  .picker-modal-container{
    max-width: 90vw;
    max-height: 58vh;
  }
  .picker-card{ width: clamp(25px, 7vw, 38px); font-size: .65rem; }
}
