/* Set a better box-sizing model on the root element */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Global Styles & Dark Theme */
body {
    background-color: #121828; /* Dark blue background */
    color: #e5e7eb; /* Light gray text */
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
}

/* Header */
.site-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.site-header h1 {
    font-size: 2.5rem;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
}

/* Game Grid Layout */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Game Card Styling */
.game-card {
    background-color: #1e293b; /* Darker card background */
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(45, 156, 219, 0.4);
}

.card-image-placeholder {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.game-title-in-image {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: #ffffff;
}

.card-content p {
    margin: 0 0 20px;
    color: #9ca3af; /* Lighter gray for description */
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

.play-button {
    background-color: #2563eb; /* Bright blue button */
    color: #ffffff;
    text-align: center;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.game-card:hover .play-button {
    background-color: #3b82f6; /* Lighter blue on hover */
}

/* Placeholder Background Colors */
.bg-red { background: linear-gradient(45deg, #ef4444, #b91c1c); }
.bg-blue { background: linear-gradient(45deg, #3b82f6, #1d4ed8); }
.bg-green { background: linear-gradient(45deg, #22c55e, #15803d); }
.bg-purple { background: linear-gradient(45deg, #a855f7, #7e22ce); }
.bg-orange { background: linear-gradient(45deg, #f97316, #c2410c); }
.bg-teal { background: linear-gradient(45deg, #14b8a6, #0f766e); }
.bg-pink { background: linear-gradient(45deg, #ec4899, #be185d); }
.bg-yellow { background: linear-gradient(45deg, #eab308, #a16207); }
.bg-cyan { background: linear-gradient(45deg, #06b6d4, #0e7490); }
.bg-indigo { background: linear-gradient(45deg, #6366f1, #4338ca); }
.bg-gray { background: linear-gradient(45deg, #6b7280, #4b5563); }

/* Responsive Design */
@media (max-width: 992px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    .game-grid {
        grid-template-columns: 1fr;
    }
    .site-header h1 {
        font-size: 2rem;
    }
}

.card-image-placeholder {
    transition: transform 0.3s;
}

.game-card:hover .card-image-placeholder {
    transform: scale(1.08); /* 只放大，不旋转 */
}

/* Language Switcher Styles */
.language-switcher-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000; /* Ensure it's above other elements */
}

.language-switcher {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #555; /* Darker border */
  background-color: #444; /* Dark background */
  color: #fff; /* White text */
  font-size: 14px;
  cursor: pointer;
  -webkit-appearance: none; /* Remove default arrow on Chrome/Safari */
  -moz-appearance: none; /* Remove default arrow on Firefox */
  appearance: none;
  /* Custom arrow (white) for dark background */
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-12.8z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 35px; /* Make space for the custom arrow */
}

.language-switcher:hover {
  border-color: #777;
  background-color: #555;
}

.language-switcher:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 5px rgba(100,100,100,0.2);
}