@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #fafafa;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.container {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 48px;
  max-width: 580px;
  width: 90%;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.header-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-version {
  font-size: 0.7rem;
  color: #bbb;
  margin-left: 2px;
}

.subtitle {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 16px;
  line-height: 1.8;
  padding-left: 18px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-left: 18px;
}

.feature-tag {
  font-size: 0.68rem;
  color: #22c55e;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 2px;
  padding: 3px 8px;
}

/* ---- Text Input ---- */
.input-section {
  margin-bottom: 24px;
}

.text-input {
  width: 100%;
  height: 180px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 16px;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  color: #1a1a1a;
  background: #fafafa;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.8;
}

.text-input:focus {
  border-color: #22c55e;
  background: #fff;
}

.text-input::placeholder {
  color: #ccc;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.clear-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s;
}

.clear-btn:hover { border-color: #bbb; color: #666; }
.clear-btn::before { content: '> '; }

.hint {
  font-size: 0.7rem;
  color: #ccc;
}

/* ---- Section Label ---- */
.section-label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 12px;
}

/* ---- Stats ---- */
.stats-section {
  margin-bottom: 24px;
}

.stats {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.78rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.stat:last-child { border-bottom: none; }
.stat.highlight { background: #f0fdf4; }
.stat-label { color: #888; }

.stat-value {
  font-weight: 600;
  color: #1a1a1a;
}

.stat.highlight .stat-value { color: #22c55e; }

/* ---- SNS Gauges ---- */
.sns-section {
  margin-bottom: 24px;
}

.sns-gauges {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.sns-gauge-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.sns-gauge-item:last-child { border-bottom: none; }

.sns-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.sns-name { color: #888; }

.sns-count {
  color: #aaa;
  font-size: 0.72rem;
}

.sns-count span {
  color: #1a1a1a;
  font-weight: 600;
}

.sns-bar {
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.sns-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.15s, background 0.15s;
  min-width: 0;
}

.sns-bar-fill.warning { background: #f59e0b; }
.sns-bar-fill.over { background: #ef4444; }

/* ---- Composition ---- */
.composition-section {
  margin-bottom: 0;
}

.composition-bar-wrap {
  margin-bottom: 12px;
}

.composition-bar {
  display: flex;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}

.comp-seg {
  height: 100%;
  transition: width 0.3s;
  min-width: 0;
  position: relative;
}

#compKanji  { background: #22c55e; }
#compHira   { background: #4ade80; }
#compKata   { background: #86efac; }
#compAlnum  { background: #bbf7d0; }
#compOther  { background: #e0e0e0; }

.composition-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label { color: #888; }

.legend-value {
  color: #1a1a1a;
  font-weight: 600;
}

.kanji-advice {
  font-size: 0.7rem;
  color: #ccc;
  padding: 10px 14px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  background: #fafafa;
  transition: all 0.2s;
}

.kanji-advice.good {
  color: #22c55e;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.kanji-advice.high {
  color: #f59e0b;
  border-color: #fde68a;
  background: #fffbeb;
}

.kanji-advice.low {
  color: #888;
  border-color: #e0e0e0;
  background: #fafafa;
}

/* ---- Footer ---- */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.7rem;
  color: #ccc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer-name { color: #bbb; font-weight: 600; }
.footer-sep  { color: #e0e0e0; }
.footer-desc { color: #ccc; }

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-credit { color: #ddd; }

.footer-link {
  color: #bbb;
  text-decoration: none;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1px;
  transition: color 0.15s;
}

.footer-link:hover { color: #22c55e; border-color: #22c55e; }
.footer-x::before { content: '\f0 '; font-size: 0.65rem; }

/* ---- Responsive ---- */
@media (max-width: 500px) {
  .container { padding: 28px 20px; }
  .text-input { height: 140px; }
  .composition-legend { gap: 4px 12px; }
}