:root {
  --primary-color: #6200ea;
  --secondary-color: #03dac6;
  --background-color: #f5f5f5;
  --text-color: #333333;
  --card-background: #ffffff;
  --header-background: #7c4dff;
  --footer-background: #311b92;
  --accent-color: #ff4081;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  margin-bottom: 2rem; /* Add space below the header */
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header a {
  color: white;
  text-decoration: none;
}

nav ul {
  list-style-type: none;
  display: flex;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  font-size: 1.1rem;
}

nav ul li a:hover {
  color: var(--secondary-color);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 2rem; /* Add space above the main content */
  padding: 2rem 0;
}

h2, h3, h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.card {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.game-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.game-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.rankings {
  list-style-type: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.rankings li, .ranking-item {
  background-color: #f0f0f0;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.category {
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
  color: #000000; /* Changed to black for maximum contrast */
}

.stars, .score {
  color: #000000;
  font-size: 1.2rem;
  font-weight: bold;
  background-color: #FFD700; /* Changed to a darker gold for better contrast */
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.rules, .tips {
  margin-bottom: 2rem;
}

.rules ol, .tips ul {
  padding-left: 1.5rem;
}

.rules li, .tips li {
  margin-bottom: 0.5rem;
}

.categories-list, .equipment-list, .time-list {
  list-style-type: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.categories-list li, .equipment-list li, .time-list li {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.explore-more h3 {
  font-size: 1.8rem;
  margin-top: 2rem;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.game-list .card {
  padding: 1.5rem;
}

.game-list h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

footer {
  background-color: var(--footer-background);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
}


@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    margin-top: 1rem;
  }

  nav ul li {
    margin-left: 0;
    margin-right: 1rem;
  }

  .rankings {
    grid-template-columns: 1fr;
  }
}

.page-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.page-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-color);
  text-align: center;
}

.game-list {
  list-style-type: none;
  padding: 0;
}

.game-item {
  margin-bottom: 2rem;
}

.game-item h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.game-description {
  font-size: 1.1rem;
  color: var(--text-color);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.list-card .card-icon {
    color: var(--accent-color);
}

.category-card .card-icon {
    color: var(--secondary-color);
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

main > h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.game-detail {
    text-align: left;
}

.rankings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ranking-item {
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1 1 calc(33.333% - 1rem); /* This will create 3 items per row on larger screens */
    min-width: 150px; /* Minimum width to prevent too narrow items */
}

.ranking-item .category {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.ranking-item .stars {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .ranking-item {
        flex: 1 1 calc(50% - 1rem); /* 2 items per row on medium screens */
    }
}

@media (max-width: 480px) {
    .ranking-item {
        flex: 1 1 100%; /* 1 item per row on small screens */
    }
}

.rules, .tips {
    margin-bottom: 2rem;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rules h3, .tips h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.rules ol, .tips ul {
    padding-left: 1.5rem;
}

.rules li, .tips li {
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease;
}

.rules li:hover, .tips li:hover {
    transform: translateX(5px);
}

.home-grid {
    display: grid;
    gap: 2rem;
}

.featured-games .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.featured-games .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.featured-games .card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.featured-games .card-description {
    font-size: 0.9rem;
    flex-grow: 1;
}

.popular-lists .list-list,
.game-categories .category-list {
    list-style-type: none;
    padding: 0;
}

.popular-lists .list-list li,
.game-categories .category-list li {
    margin-bottom: 0.5rem;
}

.popular-lists .list-list a,
.game-categories .category-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-lists .list-list a:hover,
.game-categories .category-list a:hover {
    color: var(--primary-color);
}

/* Add this to your existing CSS file */
.index-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.index-card .card-title,
.index-card .card-description {
    max-width: 100%;
    width: 100%;
}

.index-card .card-icon {
    margin-bottom: 1rem;
}

/* Add this to your existing CSS file */
.home-content {
    text-align: center;
}

.home-content .home-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-content section {
    width: 100%;
    max-width: 800px; /* Adjust this value as needed */
}

.home-content .card-grid {
    justify-content: center;
}

.home-content h2 {
    text-align: center;
}

.categories-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.categories-list li {
    margin-bottom: 5px;
}

.category-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.category-link:hover {
    transform: translateY(-2px);
}

.game-content-wrapper {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: center; /* This will vertically center the children */
}

.rankings-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* This will center the content vertically */
}

.game-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center; /* This will center the image vertically */
}

.game-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Rest of the CSS remains the same */

@media (max-width: 768px) {
    .game-content-wrapper {
        flex-direction: column;
        align-items: stretch; /* Reset alignment for mobile view */
    }
    
    .game-image-container {
        order: -1;
        margin-bottom: 1rem;
    }

    /* Rest of the media query remains the same */
}

/* Styles for when there's no image */
.game-content-wrapper.no-image .rankings-grid {
    grid-template-columns: repeat(3, 1fr);
}

.game-content-wrapper.no-image .rankings-container {
    flex: 1;
}

.game-content-wrapper.no-image .game-image-container {
    display: none;
}

@media (max-width: 768px) {
    .game-content-wrapper {
        flex-direction: column;
    }
    
    .game-image-container {
        order: -1;
        margin-bottom: 1rem;
    }

    .rankings-grid,
    .game-content-wrapper.no-image .rankings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .rankings-grid,
    .game-content-wrapper.no-image .rankings-grid {
        grid-template-columns: 1fr;
    }
}

.footer-link,
.footer-link:visited {
    color: #FFE666; /* Lighter gold color for better contrast */
    text-decoration: underline;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 3px;
    position: relative;
}

.footer-link::after {
    content: '↗';
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.footer-link:hover,
.footer-link:focus,
.footer-link:visited:hover,
.footer-link:visited:focus {
    background-color: #FFE666;
    color: #311b92; /* Dark purple (footer background color) */
    text-decoration: none;
    outline: none;
}

.footer-link:hover::after,
.footer-link:focus::after,
.footer-link:visited:hover::after,
.footer-link:visited:focus::after {
    transform: translateX(2px) translateY(-2px);
}

.footer-link:focus,
.footer-link:visited:focus {
    box-shadow: 0 0 0 2px #FFE666;
}

a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid #ffeb3b;
  outline-offset: 2px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.game-video-container {
    width: 100%;
    margin: 3rem auto;
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.game-video-container h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (min-width: 768px) {
    .game-video-container {
        padding: 1.5rem;
    }
    
    .game-video-container h3 {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    .game-video-container {
        padding: 2rem;
    }
    
    .game-video-container h3 {
        font-size: 2.2rem;
    }
}

@media (min-width: 1200px) {
    .game-video-container {
        padding: 2.5rem;
    }
}

.long-description {
    margin: 2rem 0 3rem; /* Increased bottom margin */
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.long-description p {
    margin-bottom: 1rem;
}

.long-description p:last-child {
    margin-bottom: 0;
}

.game-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style-type: none;
    padding: 0;
}

.game-list .card {
    flex: 1 1 300px;
    max-width: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.game-list .card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.game-card-link {
    display: block;
    padding: 20px;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.game-card-link h3 {
    margin-top: 0;
    color: #8a2be2; /* Purple color for the title */
}

.game-card-link p {
    margin-bottom: 0;
}