/* Calítera-inspired palette: phoenix red + blue/yellow accents */
:root {
  --bg: #0B0D12;
  --panel: rgba(255, 255, 255, 0.09);
  --panel2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --red: #B11226;
  /* phoenix red */
  --red2: #8E0D1D;
  --blue: #1E5BFF;
  /* accent blue */
  --cyan: #66D6FF;
  /* soft glow option */
  --yellow: #F2C94C;
  /* accent yellow */
  --gold: #D7A94A;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  /* lighter base */
  background-color: #101522;
  /* layered gradients that scroll naturally */
  background-image: radial-gradient(1200px 700px at 10% 0%, rgba(30, 91, 255, 0.20), transparent 60%), radial-gradient(900px 600px at 95% 10%, rgba(242, 201, 76, 0.18), transparent 55%), radial-gradient(900px 800px at 50% 120%, rgba(177, 18, 38, 0.22), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.20));
  background-attachment: fixed, fixed, fixed, fixed;
  /* feels “infinite” */
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.hero {
  position: relative;
  padding: 22px 0 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(177, 18, 38, 0.28), rgba(30, 91, 255, 0.18), rgba(242, 201, 76, 0.12));
}

.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 45%), linear-gradient(135deg, var(--red), var(--blue));
  box-shadow: 0 10px 30px rgba(30, 91, 255, 0.18), 0 10px 30px rgba(177, 18, 38, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
}

.searchbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

input {
  flex: 1;
  min-width: 260px;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 26, 0.55);
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

input:focus {
  border-color: rgba(102, 214, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 214, 255, 0.14);
}

.btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn.secondary {
  background: rgba(0, 0, 0, 0.22);
}

.btn.secondary:hover {
  background: rgba(0, 0, 0, 0.30);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  user-select: none;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.10);
}

.chip.active {
  border-color: rgba(242, 201, 76, 0.55);
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  padding-top: 16px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.panel h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.25px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.results {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.card {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.08s ease, background 0.08s ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: rgba(102, 214, 255, 0.35);
  background: rgba(0, 0, 0, 0.24);
}

.card .top {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.hw {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.gloss {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.80);
}

.small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.entry {
  padding: 14px;
  min-height: 420px;
}

.entry.empty {
  color: var(--muted);
}

.entry h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.entry .pron {
  color: rgba(242, 201, 76, 0.92);
  font-weight: 600;
}

.entry .line {
  margin: 10px 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
}

.entry .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.entry ul {
  margin: 8px 0 0 18px;
}

.entry li {
  margin: 6px 0;
}

.entry .ex {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
}

.entry .ex .src {
  font-weight: 600;
}

.entry .ex .gl {
  color: var(--muted);
  margin-top: 4px;
}

.footer {
  padding-top: 10px;
  padding-bottom: 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  padding: 6px;
}

#heritageTop,
#heritageLine {
  white-space: pre-line;
}

.filters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.filter {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(8px);
}

.filter-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

/* A–Z browse strip */
.azwrap {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.azhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.az {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.azbtn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.14);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.azbtn:hover {
  background: rgba(255, 255, 255, 0.10);
}

.azbtn.active {
  border-color: rgba(102, 214, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 214, 255, 0.12);
}

.azbtn.disabled {
  opacity: 0.35;
  cursor: default;
}

/* Tiny buttons */
.btn.tiny {
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 12.5px;
}

/* Mode label spacing */
#modeLabel {
  display: inline-block;
  min-width: 110px;
}

/* Entry header + actions */
.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.entry-link {
  margin-top: 6px;
}

.permalink {
  color: rgba(102, 214, 255, 0.92);
  text-decoration: none;
}

.permalink:hover {
  text-decoration: underline;
}

/* Cross-reference links */
.xref {
  color: rgba(102, 214, 255, 0.92);
  text-decoration: none;
  border-bottom: 1px dashed rgba(102, 214, 255, 0.35);
}

.xref:hover {
  border-bottom-color: rgba(102, 214, 255, 0.85);
}

/* Toast */
.toast {
  position: sticky;
  top: 8px;
  margin-top: 10px;
  display: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.90);
}

.toast.show {
  display: block;
}

/* Disabled tiny button look */
.btn.disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Top nav */
.topnav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.navlink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.14);
  color: rgba(255,255,255,0.86);
  text-decoration:none;
}
.navlink:hover{ background: rgba(255,255,255,0.10); }
.navlink.active{
  border-color: rgba(242,201,76,0.55);
  box-shadow: 0 0 0 4px rgba(242,201,76,0.12);
}

/* Table */
.tablewrap{ overflow:auto; }
.table{
  width:100%;
  border-collapse: collapse;
}
.table thead th{
  text-align:left;
  font-size: 12.5px;
  letter-spacing: .2px;
  color: rgba(255,255,255,0.72);
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}
.table tbody tr:hover{
  background: rgba(255,255,255,0.05);
}

.g{
  display:inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
  font-weight: 700;
}
.ipa{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: rgba(242,201,76,0.92);
  font-weight: 600;
}
.panel-foot{ padding: 12px 14px 14px; }
.brandlink{ display:inline-flex; }

.home-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}
@media (max-width: 980px){
  .home-grid{ grid-template-columns: 1fr; }
}
.home-card{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.20);
}
.home-card h2{
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: 0.2px;
}
.home-card .btn{ margin-top: 10px; display:inline-flex; text-decoration:none; }