/* VB Games — mobile-first, dark, fun. */
:root {
    --bg: #0f0f1e;
    --bg-soft: #1a1a2e;
    --bg-card: #232342;
    --fg: #f4f4ff;
    --fg-dim: #9b9bbf;
    --accent: #ff4ecb;
    --accent-2: #4ed8ff;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --radius: 14px;
    --gap: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overscroll-behavior: none;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid #2a2a44;
}

.logo {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--fg);
    text-decoration: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topnav .pseudo {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.topnav .link {
    color: var(--fg);
    text-decoration: none;
    font-size: 1.2rem;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.flash {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    background: var(--bg-card);
}
.flash li { padding: 6px 0; }
.flash-error { color: var(--bad); }
.flash-success { color: var(--good); }
.flash-warning { color: var(--warn); }

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: var(--gap);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

h1, h2, h3 { margin: 0 0 0.6em 0; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; color: var(--accent-2); }

p { margin: 0 0 0.8em 0; color: var(--fg-dim); line-height: 1.45; }

.btn, button, input[type="submit"] {
    display: inline-block;
    width: 100%;
    padding: 14px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin: 6px 0;
    -webkit-tap-highlight-color: transparent;
}
.btn.secondary { background: var(--bg-soft); border: 1px solid #3a3a5c; }
.btn.ghost { background: transparent; border: 1px solid #3a3a5c; }
.btn.small { padding: 8px 12px; width: auto; font-size: 0.9rem; }
.btn:active { transform: scale(0.98); }
.btn.danger { background: var(--bad); }

input[type="text"], input[type="password"], input[type="number"],
input[type="tel"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-soft);
    color: var(--fg);
    border: 1px solid #2a2a44;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
textarea { min-height: 100px; resize: vertical; }

label { display: block; margin: 10px 0 4px; color: var(--fg-dim); font-size: 0.9rem; }

.pin-input {
    letter-spacing: 0.5em;
    font-size: 1.6rem;
    text-align: center;
    font-family: monospace;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--gap);
}

.game-tile {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    color: var(--fg);
    text-decoration: none;
    border: 1px solid #2a2a44;
    transition: transform 0.1s ease;
}
.game-tile:active { transform: scale(0.97); }
.game-tile .emoji { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.game-tile .label { font-weight: 600; font-size: 0.95rem; }
.game-tile .kind { font-size: 0.75rem; color: var(--fg-dim); margin-top: 4px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    font-size: 0.75rem;
    color: var(--fg-dim);
}

.list { list-style: none; padding: 0; margin: 0; }
.list li {
    padding: 12px 0;
    border-bottom: 1px solid #2a2a44;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list li:last-child { border-bottom: none; }

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.bar {
    height: 10px;
    background: var(--bg-soft);
    border-radius: 999px;
    overflow: hidden;
    margin: 4px 0;
}
.bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: var(--bg-soft);
    color: var(--fg-dim);
    margin-right: 4px;
}
.pill.on { background: var(--accent); color: #fff; }

.muted { color: var(--fg-dim); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
