:root {
    --green: #246d4b;
    --green-dark: #154931;
    --gold: #ffc107;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0b3d27;
    background-image: url('/images/bg-2.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1d1d1d;
}

html:not(.theme-ready) .main-title {
    visibility: hidden;
}

.board-header {
    text-align: center;
    padding: 18px 16px 6px;
}

h1.main-title {
    margin: 0 auto;
    height: 14vh;
    min-height: 80px;
    background: url('/images/main-text.png') no-repeat center;
    background-size: contain;
    text-indent: -9999px;
    overflow: hidden;
}

.board-event {
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.6rem);
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.board-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 16px 32px 28px;
}

.board-panel {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.board-panel-header {
    background: var(--green);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-panel:first-child .board-panel-header {
    background: var(--gold);
    color: #1d1d1d;
}

.board-panel-header h2 {
    font-size: clamp(1.1rem, 1.8vw, 1.6rem);
    margin: 0;
    font-weight: 700;
    flex: 1;
}

.count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    padding: 0 12px;
    margin-left: 6px;
    font-size: 0.85em;
}

.board-search {
    max-width: 180px;
}

.board-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 0;
}

.empty {
    color: #888;
    text-align: center;
    padding: 24px 0;
}

.empty.small {
    padding: 6px 0 4px;
    text-align: left;
    font-size: 0.95rem;
}

/* Người trúng nhóm theo giải */
.prize-group {
    margin-bottom: 18px;
}

.prize-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.prize-group-header img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.prize-group-header .li {
    font-size: 1.8rem;
    color: var(--green);
}

.prize-group-name {
    font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    font-weight: 700;
    color: var(--green);
    flex: 1;
}

.prize-group-header .left {
    font-weight: 600;
    color: #666;
}

.winner-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.winner-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6fbf8;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: clamp(1rem, 1.4vw, 1.3rem);
    font-weight: 600;
}

.winner-list .num {
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.winner-list li.new {
    animation: winner-new 2.5s ease;
}

@keyframes winner-new {
    0% {
        background: var(--gold);
        transform: scale(1.08);
    }

    100% {
        background: #f6fbf8;
        transform: scale(1);
    }
}

/* Người tham dự: lưới nhiều cột */
.participant-grid {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: p;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px 16px;
}

.participant-grid li {
    counter-increment: p;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    padding: 6px 4px;
    border-bottom: 1px dashed #e3e3e3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-grid li::before {
    content: counter(p) ". ";
    color: #999;
    font-size: 0.85em;
}

.board-status {
    display: none;
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    body {
        /* iOS không hỗ trợ tốt background-attachment: fixed */
        background-attachment: scroll;
    }

    .board-main {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 16px;
    }

    .board-panel {
        max-height: 75vh;
    }

    h1.main-title {
        height: 22vw;
        min-height: 60px;
    }

    .board-panel-header {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .board-search {
        max-width: none;
        flex-basis: 100%;
    }

    .board-panel-body {
        padding: 12px 14px;
    }

    .winner-list,
    .participant-grid {
        grid-template-columns: 1fr;
    }
}
