:root { color-scheme: light dark; }
body { font-family: system-ui, sans-serif; max-width: 900px; margin: 0 auto; padding: 0 1rem 2rem; }
header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid #8883; margin-bottom: 1.5rem; }
header .brand { font-weight: 700; text-decoration: none; color: inherit; font-size: 1.1rem; }
header a { color: inherit; }
h1 { margin-bottom: 0.25rem; }
.meta { font-size: 0.85rem; opacity: 0.75; }
.error { color: #c0392b; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { padding: 0.4rem 0.6rem; font-size: 0.9rem; border: 1px solid #8886; border-radius: 6px; background: transparent; color: inherit; }
.f-search { flex: 1; min-width: 160px; }

.table-scroll { overflow-x: auto; border: 1px solid #8883; border-radius: 8px; margin-bottom: 1rem; }
#games-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; table-layout: fixed; }
#games-table th, #games-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid #8882; text-align: left; overflow: hidden; }
#games-table thead th { position: sticky; top: 0; background: Canvas; border-bottom: 1px solid #8886; z-index: 1; }

#games-table .col-name { width: 200px; max-width: 200px; white-space: normal; word-break: break-word; }
#games-table td.col-name, #games-table th.col-name { position: sticky; left: 0; background: Canvas; z-index: 2; }
#games-table .col-status { width: 90px; white-space: nowrap; }
#games-table .col-status .badge { padding: 0.1rem 0.4rem; font-size: 0.72rem; white-space: nowrap; }

#games-table .col-owner { width: 2.2rem; max-width: 2.2rem; text-align: center; padding: 0.35rem 0.1rem; }
#games-table th.col-owner { height: 7rem; vertical-align: bottom; padding-bottom: 0.5rem; }
#games-table th.col-owner span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 600; font-size: 0.75rem; }

#games-table a { color: inherit; text-decoration: none; }
#games-table a:hover { text-decoration: underline; }
.owned { color: #1e8449; font-weight: 700; }

.game-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.game-card { border: 1px solid #8883; border-radius: 8px; overflow: hidden; }
.game-card a { display: block; padding: 0.8rem; text-decoration: none; color: inherit; }
.game-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; margin-bottom: 0.5rem; }
.game-name { font-weight: 600; }

.detail-image { max-width: 100%; border-radius: 8px; margin: 1rem 0; }

.badge { display: inline-block; font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 999px; margin-top: 0.4rem; }
.badge-available { background: #2ecc7133; color: #1e8449; }
.badge-lent { background: #e74c3c33; color: #c0392b; }
.badge-unknown { background: #8883; color: inherit; }

.tags { margin-top: 0.5rem; }
.tag { display: inline-block; font-size: 0.8rem; background: #8882; border-radius: 999px; padding: 0.1rem 0.6rem; margin-right: 0.3rem; }

.game-form, .admin-list li { display: flex; flex-direction: column; gap: 0.6rem; border: 1px solid #8883; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.game-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
.game-form input, .game-form textarea { padding: 0.4rem; font-size: 0.95rem; }
.game-form button, .actions button { cursor: pointer; border: 1px solid #8886; border-radius: 6px; background: transparent; padding: 0.4rem 0.8rem; font-size: 0.9rem; align-self: flex-start; }

.admin-list { list-style: none; padding: 0; }
.actions { display: flex; gap: 0.5rem; }
