* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Share Tech Mono', monospace;
}

#codes-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 30;
}

#code-input {
    padding: 5px 10px;
    font-family: 'Share Tech Mono', monospace;
    background: rgba(0,0,0,0.5);
    color: #00f3ff;
    border: 1px solid #444;
    border-radius: 4px;
    outline: none;
    width: 150px;
}

#code-submit {
    padding: 5px 10px;
    font-family: 'Share Tech Mono', monospace;
    background: #00f3ff;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#code-submit:hover { filter: brightness(1.2); }

body {
    background-color: #0d0d12;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#bonus-messages {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: none;
    z-index: 100;
}

.bonus-text {
    font-size: 36px;
    color: #a200ff;
    text-shadow: 0 0 20px #a200ff, 0 0 40px #fff;
    font-weight: bold;
    animation: floatUpFade 2s forwards;
}

.bonus-text.dev-mode {
    color: #00f3ff;
    text-shadow: 0 0 20px #00f3ff, 0 0 40px #fff;
}

@keyframes floatUpFade {
    0% { opacity: 0; transform: translateY(50px) scale(0.5); }
    10% { opacity: 1; transform: translateY(0) scale(1.2); }
    20% { transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(-100px); }
    100% { opacity: 0; transform: translateY(-150px); }
}

#game-title {
    font-size: 32px;
    margin-bottom: 5px;
    margin-top: -20px;
    color: #00f3ff;
    text-shadow: 0 0 15px #00f3ff;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

#external-lives-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.external-lives {
    font-size: 48px;
    letter-spacing: 8px;
    color: #ff003c;
    text-shadow: 0 0 15px #ff003c;
}

#game-container {
    position: relative;
    width: 600px;
    height: 800px;
    background-color: #121218;
    border: 2px solid #222;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

#hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 10;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 12px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.hud-value {
    font-size: 24px;
    font-weight: bold;
}

.hud-score { color: #fff; text-shadow: 0 0 8px #fff; }
.hud-time { color: #00f3ff; text-shadow: 0 0 8px #00f3ff; }
.hud-speed { color: #39ff14; text-shadow: 0 0 8px #39ff14; }
.hud-lives-val { color: #ff003c; text-shadow: 0 0 8px #ff003c; letter-spacing: 4px; }

#mode-display.easy { color: #39ff14; text-shadow: 0 0 8px #39ff14; }
#mode-display.normal { color: #ff8c00; text-shadow: 0 0 8px #ff8c00; }
#mode-display.hard { color: #ff0000; text-shadow: 0 0 8px #ff0000; }
#mode-display.infinite { color: #ffffff; text-shadow: 0 0 8px #ffffff; }
#mode-display.nightmare {
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 800% 100%;
    animation: gradientShiftText 4s linear infinite;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
}

@keyframes gradientShiftText {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}

#gadget-bar {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
    pointer-events: auto;
}

.gadget-slot {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.gadget-slot:hover {
    transform: scale(1.1);
}

.gadget-slot:active {
    transform: scale(0.9);
}

.gadget-circle {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.gadget-circle::after {
    content: "🐟";
    font-size: 34px;
}

.gadget-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ff003c;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    border: 2px solid #121218;
}

.shop-container {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    text-align: center;
}

.shop-container h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 20px;
}

.shop-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shop-btn {
    padding: 10px 15px;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #000;
    transition: filter 0.2s;
}

.shop-btn:hover {
    filter: brightness(1.2);
}

.shop-btn:active {
    filter: brightness(0.8);
}

#buy-green { background: #39ff14; }
#buy-blue { background: #00f3ff; }
#buy-gold { background: #ffd700; }
#buy-purple { background: #a200ff; color: #fff; }
#buy-black { background: #222; color: #fff; border: 1px solid #555; text-shadow: 0 0 5px #fff; }

canvas {
    display: block;
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 18, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.hidden {
    display: none !important;
}

#game-over h2 {
    font-size: 36px;
    color: #ff003c;
    text-shadow: 0 0 20px #ff003c;
    margin-bottom: 20px;
}

#game-over p {
    font-size: 24px;
    margin: 10px 0;
    color: #ccc;
}

#game-over span {
    color: #fff;
    font-weight: bold;
}

.diff-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}

.diff-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-family: 'Share Tech Mono', monospace;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: transform 0.2s, filter 0.2s;
    width: 250px;
}

.diff-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.diff-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

#btn-easy {
    background: #39ff14;
    color: #004d00;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

#btn-normal {
    background: #ff8c00;
    color: #663300;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

#btn-hard {
    background: #ff0000;
    color: #800000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.nightmare-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#btn-nightmare {
    background: linear-gradient(to bottom, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 100% 800%;
    animation: gradientShift 4s linear infinite;
    color: #555555;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 0%; }
    50% { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}

#nightmare-skulls {
    display: flex;
    gap: 10px;
    font-size: 24px;
}

.skull {
    color: #888;
}

.skull.crossed {
    text-decoration: line-through;
    color: #ff0000;
}

#nightmare-timer {
    font-size: 12px;
    color: #aaa;
}
