/* ============================================================
   Japanese Onomatopoeia Dictionary — Dark × Neon Theme
   y88m88.com
   ============================================================ */
:root {
  --bg:        #0d0d14;
  --bg2:       #13131e;
  --bg3:       #1a1a28;
  --border:    #2a2a3d;
  --text:      #e2e8f0;
  --text-dim:  #94a3b8;
  --primary:   #00e5a0;   /* neon green */
  --primary2:  #00b8d4;   /* neon cyan  */
  --accent:    #ff6b9d;   /* neon pink  */
  --card-hover:#22223a;
  --radius:    10px;
  --font-jp:   'Noto Sans JP', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ── Header ── */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  padding-top: .6rem; padding-bottom: .6rem;
}
.site-logo {
  font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.header-search { flex: 1; display: flex; gap: .4rem; max-width: 440px; margin-left: auto; }
.header-search input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: .42rem .75rem; color: var(--text);
  font-size: .9rem; outline: none;
}
.header-search input:focus { border-color: var(--primary); }
.header-search button {
  background: var(--primary); color: #000; font-weight: 700;
  border: none; border-radius: 6px; padding: .42rem .9rem;
  cursor: pointer; font-size: .85rem;
}
.header-search button:hover { opacity: .85; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 3rem;
  background: radial-gradient(ellipse at 50% -20%, rgba(0,229,160,.18) 0%, transparent 65%),
              var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-jp {
  font-family: var(--font-jp);
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary2), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.1; letter-spacing: .05em;
}
.hero h1 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700; margin: .6rem 0 .4rem;
  color: var(--text);
}
.hero p { color: var(--text-dim); max-width: 580px; margin: 0 auto .8rem; font-size: .95rem; }
.hero-stats {
  display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;
  margin-top: 1.2rem;
}
.stat { text-align: center; }
.stat-num {
  display: block; font-size: 2rem; font-weight: 800;
  color: var(--primary); line-height: 1;
}
.stat-lbl { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }

/* ── Filter bar ── */
.filter-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: .6rem 0;
  position: sticky; top: 54px; z-index: 90;
}
.filter-bar .container { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filter-label { color: var(--text-dim); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.filter-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 20px; padding: .28rem .85rem;
  cursor: pointer; font-size: .82rem; transition: all .15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #000; font-weight: 700;
}

/* ── Cards ── */
.results-meta { color: var(--text-dim); font-size: .85rem; padding: .8rem 0 .4rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem; padding-bottom: 2rem;
}
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: border-color .15s, background .15s, transform .15s;
  cursor: pointer;
  overflow: hidden;
}
.card:hover {
  border-color: var(--primary);
  background: var(--card-hover);
  transform: translateY(-2px);
}
.card-body { padding: .9rem 1rem .5rem; flex: 1; }
.card-word-jp {
  font-family: var(--font-jp);
  font-size: 1.9rem; font-weight: 900; line-height: 1;
  color: var(--primary);
  letter-spacing: .03em; margin-bottom: .25rem;
}
.card-romaji { font-size: .82rem; color: var(--text-dim); letter-spacing: .05em; }
.card-meaning { font-size: .83rem; color: var(--text); margin-top: .4rem; line-height: 1.4; }
.card-badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.badge {
  display: inline-block; font-size: .65rem; font-weight: 700;
  padding: .15rem .45rem; border-radius: 4px; color: #000;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-type { background: var(--primary2); }
.badge-pos  { background: #334155; color: var(--text-dim); }
.card-footer {
  padding: .5rem 1rem .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-link {
  font-size: .8rem; font-weight: 600; color: var(--primary2);
}
.card-link:hover { text-decoration: underline; }

/* ── Type pages (category) ── */
.type-header {
  padding: 2.5rem 0 1.5rem;
}
.type-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: .4rem; }
.type-header p { color: var(--text-dim); max-width: 640px; }
.type-en-label {
  display: inline-block; font-size: .75rem; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .1em;
  background: rgba(0,229,160,.1); border: 1px solid rgba(0,229,160,.3);
  border-radius: 4px; padding: .2rem .6rem; margin-bottom: .5rem;
}

/* ── Detail page ── */
.detail-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% -30%, rgba(0,229,160,.12) 0%, transparent 60%);
}
.detail-word-jp {
  font-family: var(--font-jp);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1; letter-spacing: .05em;
}
.detail-romaji-big {
  font-size: 1.3rem; color: var(--text-dim); margin-top: .4rem;
  letter-spacing: .12em; font-style: italic;
}
.detail-reading {
  font-family: var(--font-jp);
  font-size: .9rem; color: var(--text-dim); margin-top: .1rem;
}
.detail-badges { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  padding: 2rem 0 3rem;
  align-items: start;
}
@media (max-width: 760px) {
  .detail-layout { grid-template-columns: 1fr; }
}
.detail-section { margin-bottom: 1.8rem; }
.detail-section h2 {
  font-size: 1rem; font-weight: 700; color: var(--primary2);
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .8rem;
}
.meaning-block {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  font-size: 1rem; line-height: 1.7;
}

/* ── Meta table ── */
.meta-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.meta-table th {
  text-align: left; padding: .45rem .6rem;
  color: var(--text-dim); font-weight: 600; width: 130px;
  border-bottom: 1px solid var(--border);
}
.meta-table td {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--border);
}

/* ── Sidebar ── */
.sidebar-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem;
}
.sidebar-card h3 {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); margin-bottom: .8rem;
  border-bottom: 1px solid var(--border); padding-bottom: .4rem;
}
.related-list { list-style: none; }
.related-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-word-jp { font-family: var(--font-jp); font-size: 1.4rem; color: var(--primary); }
.related-romaji   { font-size: .78rem; color: var(--text-dim); }
.related-meaning  { font-size: .8rem; color: var(--text); }

/* ── Type index (categories page) ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.2rem; padding: 1.5rem 0 3rem;
}
.type-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color .15s, background .15s;
}
.type-card:hover { border-color: var(--primary); background: var(--card-hover); }
.type-card-count {
  font-size: 2.5rem; font-weight: 900; color: var(--primary); line-height: 1;
}
.type-card-label { font-size: 1.1rem; font-weight: 700; margin: .3rem 0 .4rem; }
.type-card-desc  { font-size: .85rem; color: var(--text-dim); line-height: 1.5; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--text-dim); padding: .8rem 0 .2rem;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb span { opacity: .5; }

/* ── Ad unit ── */
.ad-unit {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  margin: 1.2rem 0; overflow: hidden;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center; padding: 2rem 1rem;
  color: var(--text-dim); font-size: .82rem;
  margin-top: 3rem;
}
.site-footer p { margin: .25rem 0; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--primary); }

/* ── Utility ── */
.section-title {
  font-size: 1.4rem; font-weight: 800; margin: 1.5rem 0 .8rem;
  color: var(--text);
}
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

@media (max-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .card-word-jp { font-size: 1.5rem; }
  .hero-stats { gap: 1.2rem; }
}
