
:root{
  --bg:#0b0f14;
  --card:#121820;
  --text:#dce4ee;
  --muted:#8fa3b6;
  --accent:#4db6f7;
  --grid:#233142;
  --cell-border:#33485e;
}

*{box-sizing:border-box}

html,body{height:100%}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:linear-gradient(180deg, #0b0f14, #0e141b 60%, #0b0f14);
  color:var(--text);
  margin:0;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.container{width:min(1200px, 94%); margin:0 auto; padding:28px 0 40px;}
.header h1{margin:0 0 14px; font-size: clamp(22px,4vw,34px)}

/* Horizontal layout */
.layout{
  display:grid;
  grid-template-columns: 300px 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .layout{grid-template-columns:1fr}
}

.card{
  background:var(--card);
  border:1px solid #1b2733;
  border-radius:14px;
  padding:14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

.sidebar .form-group{margin-bottom:12px}
label{display:block; font-size:13px; color:var(--muted); margin-bottom:6px}
select,input,button{
  width:100%;
  border:1px solid #233142;
  background:#0f151d;
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
}
button{
  background:var(--accent);
  border:none;
  color:#00223a;
  font-weight:700;
  cursor:pointer;
  transition:transform .06s ease, filter .12s ease;
}
button:hover{filter:brightness(1.08)}
button:active{transform:translateY(1px)}

/* Two panels for min/max */
.main{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 1100px){
  .main{grid-template-columns:1fr}
}

.panel .panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.panel h3{margin:0; font-size:18px}
.panel .actions button{width:auto; padding:8px 12px}

/* Parsed range box */
.parsed-range{
  margin:8px 0 10px;
  padding:12px;
  border:1px solid #1b2733;
  background:#0b1017;
  border-radius:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color:#cfe7ff;
  word-break:break-word;
}

/* Poker grids */
.poker-grid{
  display:grid;
  grid-template-columns: repeat(13, 32px);
  grid-template-rows: repeat(13, 32px);
  gap:6px;
  justify-content:center;
  align-content:center;
  width:fit-content;
  margin: 10px auto 8px;
  padding:14px;
  background:var(--grid);
  border:1px solid #1b2733;
  border-radius:12px;
}
.poker-grid div{
  width:32px; height:32px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--cell-border);
  border-radius:6px;
  font-size:12px;
  color:#d5e0ea;
  background:#2b3a4b; /* default (fold) */
  transition: transform .06s ease, box-shadow .12s ease, filter .12s ease;
}
.poker-grid div:hover{ transform: translateY(-1px); box-shadow:0 8px 18px rgba(0,0,0,.35) }

/* Respect the JS inline background colors */
.poker-grid div[style*="background-color: green"]{
  background:#2ae27a !important; color:#071a0c;
  box-shadow: 0 6px 14px rgba(0,255,100,.18);
}
.poker-grid div[style*="background-color: red"]{
  background:#5a2430 !important; color:#ffe7ea;
  box-shadow: 0 6px 14px rgba(255,0,60,.18);
}

/* Legends under each grid */
.legend{
  display:flex; gap:10px; align-items:center; justify-content:center;
  font-size:12px; color:var(--muted);
  margin-top:6px;
}
.legend .sw{width:14px;height:14px;border-radius:4px;display:inline-block;border:1px solid #203040}
.legend .sw-green{background:#2ae27a}
.legend .sw-red{background:#5a2430}

/* Keep center alignment for overall body text from original look */
h1, .header, .panel h3 { text-align: center; }
