/* ===== 玄弈游戏厅 — 浅色毛玻璃风格 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f0eb;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-primary: #2d2a24;
    --text-secondary: #8a8580;
    --accent: #6366f1;
    --accent-light: #eef2ff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --radius: 20px;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部 ===== */

header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== 游戏卡片 ===== */

#game-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.game-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.9);
}

.game-card.coming-soon {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.card-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 16px;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-info h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    margin-top: 8px;
    margin-right: 4px;
}

.card-tag.hot {
    background: #fef2f2;
    color: #ef4444;
}

.card-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ===== 游戏视图 ===== */

#game-view {
    display: none;
    flex-direction: column;
    flex: 1;
}

#game-view .game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 12px;
}

#game-view .game-header .back {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.7;
}
#game-view .game-header .back:hover { opacity: 1; }

#game-view .game-header h2 {
    font-size: 18px;
    font-weight: 600;
}

#game-view .score-display {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

#game-view .score-display span {
    color: var(--text-primary);
    font-weight: 700;
}

#game-container {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    position: relative;
    touch-action: none;
}

#game-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

.game-error {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 24px;
}

/* ===== 底部 ===== */

footer {
    text-align: center;
    padding: 32px 0 16px;
}

.back-link {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}
