/* Viewport-First Responsive Design */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e; /* Dark fantasy background */
    color: #e5e5e5;
    font-family: 'Georgia', serif;
    font-size: 16px;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 0;
}

/* Header (Status Panel) */
#game-header {
    background-color: #0f0f1b;
    padding: 10px;
    border-bottom: 2px solid #5a5a8a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

#status-panel {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    font-weight: bold;
}

#time-display, #health-display, #energy-display {
    padding: 5px 10px;
    background-color: #2e2e4e;
    border-radius: 5px;
    margin: 0 5px;
}

#health-display { color: #f44336; }
#energy-display { color: #8bc34a; }

/* Main Adventure Log */
#adventure-log {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.log-entry {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    line-height: 1.6;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dm-message {
    background-color: #2e2e4e;
    border-left: 4px solid #5a5a8a;
    color: #e5e5e5;
}

.player-action {
    background-color: #1b1b36;
    border-right: 4px solid #7c6f5d;
    text-align: right;
    color: #c0c0c0;
}

.system-message {
    text-align: center;
    font-style: italic;
    color: #7a7a9a;
    font-size: 0.85em;
    padding: 5px 0;
}

.dice-roll {
    font-weight: bold;
    color: #ffd700; /* Gold for dice rolls */
}

/* Footer (Input Area) */
#input-area {
    padding: 10px;
    background-color: #0f0f1b;
    border-top: 2px solid #5a5a8a;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#action-form {
    display: flex;
    width: 100%;
}

#action-input {
    flex-grow: 1;
    padding: 12px;
    border: none;
    border-radius: 5px 0 0 5px;
    background-color: #3a3a5e;
    color: #ffffff;
    font-size: 1em;
}

#action-input:focus {
    outline: none;
    box-shadow: 0 0 5px #8bc34a;
}

#send-button {
    padding: 12px 20px;
    border: none;
    background-color: #5a5a8a;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    transition: background-color 0.2s;
}

#send-button:hover:not(:disabled) {
    background-color: #7c7c9f;
}

#send-button:disabled {
    background-color: #33334c;
    cursor: not-allowed;
}

#message-area {
    color: #f44336;
    font-size: 0.9em;
    text-align: center;
}

.loading-indicator {
    background-color: #4a4a6e;
    color: #ffffff;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
}