@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800;900&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --card-w: 300px;
    --box-sz: 64px;
    --card-bg: #34465f;
    --box-bg: #2a3850;
    --box-border: #9fb0c4;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    background: transparent;
    min-height: 100vh;
    padding: 16px;
}

.win-table {
    width: var(--card-w);
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    padding: 20px 18px;
}

/* Hidden entirely when the table is disabled or empty. */
.win-table.empty {
    display: none;
}

.win-table-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#win-title {
    display: inline-block;
    min-width: 64%;
    padding: 10px 32px;
    border-radius: 11px;
    text-align: center;
    background: linear-gradient(180deg, #fdfdfd 0%, #e2e5ea 55%, #cbd0d8 100%);
    color: #1a2433;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.win-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.win-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.win-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.win-stat-icon {
    flex-shrink: 0;
    font-size: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.win-num-box {
    flex-shrink: 0;
    width: var(--box-sz);
    height: var(--box-sz);
    border-radius: 14px;
    background: var(--box-bg);
    border: 2px solid var(--box-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.win-stat-num {
    font-size: 34px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    display: inline-block;
}

.win-stat-num.bump {
    animation: value-bump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes value-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* ── OUT state (number reached 0) — mirrors the ranking "out" look ── */
.win-out-badge {
    display: none;
    width: 70%;
    height: 70%;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.win-out-badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

.win-row.out .win-name,
.win-row.out .win-stat-icon {
    opacity: 0.35;
}

.win-row.out .win-num-box {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.win-row.out .win-stat-num {
    display: none;
}

.win-row.out .win-out-badge {
    display: flex;
}
