:root {
  --bg: #111;
  --fg: #eee;
  --accent: #66f;
  --font: "Iosevka Term", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.sortable {
  cursor: pointer;
}

.sortable .arrow {
  font-size: 0.8em;
  margin-left: 4px;
  color: #666;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  padding: 1.5rem;
  padding-top: 64px;
  padadding-bottom: 64px;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.grid {
  display: grid;
  gap: 1rem;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.game {
  border: 1px solid #333;
  padding: 1em;
  background: #1a1a1a;
  display: flex;
  flex-direction: row;
  gap: 1em;
}

.game-details {
  flex: 1;
}

.rating {
  font-weight: bold;
}

.rating.low {
  color: red;
}

.rating.medium {
  color: orange;
}

.rating.high {
  color: limegreen;
}

.nav-horizontal {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1rem 0;
}

@media (max-width: 600px) {
  table {
    font-size: 0.9em;
    table-layout: auto;
    word-break: break-word;
  }

  td,
  th {
    white-space: normal;
    padding: 0.5em;
    text-align: left;
    vertical-align: top;
  }

  td.comment {
    white-space: pre-wrap;
    word-break: break-word;
  }

  body {
    padding: 1rem;
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .game {
    flex-direction: column;
  }

  .social-icons {
    right: 8px;
    bottom: 8px;
    gap: 8px;
  }

  .home-link {
    top: 8px;
    left: 8px;
  }
}

#pagination {
  margin-top: 1em;
  text-align: center;
  user-select: none;
}

button {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--accent);
  padding: 0.3em 0.7em;
  margin: 0 0.2em;
  font-family: var(--font);
  cursor: pointer;
  border-radius: 4px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

button:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

#games {
  transition: opacity 0.4s ease;
}

.post-content {
  line-height: 1.6;
  margin-top: 1em;
}

.post-content img {
  max-width: 80%;
  height: auto;
  display: block;
  margin: 1em auto;
  border-radius: 6px;
}

.post-content p {
  margin: 1em 0;
}

#posts {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-top: 1em;
  text-align: center;
}

#posts a {
  text-decoration: none;
  color: var(--accent, #6cf);
  padding: 0.2em 0.6em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  display: inline-block;
}

#posts a:hover {
  background-color: var(--accent, #6cf);
  color: #111;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fade-in {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.social-icons {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5em;
}

.social-icons a {
  margin-left: 10px;
  color: #333;
  text-decoration: none;
  font-size: 1.5em;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: #0073e6;
}

.home-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  font-weight: bold;
  color: var(--accent, #6cf);
  text-decoration: none;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.home-link:first-child {
  left: 1rem;
}

.home-link:last-child {
  left: calc(1rem + 5rem);
}

.home-link:hover {
  background: var(--accent, #6cf);
  color: #111;
}

.top-left-links {
  position: fixed;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 1rem;
  z-index: 1000;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}
