/* 水果忍者 — 布局与 HUD（顶栏打赏/茶杯由 /assets/css/game-chrome.css 统一提供） */

.fn-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 24px;
    box-sizing: border-box;
}

.fn-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.fn-vol-wrap {
    position: relative;
}

.fn-btn-vol {
    min-width: 42px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
}

.fn-btn-vol.is-muted {
    background: rgba(255, 107, 107, 0.35);
}

.fn-vol-popup {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1a2d4a 0%, #0f1a2e 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.fn-vol-popup[hidden] {
    display: none !important;
}

.fn-vol-popup label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: block;
    margin-bottom: 6px;
}

.fn-vol-range {
    width: 100%;
    accent-color: #d4af37;
}

.fn-stage-wrap {
    position: relative;
    width: 100%;
    height: min(72vh, 640px);
    min-height: 360px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    background: radial-gradient(circle at 50% 18%, #1a2a4a 0%, #05070f 100%);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.fn-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 5;
}

.fn-hud span {
    color: #ffe14d;
}

#fnCombo {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    color: #fff700;
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.9);
    opacity: 0;
    transition: opacity 0.2s;
}

.fn-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-align: center;
    z-index: 8;
    padding: 20px;
    box-sizing: border-box;
}

.fn-overlay h2 {
    margin: 0 0 10px;
    font-size: 36px;
    color: #ffe14d;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
    letter-spacing: 3px;
}

.fn-overlay p {
    margin: 6px 0;
    font-size: 15px;
    opacity: 0.92;
    line-height: 1.5;
}

.fn-diff {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 6px;
}

.fn-diff-btn {
    min-width: 76px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.fn-diff-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.fn-diff-btn.is-active {
    color: #1a2a4a;
    background: linear-gradient(180deg, #ffe14d, #ffb300);
    border-color: #ffc107;
    box-shadow: 0 3px 0 #b37b00;
}

.fn-diff-btn.is-active:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #b37b00;
}

.fn-diff-desc {
    margin: 4px 0 0 !important;
    font-size: 13px !important;
    opacity: 0.78 !important;
    min-height: 1.4em;
}

.fn-btn {
    margin-top: 20px;
    padding: 12px 36px;
    font-size: 18px;
    font-weight: 700;
    color: #1a2a4a;
    background: linear-gradient(180deg, #ffe14d, #ffb300);
    border: none;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 6px 0 #b37b00, 0 10px 20px rgba(0, 0, 0, 0.35);
}

.fn-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #b37b00;
}

.fn-overlay.hidden,
#fnCombo.hidden {
    display: none !important;
}

.fn-hint {
    margin: 14px 0 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.6;
}

.game-stats {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    z-index: 10040;
}

.stat-item {
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(26, 26, 46, 0.95);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat-item i { color: #ffd700; }
.stat-item:nth-child(2) i { color: #ff6b6b; }

.stat-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.stat-btn.love-active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

/* 给顶栏留出左右空间，避免标题与茶杯/统计重叠 */
.game-header {
    padding-top: 72px !important;
    padding-left: 12px;
    padding-right: 12px;
}

@media (max-width: 768px) {
    .game-top-left { top: 12px !important; left: 10px !important; gap: 8px !important; }
    .game-stats { top: 10px; right: 10px; gap: 8px; flex-wrap: wrap; max-width: 52%; }
    .stat-item { font-size: 12px; padding: 8px 12px; }
    .stat-btn { padding: 8px 14px; font-size: 12px; }
    .fn-stage-wrap { height: min(68vh, 520px); min-height: 300px; }
    .fn-overlay h2 { font-size: 28px; }
    .fn-hud { font-size: 14px; padding: 10px 12px; }
    .game-header { padding-top: 64px !important; }
    .fn-diff-btn { min-width: 68px; padding: 7px 12px; font-size: 13px; }
}

/* APP / 横屏：压缩装饰，优先切水果区域（不隐藏网页版茶杯/打赏） */
@media (orientation: landscape) and (max-height: 520px) {
    .fn-main { padding: 0 8px 8px; max-width: none; }
    .fn-stage-wrap {
        height: calc(100vh - 72px);
        min-height: 220px;
        border-radius: 10px;
    }
    .fn-hint { display: none; }
    .fn-overlay h2 { font-size: 24px; }
    .fn-overlay p { font-size: 13px; }
}
