/* 结算弹窗 / Toast / 音效开关样式（自原 style.css 拆分） */
/* 结算弹窗：复盘 / 重开并排，返回大厅在下方 */
.gameover-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.gameover-actions .btn {
    min-height: 2.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.gameover-actions .btn-primary {
    padding: 0.6rem 0.75rem;
}

/* 结算面板的最终兽印明细 */
.gameover-seals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(210, 169, 59, 0.28);
    border-radius: 4px;
    background: rgba(210, 169, 59, 0.07);
    font-size: 0.78rem;
}

.gameover-seals b {
    font-weight: 700;
}

.gameover-tally-sep {
    color: #5c6e6b;
    font-style: normal;
}

.danger-kicker {
    color: #d97060;
}

/* 兽印抉择弹窗：金色 kicker + 呼吸光效，提示这是必答决策 */
.seal-kicker {
    color: var(--gold, #d2a93b);
    animation: seal-kicker-pulse 1.6s ease-in-out infinite;
}

@keyframes seal-kicker-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 0.4rem rgba(210, 169, 59, 0.4); }
    50% { opacity: 0.72; text-shadow: 0 0 0.9rem rgba(210, 169, 59, 0.85); }
}

.confirm-modal-content {
    width: min(22rem, 100%);
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.modal-actions .btn {
    min-height: 2.55rem;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.78rem;
}

.btn-danger {
    border: 1px solid #b84535;
    background: #b84535;
    color: #fff;
}

.btn-danger:hover {
    background: #cf5845;
}

.toast {
    position: fixed;
    left: 50%;
    top: max(1rem, env(safe-area-inset-top));
    z-index: 200;
    max-width: min(28rem, calc(100% - 2rem));
    padding: 0.7rem 1rem;
    border: 1px solid rgba(243, 236, 220, 0.18);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink-950);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.34);
    font-size: 0.76rem;
}

@media (max-width: 800px) {
    #lobby {
        padding: 0;
    }

    .lobby-shell {
        grid-template-columns: 1fr;
        width: 100vw;
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
    }

    .lobby-art {
        display: none;
    }

    .lobby-panel {
        display: flex;
        flex-direction: column;
        padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    }

    .mobile-brand {
        display: flex;
        flex: none;
        margin-bottom: clamp(1.2rem, 4vh, 2.2rem);
    }

    .mobile-brand .brand-mark {
        width: 2.5rem;
        height: 2.5rem;
    }

    .mobile-brand strong {
        font-size: 1.05rem;
    }

    #lobby-main,
    #waiting-room-section {
        width: min(100%, 29rem);
        margin: auto;
    }

    .panel-heading {
        margin-bottom: 1.1rem;
    }

    .panel-heading h2 {
        font-size: 1.65rem;
    }

    .join-section,
    .room-list-section {
        margin-top: 1rem;
    }

    .room-list {
        height: min(7.5rem, 17vh);
    }

    .game-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 3.1rem minmax(0, 1fr) auto;
        gap: 0.35rem;
        padding: max(0.35rem, env(safe-area-inset-top)) max(0.35rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
    }

    .game-header {
        grid-column: 1;
        grid-template-columns: auto 1fr auto;
        gap: 0.6rem;
        padding: 0 0.4rem;
    }

    .game-brand span:not(.brand-mark),
    .game-legend {
        display: none;
    }

    .game-header-actions {
        gap: 0;
    }

    .turn-indicator {
        justify-self: end;
        min-width: 7.4rem;
        padding: 0.42rem 0.65rem;
        font-size: 0.72rem;
    }

    #game .board-container {
        width: min(100%, calc((100dvh - 13.5rem) * 8 / 7));
    }

    .board-hint {
        bottom: 0.3rem;
    }

    /* 底部信息条改为内容自适应高度，玩家卡紧凑化避免裁切 */
    .game-sidebar {
        grid-row: 3;
        grid-template-columns: minmax(0, 1.35fr) minmax(11rem, 1fr);
        grid-template-rows: minmax(0, auto) auto;
        max-height: 46dvh;
        overflow-y: auto;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .victory-panel {
        grid-column: 1;
        grid-row: 1;
    }

    .log-panel {
        grid-column: 2;
        grid-row: 1;
    }

    .rules-panel {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .seal-board-head {
        gap: 0.24rem;
    }

    .player-status {
        gap: 0.12rem;
        min-height: 0;
        padding: 0.34rem 0.16rem 0.26rem;
    }

    .player-status.active {
        box-shadow: inset 0 2px 0 var(--player-color, var(--paper));
    }

    .pstatus {
        min-height: 0.75rem;
        text-align: center;
    }

    .player-status.you .pname::after {
        display: none;
    }

    .log-panel {
        border-bottom: 0;
        border-left: 1px solid var(--line);
        padding: 0.55rem 0.7rem;
    }

    .log-title {
        margin-bottom: 0.2rem;
    }

    .log-content {
        font-size: 0.66rem;
        line-height: 1.35;
    }

    .log-content .log-entry {
        padding: 0.25rem 0;
    }

    .victory-panel {
        padding: 0.55rem 0.65rem 0.6rem;
    }

    .victory-track {
        margin-top: 0.45rem;
        gap: 0.18rem;
    }

    .victory-track-step {
        height: 0.38rem;
    }

    .victory-scoreline {
        margin-top: 0.5rem;
    }

    .rules-panel {
        display: none;
    }
}

@media (max-width: 620px) {
    .game-sidebar {
        grid-template-columns: 1fr;
    }

    .log-panel {
        display: none;
    }

    .pname {
        font-size: 0.76rem;
    }

    .pcount {
        font-size: 0.62rem;
    }
}

@media (max-height: 680px) {
    .lobby-shell {
        min-height: 0;
    }

    .lobby-panel {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .brand-lockup h1 {
        font-size: 3.25rem;
    }

    .animal-showcase {
        height: 13rem;
    }

    .panel-heading {
        margin-bottom: 0.8rem;
    }

    .panel-heading h2 {
        font-size: 1.55rem;
    }

    .panel-heading p {
        margin-top: 0.3rem;
    }

    .join-section,
    .room-list-section {
        margin-top: 0.75rem;
    }

    .room-list {
        height: 4.8rem;
    }

    .game-shell {
        grid-template-rows: 2.8rem minmax(0, 1fr) auto;
    }

    #game .board-container {
        width: min(100%, calc((100dvh - 10.5rem) * 8 / 7));
    }

    .player-status {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .board-hint,
    .log-panel {
        display: none;
    }

    .game-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================
   体验细节：Toast 过渡 / 音效开关图标
   ============================================================ */

.toast {
    opacity: 0;
    transform: translate(-50%, -12px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

#sfx-toggle-btn .mute-slash {
    display: none;
}

#sfx-toggle-btn.is-muted .mute-slash {
    display: block;
}

#sfx-toggle-btn.is-muted {
    color: #7d7462;
}
