/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    color: #eee;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #fff;
    color: #000;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles - visible for keyboard navigation */
:focus {
    outline: 3px solid #4da6ff;
    outline-offset: 2px;
}

/* Header */
header {
    background: #16213e;
    padding: 1rem;
    border-bottom: 2px solid #4da6ff;
}

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

header h1 a {
    color: #4da6ff;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

header nav a {
    color: #eee;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

header nav a:hover,
header nav a:focus {
    background: #4da6ff;
    color: #000;
}

.nav-form {
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    color: #eee;
    padding: 0.5rem 1rem;
    font: inherit;
    cursor: pointer;
    border-radius: 4px;
}

.link-button:hover,
.link-button:focus {
    background: #4da6ff;
    color: #000;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 70vh;
}

/* Messages */
.messages {
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.message.success {
    background: #155724;
    border: 1px solid #28a745;
}

.message.error {
    background: #721c24;
    border: 1px solid #dc3545;
}

.message.info {
    background: #0c5460;
    border: 1px solid #17a2b8;
}

.message.warning {
    background: #856404;
    border: 1px solid #ffc107;
}

/* Forms */
form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #4da6ff;
    border-radius: 4px;
    background: #16213e;
    color: #eee;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #fff;
}

button,
input[type="submit"] {
    background: #4da6ff;
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    background: #fff;
}

.helptext {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #aaa;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    color: #ff6b6b;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Links */
a {
    color: #4da6ff;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* Cards/Items */
.card {
    background: #16213e;
    border: 1px solid #4da6ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h2,
.card h3 {
    margin-top: 0;
}

/* Lists */
.item-list {
    list-style: none;
    padding: 0;
}

.item-list li {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.item-list li:hover {
    border-color: #4da6ff;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #4da6ff;
    border-radius: 4px;
    text-decoration: none;
}

.pagination .current {
    background: #4da6ff;
    color: #000;
}

/* Profile */
.profile-header {
    margin-bottom: 2rem;
}

.profile-status {
    font-size: 1.25rem;
    padding: 1rem;
    background: #16213e;
    border-radius: 4px;
    border-left: 4px solid #4da6ff;
}

.profile-status.banned {
    border-left-color: #dc3545;
    color: #dc3545;
}

/* Rating */
.rating {
    display: flex;
    gap: 0.25rem;
}

.rating input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.rating label {
    font-size: 1.5rem;
    cursor: pointer;
    display: inline;
    font-weight: normal;
}

.rating input:checked ~ label,
.rating label:hover,
.rating label:hover ~ label {
    color: #ffc107;
}

/* Footer */
footer {
    background: #16213e;
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 2px solid #4da6ff;
}

footer nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

footer p {
    margin: 0;
    color: #aaa;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.search-form input[type="search"] {
    flex: 1;
}

/* Games grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Category badge */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #333;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Average rating display */
.avg-rating {
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 600px) {
    header nav ul {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }
}
