/* PokerTools Calculator CSS v2 — Visual 9-seat table, light theme
   BEM-like .pt- prefix to avoid WP conflicts */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;500;600;700&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────── */
.pokertools-wrap {
  --pt-ivory:       #FAF9F6;
  --pt-felt:        #4DA494;
  --pt-felt-border: #3A8578;
  --pt-red:         #BB2649;
  --pt-gold:        #B8892C;
  --pt-gold-glow:   rgba(184,137,44,0.35);
  --pt-black:       #2B2B2B;
  --pt-gray:        #D4D0C5;
  --pt-white:       #FFFFFF;
  --pt-orange:      #D4A034;
  --pt-green:       #15844E;
  --pt-trans:       0.18s ease;

  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--pt-black);
  background: var(--pt-ivory);
  border-radius: 12px;
  border: 1px solid var(--pt-gray);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* ─── Content grid ──────────────────────────────────────────────────────── */
.pt-content {
  display: grid;
  grid-template-columns: 1fr 268px;
}

/* ─── Table section ─────────────────────────────────────────────────────── */
.pt-table-section {
  background: var(--pt-ivory);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 16px 8px 18px;
}

/* ─── Table Wrapper — fixed 540×430 design, scaled via JS ───────────────── */
.pt-table-wrapper {
  position: relative;
  width: 540px;
  height: 430px;
  flex-shrink: 0;
  transform-origin: top center;
}

/* ─── Oval table ────────────────────────────────────────────────────────── */
.pt-poker-table {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 340px; height: 228px; top: 32px;
  background: radial-gradient(ellipse at 50% 40%, #5ec2b0 0%, var(--pt-felt) 55%, #3a8578 100%);
  border: 3px solid var(--pt-felt-border);
  border-radius: 50%;
  box-shadow: inset 0 6px 28px rgba(0,0,0,.22), 0 4px 18px rgba(0,0,0,.16);
}

/* ─── Board ─────────────────────────────────────────────────────────────── */
.pt-board-area {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex; gap: 4px; align-items: flex-start;
}
.pt-board-slot-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pt-board-label {
  font-size: 8px; font-weight: 600; color: rgba(255,255,255,.65);
  letter-spacing: .06em; text-transform: uppercase;
}
.pt-board-divider {
  width: 1px; height: 50px; background: rgba(255,255,255,.18);
  align-self: center; margin: 0 2px;
}

/* ─── Seats ─────────────────────────────────────────────────────────────── */
.pt-seat {
  position: absolute;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; z-index: 10;
}
.pt-seat-cards { display: flex; gap: 3px; }
.pt-seat-label {
  font-size: 9px; font-weight: 600; color: #888;
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
}

/* Seat positions (540×430 design space) */
.pt-seat-1 { left: 80.5%; top: 270px; }
.pt-seat-2 { left: 89%;   top: 112px; }
.pt-seat-3 { left: 73%;   top: 10px;  }
.pt-seat-4 { left: 50%;   top: 2px;   }
.pt-seat-5 { left: 27%;   top: 10px;  }
.pt-seat-6 { left: 11%;   top: 112px; }
.pt-seat-7 { left: 19.5%; top: 270px; }
.pt-seat-8 { left: 38%;   top: 308px; }

.pt-hero-seat {
  position: absolute; left: 50%; top: 350px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; z-index: 10;
}
.pt-hero-badge {
  font-size: 10px; font-weight: 700; color: var(--pt-gold);
  letter-spacing: .1em; text-transform: uppercase;
  padding: 1px 9px; border-radius: 10px;
  border: 1.5px solid var(--pt-gold);
  background: rgba(184,137,44,.1);
}
.pt-hero-cards { display: flex; gap: 5px; }

/* ─── Card Slots ────────────────────────────────────────────────────────── */
.pt-card-slot {
  width: 32px; height: 45px;
  border: 1.5px dashed var(--pt-gray); border-radius: 4px;
  background: rgba(255,255,255,.45); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--pt-gray);
  transition: border-color var(--pt-trans), box-shadow var(--pt-trans);
  position: relative; overflow: hidden; user-select: none;
}
.pt-card-slot:hover { border-color: var(--pt-gold); color: var(--pt-gold); }
.pt-card-slot.pt-active {
  border-color: var(--pt-gold); border-style: solid;
  box-shadow: 0 0 0 2px var(--pt-gold-glow), 0 0 10px var(--pt-gold-glow);
  animation: pt-pulse-gold 1.4s ease-in-out infinite;
}
@keyframes pt-pulse-gold {
  0%,100% { box-shadow: 0 0 0 2px var(--pt-gold-glow), 0 0 8px var(--pt-gold-glow); }
  50%      { box-shadow: 0 0 0 3px rgba(184,137,44,.5), 0 0 16px rgba(184,137,44,.4); }
}
.pt-card-slot.pt-filled {
  border-style: solid; border-color: #ccc; background: var(--pt-white); padding: 0;
}
.pt-board-slot { width: 38px; height: 54px; }
.pt-hero-slot  { width: 44px; height: 62px; }

/* ─── Card Face ─────────────────────────────────────────────────────────── */
.pt-card-face {
  width: 100%; height: 100%; background: var(--pt-white);
  border-radius: 3px; position: relative; overflow: hidden;
  animation: pt-flip-in .25s ease;
}
@keyframes pt-flip-in {
  from { transform: rotateY(80deg) scale(.85); opacity: 0; }
  to   { transform: rotateY(0) scale(1); opacity: 1; }
}
.pt-card-face.pt-red   { color: var(--pt-red); }
.pt-card-face.pt-black { color: var(--pt-black); }
.pt-cf-tl, .pt-cf-br {
  position: absolute; display: flex; flex-direction: column;
  line-height: 1; font-family: Georgia, serif; font-weight: bold;
}
.pt-cf-tl { top: 2px; left: 3px; }
.pt-cf-br { bottom: 2px; right: 3px; transform: rotate(180deg); align-items: flex-end; }
.pt-cf-rank    { font-size: 9px; }
.pt-cf-suit-sm { font-size: 7px; }
.pt-cf-center  {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); font-family: Georgia, serif;
  font-size: 14px; line-height: 1;
}
.pt-board-slot .pt-cf-rank    { font-size: 11px; }
.pt-board-slot .pt-cf-suit-sm { font-size: 9px;  }
.pt-board-slot .pt-cf-center  { font-size: 18px; }
.pt-hero-slot .pt-cf-rank     { font-size: 12px; }
.pt-hero-slot .pt-cf-suit-sm  { font-size: 10px; }
.pt-hero-slot .pt-cf-center   { font-size: 20px; }

/* ─── Results panel ─────────────────────────────────────────────────────── */
.pt-results-panel {
  background: var(--pt-white); border-left: 1px solid var(--pt-gray);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
}
.pt-rp-section { display: flex; flex-direction: column; gap: 6px; }
.pt-rp-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 12px;
  letter-spacing: .12em; color: #999;
  border-bottom: 1px solid var(--pt-gray); padding-bottom: 4px;
}

/* Equity box */
.pt-equity-box {
  text-align: center; padding: 10px 6px 8px;
  background: var(--pt-ivory); border-radius: 10px;
  border: 1px solid var(--pt-gray); position: relative; overflow: hidden;
}
.pt-equity-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--pt-gold); transition: background var(--pt-trans);
}
.pt-equity-box.pt-eq-red::before    { background: var(--pt-red); }
.pt-equity-box.pt-eq-orange::before { background: var(--pt-orange); }
.pt-equity-box.pt-eq-green::before  { background: var(--pt-green); }
.pt-equity-value {
  font-family: 'Bebas Neue', sans-serif; font-size: 58px; line-height: 1;
  letter-spacing: .03em; color: var(--pt-gold); transition: color var(--pt-trans);
}
.pt-equity-value.pt-eq-red    { color: var(--pt-red); }
.pt-equity-value.pt-eq-orange { color: var(--pt-orange); }
.pt-equity-value.pt-eq-green  { color: var(--pt-green); }
.pt-equity-value.pt-eq-gold   { color: var(--pt-gold); }
.pt-equity-label { font-size: 10px; color: #999; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.pt-hand-name { font-family: 'Bebas Neue', sans-serif; font-size: 17px; color: var(--pt-black); margin-top: 3px; min-height: 20px; }
.pt-eq-detail { display: flex; justify-content: center; gap: 16px; margin-top: 5px; }
.pt-eq-stat { display: flex; flex-direction: column; align-items: center; gap: 0; }
.pt-eq-stat b { font-family: 'Bebas Neue', sans-serif; font-size: 20px; font-weight: 400; color: var(--pt-black); line-height: 1; }
.pt-eq-stat small { font-size: 9px; color: #aaa; text-transform: uppercase; letter-spacing: .07em; }
.pt-eq-calc { font-size: 9px; color: #bbb; font-style: italic; margin-top: 3px; min-height: 13px; }

/* Villain equities */
.pt-villain-section { display: none; }
.pt-villain-equities { display: flex; flex-direction: column; gap: 4px; }
.pt-villain-eq-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 8px; background: var(--pt-ivory);
  border-radius: 6px; border: 1px solid var(--pt-gray);
}
.pt-villain-seat-lbl { font-size: 11px; font-weight: 600; color: #666; }
.pt-villain-eq-val {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px; line-height: 1;
  color: var(--pt-gold);
}
.pt-villain-eq-val.pt-eq-red    { color: var(--pt-red); }
.pt-villain-eq-val.pt-eq-orange { color: var(--pt-orange); }
.pt-villain-eq-val.pt-eq-green  { color: var(--pt-green); }
.pt-villain-eq-val.pt-eq-gold   { color: var(--pt-gold); }

/* Outs */
.pt-outs-section { display: none; }
.pt-outs-box { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--pt-ivory); border-radius: 8px; border: 1px solid var(--pt-gray); }
.pt-outs-count { font-family: 'Bebas Neue', sans-serif; font-size: 30px; color: var(--pt-orange); line-height: 1; }
.pt-outs-info { display: flex; flex-direction: column; gap: 1px; }
.pt-outs-label { font-size: 10px; color: #999; font-weight: 500; }
.pt-outs-toggle { background: none; border: none; color: #aaa; cursor: pointer; font-size: 11px; padding: 2px 4px; }
.pt-outs-cards { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.pt-outs-cards.pt-expanded { max-height: 110px; }
.pt-out-pill { padding: 2px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; background: rgba(212,160,52,.12); border: 1px solid rgba(212,160,52,.3); color: var(--pt-orange); }
.pt-out-pill.pt-red { color: var(--pt-red); background: rgba(187,38,73,.08); border-color: rgba(187,38,73,.25); }

/* Texture badges */
.pt-texture-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.pt-tex-badge { padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 600; background: #f0ede6; border: 1px solid var(--pt-gray); color: #888; }
.pt-tex-badge.pt-wet      { color: #2563eb; border-color: #2563eb; background: rgba(37,99,235,.08); }
.pt-tex-badge.pt-semi     { color: var(--pt-orange); border-color: var(--pt-orange); background: rgba(212,160,52,.08); }
.pt-tex-badge.pt-dry      { color: #6b7280; border-color: #6b7280; background: rgba(107,114,128,.08); }
.pt-tex-badge.pt-flush    { color: var(--pt-red); border-color: var(--pt-red); background: rgba(187,38,73,.08); }
.pt-tex-badge.pt-straight { color: var(--pt-gold); border-color: var(--pt-gold); background: rgba(184,137,44,.08); }
.pt-tex-badge.pt-paired   { color: #7c3aed; border-color: #7c3aed; background: rgba(124,58,237,.08); }

/* Pot Odds */
.pt-po-inputs { display: flex; gap: 6px; margin-top: 4px; }
.pt-po-group { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pt-po-group label { font-size: 9px; font-weight: 500; color: #999; text-transform: uppercase; letter-spacing: .06em; }
.pt-po-group input {
  width: 100%; padding: 5px 7px; border: 1.5px solid var(--pt-gray); border-radius: 5px;
  background: var(--pt-white); color: var(--pt-black);
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  outline: none; transition: border-color var(--pt-trans);
}
.pt-po-group input:focus { border-color: var(--pt-gold); }
.pt-po-result {
  margin-top: 6px; padding: 7px 10px; border-radius: 8px;
  background: var(--pt-ivory); border: 1px solid var(--pt-gray);
  text-align: center; min-height: 46px; display: flex; flex-direction: column; justify-content: center;
}
.pt-po-pct { font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: #aaa; line-height: 1; }
.pt-po-verdict { font-size: 10px; font-weight: 600; color: #aaa; margin-top: 2px; }
.pt-po-verdict.pt-call     { color: var(--pt-green); }
.pt-po-verdict.pt-fold     { color: var(--pt-red); }
.pt-po-verdict.pt-marginal { color: var(--pt-orange); }

/* ─── Card Picker ───────────────────────────────────────────────────────── */
.pt-picker {
  background: var(--pt-white); border-top: 1px solid var(--pt-gray);
  padding: 8px 14px 12px; flex-shrink: 0;
}
.pt-picker-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.pt-picker-indicator { font-size: 11px; color: #999; font-weight: 500; }
.pt-slot-name { color: var(--pt-gold); font-weight: 700; }

.pt-btn-reset {
  padding: 4px 12px; border: 1.5px solid var(--pt-gray); border-radius: 6px;
  background: transparent; color: #888; font-family: 'Poppins', sans-serif;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all var(--pt-trans); flex-shrink: 0;
}
.pt-btn-reset:hover { border-color: var(--pt-red); color: var(--pt-red); }

/* Suits grid — 2 lignes sur desktop */
.pt-suits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 24px;
}
.pt-suit-row { display: flex; align-items: center; }
.pt-rank-btns { display: flex; gap: 2px; flex-wrap: nowrap; }

/* Mini card buttons — ratio 5:7 fixe */
.pt-rank-btn {
  flex: 0 0 auto;
  height: 48px;
  aspect-ratio: 5/7;
  border: 1px solid #ccc; border-radius: 3px;
  background: var(--pt-white); cursor: pointer;
  padding: 2px 2px 0;
  display: flex; flex-direction: column; align-items: flex-start;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
}
.pt-rank-btn.pt-red   { color: var(--pt-red); }
.pt-rank-btn.pt-black { color: var(--pt-black); }
.pt-rb-suit { display: none; }  /* redundant — center already shows the suit */
.pt-rb-rank {
  font-family: Georgia, serif; font-size: 13px; font-weight: bold;
  line-height: 1; pointer-events: none;
}
.pt-rb-center {
  position: absolute; top: 52%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 19px; line-height: 1; pointer-events: none;
}
.pt-rank-btn:hover:not(.pt-used) {
  border-color: var(--pt-gold);
  box-shadow: 0 3px 8px rgba(184,137,44,.3);
  transform: translateY(-3px); z-index: 2;
}
.pt-rank-btn.pt-used {
  opacity: .18; cursor: not-allowed;
  background: #f5f3ee; transform: none !important;
  box-shadow: none; border-color: var(--pt-gray);
}

/* ─── Mobile layout — hidden on desktop ─────────────────────────────────── */
.pt-mobile-layout { display: none; }

/* ─── Mobile (≤ 680px) ──────────────────────────────────────────────────── */
@media (max-width: 680px) {

  /* Hide desktop table + results panel */
  .pt-content { display: none; }

  /* Show mobile layout */
  .pt-mobile-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px 6px;
    background: var(--pt-ivory);
  }

  /* ── Board felt strip ── */
  .pt-mob-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: radial-gradient(ellipse at 50% 40%, #5ec2b0 0%, var(--pt-felt) 60%, #3a8578 100%);
    border-radius: 14px;
    padding: 10px 8px 8px;
    border: 2px solid var(--pt-felt-border);
    box-shadow: inset 0 4px 18px rgba(0,0,0,.18), 0 3px 12px rgba(0,0,0,.12);
  }
  .pt-mob-section-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
    color: rgba(255,255,255,.65);
  }
  .pt-mob-board-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: flex-start;
    justify-content: center;
  }
  .pt-mob-board-slot-wrap {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    flex-shrink: 0;
  }
  /* Board card slots on mobile */
  .pt-mobile-layout .pt-board-slot {
    width: 42px; height: 58px;
  }

  /* ── Players list ── */
  .pt-mob-players {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .pt-mob-player {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: var(--pt-white);
    border-radius: 12px;
    padding: 10px 10px;
    border: 1.5px solid var(--pt-gray);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  .pt-mob-hero-row {
    border-color: rgba(184,137,44,.45);
    background: #fffdf7;
  }

  /* Left part: label + 2 cards side by side */
  .pt-mob-player-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }
  .pt-mob-player-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    flex-shrink: 0;
  }
  /* Hero/villain card slots on mobile — bigger touch targets */
  .pt-mobile-layout .pt-hero-slot {
    width: 48px; height: 68px;
  }

  .pt-mob-villain-label {
    font-size: 10px; font-weight: 700; color: #888;
    text-transform: uppercase; letter-spacing: .07em;
    white-space: nowrap; flex-shrink: 0;
    min-width: 44px;
  }

  /* Equity % shown on the right of each row */
  .pt-mob-eq {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px; line-height: 1;
    color: #d0cdc7;
    min-width: 56px;
    text-align: right;
    flex-shrink: 0;
    transition: color .2s ease;
  }
  .pt-mob-eq.pt-eq-red    { color: var(--pt-red); }
  .pt-mob-eq.pt-eq-orange { color: var(--pt-orange); }
  .pt-mob-eq.pt-eq-green  { color: var(--pt-green); }
  .pt-mob-eq.pt-eq-gold   { color: var(--pt-gold); }

  /* Remove villain button */
  .pt-mob-remove {
    background: none; border: none;
    color: #ccc; font-size: 22px; line-height: 1;
    cursor: pointer; padding: 4px 5px;
    border-radius: 6px; flex-shrink: 0;
    transition: color .15s, background .15s;
    touch-action: manipulation;
  }
  .pt-mob-remove:active { color: var(--pt-red); background: rgba(187,38,73,.08); }

  /* Add player button */
  .pt-mob-add-player {
    width: 100%;
    padding: 11px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    background: transparent;
    color: var(--pt-green);
    font-family: 'Poppins', sans-serif;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    touch-action: manipulation;
  }
  .pt-mob-add-player:active {
    border-color: var(--pt-green);
    background: rgba(21,132,78,.06);
  }

  /* Mobile equity summary bar */
  .pt-mob-equity-bar {
    background: var(--pt-white);
    border-radius: 12px;
    border: 1.5px solid var(--pt-gray);
    overflow: hidden;
    padding: 2px 0;
  }
  .pt-mob-equity-bar .pt-equity-box {
    border: none; border-radius: 0; background: transparent;
  }

  /* ── Card Picker — scrollable rows, one per suit ── */
  .pt-suits-grid {
    grid-template-columns: 1fr;   /* 4 rows stacked */
    gap: 4px;
  }
  .pt-suit-row {
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;         /* hide scrollbar on Firefox */
    padding-bottom: 2px;
  }
  .pt-suit-row::-webkit-scrollbar { display: none; }
  .pt-rank-btns {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
  }
  .pt-rank-btn {
    height: 44px;                  /* bigger touch target */
    flex-shrink: 0;
  }
  /* Hide the redundant small suit icon — center suit already shows it */
  .pt-rb-suit { display: none; }
  .pt-rb-rank { font-size: 9px; }
  .pt-rb-center { font-size: 15px; }

  .pt-picker { padding: 8px 10px 12px; }
  .pt-picker-header { flex-wrap: wrap; gap: 6px; }
  .pt-picker-indicator { font-size: 10px; }
}
