#hud {
    position: fixed;
    top: var(--safe-area-inset-top, 0px);
    left: var(--safe-area-inset-left, 0px);
    right: var(--safe-area-inset-right, 0px);
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 1rem;
    border-bottom: 2px solid #8b0000;
    display: flex;
    
    gap: 2rem;
    z-index: 1000;
}

.hud-item {
    font-size: 0.9rem;
    color: #d4d4d4;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.hud-item span {
    color: #8b0000;
    font-weight: bold;
}

.hud-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .hud-label {
        display: none;
    }
    
    .hud-item {
        gap: 0.2rem;
    }
    
    #hud {
        gap: 1rem;
    }
}

.purchased-energy {
    color: #d4a574;
    font-weight: bold;
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.purchased-energy.energy-updated {
    animation: energyAppear 0.8s ease-out;
}

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

.buy-energy-link {
    color: #8b0000;
    text-decoration: none;
    font-weight: bold;
    padding: 0.1rem 0.4rem;
    border: 1px solid #8b0000;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

.buy-energy-link:hover {
    background: #8b0000;
    color: #fff;
    transform: scale(1.1);
}

.low-energy-warning {
    position: fixed;
    top: calc(60px + var(--safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    animation: slideDown 0.5s ease-out;
    max-width: calc(100vw - 20px);
}

.low-energy-content {
    background: linear-gradient(135deg, rgb(139, 0, 0) 0%, rgb(100, 0, 0) 100%);
    border: 2px solid #ff4444;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    animation: redGlow 2s ease-in-out infinite;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.warning-icon {
    flex-shrink: 0;
    animation: warningBlink 1.5s ease-in-out infinite;
}

.warning-text {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}

.warning-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.buy-energy-warning-btn,
.sleep-warning-btn,
.dismiss-warning-btn {
    background: #fff;
    color: #8b0000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 120px;
}

.dismiss-warning-btn {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.buy-energy-warning-btn:hover,
.sleep-warning-btn:hover {
    background: #ffcc00;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
}

.dismiss-warning-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.buy-energy-warning-btn:active,
.sleep-warning-btn:active,
.dismiss-warning-btn:active {
    transform: scale(0.98);
}

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

@keyframes redGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6),
                    0 0 40px rgba(255, 0, 0, 0.4),
                    0 0 60px rgba(255, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.9),
                    0 0 60px rgba(255, 0, 0, 0.6),
                    0 0 90px rgba(255, 0, 0, 0.4);
    }
}

@keyframes warningBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 767px) {
    .low-energy-warning {
        left: 10px;
        right: 10px;
        transform: none;
        top: calc(55px + var(--safe-area-inset-top, 0px));
        max-width: calc(100vw - 20px);
    }
    
    .low-energy-content {
        padding: 0.8rem 0.8rem 0.6rem;
        gap: 0.6rem;
    }
    
    .warning-text {
        font-size: 0.85rem;
    }
    
    .warning-buttons {
        gap: 0.5rem;
    }
    
    .buy-energy-warning-btn,
    .sleep-warning-btn,
    .dismiss-warning-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.dialogue-box {
    position: absolute;
    bottom: calc(2% + var(--safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1000px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #512c08;
    border-radius: 10px;
    padding: 0.8rem;
}

.dialogue-speaker {
    color: #8b0000;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.dialogue-text {
    color: #d4d4d4;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.dialogue-input-wrapper {
    position: relative;
    width: 100%;
}

.dialogue-input {
    width: 100%;
    padding: 0.8rem;
    padding-right: 3rem;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #d4d4d4;
    font-size: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.dialogue-input:focus {
    outline: none;
    border-color: #8b0000;
}

.voice-input-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 50%;
    color: #d4d4d4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
}

.voice-input-btn:hover {
    background: #3a3a3a;
    border-color: #8b0000;
}

.voice-input-btn.recording {
    background: #8b0000;
    border-color: #ff0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dialogue-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1rem;
}

.dialogue-option {
    padding: 0.5rem 1rem;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #d4d4d4;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.dialogue-option:hover {
    background: #3a3a3a;
    border-color: #8b0000;
}

.dialogue-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1a1a1a;
    border-color: #333;
}

.dialogue-option:disabled:hover {
    background: #1a1a1a;
    border-color: #333;
}

.dialogue-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #d4d4d4;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s;
}

.dialogue-close-btn:hover {
    background: #8b0000;
    border-color: #8b0000;
}

.dialogue-finish-btn {
    width: 100%;
    padding: 0.6rem;
    margin-top: 1rem;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #d4d4d4;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.dialogue-finish-btn:hover {
    background: #3a3a3a;
    border-color: #8b0000;
}

@keyframes summaryGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 170, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 170, 0, 0.6), 0 0 25px rgba(255, 170, 0, 0.3);
    }
}

@keyframes summaryFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px);
    }
}

@keyframes dialogueFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

.summary-playing {
    animation: summaryGlow 2s ease-in-out infinite;
    color: #ffaa00;
    font-size: 1.05rem;
    line-height: 1.7;
    padding: 0.5rem 0;
}

.summary-fade-out {
    animation: summaryFadeOut 0.8s ease-out forwards;
}

.dialogue-closing {
    animation: dialogueFadeOut 0.5s ease-out forwards;
}

@keyframes loaderDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

.dialogue-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ffaa00;
    font-size: 1.1rem;
}

.dialogue-loader::after {
    content: '...';
    display: inline-block;
    animation: loaderDots 1.5s infinite;
}

.dialogue-loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 170, 0, 0.2);
    border-top-color: #ffaa00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .dialogue-box {
        bottom: calc(1% + var(--safe-area-inset-bottom, 0px));
        width: 98%;
        padding: 0.5rem;
        border-radius: 6px;
    }

    .dialogue-speaker {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .dialogue-text {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.6rem;
    }

    .dialogue-input {
        padding: 0.5rem;
        padding-right: 2.5rem;
        font-size: 0.85rem;
    }

    .dialogue-options {
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .dialogue-option {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .voice-input-btn {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.9rem;
    }

    .dialogue-close-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .dialogue-finish-btn {
        padding: 0.5rem;
        margin-top: 0.6rem;
        font-size: 0.85rem;
    }

    .summary-playing {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .dialogue-loader {
        font-size: 0.95rem;
    }

    .dialogue-loader-spinner {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }

    @keyframes summaryGlow {
        0%, 100% {
            text-shadow: 0 0 3px rgba(255, 170, 0, 0.3);
        }
        50% {
            text-shadow: 0 0 8px rgba(255, 170, 0, 0.5), 0 0 15px rgba(255, 170, 0, 0.2);
        }
    }
}

.guest-card {
   
}

.guest-card.suspicious {
    border-color: #ff8800;
}

.guest-card.dangerous {
    border-color: #ff0000;
}

.guest-name {
    color: #8b0000;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.guest-role {
    color: #888;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.guest-suspicion {
    margin-bottom: 1rem;
}

.suspicion-bar {
    width: 100%;
    height: 20px;
    background: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.suspicion-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a4a4a, #ff8800, #ff0000);
    transition: width 0.5s ease;
}

.suspicion-history {
    margin: 1rem 0;
    padding: 0.8rem;
    
}

.suspicion-history-title {
    color: #ff8800;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.suspicion-history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    color: #d4d4d4;
    font-size: 0.85rem;
}

.suspicion-history-item.blink-item {
    animation: blink-highlight 1s ease-in-out infinite;
    background: rgba(139, 0, 0, 0.1);
    padding: 0.5rem;
    margin: 0.2rem -0.5rem;
    border-radius: 4px;
    border-left: 3px solid #8b0000;
}

@keyframes blink-highlight {
    0%, 100% {
        background: rgba(139, 0, 0, 0.2);
        border-left-color: #8b0000;
    }
    50% {
        background: rgba(255, 136, 0, 0.3);
        border-left-color: #ff8800;
    }
}

.suspicion-icon {
    font-size: 1rem;
}

.suspicion-reason {
    flex: 1;
    color: #aaa;
}

.suspicion-points {
    color: #ff8800;
    font-weight: bold;
}

.guest-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.guest-action-btn {
    flex: 1;
    min-width: 120px;
    max-width: 100%;
    padding: 0.8rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.guest-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #333;
    border-color: #555;
}

.guest-action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.notification {
    position: fixed;
    top: calc(100px + var(--safe-area-inset-top, 0px));
    right: calc(20px + var(--safe-area-inset-right, 0px));
    background: rgba(139, 0, 0, 0.9);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.5s ease-out;
    z-index: 10020;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .guest-action-btn {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .guest-action-btn {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    .guest-actions {
        gap: 0.4rem;
    }
}
