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

body {
    background-image: 
        url('https://static.igem.wiki/teams/5607/game/cat.webp'),
        url('https://static.igem.wiki/teams/5607/game/back2.webp'),
        url('https://static.igem.wiki/teams/5607/game/back1.webp');
    background-size: 100vw auto, 100vw 100vh, 100vw 100vh;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center center, center center, center center;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    width: 62vw;
    height: 95vh;
    position: relative;
    /* background-color: #34495e; */
    border-radius: 10px;
    overflow: hidden;
}

.status-bar {
    font-size: 1.5vw;
    /* background-color: rgba(0, 0, 0, 0.5); */
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
}

.score {
    display: flex;
    gap: 20px;
}

.score span {
    padding: 7px 25px;
    font-weight: bold;
}

.score .coins {
    background-image: url('https://static.igem.wiki/teams/5607/game/icon2.webp');
    background-size: cover;
}

.score .health {
    background-image: url('https://static.igem.wiki/teams/5607/game/icon1.webp');
    background-size: cover;
}

.wave-info {
    background-image: url('https://static.igem.wiki/teams/5607/game/icon3.webp');
    background-size: cover;
    padding: 7px 25px;
    font-weight: bold;
}

.game-board {
    height: calc(100% - 250px);
    position: relative;
    background-image: url('https://static.igem.wiki/teams/5607/game/game.webp');
    background-size: cover;
}

.toolbar {
    height: 220px;
    /* background-color: rgba(0, 0, 0, 0.7); */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.damage-slot, .locked-slot, .special-attack-slot {
    width: 160px;
    height: 160px;
    background-color: #2c3e50;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 8px 5px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.locked-slot {
    background-color: #34495e;
    position: relative;
}

.locked-slot::after {
    content: "🔒";
    font-size: 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.special-attack-slot {
    background-color: #8e44ad;
    position: relative;
    overflow: hidden;
}

.special-attack-slot:hover {
    transform: scale(1.1);
    background-color: #9b59b6;
}

.special-attack-slot.cooldown {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #6c3483;
}

.special-attack-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.special-attack-slot .damage-value {
    font-size: 36px;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    margin: 8px 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.special-attack-slot .damage-cost {
    background-color: #f1c40f;
    color: #2c3e50;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    text-align: center;
    min-width: 30px;
}

.damage-title {
    font-size: 11px;
    color: #95a5a6;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 5px;
}

.damage-value {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
    margin: 8px 0;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.damage-cost {
    background-color: #f1c40f;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    min-width: 30px;
}

.building {
    position: absolute;
    width: 10vw;
    height: 7vw;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.building.defense {
    background: url('https://static.igem.wiki/teams/5607/game/food.webp') no-repeat center center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 8vw;
    height: 5vw;
    position: relative;

}

.building.mint {
    background: url('https://static.igem.wiki/teams/5607/game/build.webp') no-repeat  center center;
    background-size: cover;
    /* width: 5vw; */
    width: 2vw;
    height: 3vw;
}

.enemy {
    position: absolute;
    border-radius: 50%;
    transition: all 0.3s linear;
}

/* 怪物图片样式 */
.enemy.normal {
    background: url('https://static.igem.wiki/teams/5607/game/enemy2.webp') no-repeat center center;
    background-size: cover;
}
.enemy.elite {
    background: url('https://static.igem.wiki/teams/5607/game/enemy1.webp') no-repeat center center;
    background-size: cover;
}

.enemy.boss {
    width: 45px;
    height: 45px;
    background-color: #e74c3c;
    border: 2px solid #c0392b;
}

.enemy.fast {
    background-color: #3498db;
    border: 2px solid #2980b9;
}

.bullet {
    position: absolute;
    pointer-events: none;
}

.coin-indicator {
    position: absolute;
    color: #f1c40f;
    font-weight: bold;
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

.health-bar {
    position: absolute;
    left: 0;
    top: -18px;
    width: 100%;
    height: 4px;
    background: #555;
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
}

.health-bar-inner {
    height: 100%;
    background: #e74c3c;
    border-radius: 2px;
    transition: width 0.2s;
}

.enemy .health-bar {
    top: -6px;
    height: 3px;
    background: rgba(0, 0, 0, 0.5);
}

.enemy .health-bar-inner {
    background: #e74c3c;
}

.enemy.elite .health-bar-inner {
    background: #e67e22;
}

.enemy.boss .health-bar {
    top: -8px;
    height: 4px;
}

.enemy.boss .health-bar-inner {
    background: #c0392b;
}

/* 结算界面 */
.overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,183,77,0.98) 60%, rgba(255,140,0,0.92) 100%);
    box-shadow: 0 0 40px 10px rgba(255,140,0,0.18) inset;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: overlay-pop 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}
.overlay h1 {
    color: #fff3e0;
    margin-bottom: 20px;
    font-size: 2.8rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 12px #ff9800, 0 0 8px #fff2;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
}
.overlay .summary {
    color: #fffde7;
    font-size: 1.3rem;
    margin-bottom: 30px;
    background: rgba(255,152,0,0.18);
    border-radius: 10px;
    padding: 16px 32px;
    box-shadow: 0 2px 8px #ff980033;
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
}
.overlay button {
    padding: 12px 38px;
    font-size: 1.3rem;
    background: linear-gradient(90deg, #ffb74d 60%, #ff9800 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 16px #ff980040, 0 1px 0 #fff4 inset;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    outline: none;
}
.overlay button:hover {
    background: linear-gradient(90deg, #ff9800 60%, #ffb74d 100%);
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 32px #ff980080, 0 2px 0 #fff6 inset;
}
@keyframes overlay-pop {
    0% { transform: scale(0.7) translateY(40px); opacity: 0; }
    80% { transform: scale(1.05) translateY(-8px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 冰冻效果 */
.frozen {
    animation: frozen 0.5s infinite;
}

@keyframes frozen {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(180deg); }
    100% { filter: hue-rotate(360deg); }
}

/* 爆炸效果 */
.explosion {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,0,0,0) 70%);
    animation: explode 0.5s forwards;
    pointer-events: none;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.enemy.bombed {
    animation: bombed-flash 0.5s;
}

@keyframes bombed-flash {
    0% { box-shadow: 0 0 20px 10px #ff0000, 0 0 0 #fff; filter: brightness(2); }
    50% { box-shadow: 0 0 40px 20px #ff0000, 0 0 0 #fff; filter: brightness(2.5); }
    100% { box-shadow: none; filter: none; }
}

.special-attack-slot.locked {
    background-color: #34495e;
    cursor: not-allowed;
    opacity: 0.7;
}

.special-attack-slot.locked::after {
    content: "🔒";
    font-size: 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.special-attack-slot.locked .damage-cost {
    background-color: #95a5a6;
    color: #2c3e50;
}

/* 治疗效果 */
.heal-effect {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(46,204,113,0.8) 0%, rgba(46,204,113,0) 70%);
    animation: heal-pulse 1s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes heal-pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.heal-text {
    position: absolute;
    color: #2ecc71;
    font-weight: bold;
    font-size: 20px;
    animation: heal-float 1s ease-out forwards;
    pointer-events: none;
    z-index: 2;
}

@keyframes heal-float {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

.freeze-area {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 255, 255, 0.1), rgba(0, 255, 255, 0.1));
    pointer-events: none;
    animation: freeze-pulse 1s infinite;
    z-index: 1;
}

@keyframes freeze-pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.5; }
    100% { opacity: 0.3; }
}

.enemy.frozen {
    filter: hue-rotate(180deg) brightness(1.5);
    animation: frozen-shake 0.5s infinite;
}

@keyframes frozen-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}


#damageUpgrade {
    background: url('https://static.igem.wiki/teams/5607/game/attack.webp') no-repeat center center !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}

#bulletCountUpgrade {
    background: url('https://static.igem.wiki/teams/5607/game/shoot.webp') no-repeat center center !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}

#mintSlot {
    background: url('https://static.igem.wiki/teams/5607/game/money.webp') no-repeat center center !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}

#freezeAttack {
    background: url('https://static.igem.wiki/teams/5607/game/froze.webp') no-repeat center center !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}

#healAttack {
    background: url('https://static.igem.wiki/teams/5607/game/cure.webp') no-repeat center center !important;
    background-size: cover !important;
    position: relative;
    overflow: hidden;
}

#bulletCountUpgrade .damage-value,
#mintSlot .damage-value,
#freezeAttack .damage-value,
#healAttack .damage-value {
    opacity: 0;
}

.logo {
    position: absolute;
    top: -20px;
    left: 20px;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logo-breath 3.5s ease-in-out infinite;
    transition: transform 0.3s;
}
.logo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 0 16px 2px rgba(0,0,0,0.15);
}
.logo:hover {
    transform: scale(1.15) rotate(-8deg);
}
@keyframes logo-breath {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
} 

.building.defense .health-bar {
    top: -2vw !important;
} 

/* 主基地受伤抖动+流汗效果 */
.base-hurt-effect {
    animation: baseHurtShake 0.6s;
    position: relative;
}
.sweat-emoji {
    position: absolute;
    right: -18px;
    top: -18px;
    font-size: 2.2rem;
    opacity: 0.85;
    animation: sweatDrop 0.6s;
    pointer-events: none;
    z-index: 10;
}
@keyframes baseHurtShake {
    0% { transform: translate(0,0) scale(1); }
    10% { transform: translate(-1.5px,0.5px) scale(1.01);}
    20% { transform: translate(1.5px,-0.5px) scale(0.995);}
    30% { transform: translate(-1px,0.5px) scale(1.005);}
    40% { transform: translate(1px,-0.5px) scale(0.995);}
    50% { transform: translate(-0.5px,0.5px) scale(1.005);}
    60% { transform: translate(0.5px,-0.5px) scale(0.995);}
    70% { transform: translate(-0.5px,0.5px) scale(1.005);}
    80% { transform: translate(0.5px,-0.5px) scale(1);}
    100% { transform: translate(0,0) scale(1);}
}
@keyframes sweatDrop {
    0% { opacity: 0.85; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(10px) scale(1.1); }
    100% { opacity: 0; transform: translateY(24px) scale(0.8); }
} 

.enemy-melt {
    animation: enemyMelt 0.6s forwards;
    filter: blur(1px) brightness(1.2);
    z-index: 10;
    transform-origin: bottom center;
}
@keyframes enemyMelt {
    0% {
        opacity: 1;
        transform: scaleY(1) scaleX(1) translateY(0);
        filter: blur(1px) brightness(1.2);
    }
    40% {
        opacity: 0.8;
        transform: scaleY(0.7) scaleX(1.05) translateY(20px);
        filter: blur(2px) brightness(1.1);
    }
    70% {
        opacity: 0.5;
        transform: scaleY(0.3) scaleX(1.2) translateY(60px);
        filter: blur(4px) brightness(0.9);
    }
    90% {
        opacity: 0.2;
        transform: scaleY(0.12) scaleX(1.35) translateY(90px);
        filter: blur(8px) brightness(0.7);
    }
    100% {
        opacity: 0;
        transform: scaleY(0.05) scaleX(1.5) translateY(120px);
        filter: blur(12px) brightness(0.5);
    }
} 

.jiangnan-logo {
    position: absolute;
    top: 2px;
    right: 20px;
    left: auto;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logo-breath 3.5s ease-in-out infinite;
    transition: transform 0.3s;
}
.jiangnan-logo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 0 16px 2px rgba(0,0,0,0.15);
}
.jiangnan-logo:hover {
    transform: scale(1.15) rotate(8deg);
} 

.role-intro-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: #fff3e0;
  color: #8e44ad;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px #8e44ad33;
  transition: background 0.2s;
}
.role-intro-btn:hover {
  background: #ffe0b2;
}

.role-intro-modal {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.role-intro-content {
  background: #fff;
  border-radius: 18px;
  padding: 32px 40px;
  min-width: 350px;
  max-width: 90vw;
  box-shadow: 0 8px 32px #8e44ad33;
  position: relative;
}
.close-btn {
  position: absolute; top: 12px; right: 18px;
  font-size: 2rem; color: #8e44ad; cursor: pointer;
}
.role-cards {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: center;
}
.role-card {
  background: #f8f4ff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #8e44ad22;
  padding: 18px 16px;
  width: 220px;
  text-align: center;
}
.role-card img {
  width: 80px; height: 80px; object-fit: contain; margin-bottom: 10px;
}
.role-card h3 { color: #8e44ad; margin-bottom: 8px; }
.role-card p { font-size: 1rem; margin-bottom: 6px; }
.role-card small { color: #888; font-size: 0.9rem; } 

