@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap");

:root {
  --primary: #8850F2;
  --secondary: #ddd5ec;
  --tertiary: #FE21CE;
  --shadow: 0.15rem 0.05rem 0.3rem rgba(0, 0, 0, 0.7);
  background: var(--secondary);
}

body {
  font-family: "Open Sans", sans-serif;
  min-width: 30vw;
  max-width: 800px;
  margin: 2rem auto;
  padding: 2.5rem;
  line-height: 1.6;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: .33rem;
}

h1 {
  font-weight: normal;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

h3 {
  margin-top: 2rem;
}

.site-nav {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.site-nav a {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  background: var(--primary);
  box-shadow: var(--shadow);
  border-radius: .33rem;
  color: #fff;
  font-weight: bold;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.table-search {
  width: 100%;
  padding: 0.5rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
  border-radius: .33rem;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
  table-layout: fixed;
}
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-container table {
  min-width: 100%;
  width: auto;
  table-layout: auto;
}

th,
td {
  padding: 0.25rem;
  border: 1px solid #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  background: var(--secondary);
  cursor: pointer;
  position: relative;
  font-weight: 600;
  color: #333;
  text-align: left;
}

th.sorting::after,
th.sorting_asc::after,
th.sorting_desc::after {
  content: "▼";
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: #999;
}

th.sorting_desc::after {
  content: "▲";
  color: #333;
}
th.sorting_asc::after {
  color: #333;
}

.center {
  text-align: center;
}
.left {
  text-align: left;
}

img {
  height: 256px;
  box-shadow: var(--shadow);
  display: block;
}
.hero-img {
  box-shadow: none;
}

.header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: 1rem;
}

.header img {
  width: 256px;
  max-height: 512px;
  height: auto;
  object-fit: contain;
}
.header img:hover {
  transform: scale(1.015);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.info {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.title {
  font-size: clamp(1.75rem, 5.75vw, 5rem);
  white-space: normal;
  overflow-wrap: break-word;
}
.metadata {
  font-size: 1.15rem;
  background: var(--secondary);
  padding: 1rem;
  border-left: 7px solid var(--primary);
  box-shadow: var(--shadow);
  border-radius: .33rem;
}

p {
  font-size: 1.15rem;
  line-height: 1.65rem;
  color: #222;
  max-width: 65ch;
  text-align: left;
  text-wrap: balance;
}

.related {
  margin-top: 2rem;
  font-style: italic;
  border-top: 1px solid #ddd;
  padding-top: 1rem;
}

.score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.25rem auto 0.25rem;
  max-width: fit-content;
}
.score-text {
  display: flex;
  flex-direction: column;
  justify-content: bottom;
  color: #000;
  line-height: 1.3rem;
}
.score-line1 {
  font-size: 0.9rem;
  font-weight: normal;
}
.score-line2 {
  font-size: 1.6rem;
  font-weight: bold;
  text-transform: uppercase;
}
.score {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 5rem;
  height: 5rem;
  font-weight: bold;
  font-size: 3rem;
  color: #fff;
  border-radius: 0.33em;
  box-shadow: var(--shadow);
  text-shadow: var(--shadow);
  margin: auto;
}
.score-1 {
  background: #e5470b;
}
.score-2 {
  background: #f56918;
}
.score-3 {
  background: #fe9029;
}
.score-4 {
  background: #fcb136;
}
.score-5 {
  background: #efcd3a;
}
.score-6 {
  background: #b7f735;
}
.score-7 {
  background: #92ff47;
}
.score-8 {
  background: #65fd69;
}
.score-9 {
  background: #35f394;
}
.score-10 {
  background: #19e3b9;
}

.score-sm {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

nav a:hover,
.cross-link:hover {
  background: var(--tertiary);
  color: white;
}
a:hover {
  background: none;
  color: var(--tertiary);
  text-decoration: underline;
}

.video-container {
  display: flex;
  justify-content: center;
  margin: 2rem auto;
}

.yt-preview {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 16 / 9;
  border: none;
  box-shadow: var(--shadow);
}

.align-left {
  text-align: left;
}
.align-center {
  text-align: center;
}

/* mobile */
@media (max-width: 900px) {
  body {
    margin: 1rem;
    padding: 0.9rem 0.9rem 2.5rem;
    min-width: auto;
    max-width: none;
  }

  h1 {
    text-align: center;
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    margin: 0 auto;
  }
  .site-nav a {
    margin: 0;
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
  }

  table {
    font-size: x-small;
  }

  img,
  .header img {
    width: 90%;
    height: auto;
    max-width: none;
    margin: 1rem auto;
  }

  .header {
    display: block;
  }
  .title {
    text-align: center;
  }
  .info {
    display: block;
    height: auto;
  }

  p {
    font-size: 1rem;
    line-height: 1.5rem;
    max-width: 100%;
  }

  .score-line1 {
    font-size: 0.7rem;
    font-weight: normal;
  }
  .score-line2 {
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
  }

  .cross-link {
    right: 0;
    left: 0;
    margin: 0 auto;
    width: max-content;
  }

  .score-sm {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.875rem;
  }
}
