:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface-2: #20242f;
  --border: #2b303c;
  --text: #e6e8ee;
  --muted: #9aa1b1;
  --accent: #5b8cff;
  --accent-2: #3fd0a0;
  --radius: 12px;
  --max: 960px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }

/* ---- Hero ---- */
.hero { text-align: center; padding: 56px 0 32px; }
.hero h1 { font-size: 2.2rem; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0 auto; max-width: 560px; }

/* ---- Tool grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 6px; color: var(--text); font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card .icon { font-size: 1.6rem; margin-bottom: 8px; }

/* ---- Tool page ---- */
.tool { margin: 32px 0; }
.tool h1 { font-size: 1.8rem; margin-bottom: 8px; }
.tool .lead { color: var(--muted); margin-bottom: 24px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

label { display: block; font-size: 0.9rem; color: var(--muted); margin: 14px 0 6px; }

input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 1rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: filter 0.15s;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.secondary, .btn.secondary { background: var(--surface-2); border: 1px solid var(--border); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

.result {
  margin-top: 18px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1.05rem;
  word-break: break-word;
}
.result .big { font-size: 1.6rem; font-weight: 700; color: var(--accent-2); }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.stat-box .num { font-size: 1.5rem; font-weight: 700; color: var(--accent-2); }
.stat-box .label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Color preview ---- */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 12px;
  transition: background 0.2s;
}

/* ---- Emoji grid ---- */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.emoji-item:hover { border-color: var(--accent); transform: scale(1.1); }

/* ---- Holiday list ---- */
.holiday-group { margin-bottom: 20px; }
.holiday-group h3 { color: var(--accent); font-size: 1rem; margin-bottom: 8px; }
.holiday-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.holiday-item .date { color: var(--muted); font-size: 0.9rem; }

/* ---- Ad slots ---- */
.ad-slot {
  margin: 28px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- Article / static pages ---- */
.prose { margin: 32px 0; }
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.3rem; margin-top: 28px; }
.prose p, .prose li { color: #cfd3dd; }
.prose ul { padding-left: 20px; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-links a { color: var(--muted); margin-right: 16px; }

.note { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--muted);
}

/* ---- Copy feedback ---- */
.copied {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-2);
  color: #000;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 100;
  animation: fadeOut 1.5s forwards;
}
@keyframes fadeOut { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  .nav-links a { margin-left: 0; font-size: 0.82rem; padding: 4px 6px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .row { flex-direction: column; }
}
