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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    min-height: 100vh;
    padding: 16px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0 24px;
}

header h1 {
    font-size: 2rem;
    color: #333;
}

.subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-top: 4px;
}

/* Filters */
.filters {
    background: white;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.filter-chip {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 14px;
    font-size: 0.8rem;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    border-color: #5D4037;
    color: #5D4037;
}

.filter-chip.active {
    background: #5D4037;
    border-color: #5D4037;
    color: white;
}

.filter-chip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(93, 64, 55, 0.3);
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: #e0e0e0;
    margin: 0 4px;
}

.clear-filters {
    margin-left: auto;
    padding: 4px 10px;
    border: none;
    border-radius: 14px;
    font-size: 0.8rem;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-filters:hover {
    background: #f5f5f5;
    color: #666;
}

.clear-filters.has-filters {
    color: #5D4037;
}

.clear-filters.has-filters:hover {
    background: #EFEBE9;
}

/* Expandable tags */
.filter-group-expandable {
    flex-wrap: wrap;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.filter-toggle label {
    cursor: pointer;
}

.toggle-icon {
    font-size: 0.6rem;
    color: #999;
    transition: transform 0.2s ease;
}

.filter-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.filter-chips-collapsible {
    display: none;
}

.filter-chips-collapsible.expanded {
    display: flex;
}

/* Game List */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.game-card:active {
    transform: translateY(0);
}

.game-thumbnail {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
    flex-shrink: 0;
}

.game-info {
    flex: 1;
    min-width: 0;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-arrow {
    color: #ccc;
    font-size: 1.2rem;
}

/* Tags */
.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: lowercase;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1rem;
}

/* Complexity badges */
.complexity-light {
    background: #e3f2fd;
    color: #1565c0;
}

.complexity-medium {
    background: #fff3e0;
    color: #e65100;
}

.complexity-heavy {
    background: #fce4ec;
    color: #c2185b;
}

/* Back button (for game pages) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5D4037;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Install prompt */
.install-prompt {
    background: linear-gradient(135deg, #5D4037 0%, #4E342E 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.install-prompt p {
    font-size: 0.9rem;
}

.install-prompt button {
    background: white;
    color: #5D4037;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.install-prompt .dismiss {
    background: transparent;
    color: rgba(255,255,255,0.7);
    padding: 8px;
}
