/* ══════════════════════════════════════════════════════════════
   Poker Tools — Shared Design System
   Matches main site dark theme, calculator-panel aesthetic
   ══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  --bg-page:      #1a1f2e;
  --bg-panel:     #252a3a;
  --bg-panel-alt: #2a3042;
  --bg-input:     #1e2332;
  --bg-header:    #151926;
  --bg-hover:     #323850;
  --text-primary: #e4e8f1;
  --text-secondary: #9aa3b8;
  --text-muted:   #6b7590;
  --accent:       #f5a623;    /* Orange — primary tool accent */
  --accent-hover: #e09510;
  --accent-blue:  #4a90d9;
  --clr-raise:    #e74c3c;    /* Red — raise/strong */
  --clr-call:     #f39c12;    /* Yellow — call/medium */
  --clr-fold:     #7f8c8d;    /* Gray — fold/weak */
  --clr-success:  #43b581;
  --border:       #2f3652;
  --border-light: #3a4260;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --shadow-panel: 0 4px 24px rgba(0,0,0,.4), 0 1px 4px rgba(0,0,0,.2);
  --shadow-btn:   0 2px 8px rgba(0,0,0,.3);
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono:    "SF Mono", "Fira Code", Consolas, monospace;
  --max-tool:     800px;
  --max-page:     1200px;
  --touch-min:    44px;       /* Minimum touch target */
}

html { overflow-x: hidden; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; transition: color .2s; }
a:hover { color: #6aafff; }
img { max-width: 100%; height: auto; }

/* ── Page Layout ── */
.page-container {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ── Header ── */
.tool-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.tool-header-inner {
  max-width: var(--max-page);
  margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.tool-header-logo {
  font-size: 18px; font-weight: 800;
  color: var(--accent); letter-spacing: 1px;
  text-decoration: none;
}
.tool-header-logo span { color: var(--text-primary); font-weight: 400; font-size: 14px; }
.tool-header-nav { display: flex; gap: 16px; align-items: center; }
.tool-header-nav a {
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  padding: 4px 0; transition: color .2s;
}
.tool-header-nav a:hover { color: var(--text-primary); }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; text-decoration: none;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--text-primary); }

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 12px 0; font-size: 13px; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ── Tool Panel (Calculator-feel) ── */
.tool-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  max-width: var(--max-tool);
  margin: 0 auto 32px;
}
.panel-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.panel-section:last-child { border-bottom: none; }
.panel-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ── Input zone ── */
.input-zone { background: var(--bg-panel); }

/* ── Action zone ── */
.action-zone {
  background: var(--bg-panel-alt);
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 16px 24px;
}

/* ── Result zone ── */
.result-zone {
  background: var(--bg-input);
  border-top: 2px solid var(--accent);
  padding: 24px;
  text-align: center;
}
.result-value {
  font-size: 32px; font-weight: 800; color: var(--accent);
  animation: fadeInUp .3s ease;
}
.result-label {
  font-size: 14px; color: var(--text-secondary); margin-top: 4px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 24px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer;
  min-height: var(--touch-min); min-width: var(--touch-min);
  transition: all .15s; user-select: none;
}
.btn-primary {
  background: var(--accent); color: #1a1f2e;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg-panel-alt); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--accent-blue); }

/* Button group (position selectors etc.) */
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-group .btn-option {
  padding: 8px 14px; border-radius: var(--radius);
  background: var(--bg-panel-alt); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  min-height: var(--touch-min); min-width: var(--touch-min);
}
.btn-group .btn-option:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-group .btn-option.active {
  background: var(--accent); color: #1a1f2e; border-color: var(--accent);
}

/* ── Card Picker (shared across tools) ── */
.card-picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 500; display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.card-picker-overlay.open { display: flex; }
.card-picker-panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-panel);
  padding: 20px; max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.card-picker-title {
  font-size: 15px; font-weight: 700; margin-bottom: 12px; text-align: center;
}
.card-picker-grid {
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px;
}
.pick-card {
  aspect-ratio: 5/7; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer;
  border: 2px solid var(--border); background: var(--bg-input);
  transition: all .15s; user-select: none;
  min-height: var(--touch-min);
  font-size: 13px; line-height: 1.1;
}
.pick-card:hover:not(.used):not(.selected) {
  border-color: var(--accent); transform: scale(1.08); z-index: 2;
}
.pick-card.selected {
  border-color: var(--accent); background: rgba(245,166,35,.15);
  box-shadow: 0 0 8px rgba(245,166,35,.3);
}
.pick-card.used {
  opacity: .2; cursor: not-allowed;
}
.pick-card .rank { font-size: 14px; }
.pick-card .suit { font-size: 12px; }
.suit-s, .suit-c { color: var(--text-primary); }  /* Spade, Club = white/light */
.suit-h, .suit-d { color: var(--clr-raise); }     /* Heart, Diamond = red */

.card-picker-close {
  display: block; margin: 12px auto 0; padding: 8px 24px;
}

/* ── Card Slots (displayed selected cards) ── */
.card-slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.card-slot {
  width: 60px; height: 84px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
  border: 2px dashed var(--border-light);
  background: var(--bg-input); color: var(--text-muted);
  font-size: 13px; font-weight: 600; user-select: none;
}
.card-slot:hover { border-color: var(--accent); }
.card-slot.filled {
  border-style: solid; font-size: 18px; font-weight: 800;
}
.card-slot.filled .slot-rank { font-size: 20px; line-height: 1; }
.card-slot.filled .slot-suit { font-size: 16px; line-height: 1; }
.card-slot.filled.suit-h, .card-slot.filled.suit-d {
  border-color: var(--clr-raise); color: var(--clr-raise); background: #2a2030;
}
.card-slot.filled.suit-s, .card-slot.filled.suit-c {
  border-color: #7a8aa8; color: var(--text-primary); background: #1e2535;
}

/* ── Content Sections (SEO text below tool) ── */
.content-section {
  max-width: var(--max-tool);
  margin: 0 auto 32px;
  padding: 0 4px;
}
.content-section h2 {
  font-size: 22px; font-weight: 700; margin: 32px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.content-section h3 { font-size: 17px; margin: 20px 0 8px; }
.content-section p { margin-bottom: 14px; color: var(--text-secondary); font-size: 15px; line-height: 1.8; }
.content-section ul, .content-section ol {
  margin: 0 0 14px 24px; color: var(--text-secondary); font-size: 15px;
}
.content-section li { margin-bottom: 6px; }
.content-section strong { color: var(--text-primary); }

/* FAQ */
.faq-item { margin-bottom: 16px; }
.faq-item h3 {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 6px;
}
.faq-item p { font-size: 14px; }

/* Related links */
.related-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.related-link {
  padding: 14px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .15s;
}
.related-link:hover { border-color: var(--accent); }
.related-link-title { font-size: 14px; font-weight: 600; }
.related-link-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Footer ── */
.tool-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px; text-align: center;
  font-size: 12px; color: var(--text-muted);
  margin-top: 48px;
}
.tool-footer a { color: var(--text-secondary); margin: 0 8px; }
.tool-footer a:hover { color: var(--accent); }
.tool-footer p { margin-top: 8px; }

/* ── Hand Rankings Table (shared) ── */
.rankings-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
}
.rankings-table th, .rankings-table td {
  padding: 12px 14px; border: 1px solid var(--border);
  text-align: left; font-size: 14px;
}
.rankings-table th {
  background: var(--bg-panel-alt); font-weight: 600; font-size: 13px;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px;
}
.rankings-table tr:hover { background: var(--bg-hover); }
.rankings-table .rank-num {
  font-size: 18px; font-weight: 800; color: var(--accent);
  text-align: center; width: 40px;
}
.rankings-table .hand-example {
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .page-container { padding: 0 10px; }
  .tool-header-inner { padding: 0 10px; height: 50px; }
  .tool-header-logo { font-size: 15px; }
  .tool-header-logo span { font-size: 12px; }
  .tool-header-nav { gap: 8px; }
  .tool-header-nav a { font-size: 12px; }

  .tool-panel { border-radius: var(--radius-lg); margin-bottom: 20px; }
  .panel-section { padding: 16px; }
  .action-zone { padding: 12px 16px; }
  .result-zone { padding: 16px; }
  .result-value { font-size: 24px; }

  .card-slot { width: 50px; height: 70px; }
  .card-slot.filled .slot-rank { font-size: 17px; }
  .card-slot.filled .slot-suit { font-size: 14px; }

  .card-picker-panel { padding: 14px; max-width: 100%; }
  .card-picker-grid { gap: 3px; }
  .pick-card { font-size: 11px; min-height: 38px; }
  .pick-card .rank { font-size: 12px; }
  .pick-card .suit { font-size: 10px; }

  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-group .btn-option { padding: 8px 10px; font-size: 12px; }

  .content-section h2 { font-size: 19px; }
  .content-section p { font-size: 14px; }

  .related-links { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .tool-header-nav a:not(.lang-toggle) { display: none; }
  .card-slot { width: 44px; height: 62px; }
  .card-slot.filled .slot-rank { font-size: 15px; }
  .card-slot.filled .slot-suit { font-size: 12px; }
  .card-picker-grid { gap: 2px; }
  .pick-card { font-size: 10px; border-width: 1px; min-height: 34px; }

  .panel-section { padding: 12px; }
  .result-value { font-size: 22px; }
  .rankings-table th, .rankings-table td { padding: 8px 6px; font-size: 12px; }
  .rankings-table .rank-num { font-size: 15px; }
}
