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

body {
    background: #4a3728;  /* 暗棕色背景 - RPG 溫暖基調 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
}

canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: pointer;
    border: 2px solid #8b6914;  /* 金棕邊框 */
}

.hud {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 36px;
    background: rgba(74, 55, 40, 0.95);  /* 深棕半透明 */
    border-top: 2px solid #8b6914;  /* 金色邊框 */
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #f0e6d2;  /* 米色文字 */
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
    z-index: 100;
}

.hud span {
    flex: 1;
}

.hud #hud-time {
    text-align: left;
    color: #d4a43a;  /* 金色 */
}

.hud #hud-log {
    text-align: center;
    color: #c0b090;  /* 淡棕 */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hud #hud-stats {
    text-align: right;
    color: #6abf69;  /* 綠色 */
}

.popup {
    position: fixed;
    background: rgba(74, 55, 40, 0.98);  /* 深棕半透明 */
    border: 3px solid #8b6914;  /* 金邊 */
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: #f0e6d2;  /* 米色文字 */
    padding: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    max-width: 400px;
    z-index: 200;
    line-height: 1.6;
}

.popup h3 {
    color: #d4a43a;  /* 金色標題 */
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.popup .close {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #e07070;  /* 紅色 */
    cursor: pointer;
    font-size: 16px;
}

.popup .stat-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.popup .stat-label {
    color: #a0907a;  /* 淺棕標籤 */
}

.popup .stat-value {
    color: #d4a43a;  /* 金色數值 */
}

.popup .status-ok {
    color: #6abf69;  /* 綠色正常 */
}

.popup .status-bad {
    color: #e07070;  /* 紅色異常 */
}

.hidden {
    display: none;
}
