body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}
canvas {
    display: block;
}
/* UI System Styles */
.ui-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    gap: 15px; /* Adds space between UI sections */
}
/* New Top Bar Container */
.ui-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    pointer-events: auto; /* Enable clicks on items inside */
}
/* New Left Column for stacked panels */
.ui-left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
}
.panel {
    background: rgba(10, 15, 20, 0.75);
    color: #e0e0e0;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative; /* All panels are relative now */
}
.panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#character-panel {
    padding: 20px;
    border: 2px solid #4a9eff;
    min-width: 300px;
    box-shadow: 0 0 15px rgba(74, 158, 255, 0.5), inset 0 0 5px rgba(74, 158, 255, 0.3);
    transform: translateY(-20px);
}
.character-panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.character-panel-indicator {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    margin-right: 10px;
}
.character-panel-title {
    color: #ff8c42;
    font-weight: bold;
}
.character-panel-body {
    font-size: 14px;
    line-height: 1.6;
}
.character-panel-body span {
    color: #ffffff;
    background: rgba(74, 158, 255, 0.2);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid rgba(74, 158, 255, 0.5);
    font-family: 'Courier New', Courier, monospace;
}
#interaction-panel {
    position: absolute;
    bottom: 20px; /* Position relative to viewport bottom */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(30,30,30,0.95));
    padding: 25px 35px;
    border-radius: 20px;
    border: 2px solid #66ff66;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 6px 25px rgba(102,255,102,0.4);
}
.interaction-title {
    color: #66ff66;
    font-weight: bold;
    margin-bottom: 10px;
}
#interaction-text {
    font-size: 16px;
    line-height: 1.5;
}
.interaction-tip {
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(102,255,102,0.2);
    border-radius: 15px;
    font-size: 14px;
}
.interaction-tip span {
    color: #66ff66;
}
#control-hints {
    background: rgba(0, 0, 0, 0.7);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ffc400;
    font-size: 24px;
    box-shadow: 0 0 15px rgba(255, 196, 0, 0.6);
    opacity: 1;
    cursor: pointer;
    color: #ffc400;
}