/* text-tools.css — shared styles for text/utility tool pages (sentence, syllable, coin)
   Creem neobrutalism: ink borders + hard offset shadows. */

.tt-tool {
  background-color: var(--color-surface);
  border: var(--nb-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard-lg);
  padding: var(--space-lg) var(--space-md) var(--space-lg);
  text-align: center;
  transition: background-color var(--dur-slow) ease;
}

.tt-title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: 4px;
}

.tt-sub {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

/* Text input */
.tt-input {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: var(--space-md);
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  margin-bottom: var(--space-lg);
  transition: box-shadow var(--dur-fast) ease;
}
.tt-input:focus {
  outline: none;
  box-shadow: var(--shadow-hard-lg);
}
.tt-input::placeholder { color: var(--color-text-tertiary); }

/* Stat grid */
.tt-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: var(--space-lg);
}

.tt-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 8px;
  background-color: var(--color-bg);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard-sm);
}

/* The headline metric for the page gets the accent fill */
.tt-stat-primary { background-color: var(--color-increment); }

.tt-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.tt-stat-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Buttons */
.tt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tt-btn {
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.tt-btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard-lg); }
.tt-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 0 var(--nb-ink); }
.tt-btn-clear { background-color: var(--color-decrement); }

/* ===== Coin counter specific ===== */
.tt-coin-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--space-lg); }

.tt-coin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--color-bg);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard-sm);
}

.tt-coin-name { font-weight: 700; font-size: 15px; color: var(--color-text); text-align: left; }
.tt-coin-name small { display: block; font-weight: 500; font-size: 12px; color: var(--color-text-secondary); }

.tt-coin-qty {
  width: 88px;
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-system);
  text-align: center;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: var(--nb-border);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.tt-coin-qty:focus { outline: none; box-shadow: var(--shadow-hard-sm); }

.tt-coin-sub {
  min-width: 92px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.tt-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  background-color: var(--color-increment);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
}
.tt-total-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text); }
.tt-total-value { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--color-text); font-variant-numeric: tabular-nums; }

/* ===== Syllable per-word breakdown ===== */
.tt-breakdown {
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: var(--nb-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard-sm);
  margin-bottom: var(--space-lg);
}
.tt-breakdown-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-secondary); margin-bottom: 8px; }
.tt-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin: 0 6px 6px 0;
  padding: 4px 9px;
  background-color: var(--color-surface);
  border: 2px solid var(--nb-ink);
  border-radius: 999px;
  font-size: 14px;
}
.tt-chip b { font-weight: 800; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.tt-empty { font-size: 14px; color: var(--color-text-tertiary); }

@media (max-width: 560px) {
  .tt-stats { grid-template-columns: repeat(2, 1fr); }
  .tt-stat-value { font-size: 22px; }
  .tt-total-value { font-size: 32px; }
  .tt-coin-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .tt-coin-sub { grid-column: 2; }
}

/* Content table (roll values etc.) */
.tt-table-wrap { overflow-x: auto; margin: 12px 0; }
.tt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  border: var(--nb-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tt-table th, .tt-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--nb-ink);
  color: var(--color-text-secondary);
}
.tt-table th { background-color: var(--color-purple-light); color: var(--color-text); font-weight: 700; }
.tt-table tr:last-child td { border-bottom: none; }
