/* ============================================
   mobile.css — 移动端适配
   ============================================ */

@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .game-container {
        height: 100% !important;
        width: 100% !important;
        max-height: none !important;
        max-width: none !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .game-title {
        font-size: 1.6rem;
    }

    .game-description {
        font-size: 0.85rem;
    }

    .main-menu {
        padding: var(--space-5);
    }

    /* 游戏界面 */
    .game-screen-header {
        padding: var(--space-2) var(--space-4);
        min-height: 44px;
    }

    .header-tags {
        padding: var(--space-2) var(--space-4);
    }

    .header-tags .tag {
        font-size: 0.75rem;
        padding: 2px 8px;
    }

    .event-history-section {
        flex: 2.5;
        padding: var(--space-3) var(--space-4);
        min-height: 0;
    }

    .current-event-section {
        flex: 7.5;
        padding: var(--space-4);
        min-height: 0;
    }

    .event-title {
        font-size: 1.4rem;
    }

    .event-description {
        font-size: 0.95rem;
        margin: var(--space-3) auto;
    }

    .event-options {
        margin: var(--space-4) auto;
        gap: var(--space-2);
    }

    .option-btn {
        padding: var(--space-3);
        font-size: 0.9rem;
        min-height: 48px;
        border-radius: var(--radius-md);
    }

    .option-icon {
        font-size: 1em;
        margin-right: var(--space-2);
        min-width: 18px;
    }

    /* 标签 */
    .tag {
        font-size: 0.75rem;
        padding: 2px 8px;
    }

    /* 菜单按钮 */
    .menu-btn {
        height: 48px;
        font-size: 0.95rem;
    }

    .gameover-buttons {
        gap: var(--space-3);
    }

    /* 性别卡片 */
    .gender-selection {
        gap: var(--space-3);
    }

    .gender-card {
        width: 100px;
        height: 100px;
    }

    .gender-icon {
        font-size: 1.6rem;
    }

    /* 输入框 */
    .name-input {
        width: 240px;
    }

    /* 游戏结束 */
    .gameover-screen {
        justify-content: flex-start;
        padding: var(--space-4);
    }

    .final-age {
        font-size: 3rem;
    }

    /* 返回按钮 */
    .back-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    /* 成就 */
    .achievement-card {
        padding: var(--space-3);
    }

    .achievement-icon {
        font-size: 1em;
    }

    .achievement-name {
        font-size: 0.9rem;
    }

    .achievement-stars {
        font-size: 0.7rem;
    }

    /* 存档卡片 */
    .saved-life-card {
        flex-wrap: wrap;
        padding: var(--space-3);
    }

    .saved-life-card .btn {
        width: 100%;
        margin-top: var(--space-2);
    }

    .saved-life-date {
        width: 100%;
        margin-top: var(--space-1);
        font-size: 0.75rem;
    }

    /* 弹窗 */
    .custom-modal {
        padding: var(--space-4);
    }

    /* 成就通知 */
    .achievement-notification {
        width: 90%;
        right: 5%;
        left: 5%;
    }

    /* 主题选择器 */
    .theme-selector {
        top: var(--space-3);
        right: var(--space-3);
        transform: none;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
    }

    /* 游戏结束历史 */
    .history-container {
        max-height: 200px;
        overflow-y: auto;
    }

    /* 人生详情 */
    .life-details-screen {
        padding: 0;
    }
}

/* 触摸设备 */
@media (hover: none) and (pointer: coarse) {
    .menu-btn:hover,
    .option-btn:hover,
    .btn:hover {
        transform: none;
        background: var(--color-divider);
    }

    .option-btn:hover {
        background: var(--color-divider);
    }

    .saved-life-card:hover {
        border-color: var(--color-border);
    }

    .achievement-card:hover {
        box-shadow: none;
    }

    * {
        -webkit-tap-highlight-color: transparent;
    }

    .menu-btn:active,
    .option-btn:active,
    .btn:active {
        transform: none;
        box-shadow: none;
    }
}

/* 移动端容器 */
.mobile-device .game-container {
    overflow-y: auto;
}

.mobile-device {
    overscroll-behavior: contain;
}

/* 安全区域 */
@supports (padding: max(0px)) {
    .mobile-device .game-screen-header {
        padding-top: max(var(--space-2), env(safe-area-inset-top));
    }

    .mobile-device .current-event-section {
        padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
    }
}
