/* IIDX Score Diary — custom styles layered on top of Tailwind CDN */

.filter-select {
  width: 100%;
  background: #1e293b;          /* slate-800 */
  border: 1px solid #334155;    /* slate-700 */
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #e2e8f0;
}
.filter-select:focus { outline: none; border-color: #06b6d4; }

/* Table header cells */
.th {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.th:hover { color: #e2e8f0; }
.th .arrow { opacity: 0.4; font-size: 0.7em; margin-left: 0.15rem; }
.th.sorted .arrow { opacity: 1; color: #22d3ee; }

/* Table body */
#tbody tr { border-top: 1px solid #1e293b; }
#tbody tr:hover { background: rgba(30, 41, 59, 0.5); }
#tbody td { padding: 0.5rem 0.75rem; white-space: nowrap; }

/* Difficulty badges (IIDX convention) */
.diff-badge {
  display: inline-block;
  min-width: 2.4rem;
  text-align: center;
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.diff-B { background: #14532d; color: #86efac; }  /* BEGINNER  green  */
.diff-N { background: #1e3a8a; color: #93c5fd; }  /* NORMAL    blue   */
.diff-H { background: #78350f; color: #fdba74; }  /* HYPER     orange */
.diff-A { background: #7f1d1d; color: #fca5a5; }  /* ANOTHER   red    */
.diff-L { background: #581c87; color: #e9d5ff; }  /* LEGGENDARIA purple */

/* Clear-type pills */
.clear-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.ct-noplay   { color: #64748b; border-color: #334155; }
.ct-failed   { color: #94a3b8; border-color: #475569; }
.ct-assist   { color: #d8b4fe; border-color: #7e22ce; }
.ct-easy     { color: #86efac; border-color: #16a34a; }
.ct-clear    { color: #67e8f9; border-color: #0891b2; }
.ct-hard     { color: #fca5a5; border-color: #dc2626; }
.ct-exhard   { color: #fde047; border-color: #ca8a04; }
.ct-fc       { background: linear-gradient(90deg,#22d3ee,#a78bfa,#f472b6); color: #0f172a; font-weight: 800; }

/* DJ level colors */
.dj-AAA { color: #fde047; font-weight: 800; }
.dj-AA  { color: #67e8f9; font-weight: 700; }
.dj-A   { color: #86efac; font-weight: 700; }
.dj-B, .dj-C, .dj-D, .dj-E, .dj-F { color: #94a3b8; }
.dj-none { color: #475569; }

/* Mode toggle active state (set by JS) */
.mode-btn { color: #94a3b8; }
.mode-btn.active {
  background: linear-gradient(90deg,#06b6d4,#d946ef);
  color: #0f172a;
}

/* Stat cards */
.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 0.7rem; color: #64748b; margin-top: 0.15rem; }

/* Nav links (shared header) */
.nav-link {
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  transition: all 0.15s;
}
.nav-link:hover { color: #e2e8f0; background: #1e293b; }
.nav-link.active { color: #f1f5f9; background: #1e293b; font-weight: 600; }

/* ---- Song page ---- */
.jacket {
  width: 140px; height: 140px;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; font-weight: 900;
  color: rgba(255,255,255,0.85);
  background: linear-gradient(135deg, #0e7490, #7e22ce, #be185d);
  box-shadow: 0 10px 30px -10px rgba(217,70,239,0.4);
  flex-shrink: 0;
}
/* difficulty tab buttons */
.diff-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.8rem; font-weight: 700;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}
.diff-tab:hover { border-color: #475569; }
.diff-tab.active { border-color: transparent; color: #0f172a; }
.diff-tab.active.diff-N { background: #93c5fd; }
.diff-tab.active.diff-H { background: #fdba74; }
.diff-tab.active.diff-A { background: #fca5a5; }
.diff-tab.active.diff-L { background: #e9d5ff; }

.big-score { font-size: 3rem; font-weight: 900; line-height: 1; }

.mini-stat {
  background: rgba(15,23,42,0.6);
  border: 1px solid #1e293b;
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
}
.mini-stat .v { font-size: 1.25rem; font-weight: 800; }
.mini-stat .l { font-size: 0.65rem; color: #64748b; margin-top: 0.1rem; }

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 0.35rem; top: 0.3rem; bottom: 0.3rem;
  width: 2px; background: #1e293b;
}
.tl-item { position: relative; padding-bottom: 1.1rem; }
.tl-item::before {
  content: ''; position: absolute; left: -1.5rem; top: 0.35rem;
  width: 0.7rem; height: 0.7rem; border-radius: 999px;
  background: #06b6d4; box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.tl-date { font-size: 0.75rem; color: #64748b; }

/* Diff / change indicators */
.chg-up   { color: #4ade80; }
.chg-down { color: #f87171; }
.chg-flat { color: #64748b; }
.badge-new {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em;
  background: #f472b6; color: #0f172a; padding: 0.05rem 0.35rem; border-radius: 0.3rem;
}

/* Pager buttons */
.page-btn {
  min-width: 2rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}
.page-btn:hover:not(:disabled) { background: #334155; }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-btn.active {
  background: linear-gradient(90deg,#06b6d4,#d946ef);
  color: #0f172a;
  border-color: transparent;
  font-weight: 700;
}

/* ============================================================
   Mobile responsive helpers
   ============================================================ */

/* horizontal scroll rows without a visible scrollbar (e.g. nav) */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* collapsible filter body (collapsed only matters on mobile) */
.filter-body { display: grid; }

@media (max-width: 639px) {
  /* --- collapsible filters --- */
  .filter-body.is-collapsed { display: none; }

  /* --- wide tables -> stacked cards --- */
  .table-wrap { border: none !important; overflow: visible !important; }
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody,
  .table-cards tr { display: block; width: 100%; }
  .table-cards tr {
    border: 1px solid #1e293b !important;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.55);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.65rem;
  }

  /* id-scoped so these beat the desktop #tbody / #diff-body rules */
  #tbody td, #diff-body td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.28rem 0 !important;
    white-space: normal !important;
    text-align: right;
    border: none;
    max-width: none;
  }
  #tbody td::before, #diff-body td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.66rem;
    color: #64748b;
  }
  /* title cell spans the whole card as a header */
  #tbody td.cell-title, #diff-body td.cell-title {
    display: block;
    text-align: left;
    white-space: normal !important;
    padding: 0 0 0.45rem 0 !important;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid #1e293b;
  }
  #tbody td.cell-title::before, #diff-body td.cell-title::before { display: none; }
  #tbody td.cell-title a, #diff-body td.cell-title a { font-size: 1.02rem; }
  /* low-priority columns hidden on phones */
  #tbody td.col-hide-m, #diff-body td.col-hide-m { display: none; }

  /* empty-state row inside a card table */
  .table-cards td[colspan] { justify-content: center; }
  .table-cards td[colspan]::before { display: none; }

  /* --- header logo shrink --- */
  .brand { font-size: 1.15rem; }
}
