/**
 * Code of Conquest - Play Screen Stylesheet
 * 3-column layout for immersive gameplay
 */

/* ===== PLAY SCREEN VARIABLES ===== */
:root {
    /* Play-specific backgrounds (inherit from main.css theme) */
    --play-bg-panel: var(--bg-secondary);
    --play-bg-content: var(--bg-tertiary);
    --play-border: var(--border-primary);

    /* Action tier colors */
    --action-free: #3b82f6;
    --action-free-hover: #2563eb;
    --action-premium: #8b5cf6;
    --action-premium-hover: #7c3aed;
    --action-elite: var(--accent-gold);
    --action-elite-hover: var(--accent-gold-hover);

    /* Resource bars */
    --hp-bar-fill: #ef4444;
    --hp-bar-bg: #7f1d1d;
    --mp-bar-fill: #3b82f6;
    --mp-bar-bg: #1e3a5f;
    --xp-bar-fill: #10b981;
    --xp-bar-bg: #065f46;

    /* Panel sizing */
    --sidebar-left-width: 280px;
    --sidebar-right-width: 320px;
}

/* ===== MAIN LAYOUT ===== */
.play-container {
    display: grid;
    grid-template-columns: var(--sidebar-left-width) minmax(500px, 1fr) var(--sidebar-right-width);
    gap: 1rem;
    height: calc(100vh - 140px);
    padding: 1rem;
    max-width: 2400px;
    margin: 0 auto;
}

/* Override base main styles for play screen */
.play-page main {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

/* ===== PANEL BASE STYLES ===== */
.play-panel {
    background: var(--play-bg-panel);
    border: 1px solid var(--play-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.play-sidebar {
    overflow-y: auto;
}

.play-main {
    display: flex;
    flex-direction: column;
}

/* ===== LEFT SIDEBAR - CHARACTER PANEL ===== */
.character-panel {
    padding: 1rem;
}

/* Character Header */
.character-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--play-border);
    margin-bottom: 1rem;
}

.character-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--accent-gold);
    margin-bottom: 0.25rem;
}

.character-info {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.character-class {
    color: var(--text-primary);
}

.character-level {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Resource Bars */
.resource-bars {
    margin-bottom: 1rem;
}

.resource-bar {
    margin-bottom: 0.75rem;
}

.resource-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    margin-bottom: 0.25rem;
}

.resource-bar-name {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resource-bar-value {
    color: var(--text-primary);
    font-weight: 600;
}

.resource-bar-track {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.resource-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.resource-bar--hp .resource-bar-fill {
    background: linear-gradient(90deg, var(--hp-bar-fill), #f87171);
}

.resource-bar--mp .resource-bar-fill {
    background: linear-gradient(90deg, var(--mp-bar-fill), #60a5fa);
}

/* Panel Accordion (for character panel) */
.panel-accordion {
    margin-bottom: 0.75rem;
    border: 1px solid var(--play-border);
    border-radius: 6px;
    overflow: hidden;
}

.panel-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: none;
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.panel-accordion-header:hover {
    background: var(--bg-input);
}

.panel-accordion-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.panel-accordion.collapsed .panel-accordion-icon {
    transform: rotate(-90deg);
}

.panel-accordion-content {
    padding: 0.75rem;
    background: var(--bg-secondary);
}

.panel-accordion.collapsed .panel-accordion-content {
    display: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: 4px;
}

.stat-abbr {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

/* Quick Actions (Equipment, NPC, Travel) */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--play-border);
}

/* Actions Section */
.actions-section {
    flex: 1;
}

.actions-title {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.actions-tier {
    margin-bottom: 1rem;
}

.actions-tier-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Action Buttons */
.action-btn {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover:not(:disabled) {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn--free {
    background: var(--action-free);
}

.action-btn--free:hover:not(:disabled) {
    background: var(--action-free-hover);
}

.action-btn--premium {
    background: var(--action-premium);
}

.action-btn--premium:hover:not(:disabled) {
    background: var(--action-premium-hover);
}

.action-btn--elite {
    background: var(--action-elite);
    color: var(--bg-primary);
}

.action-btn--elite:hover:not(:disabled) {
    background: var(--action-elite-hover);
}

.action-btn--locked {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px dashed var(--play-border);
}

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

.action-btn-icon {
    font-size: var(--text-base);
}

.action-btn-lock {
    margin-left: auto;
    font-size: var(--text-xs);
}

/* Special Action Button Style */
.action-btn--special {
    background: var(--bg-tertiary);
    border: 1px solid var(--play-border);
    color: var(--text-primary);
}

.action-btn--special:hover:not(:disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ===== MIDDLE - NARRATIVE PANEL ===== */
.narrative-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Location Header */
.location-header {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--play-border);
}

.location-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.location-type-badge {
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.location-type-badge--wilderness {
    background: var(--accent-green);
}

.location-type-badge--dungeon {
    background: var(--accent-red);
}

.location-type-badge--town {
    background: var(--accent-blue);
}

.location-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.location-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.location-region::before {
    content: '';
}

.turn-counter {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Ambient Details */
.ambient-section {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--play-border);
}

.ambient-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
}

.ambient-toggle:hover {
    color: var(--text-secondary);
}

.ambient-icon {
    transition: transform 0.2s ease;
}

.ambient-section.collapsed .ambient-icon {
    transform: rotate(-90deg);
}

.ambient-content {
    margin-top: 0.75rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

.ambient-section.collapsed .ambient-content {
    display: none;
}

/* DM Response Area */
.narrative-content {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
}

.dm-response {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.dm-response p {
    margin-bottom: 1rem;
}

.dm-response p:last-child {
    margin-bottom: 0;
}

/* ===== PLAYER INPUT AREA ===== */
.player-input-area {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--play-border);
}

.player-input-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-input-label {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.player-input-textarea {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--play-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: 1.5;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-input-textarea::placeholder {
    color: var(--text-muted);
}

.player-input-textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

.player-input-submit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-gold);
    border: none;
    border-radius: 6px;
    color: var(--bg-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.player-input-submit:hover:not(:disabled) {
    background: var(--accent-gold-hover);
    transform: translateX(2px);
}

.player-input-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-icon {
    font-size: var(--text-base);
    transition: transform 0.2s ease;
}

.player-input-submit:hover:not(:disabled) .submit-icon {
    transform: translateX(3px);
}

.player-input-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
}

/* Loading state for player input */
.player-input-area.htmx-request .player-input-textarea,
.player-input-area.htmx-request .player-input-submit {
    opacity: 0.6;
    pointer-events: none;
}

/* Error state */
.dm-response.error {
    color: var(--accent-red);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-red);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .player-input-submit {
        justify-content: center;
    }
}

/* Player Action Echo - Shows player's submitted action */
.player-action-echo {
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--action-free);
}

.player-action-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--action-free);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.player-action-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-style: italic;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-input);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-style: italic;
}

/* ===== RIGHT SIDEBAR - ACCORDIONS ===== */
.accordion-panel {
    display: flex;
    flex-direction: column;
}

.accordion {
    border-bottom: 1px solid var(--play-border);
}

.accordion:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: none;
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: var(--bg-input);
}

.accordion-icon {
    font-size: var(--text-xs);
    transition: transform 0.2s ease;
}

.accordion.collapsed .accordion-icon {
    transform: rotate(-90deg);
}

.accordion-content {
    padding: 0.75rem 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* History accordion gets more height */
[data-accordion="history"] .accordion-content {
    max-height: 330px;
}

.accordion.collapsed .accordion-content {
    display: none;
}

.accordion-count {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* History Items */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.history-turn {
    font-size: var(--text-xs);
    color: var(--accent-gold);
    font-weight: 600;
}

.history-action {
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.history-response {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-load-more {
    margin-top: 0.75rem;
    text-align: center;
}

.btn-load-more {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
    background: transparent;
    border: 1px solid var(--play-border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Quest Items */
.quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quest-item {
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 6px;
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.quest-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.quest-difficulty {
    font-size: var(--text-xs);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.quest-difficulty--easy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.quest-difficulty--medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.quest-difficulty--hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.quest-giver {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.quest-objectives {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.quest-objective {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.quest-objective-check {
    width: 14px;
    height: 14px;
    border: 1px solid var(--play-border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.quest-objective-check.completed {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.quest-objective-progress {
    margin-left: auto;
    color: var(--text-muted);
}

.quest-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-style: italic;
}

/* NPC Items */
.npc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.npc-item {
    padding: 0.625rem 0.75rem;
    background: var(--bg-input);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.npc-item:hover {
    border-color: var(--accent-gold);
    transform: translateX(2px);
}

.npc-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.npc-role {
    font-size: var(--text-xs);
    color: var(--accent-gold);
}

.npc-appearance {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.npc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
    overflow: hidden;
    max-height: 3.5em; /* Limit to roughly 2 rows of tags */
}

.npc-tag {
    font-size: 10px;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Map Items */
.map-region {
    margin-bottom: 1rem;
}

.map-region:last-child {
    margin-bottom: 0;
}

.map-region-name {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.map-locations {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.map-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: var(--bg-input);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.map-location:hover {
    border-color: var(--play-border);
}

.map-location.current {
    border-color: var(--accent-gold);
    background: rgba(243, 156, 18, 0.1);
}

.map-location-icon {
    font-size: var(--text-sm);
}

.map-location-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.map-location-type {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-left: auto;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-ornate);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}

/* Modal Size Variants */
.modal-content--sm { max-width: 400px; }
.modal-content--md { max-width: 500px; }
.modal-content--lg { max-width: 700px; }
.modal-content--xl { max-width: 900px; }

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

.modal-header {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--play-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--accent-gold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-xl);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--play-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Travel Modal */
.travel-destinations {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.travel-destination {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--play-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.travel-destination:hover {
    border-color: var(--accent-gold);
    background: rgba(243, 156, 18, 0.1);
}

.travel-destination-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.travel-destination-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* NPC Chat Modal */
.npc-chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.npc-chat-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
}

.npc-chat-info h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--accent-gold);
    margin: 0;
}

.npc-chat-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.chat-history {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: 6px;
}

.chat-message {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
}

.chat-message:last-child {
    margin-bottom: 0;
}

.chat-message--player {
    background: rgba(59, 130, 246, 0.2);
    margin-left: 1rem;
}

.chat-message--npc {
    background: rgba(243, 156, 18, 0.1);
    margin-right: 1rem;
    border-left: 2px solid var(--accent-gold);
}

.chat-message strong {
    font-size: var(--text-sm);
    display: block;
    margin-bottom: 0.25rem;
}

.chat-message--player strong {
    color: var(--action-free);
}

.chat-message--npc strong {
    color: var(--accent-gold);
}

.chat-input-form {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--play-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.chat-send-btn {
    padding: 0.625rem 1rem;
    background: var(--accent-gold);
    border: none;
    border-radius: 6px;
    color: var(--bg-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-send-btn:hover {
    background: var(--accent-gold-hover);
}

.chat-greet-btn {
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid var(--play-border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-greet-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .play-container {
        grid-template-columns: var(--sidebar-left-width) 1fr 280px;
    }
}

@media (max-width: 1024px) {
    .play-container {
        grid-template-columns: 1fr 280px;
        height: auto;
        min-height: calc(100vh - 140px);
    }

    .play-sidebar--left {
        display: none; /* Will be slide-out drawer on tablet */
    }

    /* Mobile menu toggle would go here */
}

@media (max-width: 768px) {
    .play-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .play-sidebar--right {
        order: 3;
    }

    .play-main {
        order: 1;
    }

    .location-name {
        font-size: var(--text-lg);
    }

    .accordion-content {
        max-height: 200px;
    }
}

/* ===== EQUIPMENT MODAL ===== */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.equipment-slot {
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--bg-input);
    transition: all 0.2s ease;
}

.equipment-slot--equipped {
    border: 1px solid var(--accent-gold);
}

.equipment-slot--empty {
    border: 1px dashed var(--play-border);
}

.slot-header {
    margin-bottom: 0.5rem;
}

.slot-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slot-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.slot-icon {
    font-size: var(--text-xl);
    line-height: 1;
}

.slot-icon--empty {
    opacity: 0.3;
}

.slot-details {
    flex: 1;
    min-width: 0;
}

.slot-item-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.slot-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.slot-stats span {
    font-size: var(--text-xs);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    background: var(--bg-tertiary);
}

.stat-damage {
    color: var(--accent-red);
}

.stat-defense {
    color: var(--accent-blue);
}

.stat-bonus {
    color: var(--accent-green);
}

.slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
}

.slot-empty-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Equipment Summary */
.equipment-summary {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

.summary-title {
    font-size: var(--text-xs);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-stat {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent-green);
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
}

.summary-none {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* ===== EXPANDED NPC MODAL ===== */
.npc-modal-body {
    display: flex;
    gap: 1.25rem;
    min-height: 400px;
}

/* NPC Profile (Left Column) */
.npc-profile {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.npc-portrait {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--play-border);
}

.npc-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npc-portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--accent-gold);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-input));
}

.npc-profile-info {
    text-align: center;
}

.npc-profile-role {
    font-size: var(--text-sm);
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.npc-profile-appearance {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.npc-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: center;
}

.npc-profile-tag {
    font-size: 10px;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Relationship Meter */
.npc-relationship {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.relationship-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.relationship-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.relationship-value {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
}

.relationship-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.relationship-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-gold), #f59e0b);
    transition: width 0.3s ease;
}

.relationship-status {
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 600;
}

.status-friendly {
    color: var(--accent-green);
}

.status-neutral {
    color: var(--text-secondary);
}

.status-unfriendly {
    color: var(--accent-red);
}

/* Interaction Stats */
.npc-interaction-stats {
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: 4px;
}

.interaction-stat {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
}

.interaction-stat .stat-label {
    color: var(--text-muted);
}

.interaction-stat .stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* NPC Conversation (Right Column) */
.npc-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.npc-conversation .chat-history {
    flex: 1;
    min-height: 250px;
    max-height: none;
}

.chat-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Responsive NPC Modal */
@media (max-width: 700px) {
    .npc-modal-body {
        flex-direction: column;
    }

    .npc-profile {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .npc-portrait {
        width: 80px;
        height: 80px;
    }

    .npc-portrait-placeholder {
        font-size: 2rem;
    }

    .npc-profile-info {
        flex: 1;
        text-align: left;
        min-width: 120px;
    }

    .npc-relationship {
        width: 100%;
    }

    .npc-profile-tags {
        width: 100%;
        justify-content: flex-start;
    }

    .npc-interaction-stats {
        width: 100%;
    }
}

/* ===== UTILITY CLASSES FOR PLAY SCREEN ===== */
.play-hidden {
    display: none !important;
}

.play-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar for play panels */
.play-panel::-webkit-scrollbar,
.accordion-content::-webkit-scrollbar,
.narrative-content::-webkit-scrollbar,
.chat-history::-webkit-scrollbar {
    width: 6px;
}

.play-panel::-webkit-scrollbar-track,
.accordion-content::-webkit-scrollbar-track,
.narrative-content::-webkit-scrollbar-track,
.chat-history::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.play-panel::-webkit-scrollbar-thumb,
.accordion-content::-webkit-scrollbar-thumb,
.narrative-content::-webkit-scrollbar-thumb,
.chat-history::-webkit-scrollbar-thumb {
    background: var(--play-border);
    border-radius: 3px;
}

.play-panel::-webkit-scrollbar-thumb:hover,
.accordion-content::-webkit-scrollbar-thumb:hover,
.narrative-content::-webkit-scrollbar-thumb:hover,
.chat-history::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
