* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #2d8c4e;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    background-color: #ffffff;
    width: 100%;
    padding: 18px 0;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.btn-admin {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.55;
    line-height: 1;
}
.btn-admin:hover { opacity: 1; }

#company-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    max-height: 50px;
    max-width: 140px;
    object-fit: contain;
}
.company-logo-hidden { display: none; }

header h1 {
    color: #000000;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.board-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.board {
    position: relative;
    width: 920px;
    height: 720px;
}

.cell {
    position: absolute;
    width: 70px;
    height: 58px;
    background-color: #f5f0e8;
    border: 2.5px solid #2a2a2a;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #222;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    z-index: 3;
}

.cell:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    z-index: 10;
}

.cell .number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.cell .icon {
    font-size: 0.8rem;
    line-height: 1;
}

/* Special cell icons */
.cell.star::after {
    content: '⭐';
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 0.55rem;
}

.cell.house::after {
    content: '🏠';
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 0.55rem;
}

/* Finish cell */
.cell.finish {
    background: linear-gradient(135deg, #8B6914, #c9a834, #8B6914);
    color: #fff;
    border-color: #5a3e00;
    width: 70px;
    height: 90px;
    border-radius: 6px;
    gap: 2px;
}

.cell.finish .number {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cell.finish .icon {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        gap: 6px;
    }
    #company-logo {
        position: static;
        transform: none;
        max-height: 40px;
        max-width: 120px;
    }
    .btn-admin {
        position: absolute;
        right: 12px;
        top: 12px;
        transform: none;
    }
    header h1 {
        font-size: 1.3rem;
        letter-spacing: 1px;
        padding: 0 10px;
    }
}

/* ── Seller tokens on board ────────────────────────────────────── */
.seller-token {
    position: absolute;
    bottom: 3px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: #c9a834;
    background-size: cover;
    background-position: center;
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: default;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Page content layout ─────────────────────────────────────────── */
.page-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    position: relative;
    justify-content: center;
}

/* ── Meta Diária legend ──────────────────────────────────────────── */
#legend {
    width: 240px;
    background: rgba(0, 0, 0, 0.38);
    border-radius: 12px;
    padding: 14px 12px;
    color: #fff;
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    max-height: 55vh;
    overflow-y: auto;
}

.legend-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 14px;
    color: #f0c040;
}

.legend-teams-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-team {
    margin-bottom: 12px;
    display: inline-flex;
    flex-direction: column;
    vertical-align: top;
    min-width: 200px;
    margin-right: 24px;
}

.legend-team-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 9px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
}
.legend-team-name.maringa  { background: #7d3c98; color: #fff; }
.legend-team-name.curitiba { background: #1a5276; color: #fff; }

.legend-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.legend-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #c9a834;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a1a;
    border: 2px solid rgba(255,255,255,0.3);
}

.legend-info {
    flex: 1;
    min-width: 0;
}

.legend-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.legend-bar {
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}

.legend-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0c040, #e67e22);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.legend-pct {
    font-size: 0.68rem;
    color: #f0c040;
    font-weight: 700;
}

.legend-empty {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    font-style: italic;
    padding: 4px 0;
}

@media (max-width: 768px) {
    .page-content {
        flex-direction: column;
    }
    .board-container {
        order: 1;
    }
    #legend {
        order: 2;
        width: calc(100% - 32px);
        position: relative;
        bottom: auto;
        left: auto;
        margin: 0 16px 16px;
    }
}
