:root {
    --bg-dark: #090d16;
    --bg-card: #131b2e;
    --bg-card-hover: #1e293b;
    --border-color: #1e293b;
    --border-highlight: #334155;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font);
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Navbar */
.nav-header {
    background: rgba(19, 27, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-accent {
    background: #0284c7;
    color: #fff;
    border-color: #38bdf8;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-accent:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Hero Section */
.hero {
    padding: 60px 20px 40px 20px;
    text-align: center;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #7dd3fc 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    max-width: 680px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

/* Feature Grid */
.features-section {
    padding: 30px 20px;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 28px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f1f5f9;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2rem;
    line-height: 1;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Rooms & Leaderboard Section */
.rooms-section {
    padding: 20px 20px 60px 20px;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.tabs-group {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--border-highlight);
}

.rooms-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Table / Card Container */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    background: #0f172a;
    padding: 12px 16px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-waiting { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-playing { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-idle { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Modallar */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #131b2e;
    border: 1px solid var(--border-highlight);
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: #fff;
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
}

.form-input {
    background: #090d16;
    border: 1px solid var(--border-highlight);
    color: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.modal-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Mobil Kart Dönüşümü (Responsive) */
@media (max-width: 768px) {
    .nav-header {
        padding: 10px 14px;
    }
    .hero {
        padding: 40px 16px 24px 16px;
        gap: 14px;
    }
    .hero-actions {
        width: 100%;
        flex-direction: column;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .custom-table thead {
        display: none;
    }
    .custom-table, .custom-table tbody, .custom-table tr, .custom-table td {
        display: block;
        width: 100%;
    }
    .custom-table tr {
        margin-bottom: 12px;
        border-radius: 10px;
        border: 1px solid var(--border-highlight);
        background: #0f172a;
        padding: 10px;
    }
    .custom-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.85rem;
    }
    .custom-table td:last-child {
        border-bottom: none;
        margin-top: 8px;
        padding-top: 8px;
        justify-content: flex-end;
    }
    .custom-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.78rem;
        text-transform: uppercase;
    }
    .tabs-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tabs-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .tab-btn {
        text-align: center;
    }
    .rooms-controls {
        width: 100%;
    }
    .rooms-controls .btn {
        width: 100%;
    }
    .modal-box {
        padding: 18px;
    }
}
