.tool-page { padding: 120px 0 80px; min-height: 100vh; }
.tool-header { margin-bottom: 40px; }
.back-link { display:inline-flex; align-items:center; gap:8px; color:var(--text-muted); font-size:13px; font-family:var(--font-head); margin-bottom:24px; transition:color var(--transition); }
.back-link:hover { color:var(--cyan); }
.tool-title { font-family:var(--font-head); font-size:clamp(28px,5vw,44px); font-weight:700; margin:12px 0 16px; }
.tool-desc { color:var(--text-muted); font-size:16px; max-width:580px; }

.bj-layout { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:40px; }
@media(max-width:720px) { .bj-layout { grid-template-columns:1fr; } }

.calc-card { background:var(--bg-2); border:1px solid var(--border); border-radius:var(--radius-lg); padding:28px; }
.calc-card h3 { font-family:var(--font-head); font-size:13px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--text-muted); margin-bottom:20px; }

/* Card rank buttons */
.rank-grid { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.rank-btn {
  width:44px; height:54px; border:1.5px solid var(--border); background:var(--bg-3);
  color:var(--text); font-family:var(--font-head); font-size:15px; font-weight:700;
  border-radius:6px; cursor:pointer; transition:all var(--transition);
  display:flex; align-items:center; justify-content:center;
}
.rank-btn:hover { border-color:var(--cyan); color:var(--cyan); }
.rank-btn.selected { background:#fff; color:#111; border-color:#fff; box-shadow:0 0 12px rgba(255,255,255,0.3); }

/* Player hand display */
.hand-display { display:flex; flex-wrap:wrap; gap:8px; min-height:60px; margin-bottom:16px; align-items:center; }
.hand-card {
  width:44px; height:58px; background:#fff; border-radius:6px;
  display:flex; flex-direction:column; justify-content:space-between;
  padding:5px; font-family:var(--font-head); font-weight:700; font-size:14px;
  box-shadow:0 2px 8px rgba(0,0,0,0.4); cursor:pointer; transition:transform .2s;
  position:relative;
}
.hand-card:hover { transform:translateY(-2px); }
.hand-card.red { color:#cc0000; }
.hand-card.black { color:#111; }
.hand-card__top { font-size:13px; line-height:1; }
.hand-card__bot { font-size:13px; line-height:1; transform:rotate(180deg); align-self:flex-end; }
.hand-card__remove {
  position:absolute; top:-6px; right:-6px; width:16px; height:16px;
  background:var(--pink); border-radius:50%; font-size:9px; color:#fff;
  display:flex; align-items:center; justify-content:center; opacity:0;
  transition:opacity .2s;
}
.hand-card:hover .hand-card__remove { opacity:1; }
.hand-total { font-family:'Press Start 2P', monospace; font-size:13px; color:var(--cyan); margin-left:8px; }

/* Recommendation box */
.rec-box {
  grid-column:1/-1; border-radius:var(--radius-lg); padding:32px;
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  border:2px solid;
}
.rec-box--hit    { background:rgba(0,255,209,.08); border-color:var(--cyan); }
.rec-box--stand  { background:rgba(57,255,20,.08); border-color:var(--green); }
.rec-box--double { background:rgba(255,157,0,.08); border-color:#FF9D00; }
.rec-box--split  { background:rgba(255,46,99,.08); border-color:var(--pink); }
.rec-box--surrender { background:rgba(167,139,250,.08); border-color:var(--purple); }
.rec-box--none   { background:var(--bg-2); border-color:var(--border); }

.rec-action { font-family:'Press Start 2P', monospace; font-size:clamp(18px,4vw,30px); }
.rec-action--hit      { color:var(--cyan); text-shadow:0 0 12px rgba(0,255,209,.7); }
.rec-action--stand    { color:var(--green); text-shadow:0 0 12px rgba(57,255,20,.7); }
.rec-action--double   { color:#FF9D00; text-shadow:0 0 12px rgba(255,157,0,.7); }
.rec-action--split    { color:var(--pink); text-shadow:0 0 12px rgba(255,46,99,.7); }
.rec-action--surrender { color:var(--purple); text-shadow:0 0 12px rgba(167,139,250,.7); }

.rec-explain { font-size:14px; color:var(--text-muted); max-width:420px; line-height:1.6; }
.rec-hand-info { text-align:right; }
.rec-hand-info__type { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px; }
.rec-hand-info__val { font-family:var(--font-head); font-size:22px; font-weight:700; color:var(--text); }

/* Legend */
.legend { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:20px; }
.legend-item { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); }
.legend-dot { width:14px; height:14px; border-radius:3px; flex-shrink:0; }

/* Strategy chart */
.chart-wrap { overflow-x:auto; margin-top:8px; }
.strategy-table { border-collapse:collapse; font-size:12px; }
.strategy-table th {
  padding:6px 10px; font-family:'Press Start 2P', monospace; font-size:9px;
  color:var(--text-muted); text-align:center; border-bottom:1px solid var(--border);
}
.strategy-table td {
  padding:5px 8px; text-align:center; border:1px solid rgba(255,255,255,.04);
  font-family:var(--font-head); font-size:12px; font-weight:600;
  min-width:36px;
}
.strategy-table .row-label { text-align:right; padding-right:12px; color:var(--text-muted); font-size:11px; white-space:nowrap; }
.strategy-table .section-label {
  padding:8px 12px; font-family:'Press Start 2P', monospace; font-size:8px;
  color:var(--text-muted); background:var(--bg-3); letter-spacing:.05em;
}

.cell-H   { background:rgba(0,255,209,.12); color:var(--cyan); }
.cell-S   { background:rgba(57,255,20,.10); color:var(--green); }
.cell-D   { background:rgba(255,157,0,.15); color:#FF9D00; }
.cell-Ds  { background:rgba(255,157,0,.10); color:#cc8800; }
.cell-P   { background:rgba(255,46,99,.12); color:var(--pink); }
.cell-R   { background:rgba(167,139,250,.12); color:var(--purple); }

.chart-tabs { display:flex; background:var(--bg-3); border-radius:var(--radius); padding:4px; gap:4px; margin-bottom:20px; }
.chart-tab { flex:1; padding:8px; border:none; background:transparent; color:var(--text-muted); font-family:var(--font-head); font-size:12px; font-weight:600; border-radius:7px; cursor:pointer; transition:all var(--transition); }
.chart-tab.active { background:var(--bg-2); color:var(--cyan); box-shadow:0 0 0 1px var(--border-bright); }

.note-box { background:var(--bg-3); border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; font-size:12px; color:var(--text-muted); margin-bottom:24px; line-height:1.7; }
.note-box strong { color:var(--text); }

@media(max-width:600px) {
  .rec-box { flex-direction:column; text-align:center; }
  .rec-hand-info { text-align:center; }
}

/* ── Content / FAQ section ───────────────────────────── */
.tool-content-section {
  padding: 64px 0 80px;
  border-top: 1px solid var(--border);
}
.tool-content-section h2 {
  font-family: var(--font-head); font-size: clamp(18px, 3vw, 26px); font-weight: 700;
  margin: 40px 0 12px;
}
.tool-content-section h2:first-child { margin-top: 0; }
.tool-content-section p {
  color: var(--text-muted); font-size: 15px; line-height: 1.75; max-width: 1200px;
  margin-bottom: 12px;
}

.content-table-wrap { overflow-x: auto; margin: 20px 0 32px; max-width: 1200px; }
.content-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.content-table th {
  font-family: var(--font-head); font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); text-align: left;
  padding: 10px 16px; border-bottom: 1px solid var(--border-bright);
}
.content-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px;
}
.content-table td:first-child {
  font-family: var(--font-head); font-weight: 700; color: var(--green);
}
.content-table tbody tr:last-child td { border-bottom: none; }
.content-table tbody tr:hover td { background: var(--bg-2); }

.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; max-width: 1200px; }
.faq-item {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; font-family: var(--font-head); font-size: 14px; font-weight: 600;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  transition: color var(--transition);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 18px; color: var(--green); transition: transform var(--transition);
  flex-shrink: 0; margin-left: 16px;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--green); }
.faq-item p {
  padding: 0 20px 16px; margin: 0;
  border-top: 1px solid var(--border);
}

.tips-list { display: flex; flex-direction: column; gap: 2px; margin: 20px 0 32px; max-width: 1200px; }
.tip-item {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  border-left: 3px solid var(--green);
  transition: border-color var(--transition), background var(--transition);
}
.tip-item:hover { background: rgba(57,255,20,0.03); border-left-color: var(--green); }
.tip-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  color: var(--green); margin-bottom: 8px; text-transform: none; letter-spacing: normal;
  text-shadow: 0 0 8px rgba(57,255,20,0.3);
}
.tip-item p { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin: 0; max-width: none; }
