/* 分数计算闯关 - 样式文件 */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 5px;
    margin: 0;
    overflow: auto;
    position: relative;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* 主容器 - 左右布局 */
.main-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    align-items: flex-start;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 220px;
    max-width: 260px;
    flex-shrink: 0;
}

.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: white;
    font-size: 22px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.score-board {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.score-item .label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.score-item .value {
    color: white;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

h1 {
    text-align: center;
    color: #f5576c;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: bold;
}

/* 问题区域 */
.question-area {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.question-text {
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 答案区域 */
.answer-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.answer-option {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 25px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .answer-option:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    }
}

.answer-option.correct {
    animation: correctPulse 0.5s ease;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.answer-option.wrong {
    animation: wrongShake 0.5s ease;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.answer-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

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

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 统计区域 - 左侧面板中 */
.stats-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 右侧按钮组 */
.right-buttons {
    position: fixed;
    right: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.btn-restart {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    background: linear-gradient(145deg, #ff6b6b, #ff8787);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-width: 120px;
    text-align: center;
    font-weight: bold;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.btn-restart:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-home {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-width: 120px;
    text-align: center;
    font-weight: bold;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.btn-home:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 横竖屏提示 */
.orientation-tip {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}

.orientation-tip .icon {
    font-size: 80px;
    margin-bottom: 20px;
}

@media screen and (orientation: portrait) and (max-width: 768px) {
    .orientation-tip.show-portrait-tip {
        display: flex;
    }
}

/* 道具栏样式 - 固定在右侧 */
.power-ups {
    position: fixed;
    right: 10px;
    top: 150px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.power-up {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    border: 3px solid #ffd700;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-width: 120px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.power-up:active {
    transform: scale(0.95);
}

.power-up.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

.power-up .count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid white;
}

/* 弹窗样式 */
.egg-modal,
.login-modal,
.rank-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.egg-modal.show,
.login-modal.show,
.rank-modal.show {
    display: flex;
}

.login-modal {
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
}

.egg-modal.show {
    animation: fadeIn 0.3s ease;
}

.egg-content,
.login-content,
.rank-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.egg-content {
    animation: bounceIn 0.5s ease;
}

.login-content {
    width: 90%;
}

.rank-content {
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.egg-content h2,
.login-content h2,
.rank-content h2 {
    color: #f5576c;
    margin-bottom: 20px;
}

.egg-content h2 {
    font-size: 32px;
}

.login-content h2,
.rank-content h2 {
    font-size: 28px;
}

.login-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.egg-content .egg-icon {
    font-size: 80px;
    margin: 20px 0;
    animation: rotate 2s linear infinite;
}

.egg-content .egg-name {
    font-size: 24px;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
}

.egg-content .egg-desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.egg-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 排行榜按钮 - 放在右侧道具栏下方 */
.rank-btn {
    position: fixed;
    right: 10px;
    top: 250px;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.9);
    border: none;
    border-radius: 8px;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.rank-btn:hover {
    background: rgba(255, 215, 0, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

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

/* 响应式设计 */

/* iPad Pro 横屏优化 */
@media (min-width: 1024px) and (max-width: 1366px) {
    .main-container {
        gap: 25px;
        padding: 15px;
    }
    
    .left-panel {
        min-width: 200px;
        max-width: 240px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .game-container {
        min-height: 550px;
        padding: 20px;
    }
    
    .question-text {
        font-size: 32px;
    }
    
    .answer-option {
        font-size: 24px;
        padding: 25px;
    }
}

/* iPad 竖屏优化 - 切换为上下布局 */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        align-items: stretch;
    }
    
    .left-panel {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 100%;
        min-width: 100%;
        gap: 15px;
    }
    
    .header {
        flex: 0 0 100%;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .score-board {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }
    
    .score-item {
        flex: 1;
        min-width: 100px;
        padding: 10px;
    }
    
    .stats-area {
        flex: 1;
        flex-direction: row;
        gap: 10px;
        padding: 15px;
    }
    
    .stat-item {
        flex: 1;
        min-width: 80px;
        padding: 8px 10px;
    }
    
    .game-container {
        min-height: 450px;
    }
    
    .question-text {
        font-size: 28px;
    }
    
    .answer-option {
        font-size: 20px;
        padding: 20px;
    }
}

/* 手机端优化 - 上下布局 */
@media (max-width: 767px) {
    .main-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    
    .left-panel {
        max-width: 100%;
        min-width: 100%;
        gap: 10px;
    }
    
    .header {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .score-board {
        padding: 12px;
        gap: 8px;
    }
    
    .score-item {
        padding: 8px 12px;
    }
    
    .score-item .label {
        font-size: 12px;
    }
    
    .score-item .value {
        font-size: 18px;
    }
    
    .stats-area {
        padding: 12px;
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px 12px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .game-container {
        min-height: 400px;
        padding: 15px;
    }
    
    .question-area {
        padding: 20px;
        min-height: 100px;
    }
    
    .question-text {
        font-size: 22px;
    }
    
    .answer-area {
        gap: 10px;
    }
    
    .answer-option {
        font-size: 18px;
        padding: 18px;
        min-height: 65px;
    }
    
    /* 手机端道具栏缩小 */
    .power-ups {
        right: 5px;
        top: 55px;
        gap: 8px;
    }
    
    .power-up {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .power-up .count {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: -8px;
        right: -8px;
    }
    
    .rank-btn {
        right: 5px;
        top: 220px;
        padding: 8px 15px;
        font-size: 14px;
        min-width: 100px;
    }
}
