/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: #444;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 1rem;
    margin-bottom: 1rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Mode Panels */
.mode-panels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.mode-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.mode-panel:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mode-panel-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.mode-panel h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.mode-panel p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Split panel (Unranked + Practice in one column) */
.mode-panel-split {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mode-panel-half {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.mode-panel-half:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mode-panel-half .mode-panel-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.mode-panel-half h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.mode-panel-half p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.unranked-half:hover {
    border-color: #f59e0b;
}

.practice-half:hover {
    border-color: var(--primary-color);
}

.practice-panel:hover {
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(43, 135, 218, 0.25);
}

.ranked-panel:hover {
    border-color: #f59e0b;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.25);
}

.party-panel:hover {
    border-color: #a855f7;
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.25);
}

.tournament-panel:hover {
    border-color: #22c55e;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.25);
}

/* Games Grid Header */
.games-grid-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.games-grid-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.games-grid-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(43, 135, 218, 0.3);
    text-decoration: none;
    color: inherit;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.game-stats {
    margin-top: auto;
    padding: 0.5rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 6px;
}

.best-score {
    color: var(--primary-color);
    font-weight: bold;
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--danger-color);
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Practice/Ranked Header */
.practice-header {
    text-align: center;
    margin-bottom: 2rem;
}

.practice-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.practice-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tournament Mini Overlay (bottom-left) */
#tournament-mini-overlay {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 240px;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: tmo-slide-in 0.3s ease;
}

@keyframes tmo-slide-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#tournament-mini-overlay .tmo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#tournament-mini-overlay .tmo-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#tournament-mini-overlay .tmo-status {
    font-size: 0.75rem;
    font-weight: 600;
}

#tournament-mini-overlay .tmo-status.waiting {
    color: #f59e0b;
}

#tournament-mini-overlay .tmo-status.in_progress {
    color: var(--success-color);
}

#tournament-mini-overlay .tmo-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tournament-mini-overlay .tmo-players {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

#tournament-mini-overlay .tmo-actions {
    display: flex;
    gap: 0.5rem;
}

#tournament-mini-overlay .tmo-view-btn {
    flex: 1;
    padding: 0.4rem 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#tournament-mini-overlay .tmo-view-btn:hover {
    opacity: 0.85;
}

#tournament-mini-overlay .tmo-leave-btn {
    flex: 1;
    padding: 0.4rem 0;
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#tournament-mini-overlay .tmo-leave-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Lockdown mode - disable all interactive elements except avatar dropdown and logout */
body.tournament-lockdown a,
body.tournament-lockdown button,
body.tournament-lockdown input,
body.tournament-lockdown select,
body.tournament-lockdown textarea {
    pointer-events: none !important;
    opacity: 0.4 !important;
    user-select: none !important;
}

/* Keep avatar dropdown and logout clickable */
body.tournament-lockdown .avatar-dropdown,
body.tournament-lockdown .avatar-dropdown *,
body.tournament-lockdown #nav-logout,
body.tournament-lockdown #nav-logout * {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Cross-platform badge */
.cross-platform-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 12px;
    vertical-align: middle;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: opacity 0.15s;
}
.cross-platform-badge:hover {
    opacity: 0.8;
}
.cross-platform-badge.cp-on {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.cross-platform-badge.cp-off {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Platform Stats */
.platform-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Site Footer */
.site-footer {
    background: #111827;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 0;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.footer-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Legal Pages (Privacy, Terms) */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-section ul {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-section li {
    margin-bottom: 0.4rem;
}

.legal-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}

/* About Page */
.about-page {
    max-width: 900px;
    margin: 0 auto;
}

.about-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.about-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.about-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.about-feature {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.about-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.about-feature h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.about-feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
}

.about-cta {
    text-align: center;
    padding: 2.5rem 0;
}

.about-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
}

.about-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Contact Page */
.contact-page {
    max-width: 900px;
    margin: 0 auto;
}

.contact-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.contact-card:hover {
    border-color: var(--primary-color);
}

.contact-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.contact-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.contact-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.contact-link:hover {
    text-decoration: underline;
}

.contact-faq {
    margin-top: 2rem;
}

.contact-faq h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.faq-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-item a:hover {
    text-decoration: underline;
}
