/* =====================
   Reset
   ===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =====================
   Variables
   ===================== */
:root {
    --bg:           #ffffff;
    --bg-surface:   #f7f7f7;
    --bg-hover:     #f0f0f0;
    --border:       #e5e5e5;
    --text-primary: #111111;
    --text-muted:   #888888;
    --accent:       #111111;
    --danger:       #e05555;
    --success:      #22c55e;

    --radius-sm:  4px;
    --radius-md:  6px;
    --radius-lg:  10px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================
   Base
   ===================== */
html, body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

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

/* =====================
   Layout
   ===================== */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =====================
   Navbar
   ===================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg);
}

.navbar-logo {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* =====================
   Typography
   ===================== */
h1 { font-size: 22px; font-weight: 500; }
h2 { font-size: 18px; font-weight: 500; }
h3 { font-size: 15px; font-weight: 500; }

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* =====================
   Form
   ===================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    height: 38px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    padding: 0 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--text-primary);
}

select {
    height: 38px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    padding: 0 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

/* =====================
   Buttons
   ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: opacity 0.15s;
    border: 0.5px solid transparent;
}

.btn:active {
    opacity: 0.8;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-outline {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--bg);
    color: var(--danger);
    border-color: var(--border);
}

.btn-danger:hover {
    background: #fff5f5;
    border-color: var(--danger);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
}

/* =====================
   Divider
   ===================== */
.divider {
    height: 0.5px;
    background: var(--border);
}

/* =====================
   Card
   ===================== */
.card {
    background: var(--bg);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

/* =====================
   Badge
   ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    background: var(--bg-surface);
    color: var(--text-muted);
}

.badge-win {
    background: #f0faf4;
    color: #22873e;
}

.badge-lose {
    background: #fff5f5;
    color: var(--danger);
}

.badge-draw {
    background: var(--bg-surface);
    color: var(--text-muted);
}

/* =====================
   Utility
   ===================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* =====================
   Message (error/success)
   ===================== */
.message {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 0.5px solid var(--border);
}

.message-error {
    background: #fff5f5;
    border-color: #fca5a5;
    color: var(--danger);
}

.message-success {
    background: #f0faf4;
    border-color: #86efac;
    color: #22873e;
}