body {
    margin: 0;
    padding: 0;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
}

#game-title {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    font-size: 2.6rem;
    font-weight: bold;
    white-space: nowrap;
    z-index: 20;
    pointer-events: none;
    background: linear-gradient(90deg,
        #ff0000, #ff8800, #ffff00, #00cc00,
        #0099ff, #8800ff, #ff0088, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% auto;
    animation: rainbow-scroll 4s linear infinite;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.9)) drop-shadow(0 2px 4px rgba(0,0,0,0.9));
    letter-spacing: 3px;
    user-select: none;
}

@keyframes rainbow-scroll {
    0%   { background-position: 0% center; }
    100% { background-position: 300% center; }
}

#game-container {
    position: absolute;
    z-index: 1;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

#meme-bg {
    position: fixed;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    z-index: 0;
    background-repeat: repeat;
    background-size: 300px;
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0.6;
}

#ui-layer {
    position: absolute;
    width: 800px;
    height: 600px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

#start-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    font-size: 24px;
    background: #ff69b4;
    color: white;
    border: 4px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
}

#view-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    pointer-events: auto;
    z-index: 10;
}

#start-btn:hover {
    background: #ff1493;
}

#dialogue-box {
    width: 90%;
    height: 120px;
    background-color: rgba(0, 0, 100, 0.85);
    border: 4px solid white;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 15px;
    box-sizing: border-box;
    color: white;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    cursor: pointer;
}

#dialogue-box.hidden {
    display: none;
}

#speaker-name {
    font-weight: bold;
    color: #ffb6c1;
    margin-bottom: 8px;
    font-size: 20px;
    text-transform: uppercase;
}

#dialogue-text {
    flex-grow: 1;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Touch controls */
#touch-controls {
    display: none; /* shown via JS on touch devices */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 800px;
    height: 140px;
    z-index: 5;
    pointer-events: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px 16px 20px;
    box-sizing: border-box;
}

#joystick-zone {
    pointer-events: auto;
}

#joystick-base {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.4);
    position: relative;
    touch-action: none;
    user-select: none;
}

#joystick-stick {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 105, 180, 0.85);
    border: 3px solid #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#touch-btn-a {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 105, 180, 0.85);
    border: 3px solid #fff;
    color: #fff;
    font-size: 26px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
