:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121e;
    --bg-surface: #1a1a2e;
    --bg-hover: #22223a;
    --accent: #00d4ff;
    --accent-dim: #0088aa;
    --purple: #7c3aed;
    --text: #e0e0e0;
    --text-muted: #8a8aa0;
    --border: #2a2a3e;
    --radius: 10px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1:focus { outline: none; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #66e5ff; }

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #3a1a1a;
    color: #ff6b6b;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.875rem;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: #ff6b6b;
}

.blazor-error-boundary {
    background: #3a1a1a;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ff6b6b;
    border-radius: var(--radius);
    border: 1px solid #5a2a2a;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.loading-progress {
    position: absolute;
    display: block;
    width: 5rem;
    height: 5rem;
    inset: 30vh 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: #2a2a3e;
    stroke-width: 6;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
    filter: drop-shadow(0 0 4px var(--accent-dim));
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
    inset: calc(30vh + 5.5rem) 0 auto 0.2rem;
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code { color: var(--accent); font-size: 0.875em; }

.overview-content p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: #c0c0d0;
}

.overview-content a {
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.overview-content a:hover {
    border-bottom-color: var(--accent);
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.game-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    opacity: 0;
    transition: opacity 0.2s;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
    border-color: var(--accent-dim);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card h3 {
    color: var(--text);
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.game-card .links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.game-card .links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    word-break: break-all;
    transition: color 0.2s;
}

.game-card .links a:hover {
    color: var(--accent);
}

.game-card .links a .label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 2rem;
}

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease-out;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dialog-header h2 {
    margin: 0;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.35rem;
}

.dialog-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dialog-close:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--accent-dim);
}

.dialog-body {
    color: #c0c0d0;
    line-height: 1.7;
}

.dialog-body p {
    margin: 0 0 1rem;
}

.dialog-body a {
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.dialog-body a:hover {
    border-bottom-color: var(--accent);
}

.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}

.not-found h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.not-found p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.not-found a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
}

.not-found a:hover {
    border-color: var(--accent-dim);
    background: var(--bg-hover);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a4e;
}
