body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background: #000;
    color: #fff;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #00ff00;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

#hud.collapsed {
    width: 50px;
    height: 50px;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    left: 180px; /* Position to the right of the radar */
}

#hud.collapsed .hud-content {
    display: none;
}

#hud.collapsed::before {
    content: ">";
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ff0000;
}

.hud-content {
    display: block;
}

#alienCount {
    color: #00ff00;
    font-size: 18px;
}

#humanCount {
    color: #00aaff;
    font-size: 16px;
}

/* Suspicion Meter Styles - Separate Box */
#suspicionMeter {
    position: absolute;
    top: 20px;
    left: 250px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ff9800;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

#suspicionBar {
    display: flex;
    gap: 3px;
    align-items: center;
}

.suspicion-segment {
    width: 25px;
    height: 12px;
    border: 2px solid #666;
    border-radius: 2px;
    background: transparent;
    transition: all 0.3s ease;
}

.suspicion-segment.yellow {
    background: #ffeb3b;
    border-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 235, 59, 0.6);
}

.suspicion-segment.red {
    background: #f44336;
    border-color: #d32f2f;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

.suspicion-segment.purple {
    background: #9c27b0;
    border-color: #7b1fa2;
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.8);
    animation: pulsePurple 0.5s infinite alternate;
}

@keyframes pulsePurple {
    0% { 
        box-shadow: 0 0 12px rgba(156, 39, 176, 0.8);
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 0 20px rgba(156, 39, 176, 1);
        transform: scale(1.05);
    }
}

#suspicionLabel {
    color: #ff9800;
    font-size: 14px;
    font-weight: bold;
}

/* Alien Flash Overlay Styles */
#alienFlashOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
}

.flash-alien-emoji {
    position: absolute;
    font-size: 60px;
    pointer-events: none;
    user-select: none;
    z-index: 10000;
}

@keyframes alienFlash {
    0% { 
        opacity: 0.3;
        transform: scale(0.8) rotate(0deg);
    }
    100% { 
        opacity: 1;
        transform: scale(1.2) rotate(15deg);
    }
}

#instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ffaa00;
    max-width: 300px;
    pointer-events: auto;
    font-size: 14px;
    transition: all 0.3s ease;
}

#instructions.collapsed {
    width: 50px;
    height: 50px;
    padding: 12px;
    max-width: none;
    border-radius: 50%;
    cursor: pointer;
}

#instructions.collapsed .instruction-content {
    display: none;
}

#instructions.collapsed::before {
    content: "❓";
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.instruction-content {
    display: block;
}

#instructions h3 {
    margin-top: 0;
    color: #ffaa00;
    text-shadow: 0 0 5px #ffaa00;
}

#instructions p {
    margin: 8px 0;
    line-height: 1.3;
}

#gameTitle {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    pointer-events: none;
    letter-spacing: 2px;
}

#radar {
    position: absolute;
    top: 20px;
    left: 250px;
    width: 150px;
    height: 150px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Universal hiding behavior for radar on all devices - copy suspicion meter pattern */
#radar.universal-hide {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 20px;
    left: 20px; /* Radar takes the leftmost position when collapsed */
    width: 150px;
    height: 150px;
}

#radar.universal-hide.visible {
    opacity: 1;
}

/* When HUD is expanded, hide universal radar */
#hud:not(.collapsed) ~ #radar.universal-hide {
    opacity: 0;
}

.radar-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.radar-player {
    background: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.radar-npc {
    background: #ff0000;
    box-shadow: 0 0 4px #ff0000;
}

.radar-convinced {
    background: #90EE90;
    box-shadow: 0 0 4px #90EE90;
}

.floating-emoji {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    z-index: 999;
    user-select: none;
}

.heart-emoji {
    animation: floatHeart 3s ease-in-out infinite;
}

.reaction-emoji {
    animation: bounceReaction 0.8s ease-out forwards;
}

@keyframes floatHeart {
    0%, 100% { 
        transform: translate(-50%, -150%) translateY(0px) rotate(0deg);
        opacity: 0.8;
    }
    50% { 
        transform: translate(-50%, -150%) translateY(-10px) rotate(5deg);
        opacity: 1;
    }
}

@keyframes bounceReaction {
    0% { 
        transform: translate(-50%, -150%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -150%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -150%) scale(1);
        opacity: 1;
    }
}

#joystick {
    position: absolute;
    bottom: 80px;
    left: 80px;
    width: 120px;
    height: 120px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: none;
    pointer-events: auto;
}

#joystickKnob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    cursor: grab;
}

#rotationJoystick {
    position: absolute;
    bottom: 80px;
    right: 80px;
    width: 120px;
    height: 120px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: none;
    pointer-events: auto;
}

#rotationKnob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    cursor: grab;
}

#joystickKnob:active, #rotationKnob:active {
    cursor: grabbing;
}

.joystick-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    text-align: center;
    pointer-events: none;
}

#dialogueBox {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 12px;
    border: 3px solid #fff;
    min-width: 500px;
    max-width: 80%;
    display: none;
    pointer-events: auto;
}

#dialogueText {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.4;
}

#dialogueOptions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dialogue-option {
    background: #333;
    color: #fff;
    border: 2px solid #666;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.dialogue-option:hover {
    background: #444;
    border-color: #00aaff;
    transform: translateX(5px);
}

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    pointer-events: auto;
}

#gameOverScreen h1 {
    color: #ff0000;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff0000;
}

#gameOverScreen.victory h1 {
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
}

#gameOverScreen p {
    font-size: 20px;
    margin-bottom: 30px;
    text-align: center;
    max-width: 600px;
    line-height: 1.6;
}

#restartButton {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

#restartButton:hover {
    background: #00aa00;
    transform: scale(1.05);
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.7;
}

@media (max-width: 1024px) and (pointer: coarse) {
    /* Show joysticks on touch devices (phones and tablets) */
    #joystick, #rotationJoystick {
        display: block;
    }
    
    /* Fix dialogue box for tablets - just increase height limits */
    #dialogueBox {
        min-width: 300px;
        max-width: 90%;
        max-height: 65vh;
    }
    
    #dialogueOptions {
        max-height: 50vh;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    /* Custom scrollbar for dialogue options */
    #dialogueOptions::-webkit-scrollbar {
        width: 8px;
    }
    
    #dialogueOptions::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
    
    #dialogueOptions::-webkit-scrollbar-thumb {
        background: #00aaff;
        border-radius: 4px;
    }
}

/* iPad landscape font adjustments ONLY - no layout changes */
@media (min-width: 1025px) and (max-width: 1366px) {
    #gameTitle {
        font-size: 20px;  /* Smaller font for iPad landscape */
    }
    
    /* You can add other font-only adjustments here if needed */
}

/* Phone landscape adjustments - scale everything down but keep positions */
@media (max-width: 932px) and (orientation: landscape) and (pointer: coarse) {
    /* Scale down HUD */
    #hud {
        padding: 10px;
        gap: 6px;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    #alienCount {
        font-size: 14px;
    }
    
    #humanCount {
        font-size: 12px;
    }
    
    /* Scale down suspicion meter */
    #suspicionMeter {
        left: 220px;  /* Adjust for smaller HUD */
        padding: 10px;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    .suspicion-segment {
        width: 20px;
        height: 10px;
    }
    
    #suspicionLabel {
        font-size: 11px;
    }
    
    /* Smaller game title */
    #gameTitle {
        font-size: 16px;
        letter-spacing: 1px;
        top: 8px;
    }
    
    /* Scale down radar */
    #radar {
        width: 110px;
        height: 110px;
        top: 20px;  /* Move to top */
        left: 180px;  /* Position to right of HUD */
        transform: scale(0.85);
        transform-origin: top left;
        transition: all 0.3s ease;
    }
    
    /* Radar positioning now handled by JavaScript */
    
    /* Scale down instructions when expanded */
    #instructions {
        max-width: 250px;
        padding: 12px;
        font-size: 12px;
        top: 15px;
        right: 15px;
    }
    
    #instructions h3 {
        font-size: 14px;
    }
    
    #instructions p {
        margin: 6px 0;
        line-height: 1.2;
        font-size: 11px;
    }
    
    /* When collapsed, make the ? button smaller */
    #instructions.collapsed {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    #instructions.collapsed::before {
        font-size: 20px;
    }
    
    /* Smaller joysticks for phones in landscape */
    #joystick, #rotationJoystick {
        width: 100px;
        height: 100px;
        bottom: 60px;
    }
    
    #joystick {
        left: 60px;
    }
    
    #rotationJoystick {
        right: 60px;
    }
    
    #joystickKnob, #rotationKnob {
        width: 35px;
        height: 35px;
    }
    
    .joystick-label {
        font-size: 10px;
        bottom: -20px;
    }
    
    /* Scale down dialogue box */
    #dialogueBox {
        padding: 15px;
        max-height: 70vh;
        min-width: 400px;
    }
    
    #dialogueText {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .dialogue-option {
        font-size: 13px;
        padding: 10px 14px;
    }
}

@media (max-width: 1024px) {
    /* iPad and smaller tablets - restored to original 1024px breakpoint */
    #joystick, #rotationJoystick {
        display: block;
        width: 120px;
        height: 120px;
    }
    
    #instructions {
        position: static;
        margin: 20px;
    }
    
    #radar {
        top: 20px;
        left: 220px;
        width: 120px;
        height: 120px;
        transition: all 0.3s ease;
    }
    
    /* Universal hide positioning for radar on tablets */
    #radar.universal-hide {
        top: 20px;
        left: 20px; /* Radar takes leftmost position */
        width: 120px;
        height: 120px;
    }
    
    /* HUD collapsed positioning for tablets */
    #hud.collapsed {
        left: 150px; /* Position to the right of the smaller radar */
        width: 50px;
        height: 50px;
        padding: 12px;
    }
    
    #hud.collapsed::before {
        content: ">";
        font-size: 24px;
        font-weight: bold;
        color: #ff0000;
    }
    
    .dialogue-option {
        font-size: 16px;
        padding: 15px;
        margin-bottom: 8px;
    }
    
    /* Adjust HUD for tablets */
    #hud {
        padding: 12px;
        gap: 8px;
    }
    
    #alienCount {
        font-size: 16px;
    }
    
    #humanCount {
        font-size: 14px;
    }
    
    /* Suspicion meter positioning for tablets - but respect universal-hide positioning */
    #suspicionMeter:not(.universal-hide) {
        top: 120px;  /* Move below HUD to avoid overlap */
        left: 20px;  /* Align with HUD left edge */
        padding: 12px;
    }

    #gameTitle {
        font-size: 20px;  /* Smaller than desktop */
        left: 60%;  /* Move right to avoid overlap */
        letter-spacing: 1px;  /* Tighten letter spacing */
    }
    
    .suspicion-segment {
        width: 20px;
        height: 10px;
    }
    
    #suspicionLabel {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Small phones */
    #joystick, #rotationJoystick {
        width: 80px;
        height: 80px;
        bottom: 60px;
    }
    
    #joystick {
        left: 60px;
    }
    
    #rotationJoystick {
        right: 60px;
    }
    
    #joystickKnob, #rotationKnob {
        width: 30px;
        height: 30px;
    }
    
    .joystick-label {
        font-size: 10px;
        bottom: -20px;
    }
    
    /* Dialogue box for phones */
    #dialogueBox {
        max-height: 65vh;
        bottom: 5px;
        left: 2%;
        right: 2%;
        width: 96%;
        min-width: auto;
    }
    
    #dialogueOptions {
        max-height: 50vh;
    }
    
    .dialogue-option {
        font-size: 14px;
        padding: 12px;
    }
    
    /* Compact HUD for phones */
    #hud {
        padding: 8px;
        gap: 6px;
        font-size: 12px;
    }
    
    #alienCount {
        font-size: 14px;
    }
    
    #humanCount {
        font-size: 12px;
    }
    
    /* Stack suspicion meter below HUD on phones */
    #suspicionMeter {
        top: 110px;
        left: 20px;
        padding: 8px;
    }
    
    .suspicion-segment {
        width: 18px;
        height: 8px;
    }
    
    #suspicionLabel {
        font-size: 10px;
    }
    
    #gameTitle {
        font-size: 20px;
        top: 5px;
    }
}

/* Universal hiding behavior for suspicion meter on all devices */
#suspicionMeter.universal-hide {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 20px;
    right: 120px; /* Position much further to the left to avoid overlap */
    left: auto;
    width: auto;
    padding: 10px;
}

#suspicionMeter.universal-hide.visible {
    opacity: 1;
}

/* When instructions are expanded, hide universal suspicion meter */
#instructions:not(.collapsed) ~ #suspicionMeter.universal-hide {
    opacity: 0;
}

/* iPhone-specific layout adjustments */
@media (max-width: 932px) and (max-height: 430px) {
    /* Hide suspicion meter in its original position */
    #suspicionMeter {
        display: none;
    }
    
    /* Mobile suspicion meter - positioned next to collapsed instructions */
    #suspicionMeter.mobile-position {
        display: block;
        position: absolute;
        top: 20px;
        right: 80px; /* Position to the left of the collapsed instructions */
        left: auto;
        width: auto;
        padding: 10px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #suspicionMeter.mobile-position.visible {
        opacity: 1;
    }
    
    /* When instructions are expanded, hide mobile suspicion meter */
    #instructions:not(.collapsed) ~ #suspicionMeter.mobile-position {
        display: none;
    }
    
    /* Adjust suspicion bar size for mobile */
    #suspicionMeter.mobile-position #suspicionBar {
        gap: 2px;
    }
    
    #suspicionMeter.mobile-position .suspicion-segment {
        width: 18px;
        height: 10px;
    }
    
    #suspicionMeter.mobile-position #suspicionLabel {
        font-size: 11px;
        margin-top: 2px;
    }
}

/* Phone landscape adjustments - MUST BE LAST to override tablet styles */
@media (max-width: 932px) and (orientation: landscape) {
    /* Scale down HUD */
    #hud {
        padding: 10px !important;
        gap: 6px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    #alienCount {
        font-size: 14px !important;
    }
    
    #humanCount {
        font-size: 12px !important;
    }
    
    /* Scale down suspicion meter - but respect universal-hide positioning */
    #suspicionMeter:not(.universal-hide):not(.mobile-position) {
        top: 20px !important;  /* Keep at top */
        left: 160px !important;  /* Closer to HUD - reduced from 220px */
        padding: 10px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    /* iPhone landscape with mobile positioning */
    #suspicionMeter.mobile-position {
        display: block !important;
        top: 15px !important;
        right: 60px !important;
        left: auto !important;
        transform: scale(0.85);
        transform-origin: top right;
    }
    
    /* Universal hide positioning for phone landscape */
    #suspicionMeter.universal-hide {
        top: 15px !important;
        right: 80px !important;
        left: auto !important;
        transform: scale(0.85);
        transform-origin: top right;
    }
    
    /* Universal hide positioning for radar on phone landscape */
    #radar.universal-hide {
        top: 20px !important;
        left: 20px !important; /* Radar takes leftmost position */
        width: 100px !important;
        height: 100px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    /* HUD collapsed positioning for phone landscape */
    #hud.collapsed {
        left: 110px !important; /* Position to the right of the smaller radar */
        width: 50px !important;
        height: 50px !important;
        padding: 12px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    .suspicion-segment {
        width: 20px !important;
        height: 10px !important;
    }
    
    #suspicionLabel {
        font-size: 11px !important;
    }
    
    /* Smaller game title */
    #gameTitle {
        font-size: 16px !important;
        letter-spacing: 1px !important;
        top: 8px !important;
        left: 50% !important;  /* Center it */
    }
    
    /* Scale down radar with dot container fix */
    #radar {
        width: 100px !important;
        height: 100px !important;
        top: 20px !important;
        left: 160px !important;
        overflow: hidden !important; /* Hide dots that go outside */
        border-radius: 50% !important; /* Ensure it stays circular */
        transition: all 0.3s ease !important;
    }
    
    /* Radar positioning now handled by JavaScript */
    
    /* Scale the dots container to match JavaScript calculations */
    #radarDots {
        width: 150px !important;
        height: 150px !important;
        transform: scale(0.667) !important; /* 100px / 150px = 0.667 */
        transform-origin: top left !important;
    }
    
    /* Ensure radar dots scale properly */
    .radar-dot {
        width: 4px !important;  /* Smaller dots */
        height: 4px !important;
    }
    
    /* Scale down instructions - much smaller for phones */
    #instructions {
        position: absolute !important;
        max-width: 180px !important;  /* Even smaller */
        padding: 8px !important;  /* Minimal padding */
        font-size: 10px !important;
        top: 10px !important;  /* Closer to top */
        right: 10px !important;  /* Closer to edge */
        margin: 0 !important;  /* Override any margins */
    }
    
    #instructions h3 {
        font-size: 12px !important;
        margin-bottom: 4px !important;
        margin-top: 0 !important;
    }
    
    #instructions p {
        margin: 3px 0 !important;
        line-height: 1.1 !important;
        font-size: 9px !important;  /* Very small text */
    }
    
    /* When collapsed, make the ? button much smaller */
    #instructions.collapsed {
        width: 30px !important;  /* Even smaller */
        height: 30px !important;
        padding: 6px !important;  /* Minimal padding */
        max-width: 30px !important;  /* Force max width */
    }
    
    #instructions.collapsed::before {
        font-size: 16px !important;  /* Smaller ? */
    }
    
    /* Make HUD collapsed button same size as question mark on phone landscape */
    #hud.collapsed {
        width: 30px !important;  /* Match question mark size */
        height: 30px !important;
        padding: 6px !important;  /* Match question mark padding */
    }
    
    #hud.collapsed::before {
        content: ">" !important;  /* Use character not emoji */
        font-size: 16px !important;  /* Match question mark font size */
        font-weight: bold !important;
        color: #ff0000 !important;  /* Red color */
    }
    
    /* Ensure content is hidden when collapsed */
    #instructions.collapsed .instruction-content {
        display: none !important;
    }
    
    /* Smaller joysticks for phones in landscape */
    #joystick, #rotationJoystick {
        width: 80px !important;  /* Reduced from 100px */
        height: 80px !important;  /* Reduced from 100px */
        bottom: 30px !important;  /* Closer to bottom */
    }
    
    #joystick {
        left: 30px !important;  /* Reduced from 40px */
    }
    
    #rotationJoystick {
        right: 30px !important;  /* Reduced from 40px */
    }
    
    #joystickKnob, #rotationKnob {
        width: 28px !important;  /* Reduced from 35px */
        height: 28px !important;  /* Reduced from 35px */
    }
    
    .joystick-label {
        font-size: 10px !important;
        bottom: -20px !important;
    }
    
    /* Scale down dialogue box */
    #dialogueBox {
        padding: 10px !important;  /* Reduced from 15px */
        max-height: 65vh !important;  /* Reduced from 70vh */
        min-width: 300px !important;  /* Reduced from 400px */
        max-width: 85% !important;  /* Ensure it fits on screen */
    }
    
    #dialogueText {
        font-size: 12px !important;  /* Reduced from 14px */
        margin-bottom: 8px !important;  /* Reduced from 10px */
        line-height: 1.3 !important;
    }
    
    .dialogue-option {
        font-size: 11px !important;  /* Reduced from 13px */
        padding: 8px 12px !important;  /* Reduced from 10px 14px */
        margin-bottom: 5px !important;  /* Reduced from 6px */
    }
    
    #dialogueOptions {
        gap: 5px !important;  /* Tighter spacing between options */
        max-height: 45vh !important;  /* Limit height to prevent overflow */
    }
}

/* Rotate screen message for portrait mode */
#rotateMessage {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.rotate-content {
    padding: 20px;
}

.rotate-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotate-content h2 {
    color: #00ff00;
    font-size: 24px;
    margin-bottom: 10px;
}

.rotate-content p {
    color: #fff;
    font-size: 16px;
}

/* Portrait mode - hide game UI and show rotate message */
@media (max-width: 932px) and (orientation: portrait) {
    #rotateMessage {
        display: flex !important;
    }
    
    /* Hide all game UI elements */
    #hud,
    #suspicionMeter,
    #instructions,
    #radar,
    #gameTitle,
    #joystick,
    #rotationJoystick,
    #dialogueBox {
        display: none !important;
    }
}

.close-dialogue-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1002;
}

.close-dialogue-btn:hover {
    background: #ff4444;
    color: white;
    transform: scale(1.1);
}