#bestiary-layout {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Keep layout */
    gap: 1.5rem; /* Keep layout */
    height: calc(100vh - 8rem); /* Adjusted height calculation if needed, keep layout otherwise */
    /* Removed background-color as it inherits from body/main */
    color: var(--clay-text-primary); /* Use theme text color */
}

#monster-list-container,
#monster-detail-container {
    background: var(--gradient-surface); /* Use theme surface gradient */
    border: 1px solid var(--clay-border); /* Use theme border */
    border-radius: 0.75rem; /* Keep rounding */
    padding: 1.5rem; /* Keep padding */
    display: flex;
    flex-direction: column;
    box-shadow: var(--clay-shadow); /* Use theme shadow */
    overflow-y: auto;
}

.list-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--clay-text-primary); /* Use theme text color */
    border-bottom: 1px solid var(--clay-border); /* Use theme border */
    padding-bottom: 0.5rem;
}

#monster-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* Adjusted columns for smaller items */
    gap: 1rem; /* Keep gap */
    padding-right: 0.5rem; /* Keep padding */
}

.monster-list-item {
    aspect-ratio: 1 / 1; /* Keep aspect ratio */
    border-radius: 0.5rem; /* Keep rounding */
    border: 1px solid var(--clay-border); /* Use theme border */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--clay-dark); /* Use theme dark background */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.monster-list-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* REMOVED HOVER EFFECT FOR MONSTER LIST ITEM
.monster-list-item:hover {
    transform: scale(1.05);
    border-color: var(--clay-focus);
    box-shadow: 0 0 10px var(--clay-glow);
} */

.monster-list-item.selected {
    border-color: var(--clay-focus); /* Use theme focus color */
    box-shadow: 0 0 15px var(--clay-glow), inset 0 0 10px rgba(136, 136, 136, 0.1);
}

#monster-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--clay-border); /* Use theme border */
}

.detail-image {
    width: 100px; /* Adjusted size */
    height: 100px; /* Adjusted size */
    object-fit: contain;
    background-color: var(--clay-dark); /* Use theme dark background */
    border-radius: 0.5rem;
    padding: 0.5rem;
    flex-shrink: 0;
    border: 1px solid var(--clay-border); /* Use theme border */
}

.detail-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* Reduced gap */
}

.detail-name {
    font-size: 1.5rem; /* Adjusted size */
    font-weight: 700;
    color: var(--clay-text-primary);
}

.detail-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-level {
    font-size: 0.9rem; /* Adjusted size */
    font-weight: 500;
    color: var(--clay-text-tertiary); /* Use theme tertiary text color */
}

.monster-type {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background-color: var(--clay-dark);
    border: 1px solid var(--clay-border);
    color: var(--clay-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.monster-type-summary {
    background-color: var(--clay-dark);
    border: 1px solid var(--clay-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.monster-type-description {
    margin: 0;
    font-size: 0.85rem;
    color: var(--clay-text-secondary);
    line-height: 1.4;
}

.monster-kills {
    font-size: 0.8rem; /* Adjusted size */
    font-weight: 500;
    color: var(--clay-text-muted); /* Use theme muted text color */
    background-color: var(--clay-dark); /* Use theme dark background */
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    width: fit-content;
}

#monster-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--clay-border); /* Use theme border */
}

.monster-tab-btn {
    padding: 0.75rem 1.25rem; /* Adjusted padding */
    font-size: 0.9rem; /* Adjusted size */
    font-weight: 500; /* Adjusted weight */
    color: var(--clay-text-muted);
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* REMOVED HOVER EFFECT FOR MONSTER TAB BUTTON
.monster-tab-btn:hover:not(.active) {
    color: var(--clay-text-secondary);
    background-color: var(--clay-darker);
} */

.monster-tab-btn.active {
    color: var(--clay-secondary); /* Use theme secondary accent */
    border-bottom-color: var(--clay-secondary);
    font-weight: 600;
}

#monster-tab-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem; /* Add padding for scrollbar */
}

.stats-section {
    margin-bottom: 1.5rem;
}

.stats-section-title {
    font-size: 1.1rem; /* Adjusted size */
    font-weight: 600;
    color: var(--clay-text-tertiary); /* Use tertiary text color */
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--clay-border); /* Use theme border */
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjusted min width */
    gap: 0.75rem;
}

.stat-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem; /* Adjusted padding */
    border-radius: 0.375rem; /* Standard rounding */
    /* Backgrounds handled by theme variables */
}

.stat-label {
    /* Styles handled by theme variables */
}

.stat-value {
    /* Styles handled by theme variables */
}

.hidden {
    display: none;
}

.drops-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.drop-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--clay-dark); /* Use theme dark background */
    border-radius: 9999px;
    padding: 0.3rem 0.7rem;
    color: var(--clay-text-primary);
    font-size: 0.8rem; /* Adjusted size */
    border: 1px solid var(--clay-border); /* Use theme border */
}

.drop-item-icon {
    width: 20px; /* Adjusted size */
    height: 20px;
    object-fit: contain;
}

.drop-item-name {
    font-weight: 500; /* Adjusted weight */
}

.drop-item-chance {
    font-family: monospace;
    font-weight: 500;
    color: var(--clay-text-muted);
    background-color: var(--clay-darker);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    font-size: 0.75rem; /* Adjusted size */
}

.monster-skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.monster-skill-card {
    background-color: var(--clay-dark);
    border: 1px solid var(--clay-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.monster-skill-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.monster-skill-name {
    font-weight: 600;
    color: var(--clay-text-primary);
}

.monster-skill-chance {
    font-family: monospace;
    color: var(--clay-text-secondary);
    background-color: var(--clay-darker);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.monster-skill-meta {
    font-size: 0.8rem;
    color: var(--clay-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.monster-skill-description {
    font-size: 0.85rem;
    color: var(--clay-text-secondary);
    margin: 0;
}

/* Stat block specific colors are handled by clay-theme.css */

.initial-prompt-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--clay-text-muted); /* Use theme muted text color */
}
