/* 体育英语小游戏 - 样式文件 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 15px;
}

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

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}
.header h1 {
    font-size: 28px;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.header p { opacity: 0.8; font-size: 14px; }

/* Role Switch */
.role-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.role-btn {
    padding: 12px 30px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
    color: white;
}
.role-btn:hover { background: rgba(255,255,255,0.2); }
.role-btn.active {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border-color: #e94560;
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}
.leaderboard-btn {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
    border-color: #f9ca24;
}
.leaderboard-btn:hover {
    box-shadow: 0 5px 20px rgba(249, 202, 36, 0.4);
}

/* Cards */
.card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.card-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #e94560;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}
.btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}
.btn-secondary {
    background: #f0f0f0;
    color: #333;
}
.btn-secondary:hover { background: #e0e0e0; }

/* Section Toggle */
.section { display: none; }
.section.active { display: block; }

/* Login Screen */
.login-screen {
    text-align: center;
    padding: 40px 20px;
}
.login-icon {
    font-size: 60px;
    margin-bottom: 20px;
}
.login-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}
.login-subtitle {
    color: #666;
    margin-bottom: 30px;
}
.login-form {
    max-width: 300px;
    margin: 0 auto;
}
.login-form input {
    margin-bottom: 15px;
}

/* Loading Animation */
.loading-container {
    text-align: center;
    padding: 30px;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    color: #666;
    font-size: 14px;
}

/* Game Area */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.game-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}
.stat-value { font-size: 24px; font-weight: bold; }
.stat-label { font-size: 12px; opacity: 0.9; }

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.card-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-size: 14px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}
.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}
.card-item.selected {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
    transform: scale(1.05);
}
.card-item.matched {
    background: #2ed573;
    opacity: 0.5;
    cursor: default;
    transform: scale(0.95);
}
.card-item.wrong {
    animation: shake 0.5s;
    background: #ff4757;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Result Screen */
.result-screen {
    text-align: center;
    padding: 40px 20px;
}
.result-icon { font-size: 80px; margin-bottom: 20px; }
.result-title { font-size: 28px; color: #333; margin-bottom: 10px; }
.result-subtitle { color: #666; margin-bottom: 30px; }
.result-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.result-stat {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 10px;
}
.result-stat-value { font-size: 32px; font-weight: bold; color: #e94560; }
.result-stat-label { font-size: 14px; color: #666; }

/* Teacher - Word List */
.word-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.word-content { flex: 1; }
.word-english { font-weight: bold; color: #333; font-size: 16px; }
.word-chinese { color: #666; margin-top: 5px; }
.word-meta { font-size: 12px; color: #999; margin-top: 5px; }

/* Teacher - Student Records */
.record-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}
.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.record-name { font-weight: bold; color: #333; }
.record-date { font-size: 12px; color: #999; }
.record-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.record-stat {
    font-size: 14px;
    color: #666;
}
.record-stat span { font-weight: bold; color: #e94560; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}
.empty-icon { font-size: 48px; margin-bottom: 10px; }

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 {
    font-size: 22px;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}
.modal-close:hover {
    opacity: 0.8;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.2s;
}
.leaderboard-item:hover {
    transform: translateX(5px);
}
.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 15px;
    flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: white; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%); color: white; }
.rank-3 { background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%); color: white; }
.rank-other { background: #e0e0e0; color: #666; }
.leaderboard-info {
    flex: 1;
}
.leaderboard-name {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}
.leaderboard-score {
    color: #e94560;
    font-weight: bold;
    font-size: 18px;
}
.leaderboard-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* Challenge Cards - 翻转隐藏机制 */
.challenge-card {
    perspective: 1000px;
    min-height: 70px;
    cursor: pointer;
}
.challenge-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 70px;
    transition: transform 0.4s;
    transform-style: preserve-3d;
}
.challenge-card.flipped .card-inner {
    transform: rotateY(180deg);
}
.challenge-card .card-front,
.challenge-card .card-back {
    position: absolute;
    width: 100%;
    min-height: 70px;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: anywhere;
    padding: 8px;
    font-size: 13px;
    line-height: 1.3;
}
.challenge-card .card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}
.challenge-card .card-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}
.challenge-card.flipped:hover .card-inner {
    transform: rotateY(180deg);
}
.challenge-card.matched .card-back {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.challenge-card.matched {
    cursor: default;
}

/* 打地鼠游戏动画 */
@keyframes bombPulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}
@keyframes scoreFloat {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -80%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -120%) scale(1); opacity: 0; }
}

/* Responsive */
@media (max-width: 600px) {
    body { padding: 10px; }
    .header h1 { font-size: 22px; }
    .game-board { grid-template-columns: repeat(3, 1fr); }
    .card-item { padding: 15px 8px; font-size: 12px; min-height: 60px; }
    .stat-box { padding: 8px 15px; min-width: 70px; }
    .stat-value { font-size: 20px; }
    .role-btn { padding: 10px 20px; font-size: 14px; }
    .challenge-card .card-back { font-size: 12px; padding: 6px; }
}
