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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 10px;
    padding-bottom: 70px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    text-align: left;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.points-display {
    background: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 120px;
}

.points-label {
    color: #666;
    font-size: 11px;
    margin-bottom: 3px;
}

.points-amount {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.redeem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.redeem-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.redeem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.redeem-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.redeem-amount {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.redeem-coins {
    font-size: 12px;
    opacity: 0.9;
}

.task-section {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.task-header {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 15px;
}

.task-header::before {
    content: "⭐";
    margin-right: 8px;
    font-size: 18px;
}

.challenge-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.challenge-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.challenge-subtitle {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.challenge-reward {
    font-size: 13px;
    font-weight: bold;
    color: #2ecc71;
    margin-bottom: 10px;
}

.challenge-progress {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.cooldown-timer {
    font-size: 13px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 10px;
    display: none;
}

.cooldown-timer.show {
    display: block;
}

.start-btn {
    width: 100%;
    padding: 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover:not(:disabled) {
    background: #1565c0;
    transform: translateY(-2px);
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.action-btn {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.join-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.join-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.join-btn:disabled {
    background: #999;
    cursor: default;
}

.verify-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.verify-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.verify-btn:disabled {
    background: #2ecc71;
    cursor: default;
}

.verify-btn:disabled::after {
    content: " ✓";
}

.spin-wheel {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.spin-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.spin-subtitle {
    font-size: 13px;
    color: #d32f2f;
    font-weight: bold;
}

.history-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.history-item.redeem {
    border-left-color: #ff6b6b;
}

.history-item.earn {
    border-left-color: #2ecc71;
}

.history-text {
    flex: 1;
}

.history-type {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
}

.history-description {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.history-detail {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

.history-points {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
}

.history-points.redeem {
    color: #ff6b6b;
}

.history-points.earn {
    color: #2ecc71;
}

.empty-history {
    text-align: center;
    padding: 30px;
    color: #999;
}

.empty-history-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    cursor: pointer;
    padding: 10px;
    color: #999;
    font-size: 12px;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: #1976d2;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    display: none;
}

.message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    z-index: 999;
}

.overlay.show {
    display: block;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.game-modal.show {
    display: flex;
}

.game-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    max-width: 95%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.game-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.game-score {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.game-progress-bar {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.game-progress-fill {
    height: 100%;
    background: #2ecc71;
    transition: width 0.3s ease;
}

.target-emoji {
    text-align: center;
    font-size: 60px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 10px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.emoji-btn {
    aspect-ratio: 1;
    font-size: 40px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.emoji-btn.correct {
    background: #2ecc71;
    border-color: #2ecc71;
    animation: correctMatch 0.5s ease;
}

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

.game-over-modal {
    text-align: center;
}

.game-over-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.game-over-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.game-over-score {
    font-size: 18px;
    color: #2ecc71;
    font-weight: bold;
    margin-bottom: 15px;
}

.close-game-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-game-btn:hover {
    background: #764ba2;
}

.spin-wheel-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.spin-wheel-modal.show {
    display: flex;
}

.spin-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 350px;
    width: 90%;
}

.spin-title-text {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.wheel-display {
    font-size: 80px;
    margin: 20px 0;
    animation: spinAnimation 0.6s ease-out;
}

@keyframes spinAnimation {
    0% { transform: rotateZ(0deg) scale(1); }
    50% { transform: rotateZ(360deg) scale(1.2); }
    100% { transform: rotateZ(720deg) scale(1); }
}

.spin-result {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
    margin: 15px 0;
}

.spin-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

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

.spin-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.spin-button.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.spin-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.spin-button.secondary {
    background: #f0f0f0;
    color: #333;
}

.spin-button.secondary:hover {
    background: #e0e0e0;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #ccc;
    color: #333;
}

.btn-cancel:hover {
    background: #bbb;
}

.btn-confirm {
    background: #2ecc71;
    color: white;
}

.btn-confirm:hover {
    background: #27ae60;
}