@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Share+Tech+Mono&display=swap');

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Pre-Menu Screen */
#pre-menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(0, 100, 150, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(100, 0, 150, 0.2) 0%, transparent 50%),
        #0a0a1a;
    z-index: 1001;
}

.pre-menu-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    padding: 30px 80px;
    border: 3px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 8px;
    animation: titlePulse 3s ease-in-out infinite;
}

.pre-menu-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
}

/* Title Screen */
#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(0, 100, 150, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(100, 0, 150, 0.2) 0%, transparent 50%),
        #0a0a1a;
    z-index: 1000;
}

#title-screen .title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    color: #00ffff;
    text-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(0, 255, 255, 0.2);
    margin-bottom: 60px;
    letter-spacing: 8px;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.3); }
    50% { text-shadow: 0 0 30px rgba(0, 255, 255, 0.7), 0 0 60px rgba(0, 255, 255, 0.5); }
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.title-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    padding: 15px 50px;
    border: 2px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 3px;
    min-width: 250px;
}

.title-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* How to Play Screen */
#how-to-play-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a1a;
    z-index: 1000;
    padding: 40px;
}

#how-to-play-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.how-to-play-content {
    font-size: 1.1rem;
    line-height: 2;
    color: #cccccc;
    max-width: 600px;
    text-align: left;
    margin-bottom: 40px;
}

.how-to-play-content p {
    margin-bottom: 10px;
}

.how-to-play-content .indent {
    margin-left: 30px;
}

.how-to-play-content strong {
    color: #00ffff;
}

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

body {
    background: #0a0a1a;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
    min-height: 100vh;
}

#game-container {
    display: flex;
    height: 100vh;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 100, 150, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(100, 0, 150, 0.1) 0%, transparent 50%),
        #0a0a1a;
}

#canvas-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

canvas {
    border: 2px solid #00ffff33;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 60px rgba(0, 255, 255, 0.05);
    background: #050510;
}

#sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #0d0d20 0%, #080812 100%);
    border-left: 4px solid #00ffff44;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    text-align: center;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    padding-bottom: 10px;
    border-bottom: 1px solid #00ffff33;
}

.panel {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid #00ffea; /* old #00ffff44 */
    border-radius: 8px;
    padding: 10px;
}

.panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: #00ffea;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

#stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}

.stat-label {
    font-size: 0.6rem;
    color: #aaaaaa;
    text-transform: uppercase;
}

#tower-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 350px;
    overflow-y: auto;
}

.tower-btn {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid #00ffff33;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.tower-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff66;
}

.tower-btn.selected {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.tower-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.tower-btn.locked:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: #00ffff33;
}

.tower-btn.locked .tower-icon {
    filter: grayscale(100%);
}

.tower-btn.locked::after {
    content: '🔒';
    position: absolute;
    right: 8px;
    font-size: 0.6rem;
    opacity: 0.7;
}

.tower-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: bold;
}

.tower-info {
    flex: 1;
    min-width: 0;
}

.tower-name {
    color: #00ffff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.tower-cost {
    color: #ffaa00;
    font-size: 0.75rem;
}

.tower-icon.hadamard { background: linear-gradient(135deg, #00ffff33, #00ffff11); border: 1px solid #00ffff; }
.tower-icon.rx20 { background: linear-gradient(135deg, #ff888833, #ff888811); border: 1px solid #ff8888; }
.tower-icon.rx45 { background: linear-gradient(135deg, #ff666633, #ff666611); border: 1px solid #ff6666; }
.tower-icon.rx90 { background: linear-gradient(135deg, #ff444433, #ff444411); border: 1px solid #ff4444; }
.tower-icon.ry20 { background: linear-gradient(135deg, #88ff8833, #88ff8811); border: 1px solid #88ff88; }
.tower-icon.ry45 { background: linear-gradient(135deg, #66ff6633, #66ff6611); border: 1px solid #66ff66; }
.tower-icon.ry90 { background: linear-gradient(135deg, #44ff4433, #44ff4411); border: 1px solid #44ff44; }
.tower-icon.rz20 { background: linear-gradient(135deg, #ff88ff33, #ff88ff11); border: 1px solid #ff88ff; }
.tower-icon.rz45 { background: linear-gradient(135deg, #ff66ff33, #ff66ff11); border: 1px solid #ff66ff; }
.tower-icon.rz90 { background: linear-gradient(135deg, #ff44ff33, #ff44ff11); border: 1px solid #ff44ff; }
.tower-icon.measure { background: linear-gradient(135deg, #ffff6633, #ffff6611); border: 1px solid #ffff66; }
.tower-icon.measureX { background: linear-gradient(135deg, #66ffff33, #66ffff11); border: 1px solid #66ffff; }
.tower-icon.measureY { background: linear-gradient(135deg, #ffaa6633, #ffaa6611); border: 1px solid #ffaa66; }

#quantum-info {
    font-size: 1rem;
    line-height: 1.5;
    color: #cccccc;
}

#quantum-info code {
    color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
}

#message-log {
    flex: 1;
    overflow-y: auto;
    font-size: 0.6rem;
    color: #999999;
    max-height: 120px;
    min-height: 80px;
}

.log-entry {
    padding: 3px 0;
    border-bottom: 1px solid #111;
}

.log-entry.kill { color: #00ff00; }
.log-entry.spawn { color: #ffaa00; }
.log-entry.collapse { color: #ff00ff; }

#start-btn {
    background: linear-gradient(135deg, #9dfcaa, #9dfcaa);
    border: 2px solid #005807;
    color: #005807; /* old #00ffff*/
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#start-btn:hover {
    background: linear-gradient(135deg, #a3ffab, #36ff46);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

#start-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#instructions {
    font-size: 0.6rem;
    color: #999999;
    text-align: center;
    line-height: 1.5;
}

.key {
    display: inline-block;
    background: #333333;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #555555;
    color: #cccccc;
}

#speed-toggle {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.speed-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff44;
    color: #00ffff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    transition: all 0.2s;
}

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

.speed-btn.active {
    background: #00ffff;
    color: #000;
}

/* Display toggles */
#display-toggle {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
}

.display-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff44;
    color: #00ffff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    transition: all 0.2s;
    text-align: center;
    flex: 1;
    white-space: nowrap;
}

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

.display-btn.active {
    background: #00ffff;
    color: #000;
}

/* Pause button */
#pause-btn {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border: 2px solid #996600;
    color: #333;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#pause-btn:hover {
    background: linear-gradient(135deg, #ffdd33, #ffaa00);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

#pause-btn.paused {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    border-color: #006633;
}

/* Music Volume Slider */
.music-volume-slider {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* End Game Button */
.end-game-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: 2px solid #990000;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.end-game-btn:hover {
    background: linear-gradient(135deg, #ff6666, #ff0000);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

/* Return to Menu Button (shown on game over) */
.return-menu-btn {
    position: absolute;
    top: 62%;
    left: 50%;
    transform: translate(-50%, -50%) translateX(-140px);
    z-index: 100;
    background: linear-gradient(135deg, #00ffff, #0088aa);
    border: 2px solid #00aaaa;
    color: #000000;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    padding: 15px 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.return-menu-btn:hover {
    background: linear-gradient(135deg, #66ffff, #00aaaa);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

/* Game container music slider - positioned to left of sidebar */
#game-container .music-volume-slider {
    position: absolute;
    top: 20px;
    right: 300px;
    z-index: 100;
}

/* How to play screen music slider */
#how-to-play-screen .music-volume-slider {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.volume-icon {
    color: #ffffff;
    font-size: 1.2rem;
}

.music-volume-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.music-volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
}

.music-volume-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Custom Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(135deg, #0d0d20 0%, #1a1a35 100%);
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 0;
    min-width: 350px;
    max-width: 450px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(0, 255, 255, 0.1),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    animation: modalPulse 2s ease-in-out infinite;
}

@keyframes modalPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), 0 0 60px rgba(0, 255, 255, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.5), 0 0 80px rgba(0, 255, 255, 0.2); }
}

.modal-header {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.15) 0%, rgba(0, 255, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding: 20px 25px;
    text-align: center;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    margin: 0;
    letter-spacing: 3px;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 20px 25px 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    min-width: 120px;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #666666;
    color: #aaaaaa;
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #888888;
    color: #ffffff;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: 2px solid #990000;
    color: #ffffff;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #ff6666, #ff0000);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* ============================================
   MULTI-PAGE HOW TO PLAY STYLES
   ============================================ */

/* Back to Menu Button */
.htp-back-menu-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid #666666;
    background: rgba(255, 255, 255, 0.1);
    color: #aaaaaa;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    z-index: 10;
}

.htp-back-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #888888;
    color: #ffffff;
}

/* Page Indicator Dots */
.htp-page-indicator {
    position: absolute;
    top: 80px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.htp-page-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.htp-page-dot:hover {
    background: rgba(0, 255, 255, 0.3);
}

.htp-page-dot.active {
    background: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transform: scale(1.2);
}

/* Page Container */
.htp-page {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    width: 100%;
    animation: htpFadeIn 0.4s ease-out;
}

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

/* Content Area */
.htp-content {
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.htp-content h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 2px;
}

.htp-intro {
    font-size: 1.2rem;
    color: #eeeeee;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Sections within pages */
.htp-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.htp-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.htp-section h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: #00ffff;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.htp-section p {
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.7;
    margin-bottom: 10px;
}

.htp-section ul {
    margin-left: 20px;
    color: #cccccc;
    line-height: 1.8;
}

.htp-section li {
    margin-bottom: 6px;
}

/* Analogy box */
.htp-analogy {
    background: rgba(255, 204, 0, 0.1);
    border-left: 3px solid #ffcc00;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #ffdd88;
}

/* Equation styling */
.htp-equation {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    border: 1px solid rgba(0, 255, 255, 0.3);
    letter-spacing: 2px;
}

/* Bullet list styling */
.htp-bullet-list {
    margin-left: 20px !important;
    list-style: disc;
}

.htp-bullet-list li {
    margin-bottom: 8px;
}

/* Diagram for Bloch sphere poles */
.htp-diagram {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.htp-diagram-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.htp-state {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 50%;
    border: 2px solid #00ffff;
    min-width: 80px;
    text-align: center;
}

.htp-state-desc {
    font-size: 0.85rem;
    color: #aaaaaa;
    text-align: center;
}

/* Tower categories */
.htp-tower-category {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.htp-tower-category h5 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #00ffea;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.htp-tower-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.htp-tower-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #cccccc;
    padding: 8px;
    background: rgba(0, 255, 255, 0.03);
    border-radius: 4px;
}

.htp-tower-item .tower-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.6rem;
    margin-right: 5px;
}

.htp-kill-option {
    border-left: 3px solid #ff4444;
    padding-left: 12px;
}

.htp-survive-option {
    border-left: 3px solid #44ff44;
    padding-left: 12px;
}

.htp-kill-text {
    color: #ff6666;
    font-size: 0.9rem;
}

.htp-survive-text {
    color: #66ff66;
    font-size: 0.9rem;
}

/* Final section */
.htp-final {
    text-align: center;
    padding: 20px !important;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 8px;
}

.htp-final p {
    font-size: 1.2rem;
    color: #00ffff;
    text-align: center;
}

/* Navigation buttons */
.htp-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.htp-nav .title-btn {
    min-width: 140px;
    font-size: 1rem;
    padding: 12px 30px;
}

.htp-next-btn {
    background: rgba(0, 255, 255, 0.15);
}

.htp-prev-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: #888888;
    color: #cccccc;
}

.htp-prev-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #aaaaaa;
    color: #ffffff;
}

.htp-done-btn {
    background: linear-gradient(135deg, #00ff88, #00aa55);
    border-color: #008833;
    color: #001100;
}

.htp-done-btn:hover {
    background: linear-gradient(135deg, #44ffaa, #00cc66);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Scrollbar styling for htp-content */
.htp-content::-webkit-scrollbar {
    width: 6px;
}

.htp-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.htp-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.htp-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* Bloch Sphere Visualization Container */
#bloch-container {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at center, #020617 0%, #01030a 100%);
    border: 1px solid rgba(0,255,255,0.2);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,255,255,0.15) inset;
    margin: 20px auto;
    overflow: hidden;
}

.htp-bloch-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Make container larger on desktop */
@media (min-width: 800px) {
    #bloch-container {
        width: 380px;
        height: 380px;
    }
}

/* ============================================
   TUTORIAL MODE STYLES
   ============================================ */

/* Tutorial Overlay */
#tutorial-overlay {
    position: absolute;
    top: 80px;
    right: 310px;
    background: rgba(5, 5, 25, 0.97);
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 20px 30px;
    max-width: 500px;
    width: 90%;
    z-index: 100;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.4),
        0 0 60px rgba(0, 255, 255, 0.2),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    animation: tutorialPulse 2s ease-in-out infinite;
}

@keyframes tutorialPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), 0 0 60px rgba(0, 255, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.6), 0 0 80px rgba(0, 255, 255, 0.3); }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.tutorial-progress {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #888888;
}

.tutorial-skip-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    padding: 5px 12px;
    border: 1px solid #666666;
    background: rgba(255, 255, 255, 0.05);
    color: #888888;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tutorial-skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaaaaa;
    border-color: #888888;
}

#tutorial-overlay h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

#tutorial-overlay p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    color: #cccccc;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 20px;
}

.tutorial-continue-btn {
    display: block;
    margin: 0 auto;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    padding: 12px 40px;
    border: 2px solid #00ffff;
    background: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tutorial-continue-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Tutorial Highlight Effect */
.tutorial-highlight {
    position: relative;
    z-index: 50;
    box-shadow: 
        0 0 0 4px rgba(0, 255, 255, 0.3),
        0 0 20px 5px rgba(0, 255, 255, 0.6) !important;
    border-radius: 8px;
    animation: highlightPulse 1s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.3), 0 0 20px 5px rgba(0, 255, 255, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(0, 255, 255, 0.5), 0 0 30px 8px rgba(0, 255, 255, 0.8); }
}

/* Tutorial Hint Arrow */
.tutorial-hint-arrow {
    display: none;
    position: absolute;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #00ffff;
    filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.8));
    animation: arrowBounce 1s ease-in-out infinite;
}

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

/* Tutorial Complete Screen */
.tutorial-complete {
    text-align: center;
    padding: 20px;
}

.tutorial-complete h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.tutorial-complete p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 25px;
}

/* Tower buttons in tutorial - ensure they're visible */
.tutorial-highlight.tower-btn {
    box-shadow: 
        0 0 0 4px rgba(0, 255, 255, 0.5),
        0 0 25px 8px rgba(0, 255, 255, 0.8) !important;
}

.tutorial-highlight#start-btn {
    box-shadow: 
        0 0 0 4px rgba(0, 255, 0, 0.5),
        0 0 25px 8px rgba(0, 255, 0, 0.8) !important;
}

.tutorial-highlight#game {
    box-shadow: 
        0 0 0 4px rgba(0, 255, 255, 0.3),
        0 0 30px 10px rgba(0, 255, 255, 0.5) !important;
}

/* Tutorial Placement Hint */
.tutorial-placement-hint {
    display: none;
    position: absolute;
    pointer-events: none;
    z-index: 60;
    width: 60px;
    height: 60px;
}

/* Individual placement hint circle (for multiple hints) */
.tutorial-placement-hint-circle {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid #ffcc00;
    border-radius: 50%;
    box-shadow: 
        0 0 10px #ffcc00,
        0 0 20px #ffcc0088,
        0 0 30px #ffcc0044,
        inset 0 0 15px #ffcc0033;
    animation: placementHintPulse 1.5s ease-in-out infinite;
    transform: translate(-50%, -50%);
}

/* ============================================
   CAREER MODE WAVE MESSAGE BOX
   ============================================ */

#wave-message {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(5, 5, 25, 0.95) 0%, rgba(20, 20, 50, 0.95) 100%);
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 15px 30px;
    z-index: 50;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
    animation: waveMessageFadeIn 0.5s ease-out;
    min-width: 250px;
    max-width: 90%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wave-message p {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin: 0;
    letter-spacing: 2px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

@keyframes waveMessageFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes placementHintPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
        box-shadow: 
            0 0 10px #ffcc00,
            0 0 20px #ffcc0088,
            0 0 30px #ffcc0044,
            inset 0 0 15px #ffcc0033;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
        box-shadow: 
            0 0 15px #ffcc00,
            0 0 30px #ffcc00aa,
            0 0 45px #ffcc0066,
            inset 0 0 20px #ffcc0044;
    }
}
