:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --success-hover: #15803d;
    --neutral: #6b7280;
    --neutral-hover: #4b5563;
    --warning: #d97706;
    --warning-hover: #b45309;
    --bg: #f9fafb;
    --surface: #ffffff;
    --nav-bg: #1e293b;
    --nav-text: #e2e8f0;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --border-focus: #2563eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --radius: 6px;
    --radius-lg: 10px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

nav {
    background: var(--nav-bg);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    box-shadow: var(--shadow);
}

nav a {
    color: var(--nav-text);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background 0.2s;
    font-size: 0.938rem;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav .nav-settings {
    margin-left: auto;
    font-size: 1.3rem;
    margin-right: 8px;
}

nav .nav-settings:hover {
    text-decoration: none;
}

nav form {
    margin-left: 0;
}

nav form button {
    background: rgba(255, 255, 255, 0.15);
    color: var(--nav-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

nav form button:hover {
    background: rgba(255, 255, 255, 0.25);
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--text);
}

p {
    margin-bottom: 12px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h1 {
    margin-bottom: 12px;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-neutral {
    background: var(--neutral);
    color: #fff;
}

.btn-neutral:hover {
    background: var(--neutral-hover);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: var(--warning-hover);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.813rem;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

thead {
    background: var(--primary);
    color: #fff;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.938rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f3f4f6;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:nth-child(even):hover {
    background: #f3f4f6;
}

table a {
    color: var(--primary);
    font-weight: 500;
}

.form-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    max-width: 480px;
}

form div {
    margin-bottom: 16px;
}

form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.875rem;
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.938rem;
    font-family: var(--font-stack);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.helptext {
    display: block;
    font-size: 0.813rem;
    color: var(--text-light);
    margin-top: 4px;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.errorlist li {
    color: var(--danger);
    font-size: 0.813rem;
    font-weight: 500;
}

ul {
    padding-left: 24px;
    margin-bottom: 12px;
}

li {
    margin-bottom: 4px;
}

.podium {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    text-align: center;
}

.podium .game-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.podium .game-score {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 4px;
}

.vote-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.vote-row select,
.vote-row input {
    margin-bottom: 0;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #dbeafe;
    color: #1e40af;
    margin-left: 4px;
    vertical-align: middle;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.bgg-search-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.bgg-search-section h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.bgg-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bgg-search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.938rem;
    font-family: var(--font-stack);
}

.bgg-search-bar input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.bgg-results-list {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface);
}

.bgg-result-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.bgg-result-item:last-child {
    border-bottom: none;
}

.bgg-result-item:hover {
    background: #eef2ff;
}

.bgg-image-preview {
    margin-top: 12px;
}

.bgg-image-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.bgg-detail-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    float: right;
    margin-left: 16px;
}

.bgg-link {
    display: inline-block;
    margin-bottom: 12px;
}

.bgg-thumbnail {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid var(--border);
}

.verified-badge {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85em;
    margin-left: 2px;
    vertical-align: middle;
    font-weight: 700;
}

.datetime-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.datetime-row .form-field {
    flex: 1;
    margin-bottom: 16px;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.875rem;
    color: var(--text);
}

.form-errors {
    margin-top: 4px;
}

.form-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.form-errors li {
    color: var(--danger);
    font-size: 0.813rem;
    font-weight: 500;
}
