.tool-page { padding: 120px 0 80px; min-height: 100vh; }
.tool-header { margin-bottom: 48px; }
.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: 540px; }

.card-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 800px) { .card-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: 0.06em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 20px;
}

/* Playing card */
.card {
  width: 90px; height: 126px; border-radius: 10px;
  background: #fff; border: 1px solid rgba(255,255,255,0.2);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 8px; position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
  cursor: default;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px); }
.card.red .card-rank, .card.red .card-suit { color: #cc0000; }
.card.black .card-rank, .card.black .card-suit { color: #111; }

.card-rank {
  font-family: 'Space Grotesk', sans-serif; font-size: 18px;
  font-weight: 700; line-height: 1;
}
.card-center { font-size: 36px; text-align: center; line-height: 1; }
.card-rank-bottom {
  font-family: 'Space Grotesk', sans-serif; font-size: 18px;
  font-weight: 700; line-height: 1; transform: rotate(180deg);
  align-self: flex-end;
}
.card-suit { font-size: 14px; line-height: 1; }
.card-suit-bottom { font-size: 14px; line-height: 1; }

.card-back {
  width: 90px; height: 126px; border-radius: 10px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0d1f33 100%);
  border: 3px solid #2a4a6b; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.card-back::before {
  content: '♦'; font-size: 80px; opacity: 0.08; color: #fff;
  position: absolute;
}
.card-back::after {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 7px;
}

@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.card.new-card { animation: cardFlip 0.35s ease forwards; }

.cards-area {
  min-height: 160px; display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-start; padding: 20px;
  background: var(--bg-3); border-radius: var(--radius); margin-top: 12px;
}

.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.action-row .btn { flex: 1; min-width: 120px; }

/* Deck counter */
.deck-bar { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.deck-bar__fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 3px; transition: width 0.3s ease; }

.stat-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.stat-item:last-child { border-bottom: none; padding-bottom: 0; }
.stat-item__label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-item__val { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--cyan); }

.empty-state { color: var(--text-muted); font-size: 13px; padding: 20px; width: 100%; 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;
}

.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(--purple); transition: transform var(--transition);
  flex-shrink: 0; margin-left: 16px;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--purple); }
.faq-item p {
  padding: 0 20px 16px; margin: 0;
  border-top: 1px solid var(--border);
}
