@import url("_primitives.css");

/* ===================================== */
/* ---------- 1. Normalize ---------- */
/* ===================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

* {
  margin: 0;
  padding: 0;
  font: inherit;
}

body {
  min-height: 100svh;
}

/* ===================================== */
/* ---------- 2. Variables ---------- */
/* ===================================== */

:root {
  /* ---------- 2.1 Primitive ---------- */

  /* 2.1.1 Typography */
  /* TODO: Add typography primitives */

  /* 2.1.2 Spacing */
  /* TODO: Add spacing scale (100 = 1rem) */

  /* 2.1.3 Sizes */
  /* TODO: Add size tokens */

  /* 2.1.4 Colors */
  /* TODO: Add color palette */

  /* 2.1.5 Borders */
  /* TODO: Add border tokens */

  /* 2.1.6 Shadows */
  /* TODO: Add elevation tokens */

  /* ---------- 2.2 Semantic ---------- */

  /* 2.2.1 Typography */
  /* TODO: Add semantic typography */

  /* 2.2.2 Spacing */
  /* TODO: Add semantic spacing */

  /* 2.2.3 Sizes */
  /* TODO: Add semantic sizes */

  /* 2.2.4 Colors */
  /* TODO: Add semantic colors */

  /* 2.2.5 Borders */
  /* TODO: Add semantic borders */

  /* 2.2.6 Shadows */
  /* TODO: Add semantic shadows */

  /* ---------- 2.3 Semantic Desktop ---------- */
  @media (width < 48rem) {
    /* TODO: Override desktop semantic tokens */
  }
}

/* ===================================== */
/* ---------- 3. Globals ---------- */
/* ---------- 3.1 Fonts ---------- */
@font-face {
  font-family: Poppins;
  src: url("../fonts/Poppins-Regular.woff2") format(woff2);
  font-weight: 400;
}

@font-face {
  font-family: Poppins;
  src: url("../fonts/Poppins-SemiBold.woff2") format(woff2);
  font-weight: 600;
}

@font-face {
  font-family: Poppins;
  src: url("../fonts/Poppins-Medium.woff2") format(woff2);
  font-weight: 500;
}

body {
  font-family: Poppins;
}
/* ---------- 3.2 Styles ---------- */

body {
  color: var(--gray-50);
  background-color: var(--graphite-700);
}

/* ===================================== */
/* ---------- 4. Layout ---------- */
/* ===================================== */

body {
  padding-inline: var(--space-200);
  padding-block: var(--space-200) var(--space-700);
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--space-100);
}

/* ===================================== */
/* ---------- 5. Components ---------- */
/* ===================================== */

.sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding-block: var(--space-100);
  padding-inline: var(--space-150);
  width: 100%;
  height: 4rem;
  background: linear-gradient(
    to bottom,
    oklch(20% 0.014 250deg),
    oklch(16.5% 0.016 250deg)
  );
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-50);
  background-color: var(--graphite-500);
  padding-block: var(--space-50) var(--space-100);
  padding-inline: var(--space-100);
  border-radius: var(--br-50);

  .account-info__bio {
    display: flex;
    flex-direction: row;
    gap: var(--space-75);

    .account-info__name-joined-container {
      display: flex;
      flex-direction: column;
      justify-content: center;

      .account-info__name {
        font-size: var(--fs-175);
      }

      .account-info__joined-date {
        color: var(--gray-400);
        font-size: var(--fs-75);
      }
    }
  }

  .account-info__level-row {
    display: flex;
    flex-direction: row;
    gap: var(--space-75);
    align-items: center;

    .account-info__bar {
      flex: 1;
    }

    .account-info__exp-points {
      font-size: var(--space-75);
      color: var(--gray-400);
      margin-inline-end: var(--space-300);
    }
  }

  .account-info__stats {
    display: flex;
    flex-flow: row wrap;
    width: 100%;

    & > div {
      width: 50%;
      margin-block-end: var(--space-100);

      .account-info__stat-description {
        font-size: var(--fs-75);
        color: var(--gray-400);
      }
    }
  }
}

.latest-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-100);

  .latest-results__title-wrapper {
    display: flex;
    flex-direction: row;
    gap: var(--space-50);
    color: var(--gray-400);
    font-size: var(--fs-87-5);
  }

  .latest-results__domain-wrapper {
    display: flex;
    flex-flow: column wrap;
    text-align: center;

    .latest-results__domain-descriptor {
      font-size: var(--fs-150);
      font-weight: var(--fw-regular);
    }

    .latest-results__domain {
      font-size: var(--fs-200);
      font-weight: var(--fw-medium);
      color: rgb(158 219 232 / 93%);
    }
  }
}

.result-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(max-content, 1fr));
  gap: var(--space-50) var(--space-75);
  place-content: center;
  align-items: center;

  .result-list__header {
    padding-inline: var(--space-100);
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
  }

  .result-list__row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    background: var(--graphite-500);
    border-radius: var(--br-25);
    align-items: center;
    padding-inline: var(--space-100);
    padding-block: var(--space-25);
    cursor: pointer;
  }

  .result-list__row:hover {
    opacity: 0.85;
  }

  .result-list__stat-name {
    font-size: var(--fs-70);
    color: var(--gray-400);
  }

  .result-list__stat {
    font-size: var(--fs-65);
    color: var(--gray-100);
    max-width: 10ch;
    overflow-wrap: break-word;
  }

  .result-list--wrong-wrap {
    max-width: 15ch;
    overflow-wrap: break-word;
  }
}

/* ===================================== */
/* ---- 6. Utilities / Modifiers ---- */
/* ===================================== */
/* TODO: Add utility and modifier classes */
