:root {
  /* BRANDMANUAL */
  --bg: #fcedcf;
  --bg-card: #ffffff;

  --primary: #5b090a;
  --text: #000000;
  --text-secondary: #5b090a;

  /* FEEDBACK */
  --success: #34a853;
  --error: #5b090a;

  /* UI */
  --radius: 16px;
  --shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.16);
  --transition: 200ms ease;
}

/* =====================
   GLOBAL STYLES
   ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
/* =====================
   SEARCHBAR CONTAINER
   ===================== */
   .searchbar-container {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .searchbar-container #search-input {
    width: 100%;
    max-width: 500px;
    min-height: 48px;
  
    background: var(--bg-card);
    color: var(--text);
  
    border: 1px solid var(--text);
    border-radius: 999px;
  
    padding: 0.75rem 1.25rem;
  
    font-size: 1rem;
  
    box-shadow: none;
  
    transition: var(--transition);
  }

.searchbar-container label {
  width: 100%;
  max-width: 500px;

  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* =====================
   DARK MODE CSS VARIABLES
   ===================== */

/* =====================
   GLOBAL STYLES
   ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;

  font-size: 1rem;
  line-height: 1.5;

  background: var(--bg);
  color: var(--text);

  min-height: 100vh;
}

/* =====================
   LAYOUT (main container)
   ===================== */
   main {
    width: min(1280px, 92%);
    margin: 0 auto;
  
    padding: 8rem 0 3rem;
  }
/* =====================
   LOGO HEADER
   ===================== */

.site-header {
  background: var(--bg);

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  padding: 1rem 3rem;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 1000;
}

.site-logo {
  width: 90px;
  height: auto;

  justify-self: start;
  display: block;
}

.site-header h1 {
  grid-column: 2;

  font-size: 1.75rem;
  font-weight: 700;

  margin: 0;
}

/* =====================
   FILTERBAR (SØG/SORT/FILTER)
   ===================== */
.filterbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  padding: 1.5rem 2vw;
  box-sizing: border-box;
  background: var(--bg);
  border-radius: var(--radius);
}

#search-input {
  flex: 1;
  min-width: 120px;
}

#search-input,
#genre-select,
#sort-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

#search-input:focus,
#genre-select:focus,
#sort-select:focus {
  outline: 2px solid var(--secondary);
  border-color: var(--secondary);
}

#search-input::placeholder {
  color: #555555;
  opacity: 1;
}

#genre-select,
#sort-select {
  min-width: 160px;
  cursor: pointer;
}

/* =====================
   HEADER & FOOTER
   ===================== */

   header {
    background: var(--bg);
    color: var(--text);
  
    padding: 1.5rem 1rem;
  
    text-align: center;
  
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  
    z-index: 1000;
  
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

header h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
 
footer {
  background: var(--primary);
  color: var(--text);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
}

/* (main er allerede defineret ovenfor - dublet fjernet) */

/* =====================
   MOVIE GRID & CARDS
   ===================== */
/* TODO !!! */

.game-card {
  width: 100%;
  max-width: 280px;

  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  transition: box-shadow var(--transition);
}

.game-card:hover {
  border-color: rgba(91, 9, 10, 0.45);
  box-shadow: var(--shadow-lg);
}


.game-poster {
  width: 100%;
  height: 230px;

  object-fit: contain;
  display: block;

  background: #ffffff;
  padding: 0;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.game-info {
  padding: 1rem;

  display: flex;
  flex-direction: column;

  gap: 0.35rem;

  flex: 1;
}

.game-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);

  margin-bottom: 0.25rem;
}

.game-playtime,
.game-players,
.game-genre {
  color: var(--text);
  font-size: 0.875rem;
}

/* =====================
   SPILDIALOG
   ===================== */

   dialog#game-dialog {
    width: min(1000px, 90vw);
  
    border: none;
    border-radius: 20px;
  
    background: var(--bg-card);
    color: var(--text);
  
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  
    padding: 0;
    margin: auto;
  
    overflow: hidden;
  }
  
  dialog#game-dialog::backdrop {
    background: rgba(0, 0, 0, 0.48);
  }
  
  /* Indhold */
  
  #dialog-content {
    min-height: 360px;
  
    padding: 2rem;
  
    display: grid;
    grid-template-columns: 300px 1fr;
  
    gap: 2.5rem;
    align-items: start;
  }
  
  /* Billede */
  
  #dialog-content img.game-poster {
    width: 300px;
    height: 300px;
  
    object-fit: contain;
  
    background: #ffffff;
  
    border-radius: 16px;
  
    box-shadow: var(--shadow);
  
    padding: 0;
  }
  
  /* Tekstområdet */
  
  .dialog-details {
    min-height: 300px;
  
    display: flex;
    flex-direction: column;
  
    position: relative;
  }
  
  /* Titel */
  
  #dialog-content h2 {
    font-size: 2rem;
    font-weight: 700;
  
    color: var(--text);
  
    line-height: 1.1;
  
    margin: 0 0 0.25rem;
  }
  
  /* Almindelig information */
  
  #dialog-content p {
    color: var(--text);
  
    font-size: 1rem;
    line-height: 1.5;
  
    margin: 0.25rem 0;
  }
  
  #dialog-content p strong {
    font-weight: 600;
  }
  
  /* Beskrivelse */
  
  .game-description {
    margin-top: 2rem !important;
  
    padding: 0 !important;
  
    background: transparent !important;
  
    border: none !important;
  
    color: var(--text) !important;
  
    font-size: 1.05rem !important;
    font-weight: 600;
  
    line-height: 1.6 !important;
  
    font-style: italic;
  }
  
  /* Rating */
  .game-rating {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
  
    display: flex;
    align-items: center;
    gap: 0.3rem;
  
    align-self: flex-end;
  
    margin-top: auto;
    margin-bottom: 0.5rem;
  }
  
  .rating-label {
    font-size: 0.875rem;
    font-weight: 500;
  }
  /* Luk */
  
  #close-dialog {
    position: absolute;
  
    top: 1.25rem;
    right: 1.5rem;
  
    width: auto;
    height: auto;
  
    padding: 0;
  
    background: transparent;
    border: none;
  
    color: #555555;
  
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
  
    cursor: pointer;
  
    z-index: 10;
  }
  
  #close-dialog:hover {
    background: transparent;
    color: var(--primary);
    transform: none;
  }

  .filterbar {
    width: 100%;
  
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
  
    gap: 1rem;
  
    margin-bottom: 2.5rem;
    padding: 1rem 0;
  
    background: transparent;
  }
  
  .filterbar label {
    position: absolute;
    width: 1px;
    height: 1px;
  
    padding: 0;
    margin: -1px;
  
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  
    border: 0;
  }
  
  .filterbar select {
    min-height: 44px;
    min-width: 150px;
  
    background: var(--bg-card);
    color: var(--text);
  
    border: 1px solid var(--text);
    border-radius: 999px;
  
    padding: 0.65rem 1rem;
  
    font-family: inherit;
    font-size: 0.95rem;
  
    text-align: center;
    text-align-last: center;
  
    cursor: pointer;
    box-shadow: none;
  }
  
  .clear-btn {
    min-height: 44px;
  
    background: var(--primary);
    color: #ffffff;
  
    border: 1px solid var(--primary);
    border-radius: 999px;
  
    padding: 0.65rem 1.25rem;
  
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
  
    cursor: pointer;
  
    transition: var(--transition);
  }
  
  .clear-btn:hover {
    background: #000000;
  }
  
  
  h1,
  h2,
  h3 {
    font-family: "SF Pro Rounded", "SF Pro Display", -apple-system,
      BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  
    color: var(--text);
  }
  
  h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
  }
  
  h2 {
    font-size: 1.25rem;
    font-weight: 700;
  }
  
  h3 {
    font-size: 1rem;
    font-weight: 700;
  }
  
  #games-heading {
    margin-bottom: 1rem;
  
    font-size: 1.25rem;
    font-weight: 700;
  
    color: var(--text);
  }
  
  .game-details-btn {
    width: 100%;
  
    margin-top: auto;
    padding: 0.65rem 1rem;
  
    background: #ffffff;
    color: var(--primary);
  
    border: 1px solid var(--primary);
    border-radius: 999px;
  
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
  
    cursor: pointer;
  
    transition: var(--transition);
  }
  
  .game-details-btn:hover {
    background: var(--primary);
    color: #ffffff;
  }
  
  #search-input:focus-visible,
  .filterbar select:focus-visible,
  button:focus-visible {
    outline: 3px solid #000000;
    outline-offset: 3px;
  }

  #game-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  

/* =====================
   RESPONSIVE & ACCESSIBILITY
   ===================== */
   @media (min-width: 600px) and (max-width: 899px) {
    #game-list {
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
    }
  
    .game-card {
      width: 100%;
      max-width: none;
      margin: 0;
    }
  }
   @media (max-width: 599px) {
    #game-list {
      grid-template-columns: 1fr;
  
      gap: 2rem;
  
      padding: 2rem 0;
    }
  
    .game-card {
      width: 100%;
      max-width: 360px;
  
      margin: 0 auto;
    }
  
    .game-poster {
      height: 230px;
    }
  
    .game-info {
      padding: 1.25rem;
    }
  }

@media (max-width: 599px) {

}

@media (max-width: 599px) {
  .site-header {
    padding: 0.75rem 1rem;

    grid-template-columns: auto 1fr auto;
  }

  .site-logo {
    width: 60px;
  }

  .site-header h1 {
    grid-column: 2;

    justify-self: center;

    font-size: 1.35rem;
  }
}

@media (max-width: 599px) {
  main {
    width: 90%;
    padding: 6.5rem 0 2rem;
  }
}
@media (max-width: 599px) {
  .searchbar-container {
    width: 100%;
    margin-bottom: 1rem;
  }

  .searchbar-container #search-input {
    width: 100%;
    max-width: none;

    min-height: 48px;
  }

  .searchbar-container label {
    text-align: center;
  }
}

@media (max-width: 599px) {
  .filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 1rem;

    width: 100%;

    margin: 0 0 2.5rem;
    padding: 0;

    transform: none;
  }

  .filterbar select,
  .clear-btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }
}

@media (max-width: 599px) {
  .game-card {
    width: 100%;
    max-width: none;

    margin: 0;
  }

  .game-poster {
    height: 210px;
  }

  .game-info {
    padding: 1rem;
  }
}

@media (max-width: 599px) {
  dialog#game-dialog {
    width: 92vw;
    max-height: 90vh;

    overflow-y: auto;
  }

  #dialog-content {
    min-height: auto;

    grid-template-columns: 1fr;

    gap: 1.25rem;

    padding: 1.5rem;
  }

  #dialog-content img.game-poster {
    width: 100%;
    max-width: 250px;
    height: 230px;

    margin: 0 auto;
  }

  .dialog-details {
    min-height: auto;
  }

  #dialog-content h2 {
    font-size: 1.5rem;
  }

  .game-description {
    margin-top: 1rem !important;
  }

  #dialog-content .game-rating {
    margin-top: 1rem;

    align-self: flex-end;
  }

  #close-dialog {
    top: 0.75rem;
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
