
:root{
  --bg: #0b0c10;
  --panel: #121319;
  --text: #eef2ff;
  --muted: #a5acc7;
  --brand: #4f46e5;
  --brand-2:#8b5cf6;
  --ok: #10b981;
  --bad:#ef4444;
  --warn:#f59e0b;
  --border: #202335;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,Apple Color Emoji,Segoe UI Emoji;
  background: radial-gradient(1200px 800px at 80% -10%, rgba(79,70,229,.15), transparent),
              radial-gradient(1000px 700px at 10% -30%, rgba(139,92,246,.12), transparent),
              var(--bg);
  color: var(--text);
  line-height:1.5;
}

a{color:inherit;text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:16px}
.header{
  position:sticky; top:0; z-index:10;
  background: rgba(11,12,16,.8); backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.header__inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
.header__nav a{padding:10px 12px;border-radius:8px;color:var(--muted)}
.header__nav a.active, .header__nav a:hover{color:#fff;background:#141626}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 16px;border-radius:10px;border:1px solid var(--border);cursor:pointer}
.btn--primary{background:linear-gradient(135deg,var(--brand),var(--brand-2));border-color:transparent;color:#fff}
.btn--ghost{background:transparent;color:#fff}
.btn--ok{background:var(--ok);color:#041307;border:none}
.btn--bad{background:var(--bad);color:#220505;border:none}
.btn--full{width:100%}

.hero{padding:48px 16px}
.hero__wrap{display:grid;gap:24px}
.hero__title{font-size:28px;line-height:1.2;margin:0 0 10px}
.hero__subtitle{color:var(--muted);margin:0 0 18px}
.hero__panel{
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border:1px solid var(--border); border-radius:var(--radius); padding:16px; box-shadow: var(--shadow);
}

.grid{display:grid;gap:16px}
.grid--2{grid-template-columns:1fr}
.grid--3{grid-template-columns:1fr}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

.badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#171926;border:1px solid var(--border);color:var(--muted);font-size:12px}

.k{font-size:40px;margin:8px 0 0;font-weight:800;letter-spacing:.5px}
.kana{color:var(--muted);margin:6px 0 2px}
.mean{font-size:18px;margin:0 0 8px}

.options{display:grid;gap:10px}
@media(min-width:768px){
  .hero__wrap{grid-template-columns:1.2fr .8fr;align-items:center}
  .grid--2{grid-template-columns:1fr 1fr}
  .grid--3{grid-template-columns:repeat(3,1fr)}
  .k{font-size:56px}
  .hero__title{font-size:40px}
}

.bottom-nav{
  position:sticky; bottom:0; z-index:9;
  background: rgba(11,12,16,.9); backdrop-filter: blur(8px);
  border-top:1px solid var(--border);
}
.bottom-nav__inner{display:flex;justify-content:space-around;padding:8px}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;border-radius:10px;color:var(--muted);font-size:12px}
.bottom-nav a.active, .bottom-nav a:hover{color:#fff;background:#141626}

.progress{width:100%;height:8px;background:#141626;border-radius:999px;overflow:hidden;border:1px solid var(--border)}
.progress__bar{height:100%;width:0;background:linear-gradient(90deg,var(--brand),var(--brand-2))}

.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px;border-bottom:1px solid var(--border)}
.table th{color:var(--muted);text-align:left}
.search{width:100%;padding:12px;border-radius:10px;background:#0f1016;border:1px solid var(--border);color:#fff}

.small{font-size:12px;color:var(--muted)}
.row{display:flex;gap:10px;align-items:center}
.col{flex:1}
hr{border:0;border-top:1px solid var(--border);margin:16px 0}

.notice{padding:12px;border:1px dashed var(--border);border-radius:10px;background:#0f1118;color:var(--muted)}

/* ===== Modal (word details) ===== */
/* Bottom-sheet spacing that adapts to the bottom nav + safe area */
.modal{
  position: fixed; inset: 0; display: none; z-index: 9999;
}
.modal.open{
  display: grid;
  place-items: end center;
  /* leave room above bottom-nav: value set from JS; falls back to 72px + safe area */
  padding: 0 0 var(--sheet-gap, calc(72px + env(safe-area-inset-bottom))) 0;
}
.modal__backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.modal__panel{
  position: relative;
  width: 100%; max-width: 640px; max-height: 85vh; overflow: auto;
  background: var(--panel); border:1px solid var(--border);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow); padding:16px;
  transform: translateY(24px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.modal.open .modal__panel{ transform: translateY(0); opacity:1; }

/* Desktop: center the dialog instead of a sheet */
@media (min-width: 992px){
  .modal.open{ place-items: center; padding-bottom: 0; }
  .modal__panel{ border-radius: 16px; }
}

/* Kanji + Kana in the list */
.word-item-kanji,
.word-item-kana {
  color: #fff !important;
}

/* English meaning in the list */
.word-item-meaning {
  color: #ccc !important; /* softer white so it’s less bright */
}

/* If they’re inside links */
.word-item a {
  color: #fff !important;
}

/* Make sure hover/focus also stay visible */
.word-item a:hover,
.word-item a:focus {
  color: #fff !important;
}

.dictionary-list .kanji,
.dictionary-list .kana,
.dictionary-list .meaning {
  color: #fff !important;
}

/* Make dictionary row buttons inherit the site colors */
button.card {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel);
  color: var(--text) !important;     /* force white text */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  width: 100%;
}

/* Keep the small meta text muted */
button.card .small {
  color: var(--muted) !important;
}

/* Inherit color for all children inside the row */
button.card * {
  color: inherit;
}

/* Nice focus state for keyboard users */
button.card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

