/* KPop Zombie Killers - Main Stylesheet */

@font-face {
    font-family: 'Fredoka One';
    src: url('../fonts/fredoka.ttf') format('truetype');
}

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

body {
    font-family: 'Fredoka One', cursive;
    background: #1a1a2e;
    color: white;
    overflow: hidden;
    cursor: default;
}

body.game-active {
    cursor: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

/* Tutorial Popup */
#tutorial-popup {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 300px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #ff69b4;
    border-radius: 10px;
    padding: 20px;
    color: white;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    display: none;
}

#tutorial-popup.active {
    display: block;
    opacity: 1;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

#tutorial-popup h3 {
    color: #ff69b4;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

#tutorial-popup ul {
    list-style: none;
}

#tutorial-popup li {
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

#tutorial-popup li strong {
    color: #ffd700;
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.loading-content {
    text-align: center;
}

.loading-logo {
    max-width: 80%;
    width: 600px;
    height: auto;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.loading-content h1 {
    font-size: 4rem;
    color: #ff69b4;
    text-shadow: 0 0 20px #ff69b4;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 400px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff69b4, #ff1493);
    transition: width 0.3s;
}

#loading-text {
    margin-top: 1rem;
    color: #888;
}

/* Menu Screen */
#menu-screen {
    background: #000;
}

.menu-background {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: url('../images/menu/menu-day.png') center/cover;
    opacity: 1;
    transition: transform 0.05s linear;
}

.menu-logo-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.menu-logo {
    max-width: 500px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.menu-options-container {
    position: absolute;
    bottom: 50px;
    left: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.menu-option-img {
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, opacity 0.2s;
    filter: grayscale(100%);
    opacity: 0.8;
    height: 90px; /* Match Python version approx height */
    width: auto;
    object-fit: contain;
    object-position: left;
}

.menu-option-img:hover {
    transform: scale(1.05);
    filter: grayscale(0%);
    opacity: 1;
}

.version {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 10;
    text-shadow: 1px 1px 2px black;
}

/* Character Select */
#character-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 2rem;
}

#character-screen .menu-background{
    opacity: 0.3;
    background-image: url('../images/kpop-slime.png');
}

#character-screen h2 {
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 2rem;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
}

.character-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.character-card:hover {
    transform: translateY(-10px);
    border-color: #ff69b4;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
}

.character-card.selected {
    border-color: #ff69b4;
    background: rgba(255, 105, 180, 0.2);
}

.character-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.character-card.locked:hover {
    transform: none;
    border-color: #666;
}

.character-avatar {
    width: 150px;
    height: 150px;
    background: #333;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background-size: cover;
    background-position: center;
}

.character-card h3 {
    color: #ff69b4;
    margin-bottom: 0.5rem;
}

.character-card .weapon {
    color: #ffd700;
}

.character-card .ability {
    color: #00ff88;
    font-size: 0.9rem;
}

.character-card .unlock-req {
    color: #ff4444;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.back-btn {
    margin-top: 2rem;
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    background: #444;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #666;
}

/* Boost Card Select */
#card-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

#card-screen h2 {
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 2rem;
}

.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.carousel-viewport {
    width: 100%;
    overflow: hidden;
    padding: 40px 0;
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.card-grid {
    display: flex;
    gap: 40px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: max-content;
    padding: 0 50%; /* Helps with centering logic */
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.boost-card {
    width: 220px;
    height: 300px;
    background: linear-gradient(135deg, #2a2a4e, #1a1a3e);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 3px solid #444;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.5;
    transform: scale(0.85);
}

.boost-card.active {
    opacity: 1;
    transform: scale(1.1);
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    z-index: 5;
}

.boost-card:hover {
    border-color: #ff69b4;
}

.boost-card.selected {
    /* Handled by .active now, but keeping for compatibility if needed */
    border-color: #ffd700;
}

.boost-card h3 {
    color: #ffd700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.boost-card p {
    color: #aaa;
}

/* Phase Transition */
#transition-screen {
    background: rgba(0, 0, 0, 0.95);
}

.transition-content {
    text-align: center;
}

#transition-title {
    font-size: 5rem;
    color: #8b5cf6;
    text-shadow: 0 0 30px #8b5cf6;
    margin-bottom: 1rem;
}

#transition-subtitle {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
}

#transition-message {
    font-size: 1.5rem;
    color: #888;
    margin-bottom: 1rem;
}

#transition-warning {
    font-size: 1.3rem;
    color: #ff6666;
}

.get-ready {
    font-size: 1.2rem;
    color: #ff69b4;
    margin-top: 2rem;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Game Screen */
#game-screen {
    background: #1a1a2e;
}

#game-canvas {
    display: block;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-center {
    align-items: center;
}

.hud-right {
    align-items: flex-end;
}

.health-bar-container {
    width: 235px;
    height: 75px;
    position: relative;
}

.health-bar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/ui/ui-health-bar.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.health-bar-fill-area {
    position: absolute;
    top: 22px;
    left: 57px;
    width: 153px;
    height: 23px;
    z-index: 1;
}

.health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.2s;
}

.health-text {
    position: absolute;
    top: 30px;
    left: 130px;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px black;
    z-index: 3;
}

.special-bar-container {
    width: 218px;
    height: 68px;
    position: relative;
    margin-bottom: 5px;
}

.special-bar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/ui/ui-special-bar.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.special-bar-fill-area {
    position: absolute;
    top: 24px;
    left: 60px;
    width: 140px;
    height: 24px;
    z-index: 1;
}

.special-fill {
    width: 100%;
    height: 100%;
    background: #00ff64;
    transition: width 0.2s;
}

.ammo-display {
    font-size: 1.5rem;
    color: #ffd700;
    margin-right: 10px;
}

.wave-info {
    text-align: center;
}

#wave-number {
    font-size: 1.8rem;
    color: #ff69b4;
    display: block;
}

#phase-timer {
    font-size: 2.5rem;
    color: white;
}

.stats-display {
    text-align: right;
}

#cash-display {
    font-size: 1.5rem;
    color: #00ff88;
    display: block;
}

#score-display {
    font-size: 1.2rem;
    color: #888;
}

/* HUD Avatar */
#hud-avatar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 128px;
    height: 128px;
    z-index: 10;
}

#hud-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
}

#hud-avatar-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hud-left {
    margin-left: 140px; /* Make room for avatar */
}

/* Pause Menu */
.pause-content, .options-content, .gameover-content {
    text-align: center;
    background: rgba(30, 30, 50, 0.95);
    padding: 3rem;
    border-radius: 20px;
    border: 3px solid #ff69b4;
}

.pause-content h2, .options-content h2 {
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 2rem;
}

.pause-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Options */
.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.option-row label {
    font-size: 1.2rem;
}

.option-row input[type="range"] {
    width: 200px;
    cursor: pointer;
}

.toggle-btn {
    padding: 0.5rem 1.5rem;
    font-family: 'Fredoka One', cursive;
    background: #444;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
}

.toggle-btn.on {
    background: #00ff88;
    color: black;
}

/* Game Over */
.gameover-image {
    max-width: 100%;
    width: 500px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.gameover-content h1 {
    font-size: 4rem;
    color: #ff4444;
    margin-bottom: 2rem;
}

.final-stats {
    margin-bottom: 2rem;
}

.final-stats p {
    font-size: 1.3rem;
    margin: 0.5rem 0;
    color: #aaa;
}

.final-stats span {
    color: #ffd700;
}

/* Gallery */
#gallery-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 2rem;
}

#gallery-screen h2 {
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 1rem;
}

.gallery-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.8rem 2rem;
    font-family: 'Fredoka One', cursive;
    background: #333;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #ff69b4;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.gallery-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.gallery-item.locked {
    opacity: 0.4;
}

.gallery-item h4 {
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.gallery-item p {
    color: #888;
    font-size: 0.9rem;
}

/* Gallery Extensions */
.gallery-container {
    width: 100%;
    max-width: 1200px;
    height: 60vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
}

/* Album Gallery */
#album-screen .menu-background{
    opacity: 0.3;
}
.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.song-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.song-item.locked {
    opacity: 0.5;
}

.song-info h4 {
    color: #ff69b4;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.song-info p {
    color: #aaa;
    font-size: 0.9rem;
}

.play-btn {
    padding: 8px 20px;
    background: #00ff88;
    border: none;
    border-radius: 20px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-btn:hover {
    transform: scale(1.05);
}

.lock-icon {
    font-size: 1.5rem;
}

/* Girls Gallery */
.gallery-carousel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.char-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.char-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    transition: all 0.3s;
}

.char-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.char-btn.active {
    background: #ff69b4;
    border-color: white;
}

.variants-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

.variant-card {
    width: 200px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.variant-card:hover {
    transform: translateY(-5px);
}

.variant-card.locked .variant-img {
    filter: grayscale(100%) brightness(0.5);
}

.variant-img {
    width: 100%;
    height: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 15px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
}

.variant-img.clickable {
    cursor: pointer;
    transition: transform 0.2s;
}

.variant-img.clickable:hover {
    transform: scale(1.05);
}

.variant-img.locked-placeholder {
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
}

.variant-img .lock-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.variant-card h4 {
    color: #fff;
    margin-bottom: 10px;
}

.variant-card .status {
    color: #00ff88;
    font-size: 0.9rem;
}

.buy-btn {
    width: 100%;
    padding: 8px;
    background: #ffd700;
    border: none;
    border-radius: 5px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
}

.buy-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

.gallery-item .desc {
    margin-top: 5px;
    font-style: italic;
    color: #aaa;
}

.gallery-item .hint {
    margin-top: 5px;
    color: #ff4444;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
}

/* Button Row */
.button-row {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

/* Image Modal */
#image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.712);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#image-modal.active {
    display: flex;
}

#modal-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;    
}

#modal-caption {
    margin-top: 20px;
    font-size: 1.5rem;
    color: #fff;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.2);
    color: #ff69b4;
}

/* Dialog Screen */
#dialog-screen {
    background: rgba(0, 0, 0, 0.4);
    /* display: flex; Removed to allow .screen class to handle hiding */
    padding-bottom: 20px; /* Reduced bottom padding */
}

#dialog-screen.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dialog-box {
    width: 95%; /* Use almost full width */
    max-width: none; /* Remove max-width constraint */
    height: 200px;
    background: rgba(20, 20, 40, 0.95);
    border: 2px solid #ff69b4;
    border-radius: 15px;
    display: flex;
    padding: 20px;
    gap: 20px;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin: 0 20px; /* Add side margins */
}

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

.dialog-avatar-container {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    border: 2px solid #444;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

#dialog-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dialog-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

#dialog-speaker {
    color: #ff69b4;
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#dialog-text {
    color: white;
    font-size: 1.2rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.next-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    background: none;
    border: none;
    color: #ff69b4;
    font-size: 1.5rem;
    cursor: pointer;
    animation: bounce 1s infinite;
}

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

/* Global Stats (Menu) */
#global-stats-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    display: none; /* Hidden by default, shown by JS on menu screens */
    gap: 20px;
    z-index: 1000;
    pointer-events: none;
}

.stat-item {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 1.2rem;
}

#global-cash { color: #00ff88; }
#global-fans { color: #ff69b4; }
#global-kills { color: #ff4444; }

/* Game Stats (Bottom Left) */
#game-stats-bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
    text-shadow: 2px 2px 0 #000;
}

.stat-row {
    font-size: 1.2rem;
    display: flex;
    gap: 10px;
}

.stat-label {
    color: #aaa;
}

#run-cash { color: #00ff88; }
#run-fans { color: #ff69b4; }
#run-kills { color: #ff4444; }

/* Gallery Menu */
.menu-option-text {
    font-size: 2rem;
    font-family: 'Fredoka One', cursive;
    color: white;
    cursor: pointer;
    padding: 10px 0;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #ff69b4;
    transition: transform 0.2s;
    margin-left: 10px;
}

.menu-option-text:hover {
    transform: scale(1.1);
    color: #ff69b4;
}

/* Album Gallery (Grid) */
.album-grid-container {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);    
    width: 90%;
    max-width: 1200px;
    height: calc(100% - 250px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px;
    overflow-y: auto;
    z-index: 10;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ff69b4 rgba(0,0,0,0.3);
}

.album-grid-container::-webkit-scrollbar {
    width: 8px;
}

.album-grid-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.album-grid-container::-webkit-scrollbar-thumb {
    background-color: #ff69b4;
    border-radius: 4px;
}

.album-grid-item {
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff69b4;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.6);
    background: rgba(0, 0, 0, 0.8);
}

.album-grid-item.locked {
    filter: grayscale(1);
    opacity: 0.7;
    pointer-events: none;
}

.album-cassette-img {
    width: auto;
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}
.album-cassette-img img{
    width:100%;
    height:auto;
}

.album-info {
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.album-title {
    color: #fff;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 0 #ff69b4;
}

.album-play-btn {
    background: #ff69b4;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

.album-play-btn:hover {
    transform: scale(1.1);
    background: #ff1493;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.8);
}

.album-play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent white;
    margin-left: 4px; /* Optical centering */
}

.album-play-btn.playing {
    background: #00ff00;
    animation: pulse-green 2s infinite;
}

.album-play-btn.playing::after {
    width: 16px;
    height: 16px;
    border: none;
    background: white;
    margin-left: 0;
    /* Stop icon shape */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.album-locked-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
    color: #333;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(255,255,255,0.8);
    padding: 5px;
    border-radius: 4px;
    pointer-events: none;
}

.cassette-lock {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-radius: 10px;
}

.now-playing-info {
    position: absolute;
    bottom: 100px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

#song-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
}

#song-status {
    color: #aaa;
    margin-bottom: 20px;
}

.action-btn {
    padding: 10px 30px;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    background: #ff69b4;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
    background: #ff1493;
}

/* Boost Gallery (Grid) */
#boost-gallery-screen .menu-background{
    opacity: 0.3;
}

.boost-grid-container {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: calc(100% - 250px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px;
    overflow-y: auto;
    z-index: 10;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ff69b4 rgba(0,0,0,0.3);
}

.boost-grid-container::-webkit-scrollbar {
    width: 8px;
}

.boost-grid-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.boost-grid-container::-webkit-scrollbar-thumb {
    background-color: #ff69b4;
    border-radius: 4px;
}

.boost-grid-item {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid #ff69b4;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(5px);
}

.boost-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.6);
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    z-index: 5;
}

.boost-grid-item.locked {
    filter: grayscale(1);
    opacity: 0.7;
    border-color: #666;
}

.boost-card-img-container {
    width: 100%;
    height: 180px; /* Fixed height for image area */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
}

.boost-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    text-shadow: 0 0 10px black;
}

.boost-info {
    text-align: center;
    width: 100%;
}

.boost-name {
    color: #fff;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 #ff69b4;
    line-height: 1.2;
}

.boost-effect {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.boost-desc {
    color: #ddd;
    font-size: 0.8rem;
    font-style: italic;
    line-height: 1.3;
}

.boost-locked-text {
    color: #aaa;
    font-weight: bold;
    margin-bottom: 5px;
}

.boost-hint {
    color: #ff69b4;
    font-size: 0.8rem;
}

.gallery-item .hint {
    color: #888;
    font-style: italic;
}

/* Girls Selection Grid */
.girls-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 150px 50px 50px 50px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    justify-items: center;
    position: relative;
    z-index: 10;
}

.character-selection-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    border: 2px solid transparent;
    width: 100%;
    max-width: 300px;
    position: relative;
    z-index: 11;
}

.character-selection-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 105, 180, 0.2);
    border-color: #ff69b4;
}

.character-selection-img {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: top center;
    border-radius: 10px;
    margin-bottom: 15px;
    pointer-events: none; /* Let clicks pass through to card */
}

.character-selection-card h3 {
    color: #ff69b4;
    font-size: 1.5rem;
    text-transform: uppercase;
    pointer-events: none; /* Let clicks pass through to card */
}

/* Girls Variants Grid */
.girls-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding: 150px 50px 50px 50px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 10;
}

.girls-variants-grid::-webkit-scrollbar {
    display: none;
}

/* Dark Overlay for Girls Screens */
#girls-selection-screen .menu-background,
#girls-variants-screen .menu-background {
    opacity: 0.3;
}

/* Ensure back button is visible */
#girls-selection-screen .menu-options-container,
#girls-variants-screen .menu-options-container {
    z-index: 100;
}

/* New Character Selection Screen */
.char-mini-selector {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 20;
}

.mini-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: cover;
    background-position: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.mini-avatar:hover {
    transform: scale(1.1);
    border-color: #fff;
}

.mini-avatar.selected {
    width: 100px;
    height: 100px;
    border-color: #ff69b4;
    box-shadow: 0 0 20px #ff69b4, 0 0 40px rgba(255, 105, 180, 0.5);
    transform: translateY(10px) scale(1.1);
}

.char-main-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 5;
}

.char-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 105, 180, 0.2) 0%, rgba(0,0,0,0.8) 80%);
    z-index: 1;
}

.char-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float-particle 10s infinite linear;
}

.p1 { width: 10px; height: 10px; top: 20%; left: 20%; animation-duration: 15s; }
.p2 { width: 15px; height: 15px; top: 80%; left: 80%; animation-duration: 20s; animation-delay: -5s; }
.p3 { width: 8px; height: 8px; top: 40%; left: 70%; animation-duration: 12s; animation-delay: -2s; }
.p4 { width: 12px; height: 12px; top: 70%; left: 30%; animation-duration: 18s; animation-delay: -8s; }
.p5 { width: 6px; height: 6px; top: 10%; left: 50%; animation-duration: 25s; animation-delay: -10s; }

@keyframes float-particle {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-100px) translateX(50px); opacity: 0; }
}

.char-main-img {
    height: 85%;
    width: auto;
    object-fit: contain;
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.5));
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.char-main-img.confirmed {
    left: 25%;
    transform: translateX(-50%) scale(1.1);
}

.char-main-img.locked {
    filter: grayscale(1) brightness(0.5) drop-shadow(0 0 20px rgba(0,0,0,0.5));
}

.char-unlock-msg {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    color: #ff4444;
    text-shadow: 0 0 10px black, 0 0 20px black;
    z-index: 15;
    text-align: center;
    pointer-events: none;
    display: none;
}

.char-unlock-msg.visible {
    display: block;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.char-details-panel {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff69b4;
    border-radius: 20px;
    padding: 30px;
    color: white;
    opacity: 0;
    transition: all 0.5s ease 0.3s; /* Delay to wait for image move */
    z-index: 15;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.char-details-logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.char-details-panel.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.char-stat-block {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

.char-desc-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    margin-top: 20px;
    font-style: italic;
}

.char-logo-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    pointer-events: none;
    transition: opacity 0.5s;
}

.char-logo-container.hidden {
    opacity: 0;
}

.char-logo-container img {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.char-nav-container {
    position: absolute;
    bottom: 30px;
    width: 100%;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
    pointer-events: none; /* Allow clicks through container */
}

.char-nav-container .menu-option-img {
    width: auto;
    cursor: pointer;
    pointer-events: auto; /* Re-enable clicks on buttons */
    transition: transform 0.2s;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

.char-nav-container .menu-option-img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 5px 15px rgba(255, 105, 180, 0.6));
}

.char-nav-container .menu-option-img.disabled {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
    pointer-events: none;
}

/* Character Background Object */
.char-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

.char-bg-obj {
    max-width: 80%;
    max-height: 80%;
    opacity: 0.4;
    filter: blur(20px);
    transform: scale(1.2);
    transition: all 0.5s ease;
    animation: float-bg 8s infinite ease-in-out;
}

@keyframes float-bg {
    0%, 100% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
}

/* Weapon Stats Bars */
.weapon-stats {
    width: 100%;
    margin-bottom: 20px;
}

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

.stat-value-highlight {
    color: #ffd700;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.stat-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bar-label {
    width: 80px;
    font-size: 0.8rem;
    color: #ccc;
    text-align: right;
    margin-right: 10px;
}

.bar-track {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 5px currentColor;
}

.bar-fill.damage { background: #ff4444; color: #ff4444; }
.bar-fill.range { background: #44ff44; color: #44ff44; }
.bar-fill.firerate { background: #ffff44; color: #ffff44; }
.bar-fill.accuracy { background: #44ffff; color: #44ffff; }
.bar-fill.health { background: #ff69b4; color: #ff69b4; }
.bar-fill.speed { background: #ffd700; color: #ffd700; }

@media (max-width: 768px) {
    #hud {
        flex-direction: column;
        padding: 10px 15px;
    }
    
    .health-bar {
        width: 150px;
    }
}

/* Weapon Shop */
#weapon-shop-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 2rem;
}

#weapon-shop-screen .menu-background {
    opacity: 0.3;
}

.screen-title {
    font-size: 3rem;
    color: #ff69b4;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    text-align: center;
}

.weapon-shop-container {
    /* Removed flex container to allow absolute positioning */
    width: 100%;
    height: 100%;
}

.weapon-shop-tabs {
    position: absolute;
    bottom: 50px;
    left: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    width: auto;
    overflow-y: visible;
}

.weapon-tab-img {
    height: 90px;
    width: auto;
    object-fit: contain;
    object-position: left;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, opacity 0.2s;
    filter: grayscale(100%);
    opacity: 0.8;
}

.weapon-tab-img:hover {
    transform: scale(1.05);
    filter: grayscale(0%);
    opacity: 1;
}

.weapon-tab-img.active {
    filter: grayscale(0%) drop-shadow(0 0 5px #ffd700);
    opacity: 1;
    transform: scale(1.05);
}

.weapon-tab-img.locked {
    filter: grayscale(100%) brightness(0.3);
    opacity: 0.5;
    cursor: not-allowed;
}

.weapon-tab-img.locked:hover {
    transform: none;
}

.weapon-shop-upgrades {
    position: absolute;
    top: 100px;
    right: 50px;
    bottom: 50px;
    width: 600px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ff69b4 rgba(0,0,0,0.3);
}

.weapon-shop-upgrades::-webkit-scrollbar {
    width: 8px;
}

.weapon-shop-upgrades::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.weapon-shop-upgrades::-webkit-scrollbar-thumb {
    background-color: #ff69b4;
    border-radius: 4px;
}

.upgrade-card {
    background: rgba(30, 30, 40, 0.9);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    border: 2px solid #444;
    transition: all 0.2s;
    min-height: 120px;
}

.upgrade-card:hover {
    border-color: #ff69b4;
    transform: translateX(5px);
    background: rgba(40, 40, 55, 0.95);
}

.upgrade-header {
    width: 200px;
    flex-shrink: 0;
}

.upgrade-header h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.upgrade-tier {
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: bold;
}

.upgrade-progress-bg {
    flex-grow: 1;
    height: 20px;
    background: #222;
    border-radius: 10px;
    margin: 0 30px;
    position: relative;
    border: 2px solid #555;
    overflow: hidden;
}

.upgrade-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.upgrade-buy-btn {
    width: 140px;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid white;
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #00ff88;
    color: #1a1a2e;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.upgrade-buy-btn .cost {
    font-size: 0.9rem;
    opacity: 0.9;
}

.upgrade-buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.upgrade-buy-btn.maxed {
    background: #555;
    color: #ffd700;
    border-color: #ffd700;
    cursor: default;
}

.upgrade-buy-btn.disabled {
    background: #ff4444;
    color: white;
    opacity: 0.7;
    cursor: not-allowed;
    border-color: #ffaaaa;
}
