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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

/* 开始界面 */
.start-content {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 100px;
    position: relative;
    overflow: hidden;
}

.start-content::before {
    content: '✨';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 30px;
    animation: sparkle 2s ease-in-out infinite;
    opacity: 0.6;
}

.start-content::after {
    content: '⭐';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    animation: sparkle 2s ease-in-out infinite;
    animation-delay: 1s;
    opacity: 0.6;
}

.start-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 24px;
}

/* Language Selector */
.lang-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.lang-btn {
    padding: 10px 22px;
    font-size: 1em;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    color: #555;
}

.lang-btn:hover {
    border-color: #667eea;
    background: #eef2ff;
    color: #4c51bf;
}

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

/* 按钮样式 */
.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

/* 社团选择界面 */
.screen-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.screen-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.screen-header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.club-card {
    background: radial-gradient(circle at top, #ffffff 0%, #f5f7fa 45%, #dde4ff 100%);
    border-radius: 24px;
    padding: 24px 22px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 340px;
    background-image:
        linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.18)),
        radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.9), transparent 55%);
}

.club-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.club-card:hover::after {
    opacity: 1;
}

.club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.club-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.club-card .sdg-number {
    font-size: 0.8em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 14px;
    border-radius: 999px;
    align-self: flex-start;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.45);
    margin-bottom: 14px;
}

.club-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.club-illustration-circle {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff 0%, #e5edff 45%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(129, 140, 248, 0.55);
    border: 3px solid rgba(129, 140, 248, 0.7);
}

.club-emoji {
    font-size: 42px;
    transform-origin: center;
    animation: float 3s ease-in-out infinite;
}

.club-card .club-name {
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    font-size: 1.4em;
    line-height: 1.2;
}

.club-card .activity {
    font-size: 0.95em;
    color: #4b5563;
    margin-bottom: 14px;
    font-style: italic;
    line-height: 1.5;
}

.club-card .slogan {
    font-size: 0.9em;
    color: #ffffff;
    font-weight: 600;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea 0%, #38bdf8 100%);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.club-card .activity::before {
    content: 'Activity';
    display: inline-block;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 4px;
    font-weight: 600;
}

.club-card .slogan::before {
    content: '“';
}

.club-card .slogan::after {
    content: '”';
}

/* 游戏界面 */
.game-header {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.club-info h2 {
    color: #667eea;
    margin-bottom: 5px;
}

.club-info p {
    color: #666;
    font-style: italic;
}

.progress-info {
    margin-top: 20px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 25px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    border-radius: 15px;
}

#progress-text {
    font-weight: 600;
    color: #333;
    min-width: 80px;
}

.level-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    position: relative;
}

/* NPC 对话风格（疯狂动物城主题） */
.npc-dialogue {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.npc-dialogue-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.npc-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.npc-column-question {
    flex: 1.1;
}

.npc-column-answer {
    flex: 1;
    align-items: flex-end;
}

.npc-avatar-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.npc-avatar-block-answer {
    flex-direction: row-reverse;
}

.npc-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff 0%, #e5edff 45%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
    border: 3px solid rgba(102, 126, 234, 0.8);
}

.npc-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.npc-meta-answer {
    text-align: right;
    align-items: flex-end;
}

.npc-name {
    font-weight: 700;
    font-size: 1.2em;
    color: #4c51bf;
    white-space: nowrap;
}

.npc-role {
    font-size: 0.9em;
    color: #718096;
    white-space: nowrap;
}

.npc-bubble {
    align-self: flex-start;
    max-width: 80%;
    background: #f5f7ff;
    border-radius: 20px 20px 20px 6px;
    padding: 18px 20px 18px 22px;
    box-shadow: 0 6px 18px rgba(79, 114, 205, 0.18);
    position: relative;
}

.npc-bubble::before {
    content: '';
    position: absolute;
    left: 14px;
    bottom: -10px;
    border-width: 10px 10px 0 0;
    border-style: solid;
    border-color: #f5f7ff transparent transparent transparent;
}

/* 若后续需要右侧气泡，可复用该类 */
.npc-bubble-answer {
    align-self: flex-end;
    border-radius: 20px 20px 6px 20px;
}

.npc-bubble-answer::before {
    right: 14px;
    left: auto;
    border-width: 10px 0 0 10px;
    border-color: #f5f7ff transparent transparent #f5f7ff;
}

.npc-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #4c51bf;
    margin-bottom: 8px;
}

.npc-text {
    font-size: 1.05em;
    color: #4a5568;
    line-height: 1.7;
}

.player-choices {
    margin-top: 8px;
    max-width: 420px;
    width: 100%;
}

.player-label {
    font-size: 0.9em;
    color: #a0aec0;
    margin-bottom: 10px;
    text-align: right;
}

.level-container::before {
    content: '🌟';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    animation: rotate 3s linear infinite;
    opacity: 0.5;
}

.level-title {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.level-description {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: center;
}

.level-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    margin-left: auto;
}

.choice-btn {
    padding: 16px 18px;
    background: #edf2ff;
    border: 2px solid #c3dafe;
    border-radius: 18px 18px 6px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1em;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '💬';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.choice-btn:hover::before {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
}

.choice-btn:hover {
    background: #e0e7ff;
    border-color: #667eea;
    transform: translateX(4px) translateY(-1px);
}

.choice-btn.selected {
    background: linear-gradient(135deg, #e0e7ff 0%, #c3dafe 100%);
    border-color: #5a67d8;
}

.game-actions {
    text-align: center;
}

/* 结果界面 */
.result-content {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 50px;
}

.result-content h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 40px;
}

.mbti-result {
    margin: 40px 0;
    min-height: 200px;
}

.mbti-card {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 60px;
    border-radius: 15px;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.mbti-description {
    font-size: 1.2em;
    color: #555;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    background: #f5f7fa;
    padding: 30px;
    border-radius: 10px;
}

.loading {
    font-size: 1.2em;
    color: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.result-actions {
    margin-top: 40px;
}

/* Character Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Welcome Character */
.character-welcome {
    margin-bottom: 30px;
}

.welcome-character {
    font-size: 120px;
    animation: bounce 2s ease-in-out infinite, rotate 4s linear infinite;
    display: inline-block;
}

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

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Header Character */
.header-character {
    font-size: 60px;
    margin-bottom: 20px;
    animation: hop 2s ease-in-out infinite;
    display: inline-block;
}

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

/* Level Character */
.level-character {
    font-size: 80px;
    text-align: center;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite, wiggle 3s ease-in-out infinite;
    display: inline-block;
    width: 100%;
}

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

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Celebration Characters */
.celebration-characters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.celeb-char {
    font-size: 80px;
    animation: celebrate 1s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.2s);
}

.celeb-char.char-1 {
    --delay: 0;
    animation: celebrate 1s ease-in-out infinite, float 3s ease-in-out infinite;
}

.celeb-char.char-2 {
    --delay: 1;
    animation: celebrate 1s ease-in-out infinite, float 3s ease-in-out infinite;
    animation-delay: 0.2s;
}

.celeb-char.char-3 {
    --delay: 2;
    animation: celebrate 1s ease-in-out infinite, float 3s ease-in-out infinite;
    animation-delay: 0.4s;
}

.celeb-char.char-4 {
    --delay: 3;
    animation: celebrate 1s ease-in-out infinite, float 3s ease-in-out infinite;
    animation-delay: 0.6s;
}

@keyframes celebrate {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-20px) rotate(-10deg) scale(1.1);
    }
    50% {
        transform: translateY(-30px) rotate(0deg) scale(1.2);
    }
    75% {
        transform: translateY(-20px) rotate(10deg) scale(1.1);
    }
}

/* Character reactions on choice selection */
.choice-btn:hover {
    transform: translateX(5px) scale(1.02);
}

.choice-btn.selected {
    animation: celebrate 0.5s ease-in-out;
}

/* Animated background characters */
.club-card {
    position: relative;
    overflow: hidden;
}

.club-card::before {
    content: '🐾';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.3;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

.club-card:hover::before {
    animation: bounce 0.5s ease-in-out;
    opacity: 0.8;
}

/* Progress bar animation with character */
.progress-bar-container {
    position: relative;
}

.progress-bar-container::after {
    content: '🎯';
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    animation: targetMove 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes targetMove {
    0%, 100% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
    50% {
        transform: translateY(-50%) translateX(-10px) rotate(15deg);
    }
}

/* Loading animation with character */
.loading::before {
    content: '🔍';
    display: inline-block;
    margin-right: 10px;
    animation: search 1s ease-in-out infinite;
}

@keyframes search {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(15deg) scale(1.2);
    }
}

/* Success animation */
.btn-success:hover::before {
    content: '✨';
    display: inline-block;
    margin-right: 5px;
    animation: sparkle 0.5s ease-in-out;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
}

/* Character appears when level completes */
.level-container.completed .level-character {
    animation: successJump 0.8s ease-in-out;
}

@keyframes successJump {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-50px) scale(1.3) rotate(360deg);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .club-grid {
        grid-template-columns: 1fr;
    }
    
    .start-content h1 {
        font-size: 2em;
    }
    
    .level-container {
        padding: 20px;
    }
    
    .npc-dialogue-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .npc-column-answer {
        align-items: flex-start;
    }
    
    .npc-bubble,
    .level-choices {
        max-width: 100%;
    }
    
    .mbti-card {
        font-size: 1.5em;
        padding: 20px 40px;
    }
    
    .welcome-character {
        font-size: 80px;
    }
    
    .header-character {
        font-size: 40px;
    }
    
    .level-character {
        font-size: 60px;
    }
    
    .celeb-char {
        font-size: 50px;
    }
    
    .celebration-characters {
        gap: 15px;
    }
}
