/* Brainrot Fighters v5.0 - Complete CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: #000;
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
    transition: background 0.5s ease;
}

/* Custom Backgrounds */
body.bg-space {
    background: linear-gradient(135deg, #0a0a2a 0%, #000033 50%, #0a002a 100%);
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 4px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 4px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
}

body.bg-neon {
    background: linear-gradient(135deg, #0a002a 0%, #330066 50%, #6600cc 100%);
    background-image: 
        linear-gradient(90deg, transparent 79px, #ff00ff 79px, #ff00ff 81px, transparent 81px),
        linear-gradient(#00ffff 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px;
}

body.bg-matrix {
    background: #000;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

body.bg-fire {
    background: linear-gradient(135deg, #330000 0%, #cc0000 50%, #ff6600 100%);
    background-image: 
        radial-gradient(ellipse at center, rgba(255,100,0,0.3) 0%, rgba(255,50,0,0.1) 70%, rgba(255,0,0,0) 100%);
}

body.bg-ice {
    background: linear-gradient(135deg, #001a33 0%, #0066cc 50%, #00ccff 100%);
    background-image: 
        radial-gradient(ellipse at center, rgba(0,200,255,0.2) 0%, rgba(0,100,255,0.1) 70%, rgba(0,50,255,0) 100%);
}

/* Screen Base Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    z-index: 10;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Device Detection & Loading Screens */
#deviceDetection, #loading {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
}

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

.pixel-logo {
    font-size: 4rem;
    color: #ff0033;
    text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033;
    margin-bottom: 2rem;
    letter-spacing: 5px;
    animation: logoPulse 2s infinite;
}

@keyframes logoPulse {
    0%, 100% { text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033; }
    50% { text-shadow: 0 0 30px #ff0033, 0 0 60px #ff0033, 0 0 80px #ff0033; }
}

.device-type {
    font-size: 2rem;
    color: #ffcc00;
    margin: 2rem 0;
    text-shadow: 0 0 10px #ff0033;
}

.device-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.device-btn {
    font-size: 1.2rem;
    color: #fff;
    background: rgba(255, 0, 51, 0.3);
    border: 2px solid #ff0033;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 5px;
}

.device-btn:hover {
    background: rgba(255, 0, 51, 0.7);
    transform: scale(1.05);
}

.loading-bar-container {
    width: 400px;
    height: 20px;
    background: #222244;
    border: 2px solid #ff0033;
    border-radius: 10px;
    overflow: hidden;
    margin: 2rem auto;
}

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

.loading-text {
    font-size: 1.2rem;
    color: #ffcc00;
    margin-bottom: 1rem;
}

.tip {
    font-size: 1rem;
    color: #aaa;
    font-style: italic;
    margin-top: 1rem;
}

/* Main Menu */
#mainMenu {
    background: transparent;
}

.menu-content {
    text-align: center;
    z-index: 2;
}

.main-title {
    font-size: 4rem;
    color: #ff0033;
    text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033;
    margin-bottom: 3rem;
    letter-spacing: 8px;
    animation: titleGlow 3s infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033; }
    50% { text-shadow: 0 0 30px #ff0033, 0 0 60px #ff0033, 0 0 80px #ffcc00; }
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
    align-items: center;
}

.menu-btn {
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255, 0, 51, 0.3);
    border: 2px solid #ff0033;
    padding: 12px 30px;
    cursor: pointer;
    text-align: center;
    width: 300px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 5px;
}

.menu-btn:hover {
    background: rgba(255, 0, 51, 0.7);
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff0033;
}

.menu-footer {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
}

.high-score, .version {
    color: #ffcc00;
    font-size: 1rem;
    text-shadow: 0 0 5px #ff0033;
}

/* Background Selection Screen */
#backgroundScreen {
    background: transparent;
}

.background-content {
    text-align: center;
    width: 90%;
    max-width: 900px;
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.bg-option {
    background: rgba(255, 0, 51, 0.1);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bg-option:hover {
    border-color: #ffcc00;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.3);
}

.bg-preview {
    width: 100%;
    height: 120px;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    border: 2px solid #222;
}

.default-bg { 
    background: #000; 
}

.space-bg { 
    background: linear-gradient(135deg, #0a0a2a 0%, #000033 50%, #0a002a 100%);
    background-image: 
        radial-gradient(white, rgba(255,255,255,.3) 1px, transparent 2px);
    background-size: 100px 100px;
}

.neon-bg { 
    background: linear-gradient(135deg, #0a002a 0%, #330066 50%, #6600cc 100%);
}

.matrix-bg { 
    background: #000;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.2) 1px, transparent 1px);
    background-size: 10px 10px;
}

.fire-bg { 
    background: linear-gradient(135deg, #330000 0%, #cc0000 50%, #ff6600 100%);
}

.ice-bg { 
    background: linear-gradient(135deg, #001a33 0%, #0066cc 50%, #00ccff 100%);
}

.bg-name {
    color: #ffcc00;
    font-size: 1.1rem;
    text-align: center;
    font-weight: bold;
}

/* Character Selection Screen */
#characterSelect {
    background: transparent;
}

.select-ui {
    width: 90%;
    max-width: 1200px;
    height: 90%;
    display: flex;
    flex-direction: column;
}

.select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 2px solid #ff0033;
    margin-bottom: 2rem;
}

.player-tag {
    font-size: 1.5rem;
    color: #ffcc00;
    background: rgba(255, 0, 51, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 2px solid #ff0033;
}

.select-title {
    font-size: 2.5rem;
    color: #ffcc00;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #ff0033;
}

.difficulty-select {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.difficulty-select select {
    background: rgba(255, 0, 51, 0.3);
    border: 2px solid #ff0033;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.difficulty-select select option {
    background: #000;
    color: white;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    flex: 1;
    margin-bottom: 2rem;
    overflow-y: auto;
    max-height: 400px;
    padding: 10px;
}

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

.character-grid::-webkit-scrollbar-track {
    background: rgba(255, 0, 51, 0.1);
    border-radius: 4px;
}

.character-grid::-webkit-scrollbar-thumb {
    background: #ff0033;
    border-radius: 4px;
}

.character-card {
    background: rgba(255, 0, 51, 0.1);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.character-card:hover {
    border-color: #ffcc00;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.3);
}

.character-card.selected {
    border-color: #ff0033;
    box-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033;
    background: rgba(255, 0, 51, 0.3);
}

.character-icon {
    width: 100px;
    height: 100px;
    background: #111;
    border-radius: 50%;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffcc00;
    border: 3px solid #333;
    transition: all 0.2s;
}

.character-card:hover .character-icon {
    border-color: #ffcc00;
    transform: scale(1.1);
}

.character-name {
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.character-style {
    font-size: 0.9rem;
    color: #ffcc00;
    text-align: center;
    margin-bottom: 0.5rem;
}

.character-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    color: #ff0033;
    font-weight: bold;
    font-size: 1.1rem;
}

.stat-label {
    color: #aaa;
    font-size: 0.8rem;
}

.character-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff0033;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.preview-model {
    width: 150px;
    height: 150px;
    background: #111;
    border: 2px solid #ffcc00;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ffcc00;
    text-shadow: 0 0 10px #ffcc00;
}

.character-info {
    flex: 1;
    padding: 0 2rem;
}

.char-name {
    font-size: 1.8rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px #ff0033;
}

.char-style {
    font-size: 1.2rem;
    color: #ff0033;
    margin-bottom: 1rem;
}

.char-desc {
    font-size: 1rem;
    color: #aaa;
    line-height: 1.5;
}

.boss-unlock, .boss-unlocked, .boss-warning {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.boss-unlock {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
    color: #ff0000;
}

.boss-unlocked {
    background: rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
    color: #00ff00;
}

.boss-warning {
    background: rgba(255, 153, 0, 0.2);
    border: 2px solid #ff9900;
    color: #ff9900;
    animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
    0%, 100% { box-shadow: 0 0 5px #ff9900; }
    50% { box-shadow: 0 0 20px #ff9900; }
}

.select-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-btn {
    font-size: 1.2rem;
    color: #fff;
    background: rgba(255, 0, 51, 0.3);
    border: 2px solid #ff0033;
    padding: 10px 30px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    border-radius: 5px;
}

.nav-btn:hover {
    background: rgba(255, 0, 51, 0.7);
    transform: scale(1.05);
}

.nav-btn.confirm {
    background: rgba(255, 204, 0, 0.3);
    border-color: #ffcc00;
}

.nav-btn.confirm:hover {
    background: rgba(255, 204, 0, 0.7);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Game Screen */
#gameScreen {
    background: #000;
    justify-content: flex-start;
    padding-top: 1rem;
}

#gameCanvas {
    width: 100%;
    max-width: 1000px;
    height: 500px;
    background: #000;
    border: 2px solid #ff0033;
    box-shadow: 0 0 20px #ff0033;
    border-radius: 5px;
}

.hud {
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.player-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.player-name {
    font-size: 1.5rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    text-align: center;
    text-shadow: 0 0 10px #ff0033;
}

.health-container {
    width: 100%;
    background: #222;
    border: 2px solid #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.health-bar {
    height: 30px;
    background: linear-gradient(90deg, #ff0033 0%, #ffcc00 100%);
    width: 100%;
    transition: width 0.3s;
}

.health-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
}

.round-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-text {
    font-size: 1.5rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px #ff0033;
}

.timer {
    font-size: 2rem;
    color: #ff0033;
    background: #111;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 2px solid #ff0033;
    box-shadow: 0 0 10px #ff0033;
}

/* Dodge Warning System */
.dodge-warning {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    color: #ff0033;
    text-shadow: 0 0 30px #ff0033, 0 0 60px #ff0033;
    font-weight: bold;
    display: none;
    z-index: 100;
    pointer-events: none;
}

@keyframes warningPulse {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.3); 
        opacity: 0.7; 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
}

/* Turn-Based UI (21 Boss) */
.turn-based-ui {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #00ccff;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    z-index: 50;
    text-align: center;
    min-width: 400px;
    box-shadow: 0 0 30px rgba(0, 204, 255, 0.5);
}

.turn-indicator {
    font-size: 1.8rem;
    color: #00ff00;
    margin-bottom: 1rem;
    font-weight: bold;
    text-shadow: 0 0 10px currentColor;
}

.turn-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.turn-btn {
    font-size: 1.2rem;
    color: #fff;
    background: rgba(0, 204, 255, 0.3);
    border: 2px solid #00ccff;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.turn-btn:hover:not(:disabled) {
    background: rgba(0, 204, 255, 0.7);
    transform: scale(1.05);
    box-shadow: 0 0 15px #00ccff;
}

.turn-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

.charge-counter {
    font-size: 1.5rem;
    color: #ffcc00;
    font-weight: bold;
    margin-top: 0.5rem;
    text-shadow: 0 0 10px #ffcc00;
}

.boss-action {
    font-size: 1.5rem;
    color: #ff0033;
    margin-top: 1rem;
    font-weight: bold;
    display: none;
    text-shadow: 0 0 10px #ff0033;
    animation: bossActionPulse 1s infinite;
}

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

/* Timing Bar System */
.timing-bar {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #ffcc00;
    border-radius: 10px;
    padding: 2rem;
    z-index: 100;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
}

.timing-bar-container {
    width: 100%;
    height: 50px;
    background: #222;
    border: 2px solid #333;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.timing-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff0033 0%, #ffcc00 50%, #00ff00 100%);
    transition: width 0.05s linear;
}

.timing-bar-target {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(0, 255, 0, 0.4);
    border: 3px solid #00ff00;
    box-shadow: 0 0 15px #00ff00;
}

.timing-text {
    font-size: 1.5rem;
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 10px #ffcc00;
}

/* Touch Controls for Tablet */
.touch-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 40;
}

.touch-controls.active {
    display: flex;
}

.touch-left, .touch-right {
    pointer-events: auto;
}

.movement-buttons {
    display: flex;
    gap: 15px;
}

.movement-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 51, 0.7);
    border: 3px solid #ffcc00;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.movement-btn:active {
    background: rgba(255, 204, 0, 0.9);
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.movement-btn.left { 
    background: rgba(255, 100, 0, 0.7); 
}

.movement-btn.right { 
    background: rgba(0, 200, 255, 0.7); 
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.touch-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 51, 0.7);
    border: 3px solid #ffcc00;
    border-radius: 50%;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.touch-btn:active {
    background: rgba(255, 204, 0, 0.9);
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.touch-btn.punch { 
    background: rgba(255, 100, 0, 0.7); 
}

.touch-btn.kick { 
    background: rgba(0, 200, 255, 0.7); 
}

.touch-btn.special { 
    background: rgba(255, 0, 200, 0.7); 
}

.touch-btn.heal { 
    background: rgba(100, 255, 100, 0.7); 
}

.touch-btn.dodge { 
    background: rgba(255, 255, 0, 0.7); 
}

/* Combo Display */
.combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #ffcc00;
    text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
    pointer-events: none;
    font-weight: bold;
}

.combo-display.active {
    opacity: 1;
    animation: comboPopIn 0.5s;
}

@keyframes comboPopIn {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Shop Screen */
#shopScreen {
    background: transparent;
}

.shop-content {
    width: 90%;
    max-width: 900px;
    text-align: center;
}

.shop-info {
    margin: 2rem 0;
}

.coins-display {
    font-size: 1.8rem;
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.2);
    padding: 1rem 2rem;
    border-radius: 10px;
    border: 2px solid #ffcc00;
    display: inline-block;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    max-height: 450px;
    overflow-y: auto;
    padding: 1rem;
}

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

.shop-items::-webkit-scrollbar-track {
    background: rgba(255, 0, 51, 0.1);
    border-radius: 4px;
}

.shop-items::-webkit-scrollbar-thumb {
    background: #ff0033;
    border-radius: 4px;
}

.shop-item {
    background: rgba(255, 0, 51, 0.1);
    border: 2px solid #ff0033;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.shop-item:hover {
    border-color: #ffcc00;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.3);
}

.item-name {
    font-size: 1.4rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0033;
}

.item-desc {
    color: #aaa;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.item-price {
    font-size: 1.3rem;
    color: #ffcc00;
    margin-bottom: 1rem;
    font-weight: bold;
}

.buy-btn {
    background: rgba(255, 204, 0, 0.3);
    border: 2px solid #ffcc00;
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
    text-transform: uppercase;
}

.buy-btn:hover:not(:disabled) {
    background: rgba(255, 204, 0, 0.7);
    transform: scale(1.05);
}

.buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.owned-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #00ff00;
    color: #000;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Controls Screen */
#controlsScreen {
    background: transparent;
}

.controls-content {
    width: 90%;
    max-width: 1100px;
    height: 90%;
    display: flex;
    flex-direction: column;
}

.controls-header {
    font-size: 2.5rem;
    color: #ffcc00;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #ff0033;
}

.controls-scroll {
    max-height: 450px;
    overflow-y: auto;
    margin: 2rem 0;
    padding-right: 10px;
}

.controls-scroll::-webkit-scrollbar {
    width: 8px;
}

.controls-scroll::-webkit-scrollbar-track {
    background: rgba(255, 0, 51, 0.1);
    border-radius: 4px;
}

.controls-scroll::-webkit-scrollbar-thumb {
    background: #ff0033;
    border-radius: 4px;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.control-group {
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid #ffcc00;
    border-radius: 10px;
    padding: 1.5rem;
}

.control-title {
    font-size: 1.5rem;
    color: #ffcc00;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 0.5rem;
    text-shadow: 0 0 5px #ff0033;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
}

.control-item:last-child {
    border-bottom: none;
}

.control-key {
    background: #ff0033;
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.control-action {
    color: #fff;
    font-size: 1.05rem;
    flex: 1;
    margin-left: 1rem;
}

.combo-list {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.combo-item {
    margin: 0.8rem 0;
    padding: 0.8rem;
    background: rgba(255, 0, 51, 0.2);
    border-left: 4px solid #ff0033;
    border-radius: 0 5px 5px 0;
    font-size: 0.95rem;
}

.controls-footer {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Update Log Screen */
#updatesScreen {
    background: transparent;
}

.updates-content {
    width: 90%;
    max-width: 900px;
    text-align: center;
}

.updates-scroll {
    max-height: 450px;
    overflow-y: auto;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid #ff0033;
}

.updates-scroll::-webkit-scrollbar {
    width: 8px;
}

.updates-scroll::-webkit-scrollbar-track {
    background: rgba(255, 0, 51, 0.1);
    border-radius: 4px;
}

.updates-scroll::-webkit-scrollbar-thumb {
    background: #ff0033;
    border-radius: 4px;
}

.update-version {
    margin-bottom: 2rem;
    text-align: left;
}

.update-version h3 {
    color: #ffcc00;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ff0033;
    padding-bottom: 0.5rem;
    font-size: 1.3rem;
}

.update-version ul {
    list-style: none;
    padding-left: 1rem;
}

.update-version li {
    color: #aaa;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.update-version li:before {
    content: "•";
    color: #ff0033;
    position: absolute;
    left: 0;
    font-size: 1.5rem;
}

/* Credits Screen */
#creditsScreen {
    background: transparent;
}

.credits-content {
    width: 90%;
    max-width: 700px;
    text-align: center;
}

.credits-list {
    margin: 3rem 0;
}

.credit-item {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 0, 51, 0.1);
    border: 2px solid #ff0033;
    border-radius: 10px;
    transition: all 0.2s;
}

.credit-item:hover {
    border-color: #ffcc00;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.3);
}

.credit-name {
    font-size: 2rem;
    color: #ffcc00;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px #ff0033;
}

.credit-role {
    font-size: 1.2rem;
    color: #aaa;
}

/* Cutscene Overlay */
#cutsceneOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    color: #ffcc00;
    font-size: 3rem;
    text-align: center;
    padding: 2rem;
}

#cutsceneText {
    font-size: 3.5rem;
    text-shadow: 0 0 20px #ff0033, 0 0 40px #ff0033;
    letter-spacing: 5px;
    line-height: 1.6;
    max-width: 80%;
    animation: cutsceneTextPulse 2s infinite;
}

@keyframes cutsceneTextPulse {
    0%, 100% { 
        text-shadow: 0 0 20px #ff0033; 
    }
    50% { 
        text-shadow: 0 0 30px #ff0033, 0 0 50px #ff0033, 0 0 70px #ffcc00; 
    }
}

/* Secret 67 Effect */
.secret-67 {
    position: fixed;
    font-size: 2.5rem;
    color: #ffcc00;
    text-shadow: 0 0 15px #ff0033;
    z-index: 9999;
    pointer-events: none;
    animation: float67 2s forwards;
}

@keyframes float67 {
    0% { 
        transform: translateY(0) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(-150px) rotate(360deg); 
        opacity: 0; 
    }
}

/* Boss Stun Effect */
.boss-stun-effect {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: #ffff00;
    text-shadow: 0 0 20px #ff9900;
    z-index: 100;
    animation: stunPulse 0.5s infinite;
}

@keyframes stunPulse {
    0%, 100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
}

/* Player Heal Effect */
.player-heal-effect {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
    z-index: 100;
    animation: healFloat 1s forwards;
}

@keyframes healFloat {
    0% { 
        transform: translate(-50%, -50%); 
        opacity: 1; 
    }
    100% { 
        transform: translate(-50%, -150%); 
        opacity: 0; 
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .background-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pixel-logo, .main-title { 
        font-size: 3rem; 
    }
    
    .menu-btn { 
        font-size: 1.2rem; 
        width: 250px; 
    }
    
    .select-title {
        font-size: 2rem;
    }
    
    .character-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .character-info {
        padding: 1rem 0;
    }
    
    .preview-model {
        width: 120px;
        height: 120px;
        font-size: 2rem;
    }
    
    .char-name {
        font-size: 1.5rem;
    }
    
    .hud {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .player-hud {
        width: 100%;
    }
    
    .touch-btn, .movement-btn {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
    }
    
    .movement-btn {
        font-size: 1.5rem;
    }
    
    .shop-items {
        grid-template-columns: 1fr;
    }
    
    .turn-based-ui {
        min-width: auto;
        width: 90%;
    }
    
    .turn-actions {
        flex-direction: column;
    }
    
    .timing-bar {
        width: 90%;
    }
    
    #cutsceneText {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .pixel-logo, .main-title { 
        font-size: 2rem; 
    }
    
    .menu-btn { 
        font-size: 1rem; 
        width: 200px; 
        padding: 8px 20px; 
    }
    
    .select-title {
        font-size: 1.5rem;
    }
    
    .controls-header {
        font-size: 2rem;
    }
    
    .controls-scroll {
        max-height: 300px;
    }
    
    .updates-scroll {
        max-height: 300px;
    }
    
    .shop-items {
        max-height: 300px;
    }
    
    .touch-btn, .movement-btn {
        width: 60px;
        height: 60px;
        font-size: 0.7rem;
    }
    
    .movement-btn {
        font-size: 1.2rem;
    }
    
    .background-grid {
        grid-template-columns: 1fr;
    }
    
    #cutsceneText {
        font-size: 1.5rem;
    }
    
    .combo-display {
        font-size: 2rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screen.active {
    animation: fadeIn 0.3s;
}

/* Button Hover Effects */
button {
    position: relative;
    overflow: hidden;
}

button:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover:before {
    width: 300px;
    height: 300px;
}

/* Glow Effects */
.glow {
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor;
    }
}
#gameCanvas {
    width: 100%;
    max-width: 1000px;
    height: 500px;
    background: #000;
    border: 2px solid #ff0033;
    box-shadow: 0 0 20px #ff0033;
    border-radius: 5px;
    display: block; /* Add this */
}
