:root{
  --bg:#0a1a14; --bg2:#0d2219; --panel:#112a1f; --ink:#ffffff; --muted:#b8d4c8;
  --accent:#4a9d7a; --border:#1a3d2d; --grid:#1a3d2d; --pill-bg:#0d211a;
  --fold:#555555; --call:#2d6b52; --raise:#c23a55; --split:#3d8465;
  --cell-fold:#3a3a3a;
}
/* TESTING: Hide auth walls */
/*
#auth-wall,
#passcode-wall {
  display: none !important;
}
*/

  *{box-sizing:border-box;font-family:system-ui,-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",sans-serif}
  body{margin:0;min-height:100vh;background:radial-gradient(circle at top,#1a3d2d 0,#0a1a14 55%) fixed;color:var(--ink);display:flex;justify-content:center;padding:24px}
  .app-shell{width:100%;max-width:1280px;background:radial-gradient(circle at 0 0,#1a3d2d 0,#0a1a14 45%) border-box,radial-gradient(circle at 100% 0,#25463a 0,#0d211a 45%) border-box,linear-gradient(to bottom,#0f241c,#081510) border-box;border-radius:24px;border:1px solid rgba(255,255,255,.06);box-shadow:0 26px 55px rgba(0,0,0,.85);padding:20px 22px 22px;display:flex;flex-direction:column;gap:18px}

  header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.06)}
  .logo-row{display:flex;align-items:center;gap:12px}
  .logo-pill{width:42px;height:42px;border-radius:999px;background:radial-gradient(circle at 20% 20%,#fff 0,#f6d45b 35%,#b03b2e 80%);position:relative;overflow:hidden;box-shadow:0 0 0 1px rgba(255,255,255,.18),0 13px 24px rgba(0,0,0,.9)}
  .logo-pill::after{content:"";position:absolute;inset:9px;border-radius:999px;border:2px solid rgba(0,0,0,.35);box-shadow:inset 0 0 12px rgba(0,0,0,.7)}
  .logo-pip{position:absolute;width:8px;height:8px;border-radius:999px;border:1px solid rgba(0,0,0,.8);box-shadow:0 0 0 1px rgba(255,255,255,.3);background:radial-gradient(circle at 25% 20%,#fff 0,#f1f1f1 40%,#b7b7b7 100%)}
  .logo-pip:nth-child(1){top:11px;left:13px}.logo-pip:nth-child(2){top:21px;right:11px}.logo-pip:nth-child(3){bottom:11px;left:19px}
.logo-img{width:42px;height:42px;border-radius:8px;object-fit:cover;box-shadow:0 0 0 1px rgba(255,255,255,.18),0 13px 24px rgba(0,0,0,.9)}
  .title-block h1{margin:0;font-size:18px;letter-spacing:.06em;text-transform:uppercase}
  .title-block p{margin:2px 0 0;font-size:12px;color:var(--muted)}
  .badge{padding:4px 10px;border-radius:999px;font-size:11px;text-transform:uppercase;letter-spacing:.09em;border:1px solid rgba(255,255,255,.12);background:rgba(5,7,18,.85);color:var(--muted);display:inline-flex;align-items:center;gap:6px}
  .badge-dot{width:6px;height:6px;border-radius:999px;background:radial-gradient(circle,#67ffb0 0,#32c17a 50%,#158953 100%);box-shadow:0 0 12px rgba(68,255,176,.9)}
  .pill-btn{border-radius:999px;border:1px solid rgba(255,255,255,.12);padding:7px 14px;font-size:12px;background:radial-gradient(circle at 0 0,#1a3d2d 0,#0d211a 60%);color:var(--ink);display:inline-flex;align-items:center;gap:8px;cursor:pointer;transition:background .14s ease,border-color .14s ease,transform .06s ease}
  .pill-btn:hover{background:radial-gradient(circle at 0 0,#2d6b52 0,#1a3d2d 65%);border-color:rgba(74,157,122,.8);transform:translateY(-.5px)}

  /* Navigation links added to match the home page */
  .nav-links{
    display:flex;
    gap:16px;
    align-items:center;
  }
  .nav-links a{
    text-decoration:none;
    color:var(--muted);
    padding:6px 12px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.12);
    background:var(--pill-bg);
    font-size:12px;
    transition:background .14s ease,border-color .14s ease,color .14s ease;
  }
  .nav-links a:hover{
    border-color:rgba(110,162,255,.8);
    color:var(--ink);
    background:linear-gradient(135deg,#3850ff,#c03dff);
  }
  /* ========== Badges Panel ========== */

.badge-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 260px;
  max-height: 60vh;
  padding: 12px;
  border-radius: 14px;
  background: rgba(10, 20, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1200;
}

.badge-panel.open {
  display: flex;
}

.badge-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.badge-panel-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

.badge-panel-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.badge-text-main {
  font-size: 12px;
  font-weight: 600;
}

.badge-text-sub {
  font-size: 11px;
  opacity: 0.75;
}

/* Badges button style tweak (optional) */
.pill-btn.subtle#badge-toggle {
  gap: 6px;
  font-size: 12px;
  padding-inline: 10px;
}

  /* Selection display boxes */
  .selection-display {
    display: flex;
    gap: 8px;
    margin-bottom: 50px;
    flex-wrap: nowrap; /* Keep in one row */
  }
  .selection-box {
    flex: 1; /* Equal width */
    min-width: 0; /* Allow flex to shrink below content size */
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px 8px; /* Reduced horizontal padding */
    background: var(--pill-bg);
    cursor: pointer;
    transition: all .2s ease;
    position: relative;
  }
  .selection-box:hover {
    border-color: rgba(121,164,255,.5);
    transform: translateY(-1px);
  }
  .selection-box.active {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(79,140,255,.3);
  }
  .selection-box.hero.active {
    border-color: #8e54e9;
    background: linear-gradient(135deg, rgba(71,118,230,.15), rgba(142,84,233,.15));
  }
  .selection-box.v1.active {
    border-color: #ff5858;
    background: linear-gradient(135deg, rgba(248,87,166,.15), rgba(255,88,88,.15));
  }
  .selection-box.v2.active {
    border-color: #29ffc6;
    background: linear-gradient(135deg, rgba(32,227,178,.15), rgba(41,255,198,.15));
  }
  .selection-label {
    font-size: 9px; /* Smaller for mobile */
    text-transform: uppercase;
    letter-spacing: .08em; /* Tighter spacing */
    color: var(--muted);
    margin-bottom: 6px;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .selection-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    word-break: break-word; /* Allow text to wrap if needed */
  }
  .selection-placeholder {
    color: var(--muted);
    font-weight: 400;
    font-style: italic;
    font-size: 11px; /* Smaller placeholder text */
  }

.selection-villain-pic {
width: 24px;
height: 24px;
border-radius: 4px;
object-fit: contain;
}
.selection-clear {
position: absolute;
top: 8px;
right: 8px;
width: 18px;
height: 18px;
border-radius: 50%;
background: rgba(255,88,88,.8);
color: white;
font-size: 12px;
display: none;
align-items: center;
justify-content: center;
cursor: pointer;
line-height: 1;
}
.selection-box.active .selection-clear {
display: flex;
}
.selection-clear:hover {
background: rgba(255,88,88,1);
}


/* Training mode overlay */
.training-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.92);
display: none;
align-items: center;
justify-content: center;
z-index: 2000;
padding: 20px;
overflow-y: auto;
}

.training-overlay.active {
display: flex;
}

.training-container {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 24px;
padding: 32px;
max-width: 900px;
width: 100%;
box-shadow: 0 20px 60px rgba(0,0,0,.9);
margin: auto;
}

.training-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px solid rgba(255,255,255,.1);
}

.training-title {
font-size: 20px;
font-weight: 600;
color: var(--ink);
}

.training-stats {
display: flex;
gap: 16px;
font-size: 12px;
color: var(--muted);
}

.training-stat {
display: flex;
align-items: center;
gap: 6px;
}

.training-stat b {
color: var(--ink);
font-size: 14px;
}

.close-training {
background: rgba(255,88,88,.2);
border: 1px solid rgba(255,88,88,.5);
color: #ff5858;
border-radius: 8px;
padding: 6px 12px;
cursor: pointer;
font-size: 12px;
transition: all 0.2s ease;
}

.close-training:hover {
background: rgba(255,88,88,.3);
}
/* ========== Training Streak Meter ========== */

.training-streak {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: radial-gradient(circle at 0 0, rgba(255,255,255,0.06), rgba(0,0,0,0.3));
  border: 1px solid rgba(255,255,255,0.12);
  min-width: 180px;
}

.streak-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

.streak-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.streak-status {
  font-size: 12px;
  font-weight: 600;
}

.streak-bar-outer {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}

.streak-bar-inner {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #47e66f, #ffdf40, #ff7a3c, #ff3b6b);
  transition: width 0.25s ease-out;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .training-header {
    gap: 12px;
  }

  .training-streak {
    width: 100%;
  }
}


/* Hole cards display */
.hole-cards {
display: flex;
gap: 16px;
justify-content: center;
margin: 32px 0;
}

.card {
width: 80px;
height: 112px;
background: white;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
font-weight: 700;
box-shadow: 0 4px 12px rgba(0,0,0,.6);
position: relative;
overflow: hidden;
}

.card::before {
content: '';
position: absolute;
top: 8px;
left: 8px;
font-size: 18px;
}

.card.red {
color: #d32f2f;
}

.card.black {
color: #212121;
}

/* Action buttons */
.training-actions {
display: flex;
gap: 12px;
justify-content: center;
margin-top: 32px;
}

.action-btn {
padding: 14px 32px;
border-radius: 12px;
border: 1px solid rgba(255,255,255,.12);
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
min-width: 120px;
}

.action-btn.fold {
background: rgba(255,88,88,.15);
border-color: rgba(255,88,88,.5);
color: #ff5858;
}

.action-btn.fold:hover {
background: rgba(255,88,88,.25);
transform: translateY(-2px);
}

.action-btn.call {
background: rgba(29,143,107,.15);
border-color: rgba(29,143,107,.5);
color: #1d8f6b;
}

.action-btn.call:hover {
background: rgba(29,143,107,.25);
transform: translateY(-2px);
}

.action-btn.raise {
background: rgba(79,140,255,.15);
border-color: rgba(79,140,255,.5);
color: #4f8cff;
}

.action-btn.raise:hover {
background: rgba(79,140,255,.25);
transform: translateY(-2px);
}

/* Feedback message */
.training-feedback {
text-align: center;
margin-top: 24px;
padding: 16px;
border-radius: 12px;
font-size: 14px;
display: none;
}

.training-feedback.show {
display: block;
}

.training-feedback.correct {
background: rgba(52,206,147,.15);
border: 1px solid rgba(52,206,147,.5);
color: #34ce93;
}

.training-feedback.incorrect {
background: rgba(255,88,88,.15);
border: 1px solid rgba(255,88,88,.5);
color: #ff5858;
}

.feedback-detail {
margin-top: 8px;
font-size: 12px;
opacity: 0.8;
}

.next-btn {
margin-top: 16px;
padding: 10px 24px;
border-radius: 10px;
border: 1px solid rgba(79,140,255,.5);
background: rgba(79,140,255,.15);
color: var(--ink);
cursor: pointer;
font-size: 13px;
}

.next-btn:hover {
background: rgba(79,140,255,.25);
}

/* Training table - read-only version */
#training-felt {
position: relative;
width: 100%;
max-width: 420px;
height: 260px;
margin: 24px auto;
background: radial-gradient(circle at 50% 50%, #0d4f2f 0%, #04270d 100%);
border-radius: 50%;
box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 0 20px rgba(0,0,0,.5);
}

.training-seat-chip {
position: absolute;
transform: translate(-50%, -50%);
border-radius: 10px;
padding: 6px 10px;
font-size: 11px;
border: 1px solid rgba(255,255,255,.12);
background: rgba(6,10,20,.8);
color: var(--ink);
min-width: 72px;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
text-align: center;
/* Allow pointer events so that hover interactions (e.g. stats overlay) work. */
pointer-events: auto;
}

.training-seat-chip.hero {
background: rgba(79,140,255,0.18);
border-color: rgba(79,140,255,0.80);
}

.training-seat-chip.v1 {
background: rgba(194,58,85,0.18);
border-color: rgba(194,58,85,0.75);
}

.training-seat-chip.v2 {
background: rgba(32,227,178,0.18);
border-color: rgba(32,227,178,0.60);
}

.training-pot-display {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: rgba(6,10,20,.85);
border: 1px solid rgba(255,255,255,.12);
border-radius: 10px;
padding: 8px 14px;
font-size: 14px;
font-weight: 600;
color: var(--ink);
pointer-events: none;
}

/* Chips to represent pot composition (small blind, big blind, raises) */
.pot-chip {
display: inline-block;
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
font-size: 10px;
font-weight: 600;
border-radius: 50%;
border: 1px solid rgba(255,255,255,0.4);
margin-right: 4px;
color: #fff;
}
.pot-chip.sb {
/* Small blind chip color: green/teal */
background: rgba(32,227,178,0.85);
}
.pot-chip.bb {
/* Big blind chip color: blue */
background: rgba(79,140,255,0.85);
}
.pot-chip.raise {
/* Raise chip color: red */
background: rgba(194,58,85,0.85);
}

/* Small stack indicator for villains */
.bb-stack {
position: absolute;
bottom: -10px;
left: 50%;
transform: translateX(-50%);
background: rgba(79,140,255,0.85);
color: #ffffff;
font-size: 9px;
padding: 2px 6px;
border-radius: 6px;
border: 1px solid rgba(255,255,255,0.3);
pointer-events: none;
line-height: 1;
white-space: nowrap;
}

/* Action animation overlay */
#action-animation {
position: absolute;
left: 50%;
top: 12%;
transform: translateX(-50%);
padding: 8px 16px;
font-size: 20px;
font-weight: 600;
color: #fff;
border-radius: 10px;
opacity: 0;
pointer-events: none;
z-index: 2100;
}

#action-animation.show {
animation: actionFade 1.2s ease forwards;
}

#action-animation.raise {
background: rgba(194,58,85,0.85);
}

#action-animation.call {
background: rgba(32,227,178,0.85);
}

#action-animation.fold {
background: rgba(121,164,255,0.85);
}

#auth-google:hover {
background: #f8f8f8;
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@keyframes actionFade {
0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
20% { opacity: 1; transform: translateX(-50%) translateY(0px); }
80% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
  /* Villain picker modal */
.villain-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.85);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
}
.villain-modal.active {
display: flex;
}
.villain-modal-content {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 18px;
padding: 20px;
max-width: 600px;
width: 90%;
}
.villain-modal-header {
font-size: 16px;
font-weight: 600;
margin-bottom: 16px;
color: var(--ink);
}
.villain-modal-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 12px;
}
  main{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1.3fr);gap:18px}
  @media (max-width:900px){
    main{grid-template-columns:minmax(0,1fr)}
  }

  /* Mobile responsive design */
  @media (max-width:768px){
    body{padding:12px;}

    .app-shell{
      padding:16px;
      border-radius:16px;
    }

    /* Header adjustments */
    header{
      flex-direction:column;
      align-items:flex-start;
      gap:12px;
    }

    .logo-row{
      width:100%;
    }

    .nav-links{
      width:100%;
      justify-content:space-between;
    }

    .nav-links a{
      flex:1;
      text-align:center;
      padding:8px 6px;
      font-size:11px;
    }

    .badge, .pill-btn{
      font-size:10px;
      padding:6px 10px;
    }

    /* Selection boxes - mobile compact layout */
    @media (max-width:768px){
      .selection-display{
        flex-direction: row; /* Changed from column */
        gap: 8px;
        flex-wrap: wrap;
      }

      .selection-box{
        min-width: auto;
        flex: 1 1 calc(33.333% - 8px); /* Three boxes in a row */
        min-width: 90px; /* Prevent boxes from getting too small */
      }

      .selection-label{
        font-size: 9px; /* Smaller label */
      }

      .selection-value{
        font-size: 11px; /* Smaller value text */
      }

      .selection-clear{
        width: 16px;
        height: 16px;
        font-size: 10px;
      }
    }
    /* Villain modal - compact on mobile */
@media (max-width:768px){
.villain-modal-content{
  width: 90%; /* Reduced from 95% */
  max-width: 400px; /* Add max width */
  padding: 12px; /* Reduced padding */
}

.villain-modal-header{
  font-size: 14px; /* Smaller header */
  margin-bottom: 12px;
}

.villain-modal-grid{
  grid-template-columns: repeat(3, 1fr); /* 3 columns instead of 2 */
  gap: 8px;
}

.villain-box{
  padding: 6px;
}

.villain-pic{
  aspect-ratio: 3/4;
}

.villain-name{
  font-size: 10px;
}
}

    /* Panel adjustments */
    .panel{
      padding:12px;
      gap:12px;
    }

    .panel-header h2{
      font-size:11px;
    }

    .panel-sub{
      font-size:11px;
      line-height:1.4;
    }

    /* Filter adjustments */
    .filter-row{
      flex-direction:row;
      align-items:center;
      justify-content:space-between;
      gap:8px;
    }

    .filter-label{
      width:auto;
      min-width:auto;
      flex-shrink:0;
    }

    .filter-select{
      flex:1;
      min-width:0;
      max-width:none;
      font-size:14px;
      padding:10px;
    }

    /* Selection boxes */
    .selection-display{
      gap: 6px; /* Tighter gap on mobile */
    }

    .selection-box{
      padding: 8px 6px; /* More compact padding */
    }

    .selection-label{
      font-size: 8px; /* Even smaller on mobile */
      letter-spacing: .06em;
    }

    .selection-value{
      font-size: 11px; /* Smaller value text */
    }

    .selection-placeholder{
      font-size: 10px;
    }

    .selection-clear{
      width: 14px;
      height: 14px;
      font-size: 10px;
      top: 6px;
      right: 6px;
    }

    /* Poker table adjustments */
    #felt, #submit-felt, #training-felt{
      max-width:100%;
      height:auto;
      aspect-ratio: 420 / 260;
      margin:12px auto;
    }

    /* Fix training table seat positioning on mobile */
    #training-felt .training-seat-chip{
      min-width:60px;
      font-size:10px;
      padding:5px 8px;
    }

    .seat-gif{
      width:16px;
      height:16px;
    }

    .pot-display, .training-pot-display{
      font-size:12px;
      padding:6px 10px;
    }

    /* Range grid adjustments */
    .range-grid{
      font-size:8px;
      border-radius:8px;
    }

    .range-cell{
      font-size:8px;
      min-height:20px;
    }

    .range-cell::after{
      font-size:8px;
    }

    /* Chart cards */
    .chart-card{
      padding:10px;
    }

    .chart-header{
      flex-wrap:wrap;
    }

    .chart-header b{
      font-size:11px;
    }

    .chart-badge{
      font-size:9px;
      padding:3px 6px;
    }

    .zoom-btn{
      padding:4px 8px;
      font-size:11px;
    }

    /* Legend adjustments */
    .legend{
      font-size:10px;
      gap:8px;
    }

    .swatch{
      width:12px;
      height:12px;
    }

    /* Summary bar */
    .summary-bar{
      flex-direction:column;
      align-items:flex-start;
      gap:6px;
    }

    .summary-pill{
      font-size:10px;
      padding:4px 8px;
    }

    /* Training mode adjustments */
    .training-overlay{
      padding:12px;
    }

    .training-container{
      padding:20px;
      max-width:100%;
    }

    .training-header{
      flex-direction:column;
      align-items:flex-start;
      gap:12px;
    }

    .training-stats{
      width:100%;
      justify-content:space-between;
    }

    .hole-cards{
      gap:12px;
      margin:24px 0;
    }

    .card{
      width:70px;
      height:98px;
      font-size:32px;
    }

    .training-actions{
      flex-direction:column;
      gap:10px;
    }

    .action-btn{
      width:100%;
      min-width:auto;
    }

    /* Paint toolbar */
    .paint-toolbar{
      padding:8px;
    }

    .paint-row{
      flex-direction:column;
      align-items:flex-start;
      gap:10px;
    }

    .paint-group{
      width:100%;
      flex-wrap:wrap;
    }

    .paint-option{
      font-size:11px;
    }

    .paint-weight-input{
      width:50px;
      font-size:11px;
    }

    /* Submit actions */
    .submit-actions{
      gap:10px;
    }

    .submit-label-input{
      font-size:12px;
      padding:10px;
    }

    .submit-buttons{
      flex-direction:column;
    }

    .action-btn.secondary,
    .action-btn.primary{
      width:100%;
      min-width:auto;
    }

    /* Villain modal */
    .villain-modal-content{
      width:95%;
      padding:16px;
    }

    .villain-modal-grid{
      grid-template-columns:repeat(2,1fr);
      gap:10px;
    }

    .villain-box{
      padding:8px;
    }

    .villain-name{
      font-size:11px;
    }

    /* Tabs */
    .tabbar{
      gap:6px;
      padding-bottom:6px;
      flex-wrap:wrap;
    }

    .tab{
      font-size:11px;
      padding:6px 10px;
      white-space:nowrap;
    }

    /* Villain stats card */
    .villain-stats-card{
      width:150px;
      padding:6px 8px;
      font-size:10px;
    }

    .villain-stats-card .header img{
      width:28px;
      height:28px;
    }

    .villain-stats-card .header .name{
      font-size:11px;
    }

    .villain-stats-card .stat-row .label,
    .villain-stats-card .stat-row .value{
      font-size:9px;
    }

    /* Train button positioning */
    .train-btn{
      bottom:-45px;
      font-size:12px;
      padding:8px 20px;
    }
  }

  /* Very small phones */
  @media (max-width:375px){
    .range-cell{
      font-size:7px;
      min-height:18px;
    }

    .range-cell::after{
      font-size:7px;
    }

    #felt, #submit-felt, #training-felt{
      height:200px;
    }

    .card{
      width:60px;
      height:84px;
      font-size:28px;
    }
  }
  .panel{border-radius:18px;background:radial-gradient(circle at 0 0,#1a3d2d 0,#0a1a14 60%);border:1px solid rgba(255,255,255,.05);padding:14px 14px 16px;box-shadow:0 18px 32px rgba(0,0,0,.78);display:flex;flex-direction:column;gap:12px}
  .panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
  .panel-header h2{margin:0;font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
  .panel-header h2 span{color:var(--ink)}
  .panel-sub{font-size:11px;color:var(--muted)}

  /* Tabs */
  .tabbar{
    display:flex;
    gap:8px;
    align-items:center;
    border-bottom:1px solid rgba(255,255,255,.06);
    padding-bottom:8px;
  }

  .tab{
    border-radius:999px;
    border:1px solid transparent;
    background:var(--pill-bg);
    color:var(--muted);
    padding:8px 12px;
    font-size:12px;
    cursor:pointer;
    transition:
      background .14s ease,
      border-color .14s ease,
      color .14s ease,
      box-shadow .14s ease;
  }

  .tab:hover{
    background:rgba(255,255,255,0.04);
    border-color:rgba(255,255,255,0.08);
    color:var(--ink);
  }

  .tab.active{
    background:rgba(79,140,255,0.16);
    border-color:rgba(79,140,255,0.60);
    color:var(--ink);
    box-shadow:0 0 0 1px rgba(79,140,255,0.45);
  }

  .tab-content{display:none;}
  .tab-content.active{display:block;}


  /* Collapsible charts */
  .collapse-indicator{cursor:pointer;margin-right:6px;font-size:14px;transition:transform .2s ease;color:var(--ink);}
  .chart-card.collapsed .collapse-indicator{transform:rotate(-90deg);}
  .chart-card.collapsed .chart-body{display:none;}

  /* Saved ranges panel */
  #saved-panel{display:none; grid-column:2 / 3; grid-row:1 / 2;}

  /* Filters */
  .filters{display:flex;flex-direction:column;gap:10px}
  .filter-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;justify-content:space-between;}
  .filter-label{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted);min-width:120px;flex-shrink:0;}
  .filter-options{display:flex;flex-wrap:wrap;gap:6px;flex:1}
  .filter-select{width:100%;max-width:360px;padding:8px 10px;background:var(--pill-bg);color:var(--ink);border:1px solid rgba(255,255,255,.12);border-radius:10px;font-size:12px}
  .filter-select option[disabled]{color:#7683a8}
  .hidden{display:none!important}

  /* Villain chooser: portrait GIF inside box */
  .villain-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;width:100%}
  @media (max-width:700px){.villain-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
  .villain-box{border:1px solid rgba(255,255,255,.12);background:rgba(7,10,20,.9);border-radius:12px;padding:10px;cursor:pointer;transition:transform .08s,border-color .12s,box-shadow .12s;display:flex;flex-direction:column;align-items:center;gap:8px}
  .villain-box:hover{transform:translateY(-1px);border-color:rgba(121,164,255,.7)}
  .villain-box.selected{box-shadow:0 0 22px rgba(121,164,255,.35);border-color:rgba(121,164,255,.9);background:radial-gradient(circle at 0 0,rgba(65,92,181,.25),rgba(7,10,20,.95))}
  .villain-pic{width:100%;aspect-ratio:3/4;border-radius:10px;overflow:hidden;background:#0b0f1a;display:flex;align-items:center;justify-content:center}
  .villain-pic img{width:100%;height:100%;object-fit:contain;display:block}
  .villain-name{font-size:12px;color:var(--ink);text-align:center}

  /* Charts: vertical scroll */
  .charts-vertical{display:flex;flex-direction:column;gap:12px;max-height:72vh;overflow:auto;padding-right:6px}
  .chart-card{border-radius:14px;background:radial-gradient(circle at 0 0,#1a3d2d 0,#0a1a14 65%);border:1px solid var(--border);padding:10px 10px 12px;display:flex;flex-direction:column;gap:6px}
  .chart-header{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;color:var(--muted)}
  .chart-header b{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:#f1f4ff}
  .chart-actions{display:flex;align-items:center;gap:6px}
  .zoom-btn{border:1px solid rgba(255,255,255,.12);background:rgba(7,10,20,.9);color:var(--ink);border-radius:8px;padding:4px 6px;cursor:pointer;font-size:13px}
  .zoom-btn:hover{border-color:rgba(121,164,255,.8)}
  .chart-badge{border-radius:999px;padding:3px 7px;font-size:10px;border:1px solid rgba(255,255,255,.12);background:rgba(9,13,25,.9);display:inline-flex;align-items:center;gap:4px}
  .chart-badge-pill{width:7px;height:7px;border-radius:999px}
  .chart-body{margin-top:4px}

  .range-grid{display:grid;grid-template-columns:repeat(13,minmax(0,1fr));border-radius:10px;overflow:hidden;border:1px solid var(--grid);background:#0a1a14}
  .range-cell{position:relative;aspect-ratio:1/1;font-size:10px;min-height:24px;display:flex;align-items:center;justify-content:center;color:rgba(232,239,255,.87);border:1px solid rgba(26,61,45,.7);transition:transform .08s,box-shadow .08s,border-color .08s;user-select:none}
  .range-cell::after{content:attr(data-label);position:absolute;inset:1px;display:flex;align-items:center;justify-content:center;border-radius:5px;background:radial-gradient(circle at 20% 0,rgba(0,0,0,.35),transparent 60%)}

  .legend{display:flex;gap:12px;flex-wrap:wrap;margin-top:6px;font-size:12px;color:var(--muted)}
  .legend-item{display:inline-flex;align-items:center;gap:6px}
  .swatch{width:14px;height:14px;border-radius:4px;border:1px solid rgba(255,255,255,.15)}

  .summary-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;font-size:11px;color:var(--muted);margin-top:8px;padding-top:9px;border-top:1px solid rgba(255,255,255,.09)}
  .summary-pill{border-radius:999px;padding:4px 9px;border:1px solid rgba(255,255,255,.13);background:rgba(6,10,20,.9);display:inline-flex;align-items:center;gap:5px}
  .summary-pill b{font-weight:600;color:var(--ink)}
  .summary-pill .small{font-size:10px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted)}
  /* Collapsible info section - hidden by default */
.info-collapse{
max-height:0;
overflow:hidden;
transition:max-height 0.3s ease;
}
.info-collapse.expanded{
max-height:500px;
}
.info-toggle{
cursor:pointer;
display:inline-flex;
align-items:center;
gap:6px;
font-size:11px;
color:var(--accent);
padding:6px 12px;
border-radius:8px;
border:1px solid rgba(79,140,255,.3);
background:rgba(79,140,255,.1);
margin-top:8px;
transition:all 0.2s ease;
}
.info-toggle:hover{
background:rgba(79,140,255,.2);
border-color:rgba(79,140,255,.5);
}
.info-toggle-icon{
transition:transform 0.3s ease;
}
.info-toggle.active .info-toggle-icon{
transform:rotate(180deg);
}
  .error-banner,.success-banner{margin-top:6px;border-radius:10px;padding:6px 9px;font-size:11px;display:none}
  .error-banner{border:1px solid rgba(255,100,133,.8);color:#ff93a6;background:linear-gradient(120deg,rgba(255,84,122,.1),transparent)}
  .success-banner{border:1px solid rgba(70,221,159,.85);color:#79ffd1;background:linear-gradient(120deg,rgba(52,206,147,.12),transparent)}
  .status-row{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:var(--muted);margin-top:4px}
  .status-row strong{color:var(--ink)}

  /* Paint toolbar - matches chart header style */
  .paint-toolbar{
    padding:10px 12px;
    border-top:1px solid rgba(255,255,255,.06);
    border-bottom:1px solid rgba(255,255,255,.06);
    background:rgba(0,0,0,.15);
  }

  .paint-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
  }

  .paint-group{
    display:flex;
    align-items:center;
    gap:10px;
  }

  .paint-label{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:var(--muted);
    font-weight:600;
  }

  .paint-option{
    display:flex;
    align-items:center;
    gap:6px;
    cursor:pointer;
    padding:4px 8px;
    border-radius:8px;
    transition:background .14s ease;
    font-size:12px;
    color:var(--ink);
  }

  .paint-option:hover{
    background:rgba(255,255,255,.05);
  }

  .paint-option input[type="radio"]{
    display:none;
  }

  .paint-swatch{
    width:16px;
    height:16px;
    border-radius:4px;
    border:1px solid rgba(255,255,255,.2);
    transition:transform .14s ease,box-shadow .14s ease;
  }

  .paint-swatch.fold{
    background:var(--fold);
  }

  .paint-swatch.call{
    background:var(--call);
  }

  .paint-swatch.raise{
    background:var(--raise);
  }

  .paint-option input[type="radio"]:checked + .paint-swatch{
    transform:scale(1.15);
    box-shadow:0 0 0 2px rgba(79,140,255,.6);
    border-color:rgba(79,140,255,.9);
  }

  .paint-weight-input{
    width:60px;
    padding:6px 8px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(7,10,20,.9);
    color:var(--ink);
    font-size:12px;
    text-align:center;
  }

  .paint-percent{
    font-size:12px;
    color:var(--muted);
  }

  /* Submit actions below chart */
  .submit-actions{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .submit-label-input{
    width:100%;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(7,10,20,.9);
    color:var(--ink);
    font-size:13px;
  }

  .submit-label-input::placeholder{
    color:var(--muted);
    opacity:0.6;
  }

  .submit-buttons{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }

  .action-btn{
    flex:1;
    min-width:160px;
    padding:10px 16px;
    border-radius:10px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:all .14s ease;
    border:1px solid rgba(255,255,255,.12);
  }

  .action-btn.secondary{
    background:rgba(255,255,255,.05);
    color:var(--ink);
  }

  .action-btn.secondary:hover{
    background:rgba(255,255,255,.1);
    border-color:rgba(255,255,255,.2);
    transform:translateY(-1px);
  }

  .action-btn.primary{
    background:linear-gradient(135deg,#3850ff,#5d6dff);
    color:white;
    border-color:rgba(79,140,255,.5);
  }

  .action-btn.primary:hover{
    background:linear-gradient(135deg,#4f61ff,#6d7dff);
    border-color:rgba(79,140,255,.8);
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(56,80,255,.3);
  }

  /* Training button in hero chart */
  #start-training-btn {
    margin-top: 16px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  #start-training-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(79,140,255,.2);
    border-color: rgba(79,140,255,.3);
  }

  #start-training-btn:disabled:hover {
    transform: none;
    box-shadow: none;
  }

  /* Submit tab uses same single-column layout as Solution Library */
  #tab-submit .submit-left{
    width:100%;
  }

  /* Poker table section */
  #table-section{margin-top:14px;}

  /* Submit table section */
  #submit-table-section{margin-top:14px;}
  #submit-felt{position:relative;width:100%;max-width:420px;height:260px;margin:0 auto;background:radial-gradient(circle at 50% 50%,#0d4f2f 0%,#04270d 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(255,255,255,.1),0 0 20px rgba(0,0,0,.5);}
  .seat-toggle{display:flex;gap:8px;justify-content:center;margin-bottom:8px;}
  .seat-toggle label{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:4px;cursor:pointer;}
  .seat-toggle input{margin-right:3px;}
  #felt{position:relative;width:100%;max-width:420px;height:260px;margin:0 auto;background:radial-gradient(circle at 50% 50%,#0d4f2f 0%,#04270d 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(255,255,255,.1),0 0 20px rgba(0,0,0,.5);}
  .seat-chip{position:absolute;transform:translate(-50%,-50%);
    border-radius:10px;
    padding:6px 10px;
    font-size:11px;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(6,10,20,.8);
    color:var(--ink);
    cursor:pointer;
    min-width:72px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    text-align:center;
  }
  .seat-chip.hero{
    background:rgba(79,140,255,0.18);
    border-color:rgba(79,140,255,0.80);
  }

  .seat-chip.v1{
    background:rgba(194,58,85,0.18);
    border-color:rgba(194,58,85,0.75);
  }

  .seat-chip.v2{
    background:rgba(32,227,178,0.18);
    border-color:rgba(32,227,178,0.60);
  }

  /* === Villain stats overlay (hover card) === */
  .villain-stats-card{
    position:relative;
    width:170px;
    background:var(--panel);
    border:1px solid var(--border);
    box-shadow:0 4px 14px rgba(0,0,0,.65);
    border-radius:12px;
    padding:8px 10px;
    font-size:11px;
    color:var(--ink);
    pointer-events:none;
  }
  .villain-stats-card .header{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:6px;
  }
  .villain-stats-card .header img{
    width:32px;
    height:32px;
    border-radius:6px;
    object-fit:contain;
  }
  .villain-stats-card .header .name{
    font-size:13px;
    font-weight:600;
  }
  .villain-stats-card .stat-row{
    display:flex;
    align-items:center;
    /* Align children to the start to keep the bar container left aligned.
       We avoid using space-between so that the bar always begins right
       after the label rather than stretching awkwardly. */
    justify-content:flex-start;
    gap:6px;
    margin-top:4px;
  }
  .villain-stats-card .stat-row .label{
    flex:1;
    font-size:10px;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .villain-stats-card .stat-row .value{
    font-size:10px;
    color:var(--muted);
    white-space:nowrap;
  }
  .villain-stats-card .stat-row .bar{
    position:relative;
    flex:1;
    height:4px;
    background:rgba(255,255,255,.1);
    border-radius:2px;
    overflow:hidden;
    margin-right:4px;
  }
  .villain-stats-card .stat-row .bar .fill{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    border-radius:2px;
    background:var(--accent);
  }

.seat-gif{
    width:20px;
    height:20px;
    object-fit:contain;
    border-radius:4px;
    margin-right:4px;
  }
  .pot-display{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
    background:rgba(6,10,20,.85);
    border:1px solid rgba(255,255,255,.12);
    border-radius:10px;
    padding:8px 14px;
    font-size:14px;
    font-weight:600;
    color:var(--ink);
    pointer-events:none;
  }
  /* === VISUAL REFINEMENT: TYPE, PANELS, BUTTONS, HIGHLIGHTS === */

/* 1) Global type scale & hierarchy */
body{
font-size:13px;
line-height:1.5;
color:var(--ink);
}

header .title-block h1{
margin:0;
font-size:22px;
font-weight:600;
letter-spacing:.03em;
}

header .title-block p{
margin:0;
font-size:13px;
color:var(--muted);
}

.panel-header h2{
margin:0;
font-size:12px;
letter-spacing:.14em;
text-transform:uppercase;
color:var(--muted);
}

.panel-header h2 span{
color:var(--ink);
}

.panel-sub{
margin-top:2px;
font-size:12px;
color:var(--muted);
}

.filter-label,
.selection-label{
font-size:11px;
text-transform:uppercase;
letter-spacing:.12em;
color:var(--muted);
}

.selection-value{
font-size:13px;
color:var(--ink);
}

/* Chart headers / titles */
.chart-header b{
font-size:13px;
font-weight:500;
}

/* 2) Panels, cards & spacing */
.app-shell{
padding:20px 22px 24px;
}

main{
gap:16px;
}

.panel{
border-radius:18px;
background:radial-gradient(circle at 0 0,#080c16 0,#050813 70%);
border:1px solid rgba(255,255,255,.06);
box-shadow:0 16px 44px rgba(0,0,0,.78);
padding:16px 18px 18px;
display:flex;
flex-direction:column;
gap:14px;
}

/* Filters stack */
.filters{
display:flex;
flex-direction:column;
gap:10px;
}

.filter-row{
display:flex;
flex-wrap:wrap;
gap:6px 10px;
align-items:center;
justify-content: space-between; /* Add this */
}

/* Range / chart cards */
.chart-card{
border-radius:14px;
background:rgba(6,10,20,.96);
border:1px solid rgba(255,255,255,.08);
padding:10px 12px 12px;
display:flex;
flex-direction:column;
gap:6px;
}

.chart-header{
display:flex;
align-items:center;
justify-content:space-between;
gap:8px;
}

.chart-body{
margin-top:6px;
}
/* === 4) Unified filter chip system === */

.filter-options{
display:flex;
flex-wrap:wrap;
gap:6px;
}

.filter-pill{
font-size:11px;
padding:6px 11px;
border-radius:999px;
border:1px solid rgba(255,255,255,0.10);
background:rgba(7,10,20,0.96);
color:var(--muted);
cursor:pointer;
transition:
  background 0.14s ease,
  color 0.14s ease,
  border-color 0.14s ease,
  box-shadow 0.14s ease,
  transform 0.06s ease;
white-space:nowrap;
display:inline-flex;
align-items:center;
gap:6px;
}

.filter-pill .dot{
width:6px;
height:6px;
border-radius:999px;
background:rgba(255,255,255,0.45);
}

/* hover = soft, not neon */
.filter-pill:hover{
border-color:rgba(121,164,255,0.75);
color:var(--ink);
background:rgba(79,140,255,0.10);
transform:translateY(-0.5px);
}

/* selected = single accent system */
.filter-pill.selected{
background:rgba(79,140,255,0.18);
border-color:rgba(79,140,255,0.95);
color:var(--ink);
box-shadow:0 0 0 1px rgba(79,140,255,0.65);
transform:translateY(-0.5px);
}

.filter-pill.selected .dot{
background:rgba(227,237,255,0.95);
}

/* disabled = same shape, just dimmed */
.filter-pill.disabled{
opacity:0.32;
cursor:default;
pointer-events:none;
border-style:dashed;
background:rgba(5,7,16,0.9);
}

/* badges as part of the same chip family */
.badge{
padding:4px 9px;
border-radius:999px;
font-size:10px;
text-transform:uppercase;
letter-spacing:0.10em;
border:1px solid rgba(255,255,255,0.10);
background:rgba(7,10,20,0.96);
color:var(--muted);
display:inline-flex;
align-items:center;
gap:6px;
}


/* === 5) Range grid + legend clarity === */

.range-grid{
border-radius:12px;
overflow:hidden;
border:1px solid rgba(21,28,50,0.95);
background:#050712;
}

/* base cell */
.range-cell{
position:relative;
aspect-ratio:1/1;
font-size:9px;
display:flex;
align-items:center;
justify-content:center;
color:rgba(232,239,255,0.9);
border:1px solid rgba(15,22,47,0.8);
cursor:default;
background:#050712;
transition:
  transform 0.08s ease,
  box-shadow 0.08s ease,
  border-color 0.08s ease,
  background 0.08s ease;
}

/* fold = darkest, low-contrast */
.range-cell.fold{
background:var(--cell-fold);
color:rgba(194,202,233,0.6);
box-shadow:inset 0 0 0 1px rgba(75,87,144,0.65);
}

/* call = soft green tile */
.range-cell.call{
background:linear-gradient(
  135deg,
  rgba(44,152,115,0.9),
  rgba(13,77,57,0.98)
);
box-shadow:inset 0 0 0 1px rgba(120,229,177,0.55);
}

/* raise = soft red tile */
.range-cell.raise{
background:linear-gradient(
  135deg,
  rgba(194,58,85,0.96),
  rgba(104,23,48,0.98)
);
box-shadow:inset 0 0 0 1px rgba(255,189,210,0.6);
}

/* split = gentle blend, no neon */
.range-cell.split{
background:linear-gradient(
  135deg,
  rgba(44,152,115,0.9),
  rgba(194,58,85,0.96)
);
box-shadow:inset 0 0 0 1px rgba(220,205,238,0.75);
}

/* label overlay toned down */
.range-cell::after{
content:attr(data-label);
position:absolute;
inset:1px;
display:flex;
align-items:center;
justify-content:center;
border-radius:4px;
background:rgba(0,0,0,0.16);
}

/* hover = subtle lift, no glow bomb */
.range-cell:hover{
transform:translateY(-1px);
box-shadow:
  0 0 0 1px rgba(254,255,255,0.22),
  0 6px 12px rgba(0,0,0,0.75);
z-index:1;
}

/* legend strip under grids */
.range-tooltip{
margin-top:6px;
padding-top:4px;
font-size:10px;
color:var(--muted);
display:flex;
flex-wrap:wrap;
gap:5px 10px;
border-top:1px solid rgba(26,35,61,0.85);
opacity:0.9;
}

.legend-item{
display:inline-flex;
align-items:center;
gap:5px;
}

.legend-dot{
width:8px;
height:8px;
border-radius:999px;
margin-right:2px;
box-shadow:0 0 0 1px rgba(0,0,0,0.6);
}
