/* 全局样式仅用于独立效果样板；所有视觉以 1920×1080 基准画布缩放。 */
:root {
    color-scheme: dark;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #fff;
    background: #010714;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    width: 100vw;
    height: 100dvh;
}

button, input {
    font: inherit;
}

button {
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:disabled {
    cursor: default;
}

button:focus-visible, input:focus-visible {
    outline: 4px solid #9af7ff;
    outline-offset: 7px;
}

.scene {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.home-scene {
    background-image: url('../assets/resources/ui/home-background.png');
}

.home-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #02030b15 30%, #02071800 60%, #02071855);
}

.corner-brand {
    position: absolute;
    top: 45px;
    left: 56px;
    font-size: 27px;
    letter-spacing: 5px;
    font-weight: 800;
}

.corner-brand span {
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 3px;
    padding-left: 22px;
    color: #b3c9df;
}

.home-title {
    position: absolute;
    width: 1150px;
    height: auto;
    left: 385px;
    top: 210px;
    filter: drop-shadow(0 8px 25px #075ddb33);
}

.home-controls {
    position: absolute;
    width: 500px;
    left: 710px;
    top: 660px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.device-field {
    height: 86px;
    width: 100%;
    border: 5px solid #00d3ff;
    border-radius: 28px;
    box-shadow: 0 0 22px #09bffe38, inset 0 0 20px #09bffe19;
    background: #02132caa;
}

.device-field input {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: center;
    border-radius: 22px;
    font-weight: 700;
    font-size: 38px;
    letter-spacing: 2px;
}

.device-field input::placeholder {
    color: #c6cfdf;
    opacity: 1;
}

.outline-button {
    border: 5px solid #fff;
    border-radius: 29px;
    background: #051529a6;
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    min-height: 86px;
    padding: 12px 36px;
    transition: background 180ms, box-shadow 180ms, transform 180ms, opacity 180ms;
}

.outline-button:hover:not(:disabled) {
    background: #0c477abf;
    box-shadow: 0 0 28px #64d7ff60;
}

.outline-button:active:not(:disabled) {
    transform: scale(0.97);
}

.outline-button:disabled {
    opacity: 0.42;
}

.robot-button {
    border-color: #74dcff;
    color: #e5f9ff;
    background: #092145b3;
    font-size: 35px;
    min-height: 78px;
}

.home-hint {
    text-align: center;
    color: #dae5f5;
    font-size: 20px;
    letter-spacing: 2px;
    margin: 4px -60px 0;
    text-shadow: 0 2px 10px #000;
}

.scene-footer {
    position: absolute;
    bottom: 35px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #acbad2;
    font-size: 16px;
    letter-spacing: 5px;
}

.scene-footer i, .match-rules i, .result-stats i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8daeca;
}

.preview-label {
    position: absolute;
    right: 36px;
    bottom: 36px;
    color: #b8c9df;
    font-size: 17px;
    letter-spacing: 1px;
}

.ambient-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(3px 3px at 18% 19%, #8aeaff, transparent),
        radial-gradient(2px 2px at 82% 28%, #fff, transparent),
        radial-gradient(4px 4px at 67% 73%, #b4e8ff, transparent);
    animation: twinkle 3.8s ease-in-out infinite alternate;
}

.back-button, .sound-button {
    position: absolute;
    top: 30px;
    left: 35px;
    z-index: 4;
    border: 1px solid #81adcf66;
    border-radius: 16px;
    min-height: 60px;
    background: #021226a3;
    padding: 8px 24px;
    font-size: 23px;
    color: #d1e9fa;
}

.versus-scene {
    background-image: linear-gradient(#02122c0a, #02122c30), url('../assets/resources/ui/versus-background.png');
}

.match-kicker {
    position: absolute;
    top: 110px;
    width: 100%;
    text-align: center;
    font-size: 29px;
    font-weight: 600;
    letter-spacing: 6px;
    text-shadow: 0 3px 12px #001021;
}

.match-player {
    position: absolute;
    top: 330px;
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.match-player.red {
    left: 175px;
}

.match-player.blue {
    right: 175px;
}

.match-player img {
    width: 180px;
    height: 180px;
    filter: drop-shadow(0 0 30px #010b25cc);
}

.match-player span {
    color: #e1edff;
    font-size: 22px;
    letter-spacing: 5px;
}

.match-player strong {
    font-size: 53px;
    font-weight: 900;
    paint-order: stroke fill;
    -webkit-text-stroke: 7px #ff323d;
    text-shadow: 0 5px 14px #111d45;
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-player.blue strong {
    -webkit-text-stroke-color: #00c9f2;
}

.versus-word {
    position: absolute;
    top: 310px;
    left: 680px;
    width: 560px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 290px;
    line-height: 1;
    letter-spacing: -16px;
    font-weight: 1000;
    color: white;
    -webkit-text-stroke: 23px #f4070d;
    paint-order: stroke fill;
    filter: drop-shadow(12px 0 #006cde) drop-shadow(-12px 0 #006cde) drop-shadow(0 12px #006cde) drop-shadow(0 -12px #006cde);
}

.match-rules {
    position: absolute;
    top: 748px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    font-size: 23px;
    text-shadow: 0 2px 8px #000;
}

.start-button {
    position: absolute;
    width: 430px;
    height: 108px;
    top: 821px;
    left: 745px;
    font-size: 54px;
    background: #06183d80;
}

.match-hint {
    position: absolute;
    top: 952px;
    width: 100%;
    text-align: center;
    color: #d3e6ff;
    font-size: 21px;
    text-shadow: 0 2px 8px #001;
}

/* 游戏主体保留原型两侧切角框，外侧裁切以扩大中间触控空间。 */
.game-scene, .result-scene {
    background-image: url('../assets/resources/ui/game-background.png');
}

/* 仅缓慢移动背景贴图，交互层保持固定；放大边缘避免露出空白。 */
.game-scene {
    background-image: none;
}

.game-scene::after {
    content: "";
    position: absolute;
    inset: -45px;
    z-index: -2;
    pointer-events: none;
    background: url('../assets/resources/ui/game-background.png') center / cover no-repeat;
    animation: nebula-drift 36s ease-in-out infinite alternate;
    will-change: transform;
}

.game-scene::before, .result-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #000b1633;
    z-index: -1;
}

.game-meta {
    position: absolute;
    top: 43px;
    left: 280px;
    font-size: 20px;
    color: #a5cbe4;
    letter-spacing: 2px;
}

.sound-button {
    left: auto;
    right: 36px;
    font-size: 20px;
}

.turn-header {
    position: absolute;
    top: 53px;
    left: 400px;
    width: 1120px;
    text-align: center;
}

#turn-chip {
    font-size: 17px;
    letter-spacing: 5px;
    color: #ff8590;
}

[data-turn="blue"] #turn-chip {
    color: #62d8ff;
}

.turn-header h1 {
    margin: 10px 0 10px;
    font-size: 43px;
    letter-spacing: 2px;
    text-shadow: 0 3px 15px #001626;
}

.turn-header p {
    margin: 0;
    font-size: 26px;
    letter-spacing: 1px;
    color: #c4def1;
}

.turn-header b {
    font-size: 31px;
    color: #fff;
}

.remaining-badge {
    position: absolute;
    right: 76px;
    top: 128px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 4px solid #5db8ff;
    box-shadow: 0 0 25px #37a5ff20, inset 0 0 25px #37a5ff10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #031b2eb3;
}

.remaining-badge span {
    font-size: 22px;
    color: #d0eaff;
}

.remaining-badge strong {
    font-family: Arial, sans-serif;
    font-size: 56px;
    line-height: 1.1;
}

.player-panel {
    position: absolute;
    width: 348px;
    height: 555px;
    top: 327px;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 23px;
    opacity: 0.65;
    transition: opacity 300ms, filter 300ms;
}

.player-panel.red {
    left: -46px;
    padding-left: 25px;
    background-image: url('../assets/resources/ui/red-panel.png');
}

.player-panel.blue {
    right: -46px;
    padding-right: 25px;
    background-image: url('../assets/resources/ui/blue-panel.png');
}

.player-panel.active {
    opacity: 1;
    filter: drop-shadow(0 0 15px #f7405260);
}

.player-panel.blue.active {
    filter: drop-shadow(0 0 15px #2fcfff75);
}

.player-panel h2 {
    font-size: 54px;
    margin: 0 0 15px;
    -webkit-text-stroke: 7px #ff303b;
    paint-order: stroke fill;
}

.player-panel.blue h2 {
    -webkit-text-stroke-color: #42b6ff;
}

.player-panel img {
    width: 112px;
    height: 112px;
}

.player-panel strong {
    font-size: 35px;
    font-weight: 800;
    max-width: 245px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-status {
    font-size: 20px;
    color: #b0d3e5;
    letter-spacing: 4px;
}

.player-panel.active .player-status {
    color: #fff;
}

.planet-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.planet {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 50%;
    pointer-events: auto;
    transition: filter 200ms;
}

.planet img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: planet-spin var(--spin) linear var(--delay) infinite;
    filter: drop-shadow(0 8px 14px #000b25a0);
    pointer-events: none;
}

.planet-hover-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid #91f3ff;
    box-shadow: 0 0 22px #4de8ff7a;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 160ms;
}

.planet.selected .planet-hover-ring {
    opacity: 1;
    border-width: 4px;
    box-shadow: 0 0 16px #b5faff, 0 0 35px #38d6ff, inset 0 0 18px #55ddff66;
    animation: selection-glow 1.6s ease-in-out infinite alternate;
}

.planet.selected img {
    filter: drop-shadow(0 0 18px #6deaffaa);
}

.planet.exploding {
    pointer-events: none;
}

.planet.exploding img {
    animation: implode 400ms ease-out forwards;
}

.planet.removed {
    display: none;
}

.game-bottom {
    position: absolute;
    bottom: 28px;
    left: 590px;
    width: 740px;
    text-align: center;
}

.selection-status {
    font-size: 21px;
    color: #c6e5f6;
    margin-bottom: 17px;
    text-shadow: 0 2px 8px #000;
}

.turn-actions {
    position: relative;
}

.confirm-button {
    width: 420px;
    height: 90px;
}

.undo-button {
    background: transparent;
    border: 1px solid #82b9df80;
    border-radius: 15px;
    color: #cce4f8;
    min-height: 60px;
    padding: 10px 22px;
    font-size: 23px;
}

.turn-actions .undo-button {
    position: absolute;
    left: -55px;
    top: 15px;
}

.undo-button:disabled {
    opacity: 0.35;
}

.game-bottom p {
    margin: 16px 0 0;
    font-size: 19px;
    color: #aacbe0;
}

.game-bottom p span {
    margin-left: 16px;
}

/* 粒子位置固定在被点击星球中心，不推动其他星球重新排布。 */
.explosion {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 8;
}

.shockwave, .flash {
    position: absolute;
    width: 120px;
    height: 120px;
    left: -60px;
    top: -60px;
    border-radius: 50%;
}

.shockwave {
    border: 5px solid #c9faff;
    box-shadow: 0 0 30px #44dfff, inset 0 0 25px #fff3a9;
    animation: shockwave 560ms ease-out forwards;
}

.flash {
    background: radial-gradient(circle, #fff 0%, #ffe1a4 20%, #ffb45480 45%, transparent 70%);
    animation: flash 400ms ease-out forwards;
}

.explosion i {
    position: absolute;
    left: -4px;
    top: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--spark-color);
    box-shadow: 0 0 12px var(--spark-color);
    animation: spark 560ms ease-out forwards;
}

.result-card {
    position: absolute;
    left: 445px;
    top: 210px;
    width: 1030px;
    height: 660px;
    background: url('../assets/resources/ui/result-frame.png') center / 100% 100% no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 34px;
}

.result-scene.blue .result-card {
    background-color: #05142b44;
}

.eyebrow {
    font-family: Arial, sans-serif;
    color: #85c3e7;
    font-size: 18px;
    letter-spacing: 7px;
}

.winner-avatar {
    width: 140px;
    height: 140px;
    margin-top: 16px;
    flex-shrink: 0;
    animation: winner-arrive 600ms ease-out;
}

.result-card h1 {
    margin: 18px 0 12px;
    font-size: 50px;
    -webkit-text-stroke: 7px #ff3c44;
    paint-order: stroke fill;
    max-width: 930px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-scene.blue h1 {
    -webkit-text-stroke-color: #29adff;
}

.result-card p {
    color: #d8e8f5;
    font-size: 22px;
    margin: 0;
}

.result-stats {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #a6c4dd;
    font-size: 20px;
    margin: 16px 0 20px;
}

.return-button {
    min-height: 78px;
    font-size: 35px;
    min-width: 260px;
}

.result-sync {
    margin-top: 14px;
    color: #95afc8;
    font-size: 16px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    background: #000a1bc9;
    backdrop-filter: blur(13px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.difficulty-dialog {
    position: relative;
    width: 1260px;
    height: 710px;
    border: 2px solid #63c3f7;
    border-radius: 28px;
    padding: 55px 65px;
    background: radial-gradient(ellipse at 50% 100%, #06416c70, transparent 80%), #06172cf2;
    text-align: center;
    box-shadow: 0 0 90px #007bcc30, inset 0 0 60px #096c9c15;
}

.close-button {
    position: absolute;
    top: 23px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid #78b7dc60;
    background: #153047;
    font-size: 38px;
    color: #9cc4df;
}

.difficulty-dialog h1 {
    font-size: 46px;
    margin: 16px 0;
    letter-spacing: 4px;
}

.difficulty-dialog > p {
    color: #91adc8;
    margin: 0;
    font-size: 22px;
    letter-spacing: 2px;
}

.difficulty-options {
    display: flex;
    gap: 24px;
    margin-top: 40px;
}

.difficulty-card {
    position: relative;
    flex: 1;
    height: 335px;
    border: 1px solid #397aa5;
    border-radius: 18px;
    background: linear-gradient(160deg, #11365180, #06172d80);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 15px;
    transition: border-color 180ms, transform 180ms, background 180ms;
}

.difficulty-card:hover {
    transform: translateY(-7px);
    border-color: #97ecff;
    background: linear-gradient(160deg, #1b5d8480, #0b214580);
}

.difficulty-index {
    position: absolute;
    top: 19px;
    left: 22px;
    color: #668eac;
    font-size: 18px;
    letter-spacing: 3px;
}

.difficulty-card img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 12px 0 16px;
    animation: planet-spin 65s linear infinite;
    filter: drop-shadow(0 0 20px #3a9de533);
}

.difficulty-card strong {
    font-size: 37px;
    letter-spacing: 8px;
    margin-bottom: 17px;
}

.difficulty-card > span:last-child {
    font-size: 19px;
    color: #98bbd3;
}

.dialog-tip {
    color: #6f95b2;
    margin-top: 30px;
    font-size: 19px;
}

.leave-dialog {
    width: 800px;
    padding: 65px;
    border: 2px solid #62bde7;
    border-radius: 25px;
    background: #06182cf5;
    text-align: center;
}

.leave-dialog h2 {
    font-size: 40px;
    margin: 0 0 24px;
}

.leave-dialog p {
    font-size: 24px;
    color: #9ebdd2;
    margin-bottom: 40px;
}

.leave-dialog > div {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.leave-dialog .outline-button {
    font-size: 28px;
    min-height: 70px;
}

.toast {
    position: absolute;
    z-index: 30;
    bottom: 190px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 20px 38px;
    border: 1px solid #5cceff;
    border-radius: 14px;
    background: #061b32f0;
    font-size: 27px;
    box-shadow: 0 10px 45px #0008;
}

.orientation-guard {
    display: none;
}

@keyframes planet-spin {
    to { transform: rotate(360deg); }
}

@keyframes nebula-drift {
    from {
        transform: translate(-14px, -8px) scale(1.02);
    }
    to {
        transform: translate(14px, 8px) scale(1.05);
    }
}

@keyframes selection-glow {
    from {
        opacity: 0.75;
    }
    to {
        opacity: 1;
    }
}

@keyframes implode {
    0% { transform: scale(1); opacity: 1; filter: brightness(1); }
    25% { transform: scale(1.18); opacity: 1; filter: brightness(3); }
    100% { transform: scale(0.2); opacity: 0; filter: brightness(5); }
}

@keyframes shockwave {
    from { transform: scale(0.3); opacity: 1; }
    to { transform: scale(2.6); opacity: 0; }
}

@keyframes flash {
    0% { transform: scale(0.4); opacity: 1; }
    30% { transform: scale(1.8); opacity: 1; }
    100% { transform: scale(2.3); opacity: 0; }
}

@keyframes spark {
    from { transform: translate(0, 0) scale(1); opacity: 1; }
    to { transform: translate(var(--dx), var(--dy)) scale(0.15); opacity: 0; }
}

@keyframes twinkle {
    from { opacity: 0.2; }
    to { opacity: 1; }
}

@keyframes winner-arrive {
    from { opacity: 0; transform: scale(0.65); }
    to { opacity: 1; transform: scale(1); }
}

@media (orientation: portrait) and (pointer: coarse) {
    .orientation-guard {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: radial-gradient(ellipse at center, #12375a, #010915 80%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 22px;
        text-align: center;
        padding: 30px;
    }

    .rotate-icon {
        font-size: 65px;
        color: #6bd8ff;
    }

    .orientation-guard strong {
        font-size: 24px;
    }

    .orientation-guard > span:last-child {
        font-size: 15px;
        color: #8daec6;
    }
}

@media (prefers-reduced-motion: reduce) {
    .planet img, .difficulty-card img, .ambient-stars, .game-scene::after,
    .planet.selected .planet-hover-ring {
        animation: none;
    }
}

/* 背景铺满实际 CSS 视口，安全内容层独立缩放，避免非 16:9 设备出现黑边。 */
.scene {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    background-image: none;
}

.scene-content {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1920px;
    height: 1080px;
    transform: translate(-50%, -50%) scale(var(--ui-scale, 1));
    z-index: 0;
}

.home-scene {
    --scene-background: url('../assets/resources/ui/home-background.png');
}

.versus-scene {
    --scene-background: url('../assets/resources/ui/versus-background.png');
}

.game-scene, .result-scene {
    --scene-background: url('../assets/resources/ui/game-background.png');
}

.scene::after {
    content: "";
    position: absolute;
    inset: -8%;
    z-index: -3;
    background: var(--scene-background) center / cover no-repeat;
    pointer-events: none;
    animation: galaxy-travel 45s ease-in-out infinite alternate;
    will-change: transform;
}

.nebula-cloud {
    position: absolute;
    inset: -15%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.24;
    background: radial-gradient(ellipse at 30% 60%, #6b39b380, transparent 42%),
        radial-gradient(ellipse at 65% 42%, #218fc980, transparent 38%);
    mix-blend-mode: screen;
    animation: nebula-river 32s ease-in-out infinite alternate;
}

.galaxy-flow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.difficulty-dialog, .leave-dialog {
    transform: scale(var(--ui-scale, 1));
    flex-shrink: 0;
}

[hidden] {
    display: none !important;
}

@keyframes galaxy-travel {
    from {
        transform: translate(-1.5%, -0.5%) scale(1.01);
    }
    to {
        transform: translate(1.5%, 0.5%) scale(1.1);
    }
}

@keyframes nebula-river {
    from {
        transform: translate(-4%, 3%) rotate(-5deg);
    }
    to {
        transform: translate(4%, -3%) rotate(5deg);
    }
}

/* 小屏、竖屏或系统高缩放时使用实际视口布局，按钮和文字保持可操作尺寸。 */
@media (max-width: 1000px), (max-height: 600px), (orientation: portrait) {
    .scene-content {
        inset: 0;
        width: 100%;
        height: 100%;
        transform: none;
    }

    .home-title {
        width: min(65vw, 850px);
        height: auto;
        left: 50%;
        top: 13%;
        transform: translateX(-50%);
    }

    .home-controls {
        width: clamp(240px, 38vw, 420px);
        left: 50%;
        top: auto;
        bottom: 6%;
        transform: translateX(-50%);
        gap: 10px;
    }

    .device-field, .outline-button, .robot-button {
        min-height: 44px;
        height: clamp(44px, 9vh, 72px);
        border-width: 3px;
        border-radius: 19px;
        font-size: clamp(20px, 2.8vw, 30px);
        padding: 6px 16px;
    }

    .device-field {
        padding: 0;
    }

    .device-field input {
        font-size: clamp(20px, 2.8vw, 30px);
    }

    .back-button, .sound-button {
        top: 10px;
        left: 10px;
        min-height: 36px;
        padding: 6px 12px;
        border-radius: 10px;
        font-size: 14px;
    }

    .sound-button {
        left: auto;
        right: 10px;
    }

    .match-kicker {
        top: 9%;
        font-size: 18px;
        letter-spacing: 2px;
    }

    .match-player {
        top: 28%;
        width: 28%;
        gap: 10px;
    }

    .match-player.red {
        left: 6%;
    }

    .match-player.blue {
        right: 6%;
    }

    .match-player img {
        width: clamp(64px, 14vh, 130px);
        height: clamp(64px, 14vh, 130px);
    }

    .match-player span {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .match-player strong {
        max-width: 100%;
        font-size: 25px;
        -webkit-text-stroke-width: 3px;
    }

    .versus-word {
        top: 30%;
        left: 35%;
        width: 30%;
        font-size: clamp(75px, 16vw, 170px);
        letter-spacing: -5px;
        -webkit-text-stroke-width: 9px;
        filter: drop-shadow(4px 0 #006cde) drop-shadow(-4px 0 #006cde) drop-shadow(0 4px #006cde);
    }

    .match-rules {
        top: auto;
        bottom: 23%;
        gap: 10px;
        font-size: 13px;
        flex-wrap: wrap;
        padding: 0 12px;
    }

    .start-button {
        left: 50%;
        top: auto;
        bottom: 7%;
        width: 240px;
        transform: translateX(-50%);
        font-size: 28px;
    }

    .match-hint, .game-meta {
        display: none;
    }

    .turn-header {
        top: 4%;
        left: 20%;
        width: 60%;
    }

    #turn-chip {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .turn-header h1 {
        font-size: clamp(18px, 2.8vw, 28px);
        margin: 5px 0;
    }

    .turn-header p {
        font-size: clamp(12px, 1.5vw, 18px);
        letter-spacing: 0;
    }

    .turn-header b {
        font-size: 16px;
    }

    .remaining-badge {
        top: 18%;
        right: 4%;
        width: 62px;
        height: 62px;
        border-width: 2px;
    }

    .remaining-badge span {
        font-size: 11px;
    }

    .remaining-badge strong {
        font-size: 27px;
    }

    .player-panel {
        top: 34%;
        width: 18%;
        height: 47%;
        gap: 8px;
    }

    .player-panel.red {
        left: -2%;
        padding-left: 10px;
    }

    .player-panel.blue {
        right: -2%;
        padding-right: 10px;
    }

    .player-panel h2 {
        font-size: 24px;
        margin: 0;
        -webkit-text-stroke-width: 3px;
    }

    .player-panel img {
        width: 48px;
        height: 48px;
    }

    .player-panel strong {
        font-size: 17px;
        max-width: 90%;
    }

    .player-status {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .planet-field {
        inset: auto;
        left: 18%;
        top: 25%;
        width: 64%;
        height: 51%;
    }

    .planet-hover-ring {
        inset: -5px;
    }

    .planet.selected .planet-hover-ring {
        border-width: 2px;
    }

    .game-bottom {
        left: 20%;
        width: 60%;
        bottom: 2%;
    }

    .selection-status {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .confirm-button {
        width: min(100%, 330px);
        height: 44px;
        font-size: 23px;
    }

    .game-bottom p {
        margin-top: 7px;
        font-size: 11px;
    }

    .game-bottom p span {
        margin-left: 6px;
    }

    .result-card {
        left: 8%;
        top: 10%;
        width: 84%;
        height: 80%;
        padding-top: 4vh;
    }

    .eyebrow {
        font-size: 11px;
        letter-spacing: 3px;
    }

    .winner-avatar {
        width: clamp(64px, 14vh, 110px);
        height: clamp(64px, 14vh, 110px);
        margin-top: 10px;
    }

    .result-card h1 {
        max-width: 90%;
        font-size: clamp(24px, 4vw, 38px);
        -webkit-text-stroke-width: 3px;
        margin: 12px 0 8px;
    }

    .result-card p, .result-stats {
        font-size: 12px;
    }

    .result-stats {
        margin: 10px 0;
        gap: 10px;
    }

    .return-button {
        min-width: 160px;
        font-size: 23px;
    }

    .result-sync {
        margin-top: 8px;
        font-size: 10px;
    }

    .difficulty-dialog, .leave-dialog {
        transform: none;
        width: min(92vw, 760px);
        height: auto;
        max-height: 94dvh;
        overflow-y: auto;
        padding: 22px;
        border-radius: 18px;
    }

    .difficulty-dialog h1, .leave-dialog h2 {
        font-size: 25px;
        margin: 12px 0;
        letter-spacing: 1px;
    }

    .difficulty-dialog > p, .leave-dialog p {
        font-size: 14px;
    }

    .close-button {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .difficulty-options {
        gap: 10px;
        margin-top: 18px;
    }

    .difficulty-card {
        min-width: 0;
        height: auto;
        padding: 18px 6px;
    }

    .difficulty-index {
        font-size: 10px;
        top: 8px;
        left: 8px;
    }

    .difficulty-card img {
        width: clamp(55px, 12vw, 85px);
        height: clamp(55px, 12vw, 85px);
        margin: 8px 0;
    }

    .difficulty-card strong {
        font-size: 22px;
        letter-spacing: 3px;
        margin-bottom: 8px;
    }

    .difficulty-card > span:last-child, .dialog-tip {
        font-size: 11px;
    }

    .dialog-tip {
        margin-top: 16px;
    }

    .toast {
        max-width: 94%;
        white-space: normal;
        text-align: center;
        padding: 12px 18px;
        bottom: 20%;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scene::after, .nebula-cloud {
        animation: none;
    }
}

/* 游戏仅允许横屏操作；竖屏遮罩覆盖全部入口，不改变星球散点布局。 */
@media (orientation: portrait) {
    .orientation-guard {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: radial-gradient(ellipse at center, #12375a, #010915 80%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 22px;
        text-align: center;
        padding: 30px;
    }

    .scene-content {
        visibility: hidden;
    }
}
