body {
    margin: 0;
    padding: 0;
    background-color: #0e0e0e;
    color: #e4e2e1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
}
canvas {
    display: block;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    image-rendering: pixelated; /* good for pixel art assets */
}
.glow-text {
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.6), 0 0 30px rgba(255, 0, 0, 0.4);
}
.menu-item {
    position: relative;
    transition: all 0.2s ease;
}
.menu-item:hover {
    color: #ffb4a8; /* primary */
    transform: translateX(10px);
}
.menu-item::before {
    content: 'sword_rose';
    font-family: 'Material Symbols Outlined';
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    color: #2ddbde; /* tertiary */
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(45,219,222,0.8);
}
.menu-item:hover::before {
    opacity: 1;
    left: -30px;
}
.crt-overlay {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 255, 0, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}
#ui-layer {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    pointer-events: none;
    z-index: 10;
}
#chat-ui {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    background: rgba(14, 14, 14, 0.92);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(246, 190, 59, 0.6);
    border-radius: 12px;
    padding: 18px 22px;
    color: white;
    z-index: 90;
    box-shadow: 0 0 25px rgba(246, 190, 59, 0.25), 0 10px 40px rgba(0,0,0,0.95);
    font-family: 'Courier New', Courier, monospace;
}
#chat-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(200, 0, 0, 0.1);
    border: 1px solid #cc0000;
    color: #ff8888;
    padding: 4px 10px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#chat-close:hover {
    background: #cc0000;
    color: white;
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.5);
}
#chat-history {
    height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}
#chat-input-container {
    display: flex;
    gap: 10px;
}
#chat-input {
    flex-grow: 1;
    padding: 10px;
    background: #222;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    font-family: inherit;
}
#chat-submit {
    padding: 10px 20px;
    background: #444;
    color: white;
    border: 1px solid #666;
    cursor: pointer;
    border-radius: 4px;
}
#chat-submit:hover {
    background: #555;
}

/* Stitch HUD Specific Styles */
.pixel-art-rendering {
    image-rendering: pixelated;
}

.hud-border {
    border: 2px solid theme('colors.outline-variant');
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5);
    background: rgba(14, 14, 14, 0.85); /* surface-container-lowest */
    backdrop-filter: blur(4px);
}

.bar-frame {
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.animate-health-shimmer {
    background: linear-gradient(90deg, #7f1d1d, #ef4444);
}

@keyframes manaPulse {
    0%, 100% { opacity: 0.85; box-shadow: 0 0 6px #3b82f6; }
    50% { opacity: 1; box-shadow: 0 0 18px #60a5fa; }
}
.animate-mana-pulse {
    animation: manaPulse 2s infinite ease-in-out;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

.stamina-fill {
    background: linear-gradient(90deg, #004b23, #00a86b);
}

.scanline {
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px;
}

.hotbar-slot {
    transition: all 0.2s ease;
}
.hotbar-slot:hover {
    transform: scale(1.05);
    border-color: theme('colors.primary');
    box-shadow: inset 0 0 10px rgba(255,180,168,0.2), 0 0 10px rgba(255,180,168,0.3);
}

/* Autoplay Manager Settings Overlay */
#ui-autoplay-config {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    z-index: 10000;
    background: rgba(14, 14, 18, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 2px solid rgba(45, 219, 222, 0.4);
    color: #e4e2e1;
    padding: 24px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    display: none;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    font-family: 'Space Grotesk', sans-serif;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%);
    pointer-events: auto;
}
#ui-autoplay-config.open {
    display: flex;
    transform: translateX(0);
}
.ai-pulse-dot {
    width: 12px;
    height: 12px;
    background-color: #2ddbde;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    box-shadow: 0 0 10px #2ddbde, 0 0 20px rgba(45,219,222,0.6);
    animation: pulseAI 1.5s infinite ease-in-out;
}
@keyframes pulseAI {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}
.preset-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 8px 12px;
    color: #bbb;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.preset-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.preset-btn.active {
    border-color: #2ddbde !important;
    color: #2ddbde !important;
    box-shadow: 0 0 12px rgba(45, 219, 222, 0.4);
    background: rgba(45, 219, 222, 0.12);
}
.config-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.12);
    outline: none;
    transition: background 0.3s;
    margin: 8px 0;
}
.config-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2ddbde;
    box-shadow: 0 0 8px #2ddbde;
    cursor: pointer;
    transition: transform 0.1s;
}
.config-slider::-webkit-slider-thumb:hover {
    transform: scale(1.35);
}
.zone-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(45, 219, 222, 0.3);
    border-radius: 4px;
    color: #fff;
    padding: 6px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    width: 75px;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}
.zone-input:focus {
    border-color: #2ddbde;
    box-shadow: 0 0 10px rgba(45, 219, 222, 0.5);
}
.ap-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: #fff;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    resize: none;
    transition: all 0.2s ease;
}
.ap-textarea:focus {
    border-color: #2ddbde;
    box-shadow: 0 0 8px rgba(45, 219, 222, 0.3);
}
