:root {
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Lato', sans-serif;
    --color-text: #4d443a;
    /* Dark, earthy brown */
    --color-heading: #3a3228;
    /* Even darker brown for headings */
    --color-background: #fdf6e3;
    /* Parchment paper */
    --color-accent: #8b4513;
    /* Saddle brown, for links/accents */
    --color-border: #d2b48c;
    /* Tan, for borders */
    --color-panel-bg: rgba(255, 255, 255, 0.4);
    --color-panel-border: #d2b48c;
    --color-hover-bg: rgba(210, 180, 140, 0.3);

    /* Discipline Colors */
    --color-brute: #c0392b;
    --color-focus: #2980b9;
    --color-flow: #27ae60;
    --color-control: #f39c12;
}

body {
    font-family: var(--font-body);
    /* Wood texture for the clipboard 'board' */
    background-color: #8B4513;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C5223' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--color-text);
    padding: 20px;
    line-height: 1.6;
    animation: pageFadeIn 0.5s ease-in-out;
}

/* --- Breadcrumb Navigation Button --- */
.breadcrumb {
    /* Center the nav above the clipboard paper */
    max-width: 1100px;
    margin: 0 auto 10px auto;
    padding: 0;
}

.breadcrumb a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-background);
    color: var(--color-accent);
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    /* Remove the default link underline */
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breadcrumb a:hover {
    background-color: var(--color-hover-bg);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --- Clipboard Layout --- */
.clipboard-paper {
    position: relative;
    max-width: 1100px;
    margin: 40px auto;
    padding: 40px;
    /* Layer the paper texture over the base color */
    background-color: var(--color-background);
    /* Parchment color */
    /* A subtle, repeating SVG pattern to mimic paper fibers */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234d443a' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* The metal clip at the top */
.clipboard-paper::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 50px;
    /* Rusty metal effect */
    background:
        /* Mottled rust spots */
        radial-gradient(circle at 20% 30%, rgba(183, 65, 14, 0.3) 10%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(123, 63, 0, 0.4) 15%, transparent 50%),
        /* Base rusty gradient */
        linear-gradient(to bottom, #a97d5d, #7a5436);
    border: 1px solid #5c3d23;
    /* Dark rust border */
    border-bottom: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.4) inset;
    /* Darker inner shadow */
    z-index: -1;
}

/* The hinge part of the clip */
.clipboard-paper::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 20px;
    background: linear-gradient(to bottom, #b08a6f, #8a624a);
    /* Slightly lighter rust */
    border: 1px solid #5c3d23;
    /* Dark rust border */
    border-radius: 5px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
    /* Darker shadow */
}

/* --- Decorative Elements: Paperclip & Coffee Stain --- */
.paperclip {
    position: absolute;
    top: -10px;
    left: 15px;
    width: 20px;
    height: 80px;
    border: 4px solid #b0b0b0;
    border-radius: 10px;
    border-left-color: transparent;
    transform: rotate(-25deg);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.paperclip::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -12px;
    width: 12px;
    height: 35px;
    border: 4px solid #b0b0b0;
    border-radius: 10px;
    border-right-color: transparent;
}

/* Make panels transparent to show the paper background */
.panel {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* Add back borders to the main sections for separation */
#character-selection-panel,
#tactical-order-panel,
.container {
    border-bottom: 2px dashed var(--color-border);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

/* --- Character Selection --- */
#character-selection-panel {
    /* --- Sticky Positioning --- */
    position: sticky;
    top: 0;
    /* Stick to the top of the viewport */
    z-index: 100;
    /* Ensure it stays on top of other content */

    /* --- Background to prevent content from showing through --- */
    background: var(--color-background);
    /* Match the paper color */

    width: 100%;
    max-width: 1100px;

    /* Match the width of the container below */
    border-bottom: 2px dashed var(--color-border);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

/* Center the heading inside the character selection panel */
#character-selection-panel h2 {
    text-align: center;
}

#character-list {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.character-card {
    border: 3px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.character-card.selected {
    border-color: var(--color-accent);
    background-color: var(--color-hover-bg);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.character-card:hover:not(.selected) {
    /* background-color: rgba(80, 46, 46, 0.4); */
    /* border-radius: 2px; */
    transform: translateY(-3px);
}

.character-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--color-border);
    /* Placeholder color */
    object-fit: cover;
    margin-bottom: 5px;
}

.character-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-heading);
}

.character-job-title {
    font-size: 0.85rem;
    font-weight: bold;
    margin: 5px 0 0 0;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #e0d6c3;
    /* Default background */
    color: var(--color-text);
    display: inline-block;
    /* Allows padding and background */
    transition: all 0.3s ease-in-out;
    min-height: 1em;
    /* Prevents layout shift when empty */
}

/* --- Animation for Job Unlock on Character Card --- */
@keyframes job-unlocked-glow {
    0% {
        border-color: var(--color-accent);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

    50% {
        border-color: #ffd700;
        /* Gold */
        box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.5);
    }

    100% {
        border-color: var(--color-accent);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
}

.job-unlocked-animation {
    animation: job-unlocked-glow 1.2s ease-in-out;
}

.job-tooltip {
    visibility: hidden;
    /* Hidden by default */
    opacity: 0;
    width: max-content;
    background-color: var(--color-heading);
    color: var(--color-background);
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: -10%;
    /* Position above the job title */
    left: 50%;
    /* Start slightly lower and centered */
    transform: translate(-50%, 10px);
    /* Transition opacity and transform for the slide effect */
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Show the tooltip on hover */
.character-job-title:hover>.job-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
    /* Move to final position */
}

.character-job-title.job-active {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.4s ease-out;
}

/* --- Skill Tooltip on Hover --- */
.skill-tooltip {
    position: absolute;
    /* Will be positioned by JS */
    visibility: hidden;
    /* Hidden by default */
    opacity: 0;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 10px 15px;
    max-width: 280px;
    z-index: 200;
    /* High z-index to appear on top */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    /* Tooltip won't interfere with mouse events */
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
    font-size: 0.85rem;
    line-height: 1.5;
}

.skill-tooltip.visible {
    visibility: visible;
    opacity: 1;
}

.skill-tooltip-tags {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--color-border);
}

.skill-tooltip-tags strong {
    color: var(--color-heading);
}

.skill-tooltip-effect strong {
    display: block;
    margin-bottom: 4px;
    color: var(--color-heading);
}

/* --- Main Container --- */
.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    min-height: 720px;
}

h2,
h3 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    margin-top: 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4em;
}

/* Technique List */
#technique-list-container {
    width: 300px;
    /* Make the container itself have a max height relative to the screen */
    max-height: 720px;
    display: flex;
    flex-direction: column;
}

#technique-list {
    list-style-type: none;
    padding: 0;
    /* Allow the list to grow and scroll within the flex container */
    overflow-y: auto;
    flex-grow: 1;
    /* Allows the list to fill the available space in the container */
}

/* --- Custom Scrollbar for Technique List --- */
/* For Firefox */
#technique-list {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-background);
}

/* For Webkit browsers (Chrome, Safari, Edge) */
#technique-list::-webkit-scrollbar {
    width: 10px;
}

#technique-list::-webkit-scrollbar-track {
    background: rgba(210, 180, 140, 0.2);
    /* A faint tan track */
    border-radius: 10px;
}

#technique-list::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);
    /* Saddle brown handle */
    border-radius: 10px;
    border: 2px solid var(--color-background);
    /* Parchment border around handle */
}

.technique-item {
    padding: 10px 10px 10px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: grab;
    background-color: rgba(245, 245, 220, 0.5);
    position: relative;
    /* Needed for absolute positioning of stars */
}

.technique-item.innate {
    cursor: not-allowed;
    background-color: rgba(233, 236, 239, 0.5);
    font-style: italic;
}

.technique-item:hover {
    background-color: var(--color-hover-bg);
}

/* --- Secret Art Styling --- */
.technique-item.secret-art,
.technique-item.ancient-art {
    font-weight: bold;
    padding-bottom: 25px;
    /* Make space for the stars */
}

/* --- Star Rating Styling --- */
.art-stars {
    position: absolute;
    bottom: 5px;
    left: 10px;
    font-size: 14px;
}

.art-stars span {
    color: #ffd700;
    /* Gold color for stars */
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* --- Discipline Glow Effects --- */
.technique-item.Brute.secret-art,
.technique-item.Brute.ancient-art {
    box-shadow: 0 0 8px var(--color-brute);
    background-color: rgba(192, 57, 43, 0.15);
}

.technique-item.Focus.secret-art,
.technique-item.Focus.ancient-art {
    box-shadow: 0 0 8px var(--color-focus);
    background-color: rgba(41, 128, 185, 0.15);
}

.technique-item.Flow.secret-art,
.technique-item.Flow.ancient-art {
    box-shadow: 0 0 8px var(--color-flow);
    background-color: rgba(39, 174, 96, 0.15);
}

.technique-item.Control.secret-art,
.technique-item.Control.ancient-art {
    box-shadow: 0 0 8px var(--color-control);
    background-color: rgba(243, 156, 18, 0.15);
}

.technique-item.Brute {
    border-left: 5px solid var(--color-brute);
}

.technique-item.Focus {
    border-left: 5px solid var(--color-focus);
}

.technique-item.Flow {
    border-left: 5px solid var(--color-flow);
}

.technique-item.Control {
    border-left: 5px solid var(--color-control);
}

/* --- Hybrid Art Styling --- */
/* Generic rule for any hybrid with two disciplines */
.technique-item.hybrid-flow-focus,
.technique-item.hybrid-brute-focus {
    /* A gradient border to show the two disciplines */
    border-left-width: 5px;
}

/* Specific gradient for Brute (Red) and Focus (Blue) */
.technique-item.hybrid-brute-focus {
    border-image: linear-gradient(to bottom, var(--color-brute), var(--color-focus)) 1;
}

.technique-item.hybrid-flow-focus {
    border-image: linear-gradient(to bottom, var(--color-flow), var(--color-focus)) 1;
}

/* Style for hybrid ancient arts in the list */
.technique-item.hybrid-ancient-art {
    /* Base class for hybrid ancient arts, animation is applied on specific classes */
    animation: gradient-shift 4s linear infinite;
    background-size: 200% auto;
}

.technique-item.hybrid-ancient-art.hybrid-brute-focus {
    border-image: linear-gradient(45deg, var(--color-brute), var(--color-focus), var(--color-brute)) 1;
}

.technique-item.hybrid-ancient-art.hybrid-flow-focus {
    border-image: linear-gradient(45deg, var(--color-flow), var(--color-focus), var(--color-flow)) 1;
}

/* Combat Prowess */
#combat-prowess {
    width: 350px;
}

/* Position the h2 and the clear button side-by-side */
#combat-prowess h2 {
    display: inline-block;
    width: auto;
    margin-right: 1rem;
    vertical-align: middle;
}

#clear-loadout-btn {
    display: inline-block;
    vertical-align: middle;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--color-accent);
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-container {
    padding: 10px;
    border: 2px dashed var(--color-border);
    border-radius: 4px;
    min-height: 50px;
    margin-bottom: 10px;
}

.slot-container.drag-over {
    border-color: var(--color-heading);
    background-color: var(--color-hover-bg);
}

/* --- Animation for Invalid Drop --- */
@keyframes flash-red {
    0% {
        background-color: rgba(255, 0, 0, 0);
    }

    50% {
        background-color: rgba(192, 57, 43, 0.3);
        /* Semi-transparent red */
        border-color: var(--color-brute);
    }

    100% {
        background-color: rgba(255, 0, 0, 0);
    }
}

.slot-container.invalid-drop {
    animation: flash-red 0.4s ease-in-out;
}

/* --- Animation for Returned Item --- */
@keyframes flash-green {
    0% {
        /* Start at default */
    }

    50% {
        background-color: rgba(39, 174, 96, 0.3);
        /* Semi-transparent green */
        transform: scale(1.02);
    }

    100% {
        /* End at default */
    }
}

.technique-item.item-returned-flash {
    animation: flash-green 0.7s ease-in-out;
}

/* --- Equipped Technique Styling --- */
/* Make techniques in slots look different from the main list */
.slot-container .technique-item {
    background-color: #f5eeda;
    /* A slightly more opaque parchment color */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
    /* "Pressed in" effect */
    color: var(--color-heading);
    /* Darker text for better contrast */
    font-weight: bold;
    cursor: grab;
    /* Still grabbable */
}

/* --- Animation for a successfully slotted item --- */
@keyframes item-slotted {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 0 8px var(--color-accent);
    }

    100% {
        transform: scale(1.0);
        opacity: 1;
    }
}

.item-slotted-animation {
    animation: item-slotted 0.4s ease-out;
}

/* --- Animation for Clearing Loadout --- */
@keyframes disintegrate {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.2) rotate(15deg) translateX(50px);
        filter: blur(3px);
    }
}

.disintegrating {
    /* Make sure it animates on top of other elements */
    position: relative;
    z-index: 10;
    /* Apply the animation */
    animation: disintegrate 0.5s ease-in forwards;
    transform-origin: center;
}

/* Details Panel */
#details-panel {
    width: 320px;
    /* Make the panel stick to the top when scrolling */
    /* position: sticky; */
    top: 20px;
}

/* --- Job Evolution Status --- */
#job-evolution-status {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(245, 245, 220, 0.5);
    background-image: none;
    /* Reset any inline styles */
    border-radius: 6px;
    border: 1px solid var(--color-border);
    transition: background-image 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

/* When a job is active, make the text white for contrast */
#job-evolution-status.job-active,
#job-evolution-status.job-active h3,
#job-evolution-status.job-active p strong {
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

#job-evolution-status h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
    /* This will be overridden by the text color change */
}

/* --- Technique Details Styles --- */
#details-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-heading);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

/* Glow effect for Secret/Ancient Art titles in the details panel */
#details-content h3.glowing-title {
    /* The --glow-color is set dynamically via inline style in the script */
    text-shadow: 0 0 8px var(--glow-color);
}

#details-content p {
    margin: 0.75rem 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Style for the key-value pairs like Type, Discipline */
#details-content p strong {
    color: var(--color-heading);
    display: inline-block;
    min-width: 90px;
    /* Align the text that follows */
}

/* Style for icons in the details panel */
.details-icon {
    vertical-align: -0.15em;
    /* Adjusts vertical alignment */
    margin-right: 0.3em;
    /* Adds a little space between icon and text */
}

/* Special styling for the main info blocks */
#details-content p:has(strong[class="info-block"]) {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

#details-content .info-block {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #111;
    color: var(--color-heading);
}

/* --- Activation Details Block --- */
.activation-details {
    background-color: rgba(108, 117, 125, 0.05);
    /* Default/Balanced background */
    border: 1px solid var(--color-border);
    border-left: 4px solid #00ff95;
    /* Default/Balanced border color */
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease-in-out;
}

.activation-details.order-offensive {
    border-left-color: var(--color-brute);
    background-color: rgba(192, 57, 43, 0.05);
}

.activation-details.order-defensive {
    border-left-color: var(--color-focus);
    background-color: rgba(41, 128, 185, 0.05);
}

/* Tactical Order Button Styling */
.tactical-order-btn.active[data-order="Offensive"] {
    background-color: #f5485a;
    /* Brute/Attack Red */
    color: white;
}

.tactical-order-btn.active[data-order="Defensive"] {
    background-color: #7bbbff;
    /* Focus/Buff Blue */
    color: white;
}

/* The default 'active' style can be for Balanced or a general highlight */
.tactical-order-btn.active {
    border-color: #ffd34e;
}

.activation-details p {
    margin: 0;
    /* Reset margin for paragraphs inside this block */
}

/* --- Tactical Order Panel --- */
#tactical-order-panel {
    width: 100%;
    max-width: 1070px;
    text-align: center;
}

#tactical-order-panel p {
    margin-top: -10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--color-text);
}

#tactical-order-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.tactical-order-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--color-border);
    background-color: transparent;
    color: var(--color-text);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

.tactical-order-btn:hover {
    background-color: #90ee90;
    /* lightgreen */
    color: var(--color-heading);
    border-color: #27ae60;
    /* var(--color-flow) */
}

.tactical-order-btn.active {
    background-color: #e38541;
    color: white;
    border-color: var(--color-accent);
}

#filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 15px;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    /* Rounded tag shape */
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--color-text);
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none;
}

.filter-btn:hover {
    background-color: var(--color-hover-bg);
    border-color: var(--color-accent);
}

/* Active state for the selected filter */
.filter-btn.active {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    border-width: 2px;
}

/* --- Discipline Colors --- */

/* 'All' button style */
.filter-btn.All.active {
    background-color: var(--color-accent);
    /* Saddle brown for 'All' */
    border-color: var(--color-accent);
}

/* Red discipline */
.filter-btn.Brute.active {
    background-color: var(--color-brute);
    border-color: var(--color-brute);
}

/* Blue discipline */
.filter-btn.Focus.active {
    background-color: var(--color-focus);
    border-color: var(--color-focus);
}

/* Green discipline */
.filter-btn.Flow.active {
    background-color: var(--color-flow);
    border-color: var(--color-flow);
}

/* Yellow discipline */
.filter-btn.Control.active {
    background-color: var(--color-control);
    border-color: var(--color-control);
}

/* --- Animation for Special Art Addition --- */
@keyframes art-glow-pulse {
    0% {
        /* Start with the default shadow */
        box-shadow: inherit;
        transform: scale(1);
    }

    50% {
        /* Make the glow more intense and the item slightly larger */
        box-shadow: 0 0 16px var(--glow-color, var(--color-accent));
        transform: scale(1.03);
    }

    100% {
        box-shadow: inherit;
        transform: scale(1);
    }
}

/* --- Animation for Technique List Filtering --- */
@keyframes listFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes listFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.list-fade-in {
    animation: listFadeIn 0.3s ease-out forwards;
}

.list-fade-out {
    animation: listFadeOut 0.2s ease-in forwards;
}

/* --- Animation for Technique Details Panel --- */

/* Keyframes define the animation steps */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        /* Start slightly below */
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
        /* End slightly above */
    }
}

/* Classes to trigger the animations */
.details-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.details-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

/* Keyframes for the job title animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* This class will hide the content while it's being updated */
#details-content.is-updating {
    opacity: 0;
}

/* --- Media Queries for Responsiveness --- */

/* Medium Screens / Tablets (<= 1100px) */
@media (max-width: 1100px) {
    .container {
        flex-wrap: wrap;
        /* Allow items to wrap */
        justify-content: center;
        /* Center the wrapped items */
    }

    #technique-list-container,
    #combat-prowess {
        width: 48%;
        /* Two columns side-by-side */
    }

    #details-panel {
        width: 100%;
        /* Details panel takes full width below */
        margin-top: 20px;
        max-width: 600px;
        /* Keep it from being too wide */
    }

    /* Make character selection not sticky on smaller screens to avoid layout issues */
    #character-selection-panel {
        position: static;
    }

    #character-list {
        flex-wrap: wrap;
        /* Allow character cards to wrap */
    }
}

/* Small Screens / Mobile (<= 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .clipboard-paper {
        padding: 30px 15px;
        margin: 30px auto;
    }

    /* Hide decorative elements on small screens to save space */
    .clipboard-paper::before,
    .clipboard-paper::after,
    .paperclip {
        display: none;
    }

    .container {
        flex-direction: column;
        /* Stack all main sections vertically */
        align-items: center;
        /* Center them in the column */
        gap: 30px;
        /* Increase gap for vertical stacking */
    }

    #technique-list-container,
    #combat-prowess,
    #details-panel {
        width: 100%;
        /* Each section takes full width */
        max-width: 100%;
        /* Override any max-widths */
    }

    #technique-list-container {
        max-height: 50vh;
        /* Limit height to prevent it from taking the whole screen */
    }

    .character-card img {
        width: 80px;
        height: 80px;
    }

    .character-card {
        padding: 5px;
    }

    #tactical-order-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Extra Small Screens / Mobile S (<= 400px) */
@media (max-width: 400px) {
    body {
        padding: 5px;
        font-size: 0.9rem;
        /* Reduce base font size */
    }

    .clipboard-paper {
        padding: 25px 10px;
        /* Reduce horizontal padding */
        margin: 20px auto;
    }

    h2 {
        font-size: 1.4rem;
        /* Make main headings smaller */
    }

    #details-content h3 {
        font-size: 1.2rem;
        /* Make detail headings smaller */
    }

    #character-list {
        gap: 5px;
        /* Reduce gap between character cards */
    }

    .character-card {
        padding: 5px;
    }

    .character-card img {
        width: 60px;
        /* Make character images smaller */
        height: 60px;
    }

    .character-name {
        font-size: 0.9rem;
    }

    .filter-btn {
        padding: 4px 8px;
        /* Make filter buttons more compact */
        font-size: 0.8rem;
    }

    /* Allow labels in the details panel to stack on very small screens */
    #details-content p strong {
        min-width: unset;
        display: block;
        /* Make label take its own line */
        margin-bottom: 2px;
    }
}

@keyframes rainbow-shift {
    0% {
        background-position: 0% 0%;
        filter: hue-rotate(0deg);
    }

    100% {
        background-position: 200% 0%;
        filter: hue-rotate(360deg);
    }
}

/* Reusable class for animated text (like details title) */
.animated-gradient-text {
    background: linear-gradient(90deg, var(--color-brute), var(--color-focus), var(--color-flow), var(--color-control), var(--color-brute));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: rainbow-shift 4s linear infinite;
}


/* New animation for specific color gradients */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}