/* Minigame betting arena — matches site glass / cyan-yellow system */

.mg-main {

    position: relative;

    z-index: 2;

    max-width: var(--content-width, 1460px);

    margin: 0 auto;

    padding: calc(var(--header-height, 88px) + 28px) clamp(16px, 3vw, 40px) 72px;

    box-sizing: border-box;

    min-height: 100vh;

}

.mg-heading {

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    flex-wrap: wrap;

    gap: 16px;

    margin-bottom: 28px;

    padding-bottom: 20px;

    border-bottom: 1px solid rgba(120, 232, 255, 0.18);

}

.mg-eyebrow {

    margin: 0 0 6px;

    color: var(--cyan, #12d8ff);

    letter-spacing: 3px;

    font-size: 13px;

    font-weight: 700;

}

.mg-heading h1 {

    margin: 0 0 8px;

    font-size: clamp(28px, 3vw, 40px);

    color: #fff;

}

.mg-intro {

    margin: 0;

    max-width: 720px;

    color: var(--muted, #a3cbf5);

    line-height: 1.55;

    font-size: 14px;

}

.mg-heading-meta { display: flex; align-items: center; gap: 12px; }

.mg-pill {

    display: inline-flex;

    padding: 6px 12px;

    border-radius: 999px;

    background: rgba(8, 48, 148, 0.55);

    border: 1px solid rgba(120, 232, 255, 0.25);

    color: var(--cyan-soft, #78e8ff);

    font-size: 13px;

}

.mg-link { color: var(--yellow, #ffe100); text-decoration: none; font-weight: 600; }

.mg-link:hover { color: var(--link-hover, #ffe76a); }



.mg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.75fr);
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 980px) {

    .mg-layout { grid-template-columns: 1fr; }

}



.mg-stage-card, .mg-card {

    background: rgba(3, 27, 88, 0.72);

    border: 1px solid rgba(120, 232, 255, 0.18);

    border-radius: 14px;

    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);

    padding: 16px 16px 18px;

}

.mg-card h2 {

    margin: 0 0 12px;

    font-size: 18px;

    color: #edf5ff;

}

.mg-card h3 {

    margin: 0;

    font-size: 15px;

    color: #fff;

    display: flex;

    justify-content: space-between;

    gap: 8px;

}

.mg-card h3 span { color: var(--yellow, #ffe100); font-weight: 700; }

.mg-muted { color: var(--muted, #a3cbf5); font-size: 13px; margin: 0 0 12px; }

.mg-hint { margin: 4px 0 8px; font-size: 12px; color: #7eb6e8; }



.mg-stage-toolbar {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 10px 16px;

    margin-bottom: 12px;

}

.mg-status { color: var(--cyan-soft, #78e8ff); font-weight: 600; font-size: 14px; }

.mg-countdown {

    font-family: Impact, "Arial Black", sans-serif;

    font-size: 28px;

    color: var(--yellow, #ffe100);

    letter-spacing: 1px;

    min-width: 4.5ch;

}

.mg-toolbar-actions { margin-left: auto; display: flex; gap: 8px; }



.mg-btn {

    border: 1px solid rgba(255, 255, 255, 0.35);

    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

    color: #fff;

    border-radius: 8px;

    padding: 8px 14px;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

}

.mg-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.mg-btn.ghost {

    background: rgba(8, 48, 148, 0.45);

    border-color: rgba(120, 232, 255, 0.28);

    color: var(--cyan-soft, #78e8ff);

}

.mg-btn.active, .mg-bet-options button.active {

    outline: 2px solid var(--yellow, #ffe100);

    outline-offset: 1px;

}

.mg-btn.team0, .mg-bet-options button.team0, .mg-bet-options button.faction-red { background: #d93d3d; }

.mg-btn.team1, .mg-bet-options button.team1, .mg-bet-options button.faction-blue { background: #3d5bd9; }



.mg-canvas-wrap {

    position: relative;

    display: flex;

    align-items: stretch;

    justify-content: stretch;

    background: linear-gradient(180deg, #00000a 0%, #0b1238 55%, #1d2b66 100%);

    border-radius: 10px;

    border: 1px solid rgba(120, 232, 255, 0.12);

    overflow: hidden;

    min-height: 220px;

    width: 100%;

}

.mg-canvas-wrap canvas {

    display: block;

    width: 100%;

    height: 100%;

    max-width: none;

    border: 0;

    image-rendering: pixelated;

    flex: 1 1 auto;

}

.mg-canvas-wrap:fullscreen,

.mg-canvas-wrap:-webkit-full-screen {

    width: 100vw;

    height: 100vh;

    max-width: none;

    border-radius: 0;

    border: 0;

    background: linear-gradient(180deg, #00000a 0%, #0b1238 55%, #1d2b66 100%);

    display: flex;

    align-items: stretch;

    justify-content: stretch;

    overflow: hidden;

}

.mg-canvas-wrap:fullscreen canvas,

.mg-canvas-wrap:-webkit-full-screen canvas {

    width: 100%;

    height: 100%;

    max-width: none;

}

.mg-overlay-panel {

    position: absolute;

    left: 50%;

    top: 16px;

    transform: translateX(-50%);

    background: rgba(0, 0, 0, 0.85);

    border: 2px solid #e8e8e8;

    padding: 12px 18px;

    color: #fff;

    text-align: center;

    min-width: 240px;

    border-radius: 8px;

}

.mg-footnote {

    margin: 12px 4px 0;

    font-size: 12px;

    color: #7eb6e8;

    line-height: 1.5;

}



.mg-teams {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-bottom: 14px;

}

.mg-team {

    border-radius: 10px;

    padding: 10px;

    background: rgba(0, 0, 0, 0.22);

    border: 1px solid rgba(255, 255, 255, 0.12);

}

.mg-team.t0, .mg-team.faction-red { border-color: rgba(255, 92, 92, 0.65); }

.mg-team.t1, .mg-team.faction-blue { border-color: rgba(92, 124, 255, 0.65); }

.mg-team h4 { margin: 0 0 6px; font-size: 14px; }

.mg-team ul { margin: 0; padding-left: 16px; font-size: 13px; color: #d7e9ff; }



.mg-bet-block {

    padding: 10px 0;

    border-top: 1px solid rgba(120, 232, 255, 0.12);

}

.mg-bet-options {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}

.mg-bet-options button {

    border: 1px solid rgba(255, 255, 255, 0.28);

    background: rgba(8, 48, 148, 0.55);

    color: #fff;

    border-radius: 8px;

    padding: 7px 10px;

    font-size: 12px;

    cursor: pointer;

}

.mg-bet-options button:disabled { cursor: not-allowed; }

.mg-msg {

    margin: 10px 0 0;

    padding: 8px 10px;

    border-radius: 8px;

    background: rgba(255, 225, 0, 0.12);

    color: var(--yellow, #ffe100);

    font-size: 13px;

}



/* leaderboard scope uses .segmented */
.mg-lb {

    list-style: none;

    margin: 0;

    padding: 0;

}

.mg-lb li {

    display: grid;

    grid-template-columns: 36px 1fr auto;

    gap: 8px;

    padding: 8px 4px;

    border-bottom: 1px solid rgba(120, 232, 255, 0.1);

    font-size: 13px;

    color: #e8f3ff;

}

.mg-lb .rank { color: var(--cyan, #12d8ff); font-weight: 700; }

.mg-lb .net { color: var(--yellow, #ffe100); font-variant-numeric: tabular-nums; }

.mg-lb .net.neg { color: #ff8f8f; }

.mg-empty { color: #7eb6e8; font-size: 13px; padding: 8px 0; }



.mg-lb li.mg-empty {

    display: block;

    grid-template-columns: none;

    color: var(--muted, #a3cbf5);

    padding: 12px 4px;

    border-bottom: 0;

    line-height: 1.5;

    white-space: normal;

}

.mg-lb li.mg-empty span {

    display: inline;

    white-space: normal;

}



/* Chips + daily remaining */

.mg-chips-line {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 8px 14px;

}

.mg-tokens {

    display: inline-flex;

    align-items: center;

    gap: 4px;

    font-weight: 700;

    color: #ffe100;

}

.mg-token-icon {

    display: inline-block;

    width: 16px;

    height: 16px;

    border-radius: 50%;

    background: radial-gradient(circle at 35% 30%, #fff6a8 0%, #ffd000 40%, #e09a00 72%, #a86a00 100%);

    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), 0 0 0 1px rgba(255,225,0,0.35);

    vertical-align: -2px;

}

.mg-token-icon + .mg-token-icon { margin-left: -2px; }

.mg-daily-left {

    margin-left: auto;

    color: #78e8ff;

    font-weight: 600;

    font-size: 13px;

    white-space: nowrap;

}

.mg-toast {

    position: fixed;

    left: 50%;

    bottom: 28px;

    transform: translateX(-50%);

    z-index: 9999;

    background: rgba(8, 24, 64, 0.94);

    border: 1px solid rgba(255, 225, 0, 0.45);

    color: #ffe100;

    padding: 10px 18px;

    border-radius: 10px;

    font-size: 14px;

    font-weight: 700;

    box-shadow: 0 8px 28px rgba(0,0,0,0.35);

    pointer-events: none;

    opacity: 0;

    transition: opacity .2s ease;

}

.mg-toast.show { opacity: 1; }




/* LB scope: match site ranking segmented 「本月排名 / 上月排名」 */
.mg-lb-scope.segmented {
    display: flex;
    width: 100%;
    height: 40px;
    margin: 0 0 12px 0;
}
.mg-lb-scope.segmented button {
    flex: 1;
    font-size: 14px;
}

.mg-bet-team-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mg-bet-team-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Exact copy of live #playerModal .profile-view-tabs (site.css), scoped for minigame */
.mg-side .profile-view-tabs {
    display: flex;
    gap: 24px;
    margin: 0 0 14px 0;
    border-bottom: 1px solid rgba(160, 206, 255, 0.35);
}
.mg-side .profile-view-tabs button {
    color: #b9ddff;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 8px 4px 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    flex: 0 0 auto;
    outline: none;
    box-shadow: none;
}
.mg-side .profile-view-tabs button:hover {
    color: #fff;
    background: transparent;
}
.mg-side .profile-view-tabs button[aria-selected="true"],
.mg-side .profile-view-tabs button.active {
    color: #ffe600;
    border-bottom-color: #ffe600;
    background: transparent;
    outline: none;
    box-shadow: none;
}
.mg-side-panel[hidden] { display: none !important; }

@media (max-width: 980px) {
    .mg-side .profile-view-tabs {
        margin: 0 0 10px 0;
        gap: 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .mg-side .profile-view-tabs::-webkit-scrollbar { display: none; }
    .mg-side .profile-view-tabs button {
        padding: 4px 2px 6px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
}


.mg-stage-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}
.mg-stage-card .mg-canvas-wrap {
    flex: 1 1 auto;
    min-height: min(55vh, 520px);
    height: auto;
    width: 100%;
}
.mg-side {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.mg-side > .mg-card,
.mg-side > .mg-side-panel {
    flex: 1 1 auto;
}

.mg-tokens-empty {
    color: #7eb6e8;
    font-weight: 600;
    opacity: 0.7;
}
.mg-token-num { display: none; }

.mg-bet-options button {
    position: relative;
    overflow: visible;
}
.mg-bet-options button .mg-bet-chip {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 35% 30%, #fff6a8 0%, #ffd000 40%, #e09a00 72%, #a86a00 100%);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), 0 0 0 1px rgba(255,225,0,0.45), 0 1px 3px rgba(0,0,0,0.35);
    opacity: 1 !important;
    filter: none !important;
}

/* Chip/token icons stay full color (never inherit disabled opacity) */
.mg-token-icon,
.mg-bet-options button .mg-bet-chip,
.mg-bet-options button:disabled .mg-bet-chip,
.mg-bet-options button.active .mg-bet-chip {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
}
.mg-bet-options button:disabled {
    /* dim label text but keep chip vivid via child override above */
    opacity: 1;
    color: rgba(255, 255, 255, 0.55);
}
.mg-bet-options button:disabled:not(.active) {
    background: rgba(8, 48, 148, 0.28);
}

.mg-bet-options button.mg-has-bet {
    /* keep room so chip sits on the rounded bottom-right corner */
}
