:root {
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a24;
    
    /* Text */
    --text-primary: #f8f8f2;
    --text-secondary: #a0a0b0;
    --text-heading: #ffffff;
    
    /* Accent (gold for tournament theme) */
    --accent: #ffd700;
    --accent-hover: #ffed4a;
    --accent-soft: rgba(255, 215, 0, 0.1);
    
    /* Secondary accent (purple) */
    --accent-secondary: #a855f7;
    --accent-secondary-hover: #9333ea;
    
    /* Status */
    --success: #22c55e;
    --danger: #ef4444;
    
    /* Borders & shadows */
    --border: #2a2a3a;
    --border-subtle: #1f1f2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    /* Sizing */
    --radius: 12px;
    --radius-sm: 8px;
    
    /* Seed colors */
    --seed-gold: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    --seed-silver: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    --seed-bronze: linear-gradient(135deg, #cd7f32 0%, #b5651d 100%);
}

[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f0;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --text-heading: #111;
    --border: #ddd;
    --border-subtle: #eee;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.5;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--accent);
}

.nav .brand {
    font-weight: 600;
    color: var(--accent);
    font-size: 16px;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-heading);
    margin-top: 0;
}

h1 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 i {
    color: var(--accent);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* Form elements */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    min-height: 200px;
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
}

/* Buttons - Ghost/outline as default */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-soft);
}

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

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

.btn-secondary {
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 100;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Seeding options */
.seeding-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.seeding-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.seeding-option:hover {
    border-color: var(--accent);
}

.seeding-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.seeding-option input {
    display: none;
}

.seeding-option h3 {
    margin: 0 0 8px 0;
    color: var(--accent);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.seeding-option p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Lobby grid */
.lobbies {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.lobby {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.lobby-header {
    background: var(--bg-secondary);
    padding: 12px 15px;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.lobby-players {
    padding: 8px 0;
}

.player {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-subtle);
}

.player:last-child {
    border-bottom: none;
}

.seed {
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.seed.top-1 {
    background: var(--seed-gold);
    color: var(--bg-primary);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.seed.top-2 {
    background: var(--seed-silver);
    color: var(--bg-primary);
}

.seed.top-3 {
    background: var(--seed-bronze);
    color: var(--bg-primary);
}



.player-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-points {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Share section */
.share-section {
    margin-top: 30px;
}

.share-section h3 {
    margin-bottom: 8px;
}

.share-url {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-url input {
    flex: 1;
    margin-bottom: 0;
    font-family: monospace;
}

/* Help text */
.help {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -15px;
    margin-bottom: 20px;
}

/* Row layout */
.row {
    display: flex;
    gap: 20px;
}

.row > div {
    flex: 1;
}

/* Header with links */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header .links {
    display: flex;
    gap: 15px;
}

.page-header .links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.page-header .links a:hover {
    color: var(--accent);
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .seeding-options {
        flex-direction: column;
    }
    
    .row {
        flex-direction: column;
    }
    
    .lobbies {
        grid-template-columns: 1fr;
    }
}
