* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

/* =========================
   Shared buttons
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-light {
    background: #fff;
    color: #0f172a;
    border-color: #dbe4f0;
}

.btn-light:hover {
    background: #f8fbff;
}

.btn-sm {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.btn-danger-light {
    background: #fff;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-danger-light:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #b91c1c;
}



/* =========================
   Header
========================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5edf5;
}

.main-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    text-decoration: none;
    line-height: 0;
}

/* AQUÍ está el cambio clave: width, no height */
.logo {
    width: 250px;
    max-width: none;
    height: auto;
    display: block;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
    transition: 0.2s ease;
}

.menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   Footer
========================= */
.site-footer {
    background: #0f172a;
    color: #c8d3e0;
    padding: 30px 16px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-logo {
    width: 135px;
    max-width: none;
    height: auto;
    display: block;
    margin-bottom: 10px;
    object-fit: contain;
}

.footer-copy {
    margin: 0;
    color: #c8d3e0;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #dbe7f4;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

/* =========================
   Mobile
========================= */
@media (max-width: 860px) {
    .main-header .header-inner {
        padding: 10px 12px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .logo {
        width: 140px;
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin: 6px 0 0;
        padding-top: 8px;
        border-top: 1px solid #e5edf5;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav .btn {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-logo {
        width: 120px;
    }
}

/* ========== Tournament Cover (default vs real) ========== */

.hero-cover img.default-cover {
    object-fit: contain;
    background: radial-gradient(circle at center, #ffffff 0%, #eaf2fb 100%);
    padding: 30px;
}

.hero-cover img.real-cover {
    object-fit: cover;
}

/* ========== Danger / destructive actions ========== */

.text-danger {
    color: #c0392b;
    font-weight: 700;
}

.text-danger-soft {
    color: #c0392b;
    opacity: 0.9;
}

input[type="checkbox"]:checked {
    accent-color: #2563eb;
}

.user-chip-link{
    text-decoration:none;
    color:inherit;
    display:inline-flex;
}

.user-chip{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 12px;
    border:2px solid #3b6ee6;
    border-radius:999px;
    background:#fff;
    transition:.2s ease;
}

.user-chip-link:hover .user-chip{
    border-color:#2563eb;
    box-shadow:0 2px 8px rgba(37,99,235,.15);
}

.user-chip-text{
    display:flex;
    flex-direction:column;
    line-height:1.1;
    font-size:.82rem;
}

.user-chip-text strong{
    max-width:120px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.user-chip-text span{
    color:#64748b;
    font-size:.72rem;
}

.user-avatar{
    position:relative;
    width:34px;
    height:34px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#2563eb;
    color:#fff;
    font-weight:800;
    overflow:hidden;
    flex:0 0 34px;
}

.user-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.user-chip:hover{
    border-color:#2563eb;
    box-shadow:0 4px 12px rgba(37,99,235,.20);
}

.btn-logout{
    border-color:#ef4444 !important;
    color:#ef4444 !important;
}

.btn-logout:hover{
    background:#ef4444 !important;
    color:#fff !important;
}

.online-dot{
    position:absolute;
    bottom:2px;
    right:2px;
    width:10px;
    height:10px;
    background:#22c55e;
    border:2px solid #fff;
    border-radius:50%;
    z-index:10;
}

