:root {
    /* Game Specific Colors Only */
    --color-bg-dark: #1a1a1a;
    --color-bg-panel: #2d2d2d;
    --color-text-light: #e0e0e0;
    --color-primary-game: #ffd700;
    /* Renamed to avoid conflict */
    /* Gold */
    --color-primary-hover: #ffed4a;
    --color-focus: #00e5ff;
    /* Cyan for focus */

    /* Typography */
    --font-heading: 'Georgia', serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;

    /* Borders */
    --border-radius: 8px;
    --border-width: 2px;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    /* Changed from fixed height */
}

/* Header / Quest Bar */
.quest-bar {
    background-color: var(--color-bg-panel);
    padding: var(--spacing-md);
    border-bottom: 1px solid #444;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.quest-list {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-list li {
    list-style: none;
}

.quest-node {
    background: none;
    border: none;
    color: var(--color-text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.quest-node:not([disabled]) {
    opacity: 1;
}

.quest-node[aria-current="step"] {
    color: var(--color-primary-game);
    font-weight: bold;
}

.quest-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
    margin-bottom: var(--spacing-sm);
}

/* Main Layout */
.main-layout {
    display: flex;
    flex-direction: column;
    /* Default to column for mobile */
    flex: 1;
    overflow: visible;
    /* Changed from hidden */
}

@media (min-width: 768px) {
    .main-layout {
        flex-direction: row;
    }
}

img {
    max-width: 100%;
    height: auto;
}

/* HUD */
.hud {
    width: 250px;
    background-color: var(--color-bg-panel);
    padding: var(--spacing-md);
    border-right: 1px solid #444;
    overflow-y: auto;
}

.hud-section {
    margin-bottom: var(--spacing-lg);
}

.hud-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-primary-game);
    border-bottom: 1px solid #555;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.hud-stat {
    font-size: 1.1rem;
    font-weight: bold;
}

.inventory-list {
    list-style: none;
    padding: 0;
}

.inventory-item {
    padding: var(--spacing-sm);
    background-color: #3d3d3d;
    margin-bottom: var(--spacing-sm);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Controls */
.mode-toggle {
    width: 100%;
    padding: var(--spacing-md);
    background-color: #444;
    color: white;
    border: 2px solid #666;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: bold;
}

.mode-toggle[aria-pressed="true"] {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
}

/* Game Stage */
.game-stage {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    position: relative;
}

.quest-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #f0f0f0;
    /* Light background for the "web page" simulation */
    color: #333;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    min-height: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Quest Item Styles */
.quest-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.nav-container nav {
    flex: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: left;
}

.data-table th {
    background-color: #e0e0e0;
    font-weight: bold;
}

/* A5 Region Styling */
#issue-a5 {
    border: 2px solid #4a90e2;
    padding: 1rem;
    background-color: #fff;
    border-radius: 4px;
    position: relative;
}

#issue-a5::before {
    content: "News Feed";
    position: absolute;
    top: -10px;
    left: 10px;
    background: #4a90e2;
    color: white;
    padding: 0 5px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Intro Screen */
.intro-screen h1 {
    color: var(--color-bg-dark);
}

.instructions-list {
    background: #e0e0e0;
    padding: 1.5rem 2.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.instructions-list li {
    margin-bottom: 0.5rem;
}

/* Combat Mode Cursor */
body.combat-mode .game-stage {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="%23f44336"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>') 0 24, auto;
    /* Sword cursor */
}

/* Modal */
.modal {
    background-color: var(--color-bg-panel);
    color: var(--color-text-light);
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 500px;
    width: 90%;
}

.modal::backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    padding: var(--spacing-lg);
}

.wcag-ref {
    background-color: #444;
    padding: var(--spacing-sm);
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

fieldset {
    border: 1px solid #666;
    border-radius: 4px;
    padding: 0.5rem;
}

legend {
    padding: 0 0.5rem;
    font-weight: bold;
    color: var(--color-primary);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.btn-primary,
.btn-secondary,
.cta-button {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary,
.cta-button {
    background-color: var(--color-primary-game);
    color: #000;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

/* Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

/* Toast Notification */
.toast {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s;
    z-index: 100;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Text */
.error-text {
    color: #d32f2f;
    font-size: 0.9rem;
    display: block;
    margin-top: 0.25rem;
}