* {
  box-sizing: border-box;
}

:root {
  --bg: #e6edf6;
  --bg-container: #f4f8fd;
  --bg-raised: #eef4fb;
  --bg-header: #d4e1f0;
  --bg-muted: #c7d8ec;

  --text: #3f5873;
  --text-muted: #5f748a;
  --text-dim: #a9becb;
  --text-accent: #968794;

  --link: #4a6a8a;

  --border: #b8cbe0;
  --border-light: #d4e1f0;
  --accent: #d9c4c7;
}

body {
  margin: 0;
  padding: 30px;
  background: var(--bg) url(img/bg.jpg) repeat;
  font-family: "VT323", monospace;
  font-size: 18px;
  color: var(--text);
  overflow-wrap: break-word;
}

b {color: var(--text-accent);}
i {color: var(--text-dim);}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px dotted var(--link);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-muted);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.container {
  width: min(1180px, 100%);
  margin: auto;
  background: var(--bg-container);
  border: 1px solid var(--border);
}

@media (prefers-reduced-motion: no-preference) {
  .container {
    animation: fadeIn 0.2s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

.topbar {
  background: var(--bg-header);
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.site-name {
  font-size: 24px;
  letter-spacing: 1px;
}

.links a {
  color: var(--link);
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}


.main-nav {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: 6px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 19px;
}

.main-nav a {
  color: var(--link);
  text-decoration: none;
}

.main-nav a:hover {
  text-decoration: underline;
}

.main-nav [aria-current="page"] {
  color: var(--text-accent);
}

.main {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.sidebar {
  flex: 0 0 220px;
  min-width: 0;
}

.sidebar > * {
  margin-bottom: 15px;
}

.profile-pic {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  margin-bottom: 15px;
}

.box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 10px;
  margin-bottom: 15px;
}

.side-title {
  background: #fff;
  padding: 2px 0 2px 10px;
  margin-bottom: 5px;
  font-size: 20px;
  border-left: 5px solid var(--accent);
}

.content {
  flex: 1;
  min-width: 0;
}

.single-column {
  display: block;
}

.content-title {
  background: var(--bg-header);
  padding: 2px 0 2px 10px;
  margin-bottom: 5px;
  font-size: 20px;
  border-left: 5px solid var(--accent);
}

p {
  margin: 0 0 8px;
}

p:last-child {
  margin-bottom: 0;
}

.plain-list,
.project-list {
  margin: 0;
  padding-left: 18px;
}

.plain-list li,
.project-list li {
  margin-bottom: 7px;
}

.plain-list li:last-child,
.project-list li:last-child {
  margin-bottom: 0;
}

.project-list li {
  display: grid;
  gap: 4px;
}

.project-list span {
  color: var(--text-muted);
}

.status-list {
  display: grid;
  gap: 5px;
  margin: 0;
}

.status-list div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
}

.status-list dt {
  color: var(--text-accent);
}

.status-list dd {
  margin: 0;
  color: var(--text-muted);
}

.blinkies {
  display: grid;
  grid-template-columns: repeat(auto-fit, 88px);
  gap: 5px;
  justify-content: center;
}

.blinkies a {
  width: 88px;
  height: 31px;
  display: block;
}

.blinkies img {
  width: 88px;
  height: 31px;
  display: block;
  overflow: hidden;
  object-fit: contain;
}

.button-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, 88px);
  gap: 7px;
  justify-content: center;
}

.button-wall a {
  display: block;
}

.button-wall img {
  display: block;
  width: 88px;
  height: 31px;
  object-fit: contain;
}

.welcome-box {
  text-align: center;
}

.welcome-gif {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto 0;
}

}

.listening-box::before {
  display: block;
  content: "listening";
  background: var(--bg-header);
  padding: 2px 0 2px 10px;
  margin-bottom: 8px;
  font-size: 20px;
  border-left: 5px solid var(--accent);
}

.tab-nav a {
  display: block;
  padding: 6px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-bottom: none;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-size: 17px;
  text-decoration: none;
}

.tab-nav a + a {
  border-left: none;
}

.tab-nav a:focus-visible {
  outline: 2px dotted var(--link);
  outline-offset: -3px;
}

body:has(#listenbrainz:target)  .tab-nav a[href="#listenbrainz"],
body:has(#lastfm:target)        .tab-nav a[href="#lastfm"],
body:has(#stats:target)         .tab-nav a[href="#stats"],
body:not(:has(:target))         .tab-nav a[href="#listenbrainz"] {
  background: var(--bg-header);
  color: var(--text);
  position: relative;
}

.tab-panel { display: none; }
.tab-panel:target { display: block; }
body:not(:has(:target)) #listenbrainz { display: block; }

.tab-panel iframe {
  display: block;
}

.listening-empty {
  color: var(--text-dim);
  font-style: italic;
}

.anime-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.stat-card {
  background: var(--bg-container);
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.stat-card b {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.stat-card span {
  color: var(--text-muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-grid li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-container);
  border: 1px solid var(--border);
  padding: 4px 8px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--bg-container);
}

.anime-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.anime-table th,
.anime-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-light);
  padding: 5px 7px;
  vertical-align: top;
  white-space: nowrap;
}

.anime-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-header);
  color: var(--text);
  text-align: left;
  font-weight: normal;
  font-size: 20px;
}

.anime-table tr:nth-child(even) td {
  background: var(--bg-raised);
}

.anime-table tr:hover td {
  background: #fff;
}

.title-cell {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-cell {
  min-width: 220px;
  white-space: normal;
  color: var(--text-muted);
}

.score-cell {
  text-align: center;
  font-weight: bold;
}

.score-high {
  background: #dcebd8 !important;
  color: #55735c;
}

.score-good {
  background: #edf3df !important;
  color: #69784f;
}

.score-mid {
  background: #fff4d8 !important;
  color: #8a724a;
}

.score-low {
  background: #f4dcdc !important;
  color: #8a4a4a;
}

.score-none {
  color: #a0a0b0;
}

.status-pill {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 0 6px;
}

.status-completed {
  border-color: #b9d4b0;
  background: #edf7ea;
}

.status-watching {
  border-color: var(--border);
  background: #eaf3ff;
}

.status-plan-to-watch {
  border-color: var(--accent);
  background: #fff2f4;
}

.status-on-hold {
  border-color: #ded1a8;
  background: #fff9df;
}

.status-dropped {
  border-color: #d7b5b5;
  background: #fdeaea;
}

.note {
  color: var(--text-muted);
  margin-top: 6px;
}

@media (max-width: 768px) {
  .anime-table {
    min-width: 820px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .main {
    flex-direction: column;
  }

  .sidebar {
    flex-basis: auto;
    width: 100%;
  }


  .main-nav {
    gap: 10px;
  }

  .tab-nav {
    flex-wrap: wrap;
  }

  .tab-nav a + a {
    border-left: 1px solid var(--border);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }


  .links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
    font-size: 17px;
  }

  .topbar,
  .main-nav,
  .main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .main {
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-name {
    font-size: 22px;
  }

  .blinkies {
    grid-template-columns: repeat(auto-fit, 88px);
  }
}

