/* Front‑end styles for Myco‑Pet plugin */
.mycopet-portal {
    margin: 20px 0;
}
.mycopet-portal form {
    margin-bottom: 20px;
}

/* Redeem form styling */
.mycopet-portal .mycopet-redeem {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    background: #12121C;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #2a2a39;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.mycopet-portal .mycopet-redeem label {
    flex: 1 1 100%;
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 4px;
}
.mycopet-portal .mycopet-redeem input[type="text"] {
    flex: 1 1 auto;
    background: #1e1e2a;
    color: #f3f4f6;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
}
.mycopet-portal .mycopet-redeem button.button {
    background-color: #3b82f6;
    border: none;
    color: #f3f4f6;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.mycopet-portal .mycopet-redeem button.button:hover {
    background-color: #2563eb;
}
.mycopet-portal .status {
    flex: 1 1 100%;
    font-size: 12px;
    color: #10b981;
    margin-top: 4px;
}
.mycopet-portal hr {
    border: none;
    border-top: 1px solid #2a2a39;
    margin: 20px 0;
}
/* Card styling: dark background and neon outlines. */
.mycopet-portal .mycopet-card,
#mycopet-catalog .mycopet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #12121C;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px;
    margin: 5px;
    width: 150px;
    color: #f3f4f6;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

/* Neon outline variants. Each uses a custom pulse animation and a bright border */
.outline-neon-green {
    border: 2px solid #00ff7f;
    box-shadow: 0 0 20px 4px rgba(0, 255, 127, 0.9);
    animation: neon-pulse-green 4s infinite alternate;
}
.outline-neon-blue {
    border: 2px solid #0096ff;
    box-shadow: 0 0 20px 4px rgba(0, 150, 255, 0.9);
    animation: neon-pulse-blue 4s infinite alternate;
}
.outline-neon-purple {
    border: 2px solid #9600ff;
    box-shadow: 0 0 20px 4px rgba(150, 0, 255, 0.9);
    animation: neon-pulse-purple 4s infinite alternate;
}
.outline-neon-pink {
    border: 2px solid #ff0096;
    box-shadow: 0 0 20px 4px rgba(255, 0, 150, 0.9);
    animation: neon-pulse-pink 4s infinite alternate;
}
.outline-neon-yellow {
    border: 2px solid #ffff00;
    box-shadow: 0 0 20px 4px rgba(255, 255, 0, 0.9);
    animation: neon-pulse-yellow 4s infinite alternate;
}
.outline-neon-orange {
    border: 2px solid #ff8200;
    box-shadow: 0 0 20px 4px rgba(255, 130, 0, 0.9);
    animation: neon-pulse-orange 4s infinite alternate;
}
.outline-neon-teal {
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px 4px rgba(0, 255, 255, 0.9);
    animation: neon-pulse-teal 4s infinite alternate;
}
.outline-rainbow {
    border: 2px solid #ff0096;
    box-shadow: 0 0 20px 4px rgba(255, 0, 150, 0.9);
    animation: neon-rainbow 6s infinite linear;
}

/* Pulse keyframes for each neon color */
@keyframes neon-pulse-green {
    from { box-shadow: 0 0 5px 1px rgba(0,255,127,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(0,255,127,1); }
}
@keyframes neon-pulse-blue {
    from { box-shadow: 0 0 5px 1px rgba(0,150,255,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(0,150,255,1); }
}
@keyframes neon-pulse-purple {
    from { box-shadow: 0 0 5px 1px rgba(150,0,255,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(150,0,255,1); }
}
@keyframes neon-pulse-pink {
    from { box-shadow: 0 0 5px 1px rgba(255,0,150,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(255,0,150,1); }
}
@keyframes neon-pulse-yellow {
    from { box-shadow: 0 0 5px 1px rgba(255,255,0,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(255,255,0,1); }
}
@keyframes neon-pulse-orange {
    from { box-shadow: 0 0 5px 1px rgba(255,130,0,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(255,130,0,1); }
}
@keyframes neon-pulse-teal {
    from { box-shadow: 0 0 5px 1px rgba(0,255,255,0.6); }
    to { box-shadow: 0 0 20px 4px rgba(0,255,255,1); }
}
@keyframes neon-rainbow {
    0% { box-shadow: 0 0 10px 2px rgba(255,0,150,0.8); }
    14% { box-shadow: 0 0 10px 2px rgba(255,130,0,0.8); }
    28% { box-shadow: 0 0 10px 2px rgba(255,255,0,0.8); }
    42% { box-shadow: 0 0 10px 2px rgba(0,255,127,0.8); }
    57% { box-shadow: 0 0 10px 2px rgba(0,255,255,0.8); }
    71% { box-shadow: 0 0 10px 2px rgba(0,150,255,0.8); }
    85% { box-shadow: 0 0 10px 2px rgba(150,0,255,0.8); }
    100% { box-shadow: 0 0 10px 2px rgba(255,0,150,0.8); }
}

/* Hue rotation animation for pets with rainbow flag */
@keyframes hue-spin {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}
.rainbow-hue {
    /* Apply hue-spin animation; override any fixed hue-rotate filter on the element so the animation
       can control the filter. */
    animation: hue-spin 12s linear infinite;
    filter: none !important;
}

/* Outline for custom neon color (no pulsing animation as CSS vars cannot animate) */
.outline-custom {
    /* Use CSS variable set on element for custom outline color */
    box-shadow: 0 0 12px 3px var(--custom-color);
    border-color: var(--custom-color);
}

/* Rarity badge styles. Each rarity receives its own neon‑hued color and a subtle glow. */
.mycopet-rarity {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 600;
}
.rarity-common { background: #2f3e46; color: #a4acb8; box-shadow: 0 0 6px #2f3e46; }
.rarity-uncommon { background: #195b2b; color: #33dd77; box-shadow: 0 0 6px #195b2b; }
.rarity-rare { background: #003661; color: #33aaff; box-shadow: 0 0 6px #003661; }
.rarity-epic { background: #4b007a; color: #bb55ff; box-shadow: 0 0 6px #4b007a; }
.rarity-legendary { background: #593600; color: #ffb02e; box-shadow: 0 0 6px #593600; }
.rarity-mythic { background: #002e2e; color: #00ffaa; box-shadow: 0 0 6px #002e2e; }
.rarity-ultra { background: #003f5c; color: #ffa600; box-shadow: 0 0 6px #003f5c; }
.rarity-secret { background: #36013f; color: #d81159; box-shadow: 0 0 6px #36013f; }

/* Modal overlay for play */
.mycopet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 28, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.mycopet-modal-content {
    background: #12121C;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    position: relative;
    color: #f3f4f6;
}
.mycopet-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #f3f4f6;
    font-size: 24px;
    cursor: pointer;
}
.mycopet-modal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.mycopet-modal-nav button {
    background: #222230;
    border: 1px solid #3b82f6;
    color: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}
.mycopet-modal-nav button.active,
.mycopet-modal-nav button:hover {
    background: #3b82f6;
}
 .mycopet-thumb {
    width: 100%;
    height: 100px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 8px;
    border-radius: 4px;
    position: relative;
    filter: hue-rotate(var(--hue-rotate, 0deg));
 }
/* Subtle bobbing animation for thumbnails to give life */
/* Thumbnails move gently in random directions to appear alive */
.mycopet-card .mycopet-thumb {
    animation: thumb-swim 6s ease-in-out infinite;
}
@keyframes thumb-swim {
    0% { transform: translate(-3px, -3px) rotate(0deg); }
    20% { transform: translate(4px, -2px) rotate(1deg); }
    40% { transform: translate(-2px, 3px) rotate(-1deg); }
    60% { transform: translate(3px, 2px) rotate(1deg); }
    80% { transform: translate(-4px, -1px) rotate(-1deg); }
    100% { transform: translate(-3px, -3px) rotate(0deg); }
}
.mycopet-thumb.locked {
    filter: grayscale(100%) opacity(0.4);
}
.mycopet-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
    text-align: center;
}
.mycopet-card .button {
    margin-top: auto;
}

/* Info line for catalog and owned creatures: displays type and rarity */
.mycopet-info {
    font-size: 10px;
    margin-top: 2px;
    margin-bottom: 6px;
    text-align: center;
    color: #9ca3af;
    line-height: 1.2;
}
.mycopet-info .type {
    font-weight: 600;
    text-transform: capitalize;
    color: #d1d5db;
}
.mycopet-info .rarity {
    margin-left: 4px;
    font-weight: 600;
}
.mycopet-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mycopet-bars {
    margin: 10px 0;
}
.mycopet-bar {
    margin-bottom: 4px;
    font-size: 11px;
}
.mycopet-bar .label {
    display: block;
    margin-bottom: 2px;
}
.mycopet-bar .progress {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.mycopet-bar .progress .fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.5s ease;
}

/* Background selector styling */
.mycopet-bg-select {
    margin-top: 8px;
    font-size: 12px;
    color: #d1d5db;
}
.mycopet-bg-dropdown {
    background: #1e1e2a;
    color: #f3f4f6;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 4px;
}
.mycopet-controls {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mycopet-controls .button {
    font-size: 12px;
    padding: 4px 8px;
}
.mycopet-description {
    font-size: 12px;
    margin: 4px 0 8px;
    color: #d1d5db;
    text-align: center;
}

/* Traits box styling */
.mycopet-traits {
    font-size: 11px;
    margin: 0 0 8px;
    color: #9ca3af;
    text-align: center;
}
 .mycopet-media {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: hue-rotate(var(--hue-rotate, 0deg));
 }
.mycopet-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Wrapper for media and spores */
.mycopet-media-wrapper {
    position: relative;
    /* Increase the size of the wrapper to scale up the creature and give more space for movement. */
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

/* Ensure the play container has enough height for the pet and spores to move without overlapping bars */
/*
 * Play container provides space for the creature to roam. A single definition is used here rather
 * than duplicating rules. The min-height can be adjusted by administrators via the future
 * settings page. For now a fairly tall minimum is provided so that pets stay within bounds and
 * don’t overlap the stats or controls. The height property is intentionally omitted to allow
 * the element to grow with content on small screens.
 */
.mycopet-play {
    position: relative;
    width: 100%;
    /* Give pets plenty of room: this value can be overridden via settings later. */
    min-height: 700px;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

/* Layer for spores that floats behind the moving pet.  Positioned absolutely within
   the play container so spores remain fixed when the pet moves. */
.mycopet-spore-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}


/* Floating spore particles */
/* Base styles for spores; colours and sizes are assigned dynamically via JS. */
.mycopet-spore {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    mix-blend-mode: screen;
}

/* Bars container; ensure proper spacing below the playground */
.mycopet-bars {
    margin-top: 8px;
}

/* Information line under titles: align type on the left and rarity on the right */
.mycopet-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    opacity: 0.8;
    margin-bottom: 6px;
}
.mycopet-info .type {
    font-weight: 500;
    margin-right: 4px;
}
.mycopet-info .rarity {
    font-weight: 500;
    text-transform: capitalize;
}

/* Controls for catalog search and filtering */
.mycopet-catalog-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.mycopet-catalog-controls input.mycopet-search,
.mycopet-catalog-controls select.mycopet-filter {
    background: #1e1e2a;
    color: #f3f4f6;
    border: 1px solid #2a2a39;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* Unlock reveal overlay styles */
.mycopet-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.9) 0%, rgba(18,18,28,0.95) 60%, rgba(18,18,28,1) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: inherit;
}
.mycopet-reveal-content {
    text-align: center;
    background: rgba(32,32,48,0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: pulseGlow 3s infinite;
}
.mycopet-reveal-content h2 {
    margin: 0 0 8px;
    font-size: 24px;
}
.mycopet-reveal-content h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #a78bfa;
}
.mycopet-reveal-content p {
    margin-bottom: 15px;
    font-size: 14px;
    color: #d1d5db;
}
.mycopet-reveal-content .button {
    padding: 6px 12px;
    font-size: 14px;
}
@keyframes pulseGlow {
    0%,100% { box-shadow: 0 0 10px 2px rgba(168,139,250,0.6); }
    50% { box-shadow: 0 0 20px 6px rgba(168,139,250,1); }
}

/* Sudoku overlay styles and table styling */
.mycopet-sudoku-overlay {
    font-family: inherit;
    overflow-y: auto;
}
.mycopet-sudoku-table {
    border-collapse: collapse;
}
.mycopet-sudoku-table td {
    border: 1px solid #4a4a6a;
    width: 30px;
    height: 30px;
    text-align: center;
}
.mycopet-sudoku-table td input {
    width: 100%;
    height: 100%;
    background: #1e1e2a;
    color: #fff;
    border: none;
    text-align: center;
    outline: none;
}
.mycopet-sudoku-table input::-webkit-inner-spin-button,
.mycopet-sudoku-table input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}