.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; }

.calc-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px;
}
.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;
}

/* Lottery type picker */
.lotto-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.lotto-type-btn {
  padding: 14px 16px; border: 1.5px solid var(--border);
  background: var(--bg-3); border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition); text-align: left;
}
.lotto-type-btn:hover { border-color: var(--green); }
.lotto-type-btn.active { border-color: var(--green); background: rgba(57,255,20,0.06); }
.lotto-type-btn__name { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text); }
.lotto-type-btn__detail { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Ball display */
.balls-area {
  min-height: 120px; display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: center;
  padding: 24px; margin: 24px 0;
}

.ball {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace; font-size: 14px;
  position: relative; cursor: default;
  transition: transform 0.3s ease;
}
.ball--main {
  background: radial-gradient(circle at 35% 35%, #00FFD1, #007a64);
  color: #000; box-shadow: 0 0 20px rgba(0,255,209,0.5), 0 4px 12px rgba(0,0,0,0.4);
}
.ball--bonus {
  background: radial-gradient(circle at 35% 35%, #FF2E63, #8b0028);
  color: #fff; box-shadow: 0 0 20px rgba(255,46,99,0.5), 0 4px 12px rgba(0,0,0,0.4);
}
.ball--extra {
  background: radial-gradient(circle at 35% 35%, #a78bfa, #4c1d95);
  color: #fff; box-shadow: 0 0 20px rgba(167,139,250,0.5), 0 4px 12px rgba(0,0,0,0.4);
}

@keyframes ballPop {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.ball.animating { animation: ballPop 0.4s ease forwards; }

.ball-label {
  font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 6px;
  font-family: var(--font-head);
}
.ball-wrap { display: flex; flex-direction: column; align-items: center; }

.generate-area { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sets-label { font-size: 13px; color: var(--text-muted); }

.sets-display { display: flex; flex-direction: column; gap: 20px; }
.set-row {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.set-row__num { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--text-muted); min-width: 30px; }

.mini-ball {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace; font-size: 10px;
}
.mini-ball--main { background: radial-gradient(circle at 35% 35%, #00FFD1, #007a64); color: #000; box-shadow: 0 0 10px rgba(0,255,209,0.35); }
.mini-ball--bonus { background: radial-gradient(circle at 35% 35%, #FF2E63, #8b0028); color: #fff; box-shadow: 0 0 10px rgba(255,46,99,0.35); }
.mini-ball--extra { background: radial-gradient(circle at 35% 35%, #a78bfa, #4c1d95); color: #fff; box-shadow: 0 0 10px rgba(167,139,250,0.35); }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px; font-size: 14px; width: 100%; }

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