@charset "utf-8";

:root{
--bs-dark-rgb:69,69,69;
}

/* === Prevent pull-to-refresh interference (PWA) === */
html, body {
    overscroll-behavior-y: contain;
}

/* === Safe area for iOS notch === */
body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

/* === Improved tap highlight === */
* {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* === Table colors === */
.table-success{
    --bs-table-color: #fff;
    --bs-table-bg:#198754;
    --bs-table-striped-color: #fff;
    --bs-table-striped-bg: #2e9f6b;
}
.table-danger {
    --bs-table-color: #fff;
    --bs-table-bg: #dc3545;
    --bs-table-striped-color: #fff;
    --bs-table-striped-bg: #d75360;
}

/* === Dark/Danger backgrounds === */
.bg-dark{ color: #fff;}
.bg-danger .text-danger{color: #000 !important}
.bg-danger{ color: #fff;}

/* === Card custom === */
.card-custom {
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 1);
}

.card-custom-img {
    height: 170px;
    min-height: 170px;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    border-color: inherit;
    position: relative;
}

.card-custom-img::after {
    position: absolute;
    content: '';
    bottom: 0px;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-top-width: 40px;
    border-right-width: 0;
    border-bottom-width: 0;
    border-left-width: 545px;
    border-left-width: calc(575px - 5vw);
    border-top-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-left-color: inherit;
}
.card-custom-avatar{position: relative; z-index: 1; height: 100%;}
.card-custom-avatar img,.card-custom-avatar i {
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(10, 10, 10, 0.5);
    position: absolute;
    bottom: 0px;
    left: 1rem;
    width: 80px;
    height: 80px;
    background: #000;
    color: #ffffff;
    overflow: visible;
}
.card-custom-avatar .bi:before{
    font-size: 45px;
    width: 80px;
    text-align: center;
    line-height: 80px !important;
}

/* === C4 code input === */
.code-input { width: 50px; display: inline; text-align: center; font-size: 24px; margin: 3px; border-color:#f00;}
.c4 { display: flex; align-items: center; flex-direction: column; gap: 10px; }

/* === Faction point counters === */
.conta .card h1{ left: 10px; top:10px; line-height: 30px; font-size: 40px; margin: 0;}
.conta.punti .card h1{position: absolute;}
@media(min-width:772px){.conta .card h1{position: absolute;}}
.conta .col-md-4:nth-child(1) .card { background-color: #FFDDC1; }
.conta .col-md-4:nth-child(2) .card { background-color: #C1E1FF; }
.conta .col-md-4:nth-child(3) .card { background-color: #D1FFC1; }

/* === Rotated faction name background === */
.rotated-text {
    font-size: 16vw;
    font-weight: 400;
    overflow: hidden;
    white-space: nowrap;
    color: #fff;
    z-index: -1;
    line-height: 0.8;
    opacity: 0.5;
    position: fixed;
    bottom: 0;
    left: 0px;
}

/* === Active button state === */
.btn.active {
    background-color: #ff6600 !important;
    border-color: transparent;
    color: #fff !important;
}

/* === Navbar === */
@media (min-width: 992px) {
    .border-bottom-lg-0 { border-bottom: none !important; }
}
@media (max-width: 992px) {
    .navbar-collapse.menuuu{
        position: absolute;
        top: 56px;
        background: #000;
        width: 100%;
        left: 0;
        z-index: 3;
    }
}

/* === Small badges === */
.btn-xs{ width:25px; height:31px; line-height:30px; text-align:center; border:1px solid #ddd; border-radius:4px;}

/* === Admin tabs === */
#adminTabs .nav-link {
    color: #aaa;
    border-color: transparent;
}
#adminTabs .nav-link.active {
    background-color: #343a40;
    color: #fff;
    border-color: #495057 #495057 #343a40;
}

/* === QR Scanner === */
#qr-reader {
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}
#qr-reader video {
    border-radius: 8px;
}

/* ================================================================
   MOBILE OPTIMIZATION
   ================================================================ */

/* Minimum touch target size (44px per WCAG) */
@media (max-width: 768px) {
    .btn, .nav-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Better table readability on mobile */
    .table td, .table th {
        padding: 0.4rem 0.25rem;
        font-size: 0.78rem;
    }

    /* Admin tab icons on mobile */
    #adminTabs .nav-link {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Ensure action buttons stay usable */
    .btn-sm {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Conta cards on mobile */
    .conta .card {
        padding: 0.5rem !important;
    }
    .conta .card h1 {
        font-size: 28px;
    }
}

/* Map legend styling */
.info.legend {
    background: rgba(0,0,0,0.7);
    padding: 8px 12px;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    line-height: 24px;
}
.info.legend i {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 5px;
}
