:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #171a1f;
    --secondary: #727984;
    --line: #e7e9ee;
    --brand: #ff7a1a;
    --brand-weak: #fff2e8;
    --pressed: #f0f2f5;
    --shadow: 0 8px 22px rgba(23, 26, 31, .06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

button {
    margin: 0;
    padding: 0;
    border: 0;
    color: inherit;
    background: none;
    font: inherit;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.app {
    width: min(100%, 460px);
    min-height: 100svh;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    border-radius: 0;
}

.page {
    display: none;
    min-height: 100svh;
    padding: max(12px, env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
    border-radius: 0;
}

.page.active {
    display: block;
    border-radius: 0;
}

.topbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.title-wrap {
    min-width: 0;
}

.title {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: 0;
}

.subtitle {
    margin: 3px 0 0;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.35;
}

.icon-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
}

.icon-btn:active,
.game:active,
.tab:active {
    background-color: var(--pressed);
}

svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.game {
    min-height: 68px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
}

.app-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0;
}

.app-icon.snake {
    background: linear-gradient(145deg, #28bb78, #0d8b58);
}

.app-icon.tetris {
    background: linear-gradient(145deg, #4388ff, #245ad6);
}

.app-icon.gomoku {
    background: linear-gradient(145deg, #24272d, #0d0f12);
}

.app-icon.minesweeper {
    background: linear-gradient(145deg, #f05f57, #b6282f);
}

.app-icon.xiaoxiaole {
    background: linear-gradient(145deg, #ff9f1c, #ff6b1a);
}

.app-icon.lianliankan {
    background: linear-gradient(145deg, #16a3a8, #08747a);
}

.app-icon.game2048 {
    background: linear-gradient(145deg, #f7b955, #d77a21);
    font-size: 16px;
}

.app-icon.sudoku {
    background: linear-gradient(145deg, #6c8cff, #3448c5);
}

.app-icon.chess {
    background: linear-gradient(145deg, #8b6b4d, #3f3127);
}

.app-icon.ghost-maze {
    background: linear-gradient(145deg, #4b5563, #111827);
}

.game-main {
    min-width: 0;
}

.game-name {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mine-topbar {
    min-height: 78px;
    display: grid;
    place-items: center;
}

.mine-title {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 800;
}

.mine-panel,
.mine-info {
    margin-top: 12px;
    padding: 0 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.mine-row {
    width: 100%;
    min-height: 78px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.mine-row:last-child,
.mine-info-row:last-child {
    border-bottom: 0;
}

.mine-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: #fff3ec;
}

.mine-icon svg {
    width: 22px;
    height: 22px;
}

.mine-label {
    min-width: 0;
    font-size: 17px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mine-value,
.mine-arrow {
    color: #9aa0a9;
    font-size: 14px;
    white-space: nowrap;
}

.mine-arrow {
    font-size: 28px;
    line-height: 1;
}

.mine-info-row {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.mine-info-row span {
    color: #8a9099;
    font-size: 16px;
}

.mine-info-row strong {
    min-width: 0;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 20;
    width: min(100%, 460px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
}

.tab {
    height: 56px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: #818894;
    font-size: 12px;
    font-weight: 650;
}

.tab.active {
    color: var(--brand);
}

.tab svg {
    width: 22px;
    height: 22px;
}

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

@media (min-width: 720px) {
    body {
        background: #eceff3;
    }

    .app {
        min-height: calc(100svh - 40px);
        margin-top: 20px;
        margin-bottom: 20px;
        box-shadow: 0 18px 50px rgba(23, 26, 31, .12);
    }

}

@media (max-width: 340px) {
    .page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .game {
        min-height: 64px;
        padding: 10px;
        gap: 8px;
    }

    .app-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 17px;
    }

}
