:root {
  /* Green/Teal */
  --bg: hsl(210 15% 5%);
  --bg-elevated: hsl(182 40% 10%);
  --bg-surface: hsl(240 6% 13%);

  --primary: hsl(176 32% 51%);
  --primary-light: hsl(183 35% 74%);
  --primary-glow: hsl(182 50% 65%);

  --text: hsl(120 14% 93%);
  --text-muted: hsl(187 5% 55%);

  --accent: hsl(10 50% 25%);
  --accent-bright: hsl(5 60% 40%);

  --border: hsl(187 10% 28%);

  /* Red */
  --bg-saya: #0a0808;
  --bg-saya-elevated: #1a0e10;
  --bg-saya-surface: #2a1218;

  --primary-saya: #c44050;
  --primary-saya-light: #e87888;
  --primary-saya-glow: #e04858;

  --text-saya: #d4c4c8;
  --text-saya-muted: #9a8088;

  --accent-saya: #c44050;
  --accent-saya-bright: #e04858;

  --border-saya: #4a2030;
}

* {
  box-sizing: border-box;
}

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

b {color: var(--primary);}
i {color: var(--text-muted);}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  text-decoration: underline;
}

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

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

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

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

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

.container {
  width: min(1180px, 100%);
  margin: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

@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);
  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(--text-muted);
  text-decoration: none;
}

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

.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.friend-links a {
  color: var(--text-muted);
}

.friend-links a:hover {
  color: var(--primary);
}

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

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

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

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

.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-surface);
  border: 1px solid var(--border);
  margin-bottom: 15px;
}

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

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

.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(--primary);
}

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(--primary);
}

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

.my-button {
  text-align: center;
}

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

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

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

.blinkies a:hover img,
.button-wall a:hover img {
  transform: scale(1.08);
}

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

.button-wall img {
  transition: transform 0.15s;
}

.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-text {
  font-size: clamp(36px, 6vw, 96px);
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: 6px;
  line-height: 0.8;
}

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

.bbs-banner {
  background: var(--bg-elevated);
  padding: 10px;
}

.bbs-layout {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.bbs-ad {
  flex: 0 0 auto;
}

.bbs-banner a {
  display: block;
  line-height: 0;
}

.bbs-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.bbs-empty {
  flex: 1;
  background: var(--bg);
  min-height: 60px;
}

.listening-title {
  background: var(--bg);
  padding: 2px 0 2px 10px;
  margin-bottom: 8px;
  font-size: 20px;
  border-left: 5px solid var(--primary);
  flex: 0 0 100%;
}

#listening-cover {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.listening-info {
  flex: 1;
  min-width: 0;
}

.listening-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.listening-track {
  display: block;
  font-size: 22px;
  color: var(--primary);
  text-decoration: none;
}

.listening-track:hover {
  text-decoration: underline;
}

.listening-artist {
  color: var(--text-muted);
  font-size: 17px;
}

.listening-album {
  display: block;
  color: var(--text-muted);
  font-size: 16px;
  text-decoration: none;
}

.listening-album:hover {
  text-decoration: underline;
}

.listening-meta {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 2px;
}

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

.listening-recent {
  flex: 0 0 100%;
  margin-top: 4px;
}

.recent-header {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 4px;
}

.recent-entry {
  font-size: 15px;
  color: var(--text-muted);
  padding: 1px 0;
}

.recent-entry a {
  color: var(--text);
}

.recent-entry a:hover {
  color: var(--primary);
}

.recent-artist {
  color: var(--text-muted);
}

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

.stat-card {
  background: var(--bg-elevated);
  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-elevated);
  border: 1px solid var(--border);
  padding: 4px 8px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.search-input {
  flex: 1 1 180px;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  padding: 4px 8px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  padding: 4px 6px;
  cursor: pointer;
}

.result-count {
  color: var(--text-muted);
  font-size: 16px;
  margin-left: auto;
  white-space: nowrap;
}

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

.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(--bg-elevated);
  padding: 5px 7px;
  vertical-align: top;
  white-space: nowrap;
}

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

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

.anime-table tr:hover td {
  background: var(--primary-glow);
}

.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: var(--bg-surface);
  color: var(--primary-light);
}

.score-good {
  background: var(--bg-surface);
  color: var(--primary);
}

.score-mid {
  background: var(--bg-surface);
  color: var(--text);
}

.score-low {
  background: var(--bg-surface);
  color: var(--accent-bright);
}

.score-none {
  background: var(--bg-surface);
  color: var(--text-muted);
}

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

.status-completed {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

.status-watching,
.status-playing {
  border-color: var(--primary);
  background: var(--bg-surface);
}

.status-plan-to-watch,
.status-plan-to-play {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

.status-on-hold {
  border-color: var(--accent-bright);
  background: var(--bg-surface);
}

.status-dropped {
  border-color: var(--accent);
  background: var(--bg-surface);
}

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

.reading-entries {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: 8px;
}

.reading-entry {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.reading-entry:last-child {
  border-bottom: none;
}

.entry-cover {
  flex: 0 0 50px;
  width: 50px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.entry-head .card-title {
  font-size: 20px;
  color: var(--primary);
}

.type-badge {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 0 6px;
  font-size: 15px;
  color: var(--text-muted);
}

.progress-info {
  color: var(--text-muted);
  margin-bottom: 2px;
  font-size: 16px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  max-width: 200px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
}

.entry-notes {
  color: var(--text-muted);
  font-style: italic;
  font-size: 16px;
  margin-top: 2px;
}

.completed-section {
  margin-top: 20px;
}

.top-completed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.top-completed {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.top-cover {
  display: block;
  width: 100%;
  height: 225px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.top-cover:empty {
  display: block;
  height: 225px;
}

.top-completed-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}

.top-completed-body .card-title {
  flex: 1;
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 4px;
}

.top-completed-body .card-title:last-child {
  margin-bottom: 0;
}

.top-completed-foot {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.top-score {
  color: var(--text-muted);
  font-size: 16px;
}

.top-completed-body .entry-notes {
  margin-top: 4px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 15px;
}

.completed-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.completed-entry {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.completed-entry .card-title {
  font-size: 18px;
  margin-bottom: 0;
}

.completed-meta {
  color: var(--text-muted);
  font-size: 15px;
  white-space: nowrap;
}

.atabook {
  width: 100%;
  height: 75vh;
  min-height: 400px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: 8px;
}

.reading-empty {
  color: var(--text-muted);
  font-style: italic;
}

#statuscafe {
  display: grid;
  gap: 4px;
}

#statuscafe-username a {
  color: var(--primary);
  font-size: 20px;
}

#statuscafe-content {
  color: var(--text);
  font-style: italic;
}

.page-head {
  margin-bottom: 24px;
}

.page-title {
  font-size: 32px;
  color: var(--primary);
  margin: 0;
  letter-spacing: 1px;
}

.blog-post {
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 20px;
}

.post-title {
  margin: 0 0 6px;
  font-size: 30px;
  color: var(--primary);
  line-height: 1.2;
}

.post-date {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 24px;
}

.post-nav {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.post-nav a {
  color: var(--text-muted);
  font-size: 18px;
}

.post-nav a:hover {
  color: var(--primary);
}

.blog-index {
  display: flex;
  flex-direction: column;
}

.blog-summary {
  margin-bottom: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.blog-summary:first-child {
  padding-top: 0;
}

.blog-summary:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-summary h3 {
  margin: 0 0 4px;
  font-size: 26px;
}

.blog-summary h3 a {
  color: var(--primary);
}

.blog-summary h3 a:hover {
  text-decoration: underline;
}

.blog-summary .post-date {
  margin-bottom: 8px;
}

.blog-summary p {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.5;
}

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px 0;
}

.blog-post img {
  max-width: 100%;
  height: auto;
}

.blog-post figure {
  margin: 20px 0;
  text-align: center;
}

.blog-post figure img {
  display: block;
  margin: 0 auto;
}

.blog-post figcaption {
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.blog-post p {
  margin: 0 0 14px;
}

.blog-post h2 {
  color: var(--primary);
  font-size: 26px;
  margin: 32px 0 10px;
  line-height: 1.2;
}

.blog-post h3 {
  color: var(--primary);
  font-size: 24px;
  margin: 28px 0 8px;
  line-height: 1.2;
}

.blog-post h4 {
  color: var(--primary-light);
  font-size: 22px;
  margin: 24px 0 6px;
  line-height: 1.2;
}

.blog-post blockquote {
  border-left: 3px solid var(--primary);
  margin: 16px 0;
  padding: 8px 18px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 18px;
}

.blog-post blockquote p {
  margin: 4px 0;
}

.blog-post code {
  background: var(--bg);
  padding: 1px 6px;
  font-family: "VT323", monospace;
  font-size: 17px;
  border: 1px solid var(--border);
}

.blog-post pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 14px;
  overflow-x: auto;
  font-family: "VT323", monospace;
  font-size: 17px;
  line-height: 1.4;
  margin: 16px 0;
}

.blog-post pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.blog-post ul,
.blog-post ol {
  margin: 12px 0;
  padding-left: 26px;
}

.blog-post li {
  margin-bottom: 6px;
}

.blog-post li:last-child {
  margin-bottom: 0;
}

.blog-post hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.blog-post a {
  text-decoration: underline;
}

.blog-post a:hover {
  color: var(--primary-light);
}

.blog-post strong {
  color: var(--primary);
}

.blog-post em {
  color: var(--text-muted);
}

@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;
  }

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

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

/* ── Media page: tab bar ──────────────────────────────────────────── */

.media-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.media-tab {
  display: inline-block;
  padding: 4px 14px;
  font-size: 20px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.media-tab:hover {
  background: var(--bg-elevated);
  color: var(--primary);
  text-decoration: none;
}

.media-tab.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* ── Media page: sections ──────────────────────────────────────────── */

.media-section {
  margin-bottom: 0;
}

.media-box {
  margin-bottom: 0;
}

.media-count {
  color: var(--text-muted);
  font-size: 16px;
  margin-left: 8px;
}

.media-subsection {
  margin-top: 20px;
}

.media-subsection:first-child {
  margin-top: 0;
}

.media-stats {
  margin-top: 8px;
}

@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;
  }
}

