/* Memo 宝贝翻翻乐 - 游戏样式 */

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

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

/* 移动端优化：防止双击缩放 */
body {
    touch-action: manipulation;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 10px;
    padding: 8px 0;
}

.header h1 {
    font-size: clamp(1.5em, 5vw, 2.5em);
    margin-bottom: 4px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 0.6s;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.3s;
}

.header h1:hover {
    transform: scale(1.05);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

.header h1:active {
    transform: scale(0.98);
}

.header .subtitle {
    font-size: clamp(0.85em, 2.5vw, 1.1em);
    opacity: 0.9;
}

/* 掷圣杯入口链接 */
.divination-link {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s;
    font-weight: 500;
}

.divination-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.divination-link:active {
    transform: translateY(0);
}

/* 设置面板 */
.settings-panel {
    background: white;
    border-radius: 15px;
    padding: 15px 12px;
    margin-bottom: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.6s;
}

/* 游戏容器初始隐藏，避免闪烁 */
.game-container {
    display: none;
}

.settings-panel h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: clamp(1.1em, 3.5vw, 1.3em);
}

/* 主题区域滚动提示 */
.theme-scroll-hint {
    font-size: 0.85em;
    color: #999;
    text-align: center;
    margin-top: -5px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
    height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    align-content: start;
    /* 美化滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

/* Webkit浏览器滚动条样式 */
.theme-grid::-webkit-scrollbar {
    width: 6px;
}

.theme-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.theme-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.theme-grid::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.theme-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    height: 80px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s both;
    flex-shrink: 0;
}

.theme-card:nth-child(1) { animation-delay: 0.1s; }
.theme-card:nth-child(2) { animation-delay: 0.2s; }
.theme-card:nth-child(3) { animation-delay: 0.3s; }
.theme-card:nth-child(4) { animation-delay: 0.4s; }

.theme-card:active {
    transform: scale(0.95);
}

.theme-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: selectedPulse 0.5s;
}

@keyframes selectedPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.theme-icon {
    font-size: clamp(1.5em, 6vw, 2em);
    margin-bottom: 4px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.theme-name {
    font-size: clamp(0.9em, 3vw, 1em);
    font-weight: 500;
}

/* 年龄选择 */
.age-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.age-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s both;
}

.age-card:nth-child(1) { animation-delay: 0.1s; }
.age-card:nth-child(2) { animation-delay: 0.2s; }
.age-card:nth-child(3) { animation-delay: 0.3s; }

.age-card:active {
    transform: scale(0.95);
}

.age-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: selectedPulse 0.5s;
}

.age-icon {
    font-size: clamp(1.8em, 7vw, 2.2em);
    margin-bottom: 4px;
}

.age-name {
    font-size: clamp(1em, 3.5vw, 1.2em);
    font-weight: bold;
    margin-bottom: 3px;
}

.age-desc {
    font-size: clamp(0.75em, 2.5vw, 0.85em);
    opacity: 0.9;
}

/* 难度选择 */
.difficulty-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.difficulty-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s both;
}

.difficulty-card:nth-child(1) { animation-delay: 0.3s; }
.difficulty-card:nth-child(2) { animation-delay: 0.4s; }

.difficulty-card:active {
    transform: scale(0.95);
}

.difficulty-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.difficulty-icon {
    font-size: clamp(1.5em, 6vw, 2em);
    margin-bottom: 4px;
}

.difficulty-name {
    font-size: clamp(1em, 3.5vw, 1.15em);
    font-weight: bold;
    margin-bottom: 4px;
}

.difficulty-desc {
    font-size: clamp(0.8em, 2.8vw, 0.9em);
    opacity: 0.85;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 15px 0;
}

.difficulty-btn {
    padding: 18px 15px;
    border: 3px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: clamp(0.95em, 3.5vw, 1.1em);
    font-weight: 500;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.5s both;
}

.difficulty-btn:nth-child(1) { animation-delay: 0.5s; }
.difficulty-btn:nth-child(2) { animation-delay: 0.6s; }

.difficulty-btn:active {
    transform: scale(0.95);
}

.difficulty-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: selectedPulse 0.5s;
}

.difficulty-btn small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    opacity: 0.9;
}

/* 游戏区域 */
.game-container {
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.6s;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-bottom: 15px;
    padding: 10px 6px;
    background: #f5f5f5;
    border-radius: 12px;
}

.info-item {
    text-align: center;
    padding: 8px 4px;
}

.info-label {
    color: #666;
    font-size: clamp(0.65em, 2.2vw, 0.8em);
    margin-bottom: 3px;
    line-height: 1.2;
}

.info-value {
    font-size: clamp(1em, 3.5vw, 1.4em);
    font-weight: bold;
    color: #667eea;
    line-height: 1.2;
}

.combo-display {
    color: #ff6b6b;
    animation: pulse 0.5s;
}

/* 游戏板 */
.game-board {
    display: grid;
    gap: 5px;
    margin: 10px 0;
    padding: 3px;
}

/* 小宝宝模式：卡片更大更圆 */
.game-board.baby-board .card {
    border-radius: 14px;
}

.game-board.baby-board .card-inner,
.game-board.baby-board .card-front,
.game-board.baby-board .card-back {
    border-radius: 14px;
}

.game-board.baby-board .card-emoji {
    font-size: clamp(2rem, 9vw, 3rem);
}

.game-board.baby-board .card-back::after {
    font-size: clamp(1.3rem, 5vw, 2rem);
}

.card {
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
    touch-action: manipulation;
    animation: cardAppear 0.4s both;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out;
    border-radius: 10px;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    outline: 3px solid #667eea;
    outline-offset: -3px;
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

/* 卡片出现动画 - 按顺序 */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.7s; }
.card:nth-child(15) { animation-delay: 0.75s; }
.card:nth-child(16) { animation-delay: 0.8s; }
.card:nth-child(17) { animation-delay: 0.85s; }
.card:nth-child(18) { animation-delay: 0.9s; }
.card:nth-child(19) { animation-delay: 0.95s; }
.card:nth-child(20) { animation-delay: 1s; }
.card:nth-child(21) { animation-delay: 1.05s; }
.card:nth-child(22) { animation-delay: 1.1s; }
.card:nth-child(23) { animation-delay: 1.15s; }
.card:nth-child(24) { animation-delay: 1.2s; }
.card:nth-child(25) { animation-delay: 1.25s; }
.card:nth-child(26) { animation-delay: 1.3s; }
.card:nth-child(27) { animation-delay: 1.35s; }
.card:nth-child(28) { animation-delay: 1.4s; }
.card:nth-child(29) { animation-delay: 1.45s; }
.card:nth-child(30) { animation-delay: 1.5s; }
.card:nth-child(31) { animation-delay: 1.55s; }
.card:nth-child(32) { animation-delay: 1.6s; }
.card:nth-child(33) { animation-delay: 1.65s; }
.card:nth-child(34) { animation-delay: 1.7s; }
.card:nth-child(35) { animation-delay: 1.75s; }
.card:nth-child(36) { animation-delay: 1.8s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card:active:not(.flipped):not(.matched) .card-inner {
    transform: scale(0.95);
}

.card.matched .card-back {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.card.matched {
    cursor: default;
    animation: matchSuccess 0.5s ease-out;
}

.card.matched .card-inner {
    transform: rotateY(180deg) scale(0.9);
}

.card.matched .card-front {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    outline-color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.card.matched .card-image {
    opacity: 0.85;
}

.card.matched .card-emoji {
    opacity: 0.85;
}

.card.hint-glow {
    animation: hintGlow 1s infinite;
}

/* 卡片背面装饰图案 */
.card-back::after {
    content: '✦';
    font-size: clamp(1rem, 3.5vw, 1.4em);
    color: rgba(255, 255, 255, 0.6);
}

/* 卡片正面 emoji */
.card-emoji {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 卡片正面图片（图片主题） */
.card-image {
    width: 85%;
    height: 85%;
    object-fit: cover;
    border-radius: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.game-board.baby-board .card-image {
    width: 90%;
    height: 90%;
    border-radius: 10px;
}

/* 控制按钮 */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

button {
    padding: 12px 16px;
    font-size: clamp(0.85em, 3vw, 1em);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    touch-action: manipulation;
    min-height: 44px;
}

button:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-hint {
    background: linear-gradient(135deg, #ffd93d 0%, #ff9800 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-hint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* 游戏完成面板 */
.game-complete {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 92%;
    max-width: 500px;
    height: fit-content;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    padding: 20px 12px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    z-index: 10000;
}

.game-complete.show {
    display: block;
}

/* 完成面板内的按钮不应该被模糊 */
.game-complete .controls,
.game-complete button {
    filter: none !important;
    pointer-events: auto !important;
}

/* 完成面板中的按钮布局 - 三个按钮 */
.game-complete .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.game-complete .controls .btn-primary {
    grid-column: 1 / 2;
}

.game-complete .controls .btn-secondary {
    grid-column: 2 / 3;
}

.game-complete .controls .btn-share {
    grid-column: 1 / -1;
}

.game-complete h2 {
    font-size: clamp(1.4em, 5vw, 2em);
    margin-bottom: 8px;
    line-height: 1.2;
}

.stars {
    font-size: clamp(1.5em, 6vw, 2.5em);
    margin: 10px 0;
}

.star-item {
    display: inline-block;
    animation: starPop 0.5s both;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

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

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 10px 8px;
    border-radius: 10px;
    animation: fadeInUp 0.5s both;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

.stat-item > div:first-child {
    font-size: clamp(0.85em, 3vw, 1em);
    margin-bottom: 5px;
}

.stat-value {
    font-size: clamp(1.2em, 4vw, 1.6em);
    font-weight: bold;
    margin-top: 3px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-complete .controls {
    margin-top: 12px;
}

/* 模糊背景效果 */
.blur-background {
    filter: blur(5px);
    pointer-events: none;
    transition: filter 0.3s;
}

/* 排行榜容器 - 在浮层内 */
#leaderboardContainer {
    margin-top: 12px;
    max-height: 250px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 成就通知 */
.achievement-notification {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd93d 0%, #ff9800 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    animation: slideInDown 0.5s;
    z-index: 10001;
    max-width: 90%;
    width: auto;
    min-width: 250px;
}

.achievement-notification.hide {
    animation: slideOutUp 0.5s;
}

/* 连击特效（优化版） */
.combo-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 9999;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

.combo-effect.show {
    animation: comboPopIn 0.6s ease-out forwards;
}

.combo-effect.hide {
    animation: comboPopOut 0.4s ease-in forwards;
}

.combo-icon {
    font-size: clamp(2em, 8vw, 3.5em);
    margin-bottom: 5px;
    animation: comboRotate 0.6s ease-out;
}

.combo-text {
    font-size: clamp(1.2em, 4.5vw, 2em);
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    background: white;
    padding: 6px 14px;
    border-radius: 50px;
    display: inline-block;
}

@keyframes comboPopIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes comboPopOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
}

@keyframes comboRotate {
    0% {
        transform: rotate(0deg) scale(0.5);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 排行榜 */
.leaderboard {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 10px;
    margin-top: 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s;
}

.leaderboard.show {
    opacity: 1;
    transform: translateY(0);
}

.leaderboard h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: clamp(1.1em, 3.5vw, 1.3em);
}

.leaderboard h4 {
    color: #667eea;
    margin: 8px 0 6px 0;
    font-size: clamp(0.95em, 3vw, 1.1em);
}

.leaderboard p {
    font-size: clamp(0.85em, 3vw, 0.95em);
    color: #666;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.8em, 2.8vw, 0.95em);
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 10px 6px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background: #f5f5f5;
    color: #667eea;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.leaderboard-table td {
    word-break: break-word;
    color: #333;
}

.leaderboard-table tr {
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
}

.rank-medal {
    font-size: 1.3em;
    display: inline-block;
    min-width: 30px;
}

/* 当前玩家高亮 */
.current-player-row {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 3px solid #667eea;
}

.current-player-name {
    font-weight: bold;
    color: #667eea;
    animation: playerNamePulse 2s infinite;
}

@keyframes playerNamePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 排名信息框 */
.rank-info-box {
    margin-top: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s;
}

.rank-info-box.show {
    opacity: 1;
    transform: translateY(0);
}

.rank-title {
    font-size: clamp(1.1em, 4vw, 1.3em);
    margin-bottom: 12px;
    font-weight: bold;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: clamp(0.9em, 3vw, 1em);
}

.rank-number {
    font-weight: bold;
}

.rank-value {
    font-size: 1.3em;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: rankNumberPop 0.5s;
}

.rank-total {
    margin-top: 10px;
    font-size: clamp(0.85em, 2.8vw, 0.95em);
    opacity: 0.9;
}

@keyframes rankNumberPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* 分享按钮 */
.btn-share {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.share-options {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
}

.share-options.show {
    display: block;
    animation: fadeInUp 0.3s;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.share-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: clamp(0.9em, 3vw, 1em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-btn:active {
    transform: scale(0.95);
}

.share-btn-qq {
    background: #12b7f5;
    color: white;
}

.share-btn-wechat {
    background: #09bb07;
    color: white;
}

.share-btn-copy {
    background: white;
    color: #667eea;
    grid-column: 1 / -1;
}

.share-link {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: clamp(0.75em, 2.5vw, 0.85em);
    word-break: break-all;
    color: white;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flipIn {
    from {
        transform: rotateY(90deg);
    }
    to {
        transform: rotateY(0);
    }
}

@keyframes matchSuccess {
    0% { 
        transform: scale(1);
    }
    30% { 
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.8);
    }
    60% {
        transform: scale(0.95);
    }
    100% { 
        transform: scale(0.9);
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
    }
}

@keyframes hintGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
        height: 240px;
    }
}


/* ========================================
   移动端响应式优化
   ======================================== */

/* 超小屏幕（小于360px） */
@media (max-width: 360px) {
    body {
        padding: 6px;
    }
    
    .game-board {
        gap: 3px;
        padding: 2px;
    }
    
    .card {
        border-radius: 6px;
    }
    
    .card-emoji {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
    }
    
    .game-board.baby-board .card-emoji {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }
    
    .game-info {
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        padding: 8px 4px;
    }
    
    .info-item {
        padding: 4px 1px;
    }
    
    .info-label {
        font-size: 0.6em;
    }
    
    .info-value {
        font-size: 0.8em;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 6px 3px;
    }
}

/* 小屏幕（360px - 480px） */
@media (min-width: 361px) and (max-width: 480px) {
    .game-board {
        gap: 4px;
        padding: 2px;
    }
    
    .card-emoji {
        font-size: clamp(1.4rem, 4.5vw, 1.8rem);
    }
}

/* 中等屏幕（481px - 768px） */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .game-board {
        gap: 8px;
    }
    
    .theme-grid {
        grid-template-columns: repeat(4, 1fr);
        height: 260px;
    }
}

/* 大屏幕（769px+） */
@media (min-width: 769px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 900px;
    }
    
    .game-board {
        gap: 10px;
        max-width: 600px;
        margin: 20px auto;
    }
    
    .card:hover:not(.flipped):not(.matched) {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }
    
    .theme-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        height: 300px;
    }
    
    .theme-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    }
    
    .game-info {
        gap: 15px;
        padding: 20px;
    }
    
    .controls {
        max-width: 500px;
        margin: 20px auto;
    }
    
    button:hover:not(:disabled) {
        transform: translateY(-2px);
    }
    
    .settings-panel,
    .game-container {
        padding: 30px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .header .subtitle {
        font-size: 0.9em;
    }
    
    .header {
        margin-bottom: 10px;
    }
    
    .settings-panel,
    .game-container {
        padding: 15px;
    }
    
    .game-info {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .game-board {
        margin: 8px 0;
        gap: 3px;
    }
}

/* 超大屏幕（1200px+） */
@media (min-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    
    .game-board {
        max-width: 650px;
        margin: 20px auto;
    }
}

/* iOS Safari 优化 */
@supports (-webkit-touch-callout: none) {
    body {
        /* 防止iOS Safari下拉刷新 */
        overscroll-behavior-y: contain;
    }
    
    button, .card, .theme-card, .difficulty-btn {
        /* iOS Safari 按钮优化 */
        -webkit-appearance: none;
        appearance: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    /* 暂时不启用深色模式，保持明亮主题 */
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .controls,
    .achievement-notification {
        display: none;
    }
}


/* 自定义弹窗 */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s;
}

.custom-alert {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.4s;
}

.custom-alert-title {
    font-size: clamp(1.3em, 5vw, 1.5em);
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.custom-alert-message {
    font-size: clamp(0.95em, 3.5vw, 1.1em);
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.6;
    white-space: pre-wrap;
}

.custom-alert-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: clamp(0.95em, 3.5vw, 1em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.custom-alert-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-alert-cancel {
    background: #f5f5f5;
    color: #666;
}

.custom-alert-btn:active {
    transform: scale(0.95);
}

.custom-alert-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: clamp(1em, 3.5vw, 1.1em);
    margin-bottom: 20px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    text-align: center;
}

.custom-alert-input:focus {
    border-color: #667eea;
}


/* ========================================
   转场动画
   ======================================== */
.scene-exit {
    animation: sceneExit 0.4s ease-in forwards;
}

.scene-enter {
    animation: sceneEnter 0.5s ease-out forwards;
}

@keyframes sceneExit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
}

@keyframes sceneEnter {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   浮动装饰元素
   ======================================== */
.floating-deco {
    position: fixed;
    bottom: -30px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* ========================================
   庆祝撒花特效
   ======================================== */
.confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 10002;
    animation: confettiFall ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   冠军庆祝弹窗
   ======================================== */
.champion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s;
}

.champion-overlay.show {
    opacity: 1;
}

.champion-modal {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 90%;
    width: 380px;
    box-shadow: 
        0 0 60px rgba(255, 215, 0, 0.8),
        0 0 100px rgba(255, 140, 0, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.champion-modal.show {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.champion-crown {
    font-size: 4em;
    animation: crownBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes crownBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

.champion-title {
    font-size: clamp(1.3em, 5vw, 1.8em);
    font-weight: bold;
    color: #8b0000;
    margin: 15px 0 10px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.champion-name {
    font-size: clamp(1.8em, 7vw, 2.5em);
    font-weight: bold;
    color: #fff;
    text-shadow: 
        3px 3px 0 #8b0000,
        -1px -1px 0 #8b0000,
        1px -1px 0 #8b0000,
        -1px 1px 0 #8b0000;
    margin: 10px 0;
    animation: nameShine 2s linear infinite;
}

@keyframes nameShine {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

.champion-subtitle {
    font-size: clamp(1.2em, 4vw, 1.5em);
    color: #8b0000;
    font-weight: bold;
    margin-bottom: 15px;
}

.champion-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.champion-stat {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.champion-stat-icon {
    font-size: 1.5em;
}

.champion-stat span:last-child {
    font-size: 0.9em;
    color: #8b0000;
    font-weight: 500;
}

.champion-message {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #8b0000;
    margin: 15px 0;
    font-weight: 500;
}

.champion-btn {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    color: #ffd700;
    border: none;
    padding: 15px 40px;
    font-size: clamp(1.1em, 4vw, 1.3em);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(139, 0, 0, 0.5);
    transition: all 0.3s;
    animation: btnGlow 1.5s ease-in-out infinite;
}

.champion-btn:active {
    transform: scale(0.95);
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 5px 20px rgba(139, 0, 0, 0.5); }
    50% { box-shadow: 0 5px 30px rgba(255, 215, 0, 0.8); }
}

/* 金色撒花 */
.golden-confetti {
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
    border-radius: 50%;
}

/* 冠军弹窗按钮组 */
.champion-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.champion-btn-secondary {
    background: rgba(255, 255, 255, 0.3);
    color: #8b0000;
    border: 2px solid #8b0000;
    padding: 12px 30px;
    font-size: clamp(1em, 3.5vw, 1.1em);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.champion-btn-secondary:active {
    transform: scale(0.95);
}

/* ========================================
   冠军证书样式
   ======================================== */
.certificate-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    max-height: 95vh;
    overflow-y: auto;
}

.certificate {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(145deg, #fffef5 0%, #fff8e7 50%, #fffef5 100%);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.3);
}

.cert-border {
    border: 3px solid #d4af37;
    border-radius: 6px;
    padding: 3px;
    background: linear-gradient(145deg, #d4af37 0%, #f4e4bc 50%, #d4af37 100%);
}

.cert-inner {
    background: linear-gradient(145deg, #fffef8 0%, #fff9e6 100%);
    border-radius: 4px;
    padding: 20px 15px;
    position: relative;
    overflow: hidden;
}

/* 证书背景纹理 */
.cert-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.cert-header-deco {
    text-align: center;
    color: #d4af37;
    font-size: 1.2em;
    letter-spacing: 15px;
    margin-bottom: 10px;
}

.cert-title {
    text-align: center;
    font-size: clamp(1.8em, 6vw, 2.2em);
    font-weight: bold;
    color: #8b4513;
    text-shadow: 1px 1px 2px rgba(212, 175, 55, 0.5);
    margin-bottom: 2px;
}

.cert-subtitle {
    text-align: center;
    font-size: clamp(0.7em, 2.5vw, 0.85em);
    color: #b8860b;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.cert-crown {
    text-align: center;
    font-size: 2.5em;
    margin: 10px 0;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.cert-player-label {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.cert-player-name {
    text-align: center;
    font-size: clamp(1.6em, 5.5vw, 2em);
    font-weight: bold;
    color: #8b0000;
    font-family: 'Georgia', serif;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 8px;
    margin: 0 20px 15px;
}

.cert-achievement {
    text-align: center;
    font-size: clamp(0.95em, 3.2vw, 1.1em);
    color: #333;
    line-height: 1.8;
    margin-bottom: 15px;
}

.cert-highlight {
    color: #8b4513;
    font-weight: bold;
}

.cert-gold {
    color: #d4af37;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.cert-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 15px;
    margin-bottom: 15px;
}

.cert-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: clamp(0.8em, 2.8vw, 0.9em);
    color: #555;
    background: rgba(212, 175, 55, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
}

.cert-detail-icon {
    font-size: 1.1em;
}

.cert-divider {
    text-align: center;
    color: #d4af37;
    font-size: 1em;
    margin: 15px 0;
}

.cert-footer {
    text-align: center;
    padding-top: 10px;
}

.cert-logo {
    font-size: clamp(1.1em, 3.5vw, 1.3em);
    font-weight: bold;
    color: #667eea;
    margin-bottom: 3px;
}

.cert-official {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 3px;
}

.cert-contact {
    font-size: 0.75em;
    color: #999;
}

/* 印章 */
.cert-stamp {
    position: absolute;
    bottom: 60px;
    right: 20px;
    width: 80px;
    height: 80px;
    border: 4px solid #c41e3a;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    color: #c41e3a;
    transform: rotate(-15deg);
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.3);
    padding: 8px;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.cert-stamp::before {
    content: '★';
    font-size: 1.2em;
    margin-bottom: 2px;
}

.cert-stamp-text {
    font-size: 0.85em;
    letter-spacing: 1px;
}

.cert-stamp-site {
    font-size: 0.6em;
    margin-top: 2px;
    font-weight: normal;
    opacity: 0.9;
}

/* 证书操作按钮 */
.cert-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.cert-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: clamp(0.95em, 3.2vw, 1.05em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cert-btn:active {
    transform: scale(0.95);
}

.cert-btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cert-btn-back {
    background: #f0f0f0;
    color: #666;
}

.cert-tip {
    margin-top: 10px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
}


/* ==================== 掷圣杯游戏样式 ==================== */

.divination-board {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.divination-container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.divination-header {
    color: white;
    margin-bottom: 30px;
}

.divination-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.divination-header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.time-notice {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    color: white;
    font-size: 0.95em;
    line-height: 1.6;
}

.cups-area {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    margin-bottom: 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.cup {
    width: 80px;
    height: 100px;
    margin: 10px;
    display: inline-block;
    font-size: 60px;
    transition: all 0.5s;
}

.cup-flip {
    transform: rotate(180deg);
}

.cup.throwing {
    animation: throw 1s ease-in-out;
}

@keyframes throw {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-100px) rotate(180deg); }
    50% { transform: translateY(-50px) rotate(360deg); }
    75% { transform: translateY(-100px) rotate(540deg); }
}

.result-text {
    font-size: 1.8em;
    margin: 20px 0;
    font-weight: bold;
}

.result-sheng { color: #4caf50; }
.result-xiao { color: #ff9800; }
.result-yin { color: #f44336; }

.result-desc {
    color: #666;
    margin: 10px 0;
    line-height: 1.8;
    font-size: 1.05em;
}

.divination-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.throw-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    font-weight: 500;
}

.throw-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.throw-btn:active:not(:disabled) {
    transform: translateY(0);
}

.throw-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-btn {
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 18px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.divination-guide {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: left;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.divination-guide h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-icon {
    font-size: 2em;
    margin-right: 15px;
    flex-shrink: 0;
}

.guide-item strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.guide-item p {
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .divination-header h1 {
        font-size: 1.6em;
    }
    
    .cups-area {
        padding: 30px 15px;
        min-height: 200px;
    }
    
    .cup {
        width: 60px;
        height: 80px;
        font-size: 50px;
    }
    
    .throw-btn {
        padding: 15px 40px;
        font-size: 1.1em;
    }
    
    .back-btn {
        padding: 15px 30px;
        font-size: 1em;
    }
    
    .divination-actions {
        flex-direction: column;
    }
    
    .guide-item {
        padding: 12px;
    }
    
    .guide-icon {
        font-size: 1.5em;
        margin-right: 10px;
    }
}
