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

body {
    background: #05050a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Consolas', 'Courier New', monospace;
    overflow: hidden;
    color: #fff;
}

#game-wrapper {
    position: relative;
    width: 1024px;
    height: 576px;
    border: 2px solid rgba(255, 51, 102, 0.3);
    box-shadow: 0 0 40px rgba(255, 51, 102, 0.15), inset 0 0 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #0a0a12;
}

/* Overlay Styles */
.overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay.active {
    display: flex;
}

/* Menu */
#menu-overlay {
    background: rgba(5, 5, 10, 0.95);
}

.menu-content {
    text-align: center;
    padding: 40px;
}

.game-title {
    font-size: 48px;
    color: #ff3366;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 60px rgba(255, 51, 102, 0.3);
    letter-spacing: 6px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 60px rgba(255, 51, 102, 0.3); }
    50% { text-shadow: 0 0 30px rgba(255, 51, 102, 1), 0 0 80px rgba(255, 51, 102, 0.5); }
}

.subtitle {
    font-size: 14px;
    color: #00ccff;
    margin-top: 12px;
    letter-spacing: 8px;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.6);
}

.menu-buttons {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 40px;
}

.menu-btn {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    padding: 16px 36px;
    border: 2px solid #ff3366;
    background: transparent;
    color: #ff3366;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-btn:hover {
    background: #ff3366;
    color: #05050a;
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
    transform: scale(1.05);
}

.menu-btn.secondary {
    border-color: #00ccff;
    color: #00ccff;
}

.menu-btn.secondary:hover {
    background: #00ccff;
    color: #05050a;
    box-shadow: 0 0 30px rgba(0, 204, 255, 0.5);
}

.controls-info {
    display: flex;
    gap: 60px;
    margin-top: 36px;
    justify-content: center;
}

.controls-col {
    text-align: left;
}

.controls-col h3 {
    font-size: 10px;
    color: #ffcc00;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.controls-col p {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    line-height: 1.8;
}

/* Round Display */
#round-overlay {
    background: rgba(5, 5, 10, 0.85);
}

.round-display span {
    font-size: 64px;
    color: #ffcc00;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.8);
    letter-spacing: 8px;
}

/* KO Overlay */
#ko-overlay {
    background: rgba(5, 5, 10, 0.8);
}

.ko-display span {
    font-size: 80px;
    font-weight: bold;
    color: #ff3366;
    text-shadow: 0 0 40px rgba(255, 51, 102, 1), 0 0 80px rgba(255, 51, 102, 0.5);
    letter-spacing: 10px;
}

/* Victory Overlay */
#victory-overlay {
    background: rgba(5, 5, 10, 0.92);
}

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

#victory-text {
    font-size: 36px;
    margin-bottom: 12px;
    letter-spacing: 4px;
}

#final-score {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 36px;
}

.victory-content .menu-btn {
    display: block;
    margin: 12px auto;
}

/* Countdown */
#countdown-overlay {
    background: rgba(5, 5, 10, 0.7);
}

.countdown-display span {
    font-size: 100px;
    color: #ffcc00;
    text-shadow: 0 0 50px rgba(255, 204, 0, 0.9);
}

/* Coin Display */
.coin-display {
    font-size: 12px;
    color: #ffcc00;
    margin-top: 16px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.coin-icon {
    color: #ffcc00;
    font-size: 14px;
}

.menu-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}

.menu-btn.small {
    font-size: 10px;
    padding: 10px 24px;
}

/* Character Select */
#char-select-overlay {
    background: rgba(5, 5, 10, 0.95);
}

.char-select-content {
    text-align: center;
    padding: 30px;
}

.select-title {
    font-size: 20px;
    color: #ffcc00;
    margin-bottom: 24px;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.char-cards {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 24px;
}

.char-card {
    width: 260px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.char-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.char-card.selected {
    border-color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.char-card.selected[data-char="blaze"] {
    border-color: #ff3366;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.char-card.selected[data-char="frost"] {
    border-color: #00ccff;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.3);
}

.char-preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
}

.blaze-preview {
    background: radial-gradient(circle, #ff6633, #cc2200);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.4);
}

.frost-preview {
    background: radial-gradient(circle, #66ffff, #0088cc);
    box-shadow: 0 0 30px rgba(0, 204, 255, 0.4);
}

.char-name {
    font-size: 16px;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

.char-card[data-char="blaze"] .char-name { color: #ff3366; }
.char-card[data-char="frost"] .char-name { color: #00ccff; }

.char-type {
    font-size: 8px;
    color: #ffcc00;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.char-desc {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
}

.char-abilities-list {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.8;
    text-align: left;
    padding: 0 10px;
}

.char-abilities-list .owned { color: rgba(255, 255, 255, 0.7); }
.char-abilities-list .equipped { color: #ffcc00; }
.char-abilities-list .locked { color: rgba(255, 255, 255, 0.25); }
.char-abilities-list .ability-item { margin-left: 4px; }

/* Shop */
#shop-overlay {
    background: rgba(5, 5, 10, 0.95);
}

.shop-content {
    text-align: center;
    padding: 24px 30px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.shop-title {
    font-size: 22px;
    color: #ffcc00;
    margin-bottom: 8px;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.shop-coins {
    font-size: 14px;
    color: #ffcc00;
    margin-bottom: 16px;
}

.shop-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.shop-tab {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10px;
    padding: 8px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.shop-tab:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

.shop-tab.active {
    border-color: #ffcc00;
    color: #ffcc00;
}

.shop-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    max-height: 280px;
    overflow-y: auto;
}

.shop-item {
    width: 240px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
}

.shop-item.owned {
    border-color: rgba(0, 204, 255, 0.3);
    background: rgba(0, 204, 255, 0.05);
}

.shop-item.equipped {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.05);
}

.shop-item h4 {
    font-size: 9px;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.shop-item p {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 6px;
    line-height: 1.4;
}

.shop-item .price {
    font-size: 8px;
    color: #ffcc00;
}

.shop-item .shop-btn {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 7px;
    padding: 6px 12px;
    border: 1px solid #ff3366;
    background: transparent;
    color: #ff3366;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s;
}

.shop-item .shop-btn:hover {
    background: #ff3366;
    color: #05050a;
}

.shop-item .shop-btn.owned-btn {
    border-color: #00ccff;
    color: #00ccff;
}

.shop-item .shop-btn.owned-btn:hover {
    background: #00ccff;
    color: #05050a;
}

/* Stats */
#stats-overlay {
    background: rgba(5, 5, 10, 0.95);
}

.stats-content {
    text-align: center;
    padding: 30px;
}

.stats-display {
    margin: 20px 0;
    font-size: 10px;
    line-height: 2;
}

.stats-display .stat-row {
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 0;
}

.stats-display .stat-value {
    color: #ffcc00;
}

/* Ranked Rewards */
.ranked-rewards {
    margin-bottom: 16px;
}

.reward-text {
    font-size: 11px;
    color: #ffcc00;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

/* Inventory Overlay */
#inventory-overlay {
    background: rgba(5, 5, 10, 0.93);
}

.inventory-content {
    text-align: center;
    padding: 20px 30px;
    width: 85%;
    max-height: 90%;
    overflow-y: auto;
}

.inventory-title {
    font-size: 22px;
    color: #ffcc00;
    margin-bottom: 6px;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.inventory-hint {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

.inventory-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 10px;
}

.inv-tab {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 9px;
    padding: 6px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.inv-tab:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

.inv-tab.active {
    border-color: #ffcc00;
    color: #ffcc00;
}

.inventory-slots {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 10px;
}

.inv-slot-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.slot-key {
    color: #ffcc00;
}

.inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
    max-height: 260px;
    overflow-y: auto;
}

.inv-item {
    width: 160px;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.inv-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.inv-item .inv-name {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.inv-item .inv-slot-tag {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.3);
}

/* Item states in inventory */
.inv-item.equipped {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.08);
}

.inv-item.equipped .inv-name {
    color: #ffcc00;
}

.inv-item.equipped .inv-slot-tag {
    color: #ffcc00;
}

.inv-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.inv-item.locked .inv-name {
    color: rgba(255, 255, 255, 0.25);
}

/* Inventory for blaze tab */
.inv-tab[data-inv-char="blaze"].active {
    border-color: #ff3366;
    color: #ff3366;
}

.inv-tab[data-inv-char="frost"].active {
    border-color: #00ccff;
    color: #00ccff;
}

/* Button states */
.menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.menu-btn:disabled:hover {
    background: transparent;
    color: #ff3366;
    box-shadow: none;
    transform: none;
}

/* Responsive scaling */
@media (max-width: 1100px) {
    #game-wrapper {
        width: 90vw;
        height: calc(90vw * 9 / 16);
    }
    .game-title { font-size: 4vw; }
    .controls-info { flex-direction: column; gap: 20px; }
    .menu-btn { font-size: 1.5vw; padding: 12px 24px; }
    .char-cards { flex-direction: column; align-items: center; }
    .char-card { width: 80%; }
    .shop-item { width: 100%; }
}
