:root {
    color-scheme: light;
    --game-line: var(--border-color, #E8D9E1);
    --game-accent: var(--button-primary-bg, #F657B5);
    --game-accent-strong: var(--primary-accent, #D8648E);
    --game-panel: var(--secondary-bg, #FFFFFF);
    --game-muted: var(--text-secondary, #6E626A);
}

* {
    box-sizing: border-box;
}

body.mini-game-page {
    letter-spacing: 0;
}

.game-header-link,
.game-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--button-primary-text, #fff);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    background: var(--button-primary-bg, #F657B5);
}

.game-container {
    width: min(100%, 440px);
    padding-top: 8px;
    padding-bottom: 18px;
}

.game-score-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 78px;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.game-hud {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 2;
    pointer-events: none;
}

.game-score-panel > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 38px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(70, 136, 255, 0.94), rgba(19, 36, 136, 0.94)),
        #1f3dc4;
    border: 1px solid rgba(166, 218, 255, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -5px 10px rgba(5, 17, 76, 0.38),
        0 4px 12px rgba(8, 14, 82, 0.28);
    backdrop-filter: blur(10px);
}

.game-score-panel > div:nth-child(2) {
    min-height: 58px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.9), transparent 22%),
        linear-gradient(180deg, #43d7ff, #1942d0 62%, #10106d);
    border-color: rgba(207, 244, 255, 0.92);
}

.game-score-panel > div:nth-child(3) {
    background:
        radial-gradient(circle at 22% 28%, rgba(255, 244, 168, 0.92), transparent 20%),
        linear-gradient(180deg, #ffc83f, #f97316 64%, #a23d06);
    border-color: rgba(255, 236, 145, 0.9);
}

.game-score-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 9px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(5, 12, 56, 0.48);
}

.game-score-panel strong {
    color: #fff;
    font-size: 18px;
    line-height: 1;
    text-shadow:
        0 1px 0 rgba(5, 11, 52, 0.7),
        0 0 8px rgba(142, 225, 255, 0.6);
}

.game-score-panel > div:nth-child(2) strong {
    font-size: 22px;
}

.game-score-panel > div:nth-child(3) strong {
    font-size: 17px;
    text-shadow:
        0 1px 0 rgba(93, 40, 4, 0.74),
        0 0 8px rgba(255, 250, 188, 0.66);
}

.game-play-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.game-board-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.game-board {
    --board-size: min(100%, 404px);
    position: relative;
    display: block;
    width: min(100%, var(--board-size));
    aspect-ratio: 0.72;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    background:
        radial-gradient(circle at 22% 14%, rgba(103, 222, 255, 0.58), transparent 24%),
        radial-gradient(circle at 86% 30%, rgba(255, 89, 197, 0.32), transparent 28%),
        linear-gradient(180deg, #0b1b78 0%, #1d208f 42%, #3e23a5 100%);
    box-shadow:
        inset 0 0 0 2px rgba(122, 222, 255, 0.42),
        inset 0 0 30px rgba(31, 220, 255, 0.22),
        0 10px 28px rgba(10, 18, 86, 0.22);
    touch-action: none;
    user-select: none;
}

.game-board::before {
    content: "";
    position: absolute;
    inset: 4px;
    z-index: 1;
    border-radius: 7px;
    border: 1px solid rgba(187, 240, 255, 0.52);
    box-shadow:
        inset 0 0 18px rgba(125, 231, 255, 0.28),
        0 0 18px rgba(91, 199, 255, 0.2);
    pointer-events: none;
}

.game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.game-fever-meter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 38px;
    align-items: center;
    gap: 7px;
    min-height: 46px;
    padding: 9px 52px;
    border-radius: 999px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(35, 52, 168, 0.92), rgba(14, 18, 91, 0.92)),
        #151e88;
    border: 1px solid rgba(161, 225, 255, 0.56);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -7px 13px rgba(5, 9, 54, 0.44),
        0 8px 18px rgba(7, 12, 66, 0.24);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.game-fever-meter::before,
.game-fever-meter::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.55),
        inset 0 -7px 10px rgba(71, 17, 112, 0.42),
        0 4px 11px rgba(5, 10, 60, 0.32);
    transform: translateY(-50%);
}

.game-fever-meter::before {
    left: 7px;
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.92), transparent 20%),
        linear-gradient(180deg, #64f4ff, #216bff 68%, #17218f);
}

.game-fever-meter::after {
    right: 7px;
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.92), transparent 20%),
        linear-gradient(180deg, #ffe762, #ff9b18 68%, #c83c08);
}

.game-fever-label {
    font-size: 12px;
    font-weight: 900;
    color: #ff52be;
    text-shadow:
        0 1px 0 #fff,
        0 0 9px rgba(255, 74, 190, 0.82);
}

.game-fever-track {
    position: relative;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(3, 8, 55, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 2px 6px rgba(1, 5, 38, 0.55),
        0 0 10px rgba(120, 224, 255, 0.18);
}

.game-fever-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 38%),
        linear-gradient(90deg, #ff3fb9, #ff72dc 46%, #ffd65f 78%, #fff6a7);
    box-shadow:
        0 0 14px rgba(255, 82, 201, 0.72),
        0 0 18px rgba(255, 214, 95, 0.68);
    transition: width 160ms ease;
}

.game-fever-value {
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 900;
    text-align: right;
    text-shadow: 0 1px 3px rgba(1, 5, 38, 0.62);
}

.game-board.is-fever {
    box-shadow:
        inset 0 0 46px rgba(255, 214, 95, 0.32),
        inset 0 0 0 2px rgba(255, 246, 167, 0.54),
        0 10px 28px rgba(10, 18, 86, 0.22),
        0 0 0 2px rgba(255, 214, 95, 0.42),
        0 0 24px rgba(255, 82, 201, 0.34);
}

.game-board.is-fever .game-fever-meter {
    background:
        linear-gradient(180deg, rgba(255, 89, 189, 0.95), rgba(158, 30, 150, 0.94)),
        #e24f86;
    border-color: rgba(255, 246, 167, 0.72);
}

.game-side-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.game-status-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(161, 225, 255, 0.44);
    background:
        linear-gradient(180deg, rgba(35, 52, 168, 0.92), rgba(12, 17, 82, 0.92)),
        #151e88;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -6px 12px rgba(4, 9, 52, 0.38),
        0 7px 16px rgba(9, 14, 70, 0.16);
}

.game-combo-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    min-width: 0;
    text-shadow: 0 1px 2px rgba(2, 6, 38, 0.58);
}

.game-last-score {
    color: #fff6a7;
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    text-shadow:
        0 1px 0 rgba(93, 40, 4, 0.7),
        0 0 10px rgba(255, 82, 201, 0.65);
}

.game-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.48fr);
    gap: 8px;
}

.game-primary-button,
.game-secondary-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.game-primary-button {
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(180deg, #ff64c7, #f12fa4 64%, #c71982);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -5px 10px rgba(126, 8, 82, 0.32),
        0 7px 14px rgba(196, 23, 130, 0.18);
    text-shadow: 0 1px 2px rgba(91, 7, 56, 0.44);
}

.game-secondary-button {
    color: #243a96;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(224, 241, 255, 0.9)),
        #fff;
    border: 1px solid rgba(161, 225, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 5px 12px rgba(9, 14, 70, 0.12);
}

.game-primary-button:disabled {
    display: none;
}

.game-action-row:has(.game-primary-button:disabled) {
    grid-template-columns: minmax(0, 1fr);
}

.game-action-row:has(.game-primary-button:disabled) .game-secondary-button {
    min-height: 36px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    background:
        linear-gradient(180deg, rgba(50, 119, 255, 0.86), rgba(20, 41, 151, 0.9)),
        #243a96;
    border-color: rgba(161, 225, 255, 0.48);
}

.game-side-panel:has(.game-primary-button:disabled) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    align-items: stretch;
    gap: 8px;
}

.game-side-panel:has(.game-primary-button:disabled) .game-status-box {
    min-height: 42px;
}

.game-side-panel:has(.game-primary-button:disabled) .game-action-row {
    align-self: stretch;
}

.game-side-panel:has(.game-primary-button:disabled) .game-secondary-button {
    height: 100%;
    min-height: 42px;
}

.game-result-panel {
    position: relative;
    overflow: hidden;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(161, 225, 255, 0.48);
    background:
        radial-gradient(circle at 20% 12%, rgba(104, 232, 255, 0.28), transparent 28%),
        radial-gradient(circle at 94% 18%, rgba(255, 82, 201, 0.24), transparent 26%),
        linear-gradient(180deg, #172d9a 0%, #141a76 52%, #281062 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 0 22px rgba(112, 223, 255, 0.16),
        0 9px 20px rgba(9, 14, 70, 0.18);
}

.game-result-panel::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(187, 240, 255, 0.28);
    border-radius: 7px;
    pointer-events: none;
}

.game-result-eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin: 0 0 10px;
    padding: 0 9px;
    border-radius: 999px;
    color: #fff6a7;
    font-size: 11px;
    font-weight: 900;
    background: rgba(5, 10, 60, 0.36);
    border: 1px solid rgba(255, 246, 167, 0.34);
    text-shadow: 0 1px 3px rgba(2, 6, 38, 0.62);
}

.game-result-cast {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.game-result-cast-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: contain;
    padding: 3px;
    background:
        radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.28) 34%, rgba(255, 82, 201, 0.2) 100%),
        #fff;
    border: 3px solid rgba(255, 255, 255, 0.94);
    box-shadow:
        0 0 0 2px rgba(255, 82, 201, 0.58),
        0 0 18px rgba(255, 82, 201, 0.52),
        0 7px 14px rgba(2, 6, 38, 0.28);
}

.game-result-cast strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(2, 6, 38, 0.64);
}

.game-result-cast p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.game-result-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 10px;
}

.game-result-stats > div {
    min-width: 0;
    min-height: 54px;
    padding: 8px 9px;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.game-result-stats dt {
    margin: 0 0 4px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 10px;
    font-weight: 900;
}

.game-result-stats dd {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 3px rgba(2, 6, 38, 0.58);
}

.game-self-ranking {
    position: relative;
    margin-bottom: 10px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(5, 10, 60, 0.28);
    border: 1px solid rgba(187, 240, 255, 0.2);
}

.game-self-ranking-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.game-self-ranking-head span {
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.game-self-ranking-head small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.game-self-ranking-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-self-ranking-list li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
}

.game-self-ranking-list li.is-current {
    color: #fff;
    background: rgba(255, 82, 201, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 246, 167, 0.32);
}

.game-self-ranking-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    border-radius: 50%;
    color: #172d9a;
    font-size: 11px;
    font-weight: 900;
    background: rgba(255, 246, 167, 0.92);
}

.game-self-ranking-name,
.game-self-ranking-score {
    min-width: 0;
    font-size: 12px;
    font-weight: 900;
}

.game-self-ranking-score {
    white-space: nowrap;
}

.game-global-summary {
    position: relative;
    margin-bottom: 10px;
    padding: 9px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 246, 167, 0.18), transparent 32%),
        rgba(5, 10, 60, 0.28);
    border: 1px solid rgba(255, 246, 167, 0.22);
}

.game-global-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.game-global-summary-head span {
    color: #fff6a7;
    font-size: 12px;
    font-weight: 900;
}

.game-global-summary-head small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.game-global-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.game-global-summary-grid > div {
    min-width: 0;
    min-height: 50px;
    padding: 7px 8px;
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.game-global-summary-grid dt {
    margin: 0 0 4px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 10px;
    font-weight: 900;
}

.game-global-summary-grid dd {
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 3px rgba(2, 6, 38, 0.58);
}

.game-chat-link {
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 42%),
        linear-gradient(180deg, #ff64c7, #f12fa4 64%, #c71982);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -5px 10px rgba(126, 8, 82, 0.32),
        0 7px 14px rgba(196, 23, 130, 0.22);
    text-shadow: 0 1px 2px rgba(91, 7, 56, 0.44);
}

@media (max-width: 520px) {
    .game-container {
        width: 100%;
        padding-right: 8px;
        padding-left: 8px;
        padding-top: 6px;
        padding-bottom: 14px;
    }

    .game-score-panel {
        grid-template-columns: minmax(0, 1fr) 54px 70px;
        gap: 5px;
    }

    .game-hud {
        top: 7px;
        right: 7px;
        left: 7px;
    }

    .game-score-panel > div {
        min-height: 36px;
    }

    .game-score-panel strong {
        font-size: 16px;
    }

    .game-score-panel > div:nth-child(2) {
        min-height: 54px;
    }

    .game-score-panel > div:nth-child(2) strong {
        font-size: 20px;
    }

    .game-board-wrap {
        gap: 6px;
        padding: 0;
    }

    .game-fever-meter {
        right: 8px;
        bottom: 8px;
        left: 8px;
        min-height: 42px;
        padding-right: 47px;
        padding-left: 47px;
    }

    .game-fever-meter::before,
    .game-fever-meter::after {
        width: 34px;
        height: 34px;
    }
}
