html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@font-face {
    font-family: 'Expose-Regular';
    src: url('fonts/Expose-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

body {
    font-family: 'Expose-Regular';
    font-size: 13px;
    text-align: center;
    margin-top: 0;
    margin-right: 0;
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

#list th, #skillList th {
    cursor: pointer;
    padding: 5px;
}

#list td, #list td:hover {
    border-width: 0;
}

#list tbody tr {
    height: 100px;
}

#list tbody td {
    vertical-align: middle;
}

#list tr:hover td {
    background: rgba(64, 46, 24, 0.1);
}

#skillList tr:hover td {
    background: rgba(64, 46, 24, 0.1);
}

tr:hover td:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

tr:hover td:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.pagination span {
    cursor: pointer;
}

#content {
    display: inline-block;
    margin-top: 10px;
}

/* Main Title Styling */
.main-title {
    text-align: center;
    margin: 20px 0 30px 0;
}

.main-title h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.title-link {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none !important;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.title-link:hover {
    transform: scale(1.05);
    text-decoration: none !important;
    filter: brightness(1.2);
}

.title-link:visited {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none !important;
}

/* Royal version title - red color */
a[href="indexRoyal.html"].title-link {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

a[href="indexRoyal.html"].title-link:visited {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark mode title styling - keep same colors */
.dark-theme .title-link {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-theme .title-link:visited {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-theme a[href="indexRoyal.html"].title-link {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-theme a[href="indexRoyal.html"].title-link:visited {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive title */
@media only screen and (max-width: 768px) {
    .main-title h1 {
        font-size: 1.8rem;
    }
}

/* Persona 5 Navigation Styles */
.p5-title {
    text-align: center;
    margin: 30px 0 20px 0;
}

.p5-title h1 {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.p5-title .title-link {
    font-family: 'Expose-Regular';
    color: #ffffff !important;
    text-shadow: none !important;
    text-decoration: none !important;
    position: relative;
    display: inline-block;
    z-index: 10;
    transform-origin: center;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
}

.p5-title .title-link .shape-wrapper { 
    display: none; 
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    z-index: -1;
}

.p5-title .title-link:hover {
    z-index: 9999;
    color: #ff0000 !important;
    -webkit-text-fill-color: #ff0000 !important;
    background: none !important;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    animation: tiltBounce .15s ease;
    animation-fill-mode: forwards;
    text-decoration: none !important;
}

/* Override dark theme gradient on hover */
.dark-theme .p5-title .title-link:hover {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #ff0000 !important;
    -webkit-text-fill-color: #ff0000 !important;
}

.p5-title .title-link:hover .shape-wrapper { 
    transform: rotate(5deg);
    display: block; 
}

.p5-title .title-link:hover .shape-wrapper .shape.cyan-fill {
    transform: scale(3,.8);
}

.p5-title .title-link:hover .shape-wrapper .shape {
    height: 90px;
}

.p5-title .title-link:visited {
    color: #ffffff !important;
    text-decoration: none !important;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
}

.p5-navbar {
    text-align: center;
    margin: 20px 0 40px 0;
}

.p5-link-wrapper {
    position: relative;
    display: inline-block;
    margin: 0px 16px;
    text-decoration: none;
}

.p5-link-wrapper .fallback {
    font-family: 'Expose-Regular';
    font-size: 1.5em;
    letter-spacing: 2px;
    line-height: 1;
    position: relative;
    top: 15px;
    left: 0;
    color: #ffffff;
    text-shadow: none !important;
    transition: all 0.3s ease;
    z-index: 10;
    display: inline-block;
    transform-origin: center;
}

.p5-link-wrapper .shape-wrapper { 
    display: none; 
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    z-index: 1;
}

.p5-link-wrapper:hover {
    z-index: 9999;
}

.p5-link-wrapper:hover .shape-wrapper { 
    transform: rotate(-6deg);
    display: block; 
}

.p5-link-wrapper:hover .shape-wrapper .shape.cyan-fill {
    transform: scale(3,.1);
}

.p5-link-wrapper:hover .fallback {
    animation: tiltBounce .15s ease;
    animation-fill-mode: forwards;
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.p5-link-wrapper:nth-child(even):hover .shape-wrapper { 
    transform: rotate(11deg); 
}

.p5-link-wrapper:nth-child(even):hover .fallback {
    animation: tiltBounceAlt .15s ease;
    animation-fill-mode: forwards;
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.shape-wrapper {
    filter: sepia(50%) saturate(3);
}

.shape-wrapper .shape {
    transition: all .1s linear;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35px;
    overflow: hidden;
}

.shape-wrapper .shape svg {
    position: absolute;
    left: 0;
    top: 0;
}

.shape-wrapper .shape.cyan-fill {
    mix-blend-mode: screen;
    animation-delay: 0.05s;
    animation-duration: .4s;
}

.shape-wrapper .shape.red-fill {
    animation-duration: .45s;
    animation-delay: 0.08s;
    opacity: .8;
}

.jelly {
    -webkit-animation-name: jelly;
    animation-name: jelly;
    -webkit-transform-origin: center;
    transform-origin: center;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    animation-timing-function: linear;
}

@keyframes tiltBounce {
    0% {
        transform: scale(1) rotate(-7deg);
    }
    50% {
        transform: scale(1.5) rotate(-7deg);
    }
    100% {
        transform: scale(1.15) rotate(-7deg);
    }
}

@keyframes tiltBounceAlt {
    0% {
        transform: scale(1) rotate(7deg);
    }
    50% {
        transform: scale(1.5) rotate(7deg);
    }
    100% {
        transform: scale(1.15) rotate(7deg);
    }
}

@keyframes jelly {
    0% {
        width: 100%; 
        transform: scale(1.25,1) skewX(20deg) translateY(3px) rotateX(40deg) rotateY(10deg) rotateZ(-10deg);
    }
    50% { 
        width: 100%; 
        transform: scale(1.25,1.1) skewX(-15deg) translateY(-2px) translateZ(-30px); 
    }
    100% { 
        width: 100%; 
        transform: scale(1.25,1) skewX(20deg) translateY(3px) rotateX(-40deg) rotateY(-10deg) rotateZ(-15deg); 
    }
}

.infoTable, .infoTable th {
    border-collapse: collapse;
    text-align: center;
}

.infoTable, .recipesTable, #skillList {
    margin: 0 auto;
}

.recipesTable {
    text-align: left;
}

.recipesTable td, .recipesTable th {
    padding-left: 5px;
    padding-right: 5px;
}

.infoTable th, .infoTable td {
    border: 1px solid black;
    padding: 5px;
}

.caption {
    margin-top: 10px;
    margin-bottom: 10px;
}

#skillList {
    text-align: left;
}

#skillList th, #skillList td {
    padding-left: 10px;
    padding-right: 10px;
}

@media screen and (min-width: 1080px) {
    #skillList {
        width: 80%;
    }
}

.ui.sortable.table thead th:hover {
    background: white !important;
}

.wk, .rs, .nu, .rp, .ab,
.Weak, .Resist, .Null, .Repel, .Absorb {
    font-weight: bold;
}

.wk, .Weak { color: #db2828 !important; }
.rs, .Resist { color: #2185d0 !important; }
.nu, .Null { color: #b0b0b0 !important; }
.rp, .Repel { color: #fbbd08 !important; }
.ab, .Absorb { color: #21ba45 !important; }

.✓ { color: #31ce3e !important; }
.✘ { color: #db2828 !important; }

.left-border {
    border-left: 1px solid rgba(34,36,38,.1) !important;
}

@media only screen and (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
}

@media only screen and (min-width: 769px) {
    .desktop-hidden {
        display: none;
    }
}

.warning-sign {
    font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;
    font-size: small;
}

.dlc-label {
    background-color: #f0ad4e;
    display: inline-block;
    padding: .6em .8em .6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(0 10%, calc(100% - 6px) 0, 100% 90%, 4px 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.dlc-label::before,
.dlc-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.dlc-label::before {
    background: #FF0000;
    clip-path: polygon(0 15%, calc(100% - 4px) 0, 100% 95%, 6px 100%);
    transform: scale(1.03) translateX(-0.4px) translateY(-0.2px);
    z-index: -2;
}

.dlc-label::after {
    background: #00FFFF;
    clip-path: polygon(0 5%, calc(100% - 8px) 0, 100% 85%, 2px 100%);
    transform: scale(1.02) translateX(0.4px) translateY(0.2px);
    z-index: -1;
}

.dlc-label:hover::before {
    opacity: 0.5;
    transform: scale(1.05) translateX(-0.8px) translateY(-0.4px);
}

.dlc-label:hover::after {
    opacity: 0.6;
    transform: scale(1.03) translateX(0.8px) translateY(0.4px);
}

/* Mementos Location Styling */
.mementos-location {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}

.area-label {
    background-color: #6f42c1;
    display: inline-block;
    padding: .9em 1em .6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(0 5%, calc(100% - 15px) 0, 100% 95%, 8px 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
}

.area-label::before,
.area-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.area-label::before {
    background: #FF0000;
    clip-path: polygon(0 10%, calc(100% - 17px) 0, 100% 100%, 10px 100%);
    transform: scale(1.05) translateX(-1px) translateY(-0.5px);
    z-index: -2;
}

.area-label::after {
    background: #00FFFF;
    clip-path: polygon(0 0%, calc(100% - 13px) 0, 100% 90%, 6px 100%);
    transform: scale(1.03) translateX(1px) translateY(0.5px);
    z-index: -1;
}

.area-label:hover::before {
    opacity: 0.6;
    transform: scale(1.08) translateX(-2px) translateY(-1px);
}

.area-label:hover::after {
    opacity: 0.7;
    transform: scale(1.05) translateX(2px) translateY(1px);
}

.floor-label {
    background-color: #17a2b8;
    display: inline-block;
    padding: 1.0em .9em 1.0em;
    font-size: 70%;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(4px 0, 100% 30%, calc(100% - 8px) 100%, 0 70%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
}

.floor-label::before,
.floor-label::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floor-label::before {
    background: #FF0000;
    clip-path: polygon(6px 0, 100% 35%, calc(100% - 6px) 100%, 0 75%);
    transform: scale(1.04) translateX(-0.5px) translateY(-0.3px);
    z-index: -2;
}

.floor-label::after {
    background: #00FFFF;
    clip-path: polygon(2px 0, 100% 25%, calc(100% - 10px) 100%, 0 65%);
    transform: scale(1.02) translateX(0.5px) translateY(0.3px);
    z-index: -1;
}

.floor-label:hover::before {
    opacity: 0.5;
    transform: scale(1.06) translateX(-1px) translateY(-0.5px);
}

.floor-label:hover::after {
    opacity: 0.6;
    transform: scale(1.04) translateX(1px) translateY(0.5px);
}

.no-location {
    color: #6c757d;
    font-style: italic;
}

/* Dark mode mementos styling */
.dark-theme .area-label {
    background-color: #8a63d2;
}

.dark-theme .floor-label {
    background-color: #20c997;
}

.dark-theme .no-location {
    color: #adb5bd;
}

.persona-name {
    vertical-align: inherit;
}

@supports (-webkit-overflow-scrolling: touch) {
    .search-label,
    select,
    textarea,
    input,
    .ui.input input {
        font-size: 16px;
    }
    .ui.button.clear-button {
        padding: 1.4em 1.5em;
    }
}

.search-container {
    align-items: center;
    justify-content: center;
    max-width: 50%;
    margin-top: 40px;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.nav-btn {
    background: #007bff;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

.nav-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none !important;
    color: white !important;
}

.nav-btn:visited {
    color: white !important;
    text-decoration: none !important;
}

/* Responsive navigation for mobile */
@media only screen and (max-width: 768px) {
    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 200px;
    }
}

/* Version Navigation Section */
.version-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 20px 0;
}

/* Responsive version navigation */
@media only screen and (max-width: 768px) {
    .version-nav .nav-btn {
        width: 200px;
    }
}

/* P5 Theme Toggle Span Styles */
span.theme-toggle-btn,
.theme-toggle-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    margin: 0px 16px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: inline-block;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    -webkit-highlight: none !important;
    pointer-events: auto;
}

/* Remove any possible selection/highlight on all child elements */
.theme-toggle-btn *,
.theme-toggle-btn *:before,
.theme-toggle-btn *:after {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-highlight: none !important;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Version button styling - inherits all nav-btn properties */
.nav-btn.version-btn {
    background: #6f42c1 !important; /* Purple for "Switch to Original" */
}

.nav-btn.version-btn:hover {
    background: #5a2d91 !important;
}

/* Specific styling for "Switch to Royal" button */
.nav-btn[href="indexRoyal.html"] {
    background: #dc3545 !important; /* Red for "Switch to Royal" */
}

.nav-btn[href="indexRoyal.html"]:hover {
    background: #c82333 !important;
}

/* Light theme (default) */
.light-theme {
    background-color: #ffffff;
    color: #333333;
}

.light-theme a {
    color: #007bff;
}

.light-theme a:hover {
    color: #0056b3;
}

.light-theme .ui.table {
    background: #ffffff;
    color: #333333;
}

.light-theme .ui.table th {
    background: #f8f9fa;
    color: #333333;
}

.light-theme .infoTable th, 
.light-theme .infoTable td {
    border: 1px solid #dee2e6;
}

/* Light theme nav and title colors */
.light-theme .p5-link-wrapper .fallback {
    color: #000000 !important;
}

.light-theme .p5-title .title-link {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    background: none !important;
}

.light-theme .theme-toggle-btn .fallback {
    color: #000000 !important;
}

/* Dark theme */
.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark-theme a {
    color: #66b3ff;
}

.dark-theme a:hover {
    color: #99ccff;
}

.dark-theme #content {
    background-color: #1a1a1a;
}

.dark-theme .ui.table {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.dark-theme .ui.table th {
    background: #3d3d3d !important;
    color: #ffffff !important;
    border-bottom: 1px solid #555555 !important;
}

.dark-theme .ui.table td {
    border-top: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

/* Override the general td color for resistance type cells */
.dark-theme .ui.table td.wk,
.dark-theme .ui.table td.Weak {
    color: #ff6b6b !important;
}

.dark-theme .ui.table td.rs,
.dark-theme .ui.table td.Resist {
    color: #4dabf7 !important;
}

.dark-theme .ui.table td.nu,
.dark-theme .ui.table td.Null {
    color: #ced4da !important;
}

.dark-theme .ui.table td.rp,
.dark-theme .ui.table td.Repel {
    color: #ffd43b !important;
}

.dark-theme .ui.table td.ab,
.dark-theme .ui.table td.Absorb {
    color: #51cf66 !important;
}

/* Settings page text styling for dark mode */
.dark-theme p {
    color: #e0e0e0 !important;
}

.dark-theme .ui.form label {
    color: #e0e0e0 !important;
}

.dark-theme .ui.checkbox label {
    color: #e0e0e0 !important;
}

.dark-theme .ui.checkbox label:before {
    background: #3d3d3d !important;
    border: 1px solid #555555 !important;
}

.dark-theme .ui.checkbox label:after {
    color: #ffffff !important;
}

.dark-theme .ui.checkbox input:checked ~ label:before {
    background: #007bff !important;
    border-color: #007bff !important;
}

/* Modern Search Components */
.modern-search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    isolation: isolate;
}

/* Add white shape using a span element */
.search-input-wrapper .search-white-shape {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f2e8;
    clip-path: polygon(4px 0, calc(100% - 6px) 0, calc(100% - 8px) 100%, 6px 100%);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 0;
    pointer-events: none;
    transform: scale(1.03) translateX(1px) translateY(0.5px);
}

/* Geometric search input wrapper with animated shapes */
.search-input-wrapper::before,
.search-input-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
}

/* Red shape (behind) */
.search-input-wrapper::before {
    background: #FF0000;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 12px 100%);
    transform: scale(1.1) translateX(-2px) translateY(-1px);
    z-index: -2;
}

/* Cyan shape (front) */
.search-input-wrapper::after {
    background: #00FFFF;
    clip-path: polygon(8px 0, calc(100% - 4px) 0, calc(100% - 12px) 100%, 4px 100%);
    transform: scale(1.05) translateX(2px) translateY(1px);
    z-index: -1;
}

/* Show shapes on focus */
.search-input-wrapper:focus-within .search-white-shape {
    opacity: 0.9;
    transform: scale(1.05) translateX(1.5px) translateY(1px) rotate(0.2deg);
}

.search-input-wrapper:focus-within::before {
    opacity: 0.7;
    transform: scale(1.12) translateX(-3px) translateY(-2px) rotate(0.5deg);
}

.search-input-wrapper:focus-within::after {
    opacity: 0.8;
    transform: scale(1.07) translateX(3px) translateY(2px) rotate(-0.3deg);
}

/* Jelly animation for shapes */
@keyframes jellySearchRed {
    0%, 100% { 
        transform: scale(1.12) translateX(-3px) translateY(-2px) rotate(0.5deg);
    }
    50% { 
        transform: scale(1.15) translateX(-4px) translateY(-3px) rotate(1deg);
    }
}

@keyframes jellySearchCyan {
    0%, 100% { 
        transform: scale(1.07) translateX(3px) translateY(2px) rotate(-0.3deg);
    }
    50% { 
        transform: scale(1.1) translateX(4px) translateY(3px) rotate(-0.8deg);
    }
}

@keyframes jellySearchWhite {
    0%, 100% { 
        transform: scale(1.05) translateX(1.5px) translateY(1px) rotate(0.2deg);
    }
    50% { 
        transform: scale(1.07) translateX(2px) translateY(1.5px) rotate(0.5deg);
    }
}

.search-input-wrapper:focus-within .search-white-shape {
    animation: jellySearchWhite 2s ease-in-out infinite;
}

.search-input-wrapper:focus-within::before {
    animation: jellySearchRed 2.5s ease-in-out infinite;
}

.search-input-wrapper:focus-within::after {
    animation: jellySearchCyan 3s ease-in-out infinite;
}

/* Align clear button with search input */
.modern-search-container .p5-link-wrapper.modern-clear-btn {
    margin: 0;
}

.modern-search-container .p5-link-wrapper.modern-clear-btn .fallback {
    top: 0;
    font-size: 1.5em;
}

.modern-search-container .p5-link-wrapper.modern-clear-btn .shape-wrapper {
    top: -5px;
}

.modern-search-input {
    background: #ffffff;
    border: none;
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 100%, 10px 100%);
    padding: 12px 20px;
    font-size: 14px;
    font-family: 'Expose-Regular';
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    min-width: 280px;
    outline: none;
    position: relative;
    z-index: 2;
    background-clip: padding-box;
}

.modern-search-input:focus {
    box-shadow: 0 6px 16px rgba(255,0,0,0.3);
    transform: translateY(-2px);
    z-index: 3;
}

.modern-search-input:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.modern-search-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Dark mode search styling */
.dark-theme .modern-search-input {
    background: #3d3d3d;
    color: #e0e0e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.dark-theme .modern-search-input:focus {
    box-shadow: 0 6px 16px rgba(255,0,0,0.4);
}

.dark-theme .modern-search-input:hover {
    box-shadow: 0 5px 12px rgba(0,0,0,0.5);
}

.dark-theme .modern-search-input::placeholder {
    color: #6c757d;
}

/* Responsive search */
@media only screen and (max-width: 768px) {
    .modern-search-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .modern-search-input {
        min-width: 250px;
        width: 100%;
        max-width: 300px;
    }
    
    .modern-clear-btn {
        width: 120px;
    }
}

.dark-theme .ui.table tbody tr {
    background: #2d2d2d !important;
}

.dark-theme .ui.table tbody tr:hover {
    background: #404040 !important;
}

.dark-theme .infoTable,
.dark-theme .infoTable th,
.dark-theme .infoTable td {
    background: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #555555;
}

.dark-theme .recipesTable {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-theme .ui.input input {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
    border: 1px solid #555555 !important;
}

.dark-theme .ui.input input:focus {
    border-color: #66b3ff !important;
}

.dark-theme .ui.button {
    background: #404040 !important;
    color: #e0e0e0 !important;
    border: 1px solid #555555 !important;
}

.dark-theme .ui.button:hover {
    background: #505050 !important;
}

.dark-theme .ui.dropdown {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
    border: 1px solid #555555 !important;
}

.dark-theme .ui.dropdown .menu {
    background: #3d3d3d !important;
    border: 1px solid #555555 !important;
}

.dark-theme .ui.dropdown .menu .item {
    color: #e0e0e0 !important;
}

.dark-theme .ui.dropdown .menu .item:hover {
    background: #505050 !important;
}

.dark-theme .nav-btn {
    background: #495057 !important;
    color: #ffffff !important;
    border: 1px solid #6c757d;
}

.dark-theme .nav-btn:hover {
    background: #6c757d !important;
    color: #ffffff !important;
}

.dark-theme .nav-btn:visited {
    color: #ffffff !important;
}

.dark-theme .nav-btn.version-btn {
    background: #6f42c1 !important; /* Purple for "Switch to Original" */
}

.dark-theme .nav-btn.version-btn:hover {
    background: #5a2d91 !important;
}

/* Dark mode styling for "Switch to Royal" button */
.dark-theme .nav-btn[href="indexRoyal.html"] {
    background: #dc3545 !important; /* Red for "Switch to Royal" */
}

.dark-theme .nav-btn[href="indexRoyal.html"]:hover {
    background: #c82333 !important;
}

/* Override hover effects for dark mode */
.dark-theme #list tr:hover td,
.dark-theme #skillList tr:hover td {
    background: rgba(255, 255, 255, 0.1) !important;
}

.dark-theme .ui.sortable.table thead th:hover {
    background: #505050 !important;
}

/* Preserve resistance type colors in dark mode */
.dark-theme .ui.table .wk, 
.dark-theme .ui.table .Weak,
.dark-theme .wk, 
.dark-theme .Weak { 
    color: #ff6b6b !important; /* Brighter red for dark backgrounds */
}

.dark-theme .ui.table .rs, 
.dark-theme .ui.table .Resist,
.dark-theme .rs, 
.dark-theme .Resist { 
    color: #4dabf7 !important; /* Brighter blue for dark backgrounds */
}

.dark-theme .ui.table .nu, 
.dark-theme .ui.table .Null,
.dark-theme .nu, 
.dark-theme .Null { 
    color: #ced4da !important; /* Lighter gray for dark backgrounds */
}

.dark-theme .ui.table .rp, 
.dark-theme .ui.table .Repel,
.dark-theme .rp, 
.dark-theme .Repel { 
    color: #ffd43b !important; /* Brighter yellow for dark backgrounds */
}

.dark-theme .ui.table .ab, 
.dark-theme .ui.table .Absorb,
.dark-theme .ab, 
.dark-theme .Absorb { 
    color: #51cf66 !important; /* Brighter green for dark backgrounds */
}

/* Preserve checkmark colors in dark mode */
.dark-theme .ui.table .✓,
.dark-theme .✓ { 
    color: #51cf66 !important; /* Brighter green for dark backgrounds */
}

.dark-theme .ui.table .✘,
.dark-theme .✘ { 
    color: #ff6b6b !important; /* Brighter red for dark backgrounds */
}

/* Persona Page Badge Styling */
.persona-level-badge {
    background-color: #28a745;
    display: inline-block;
    padding: .7em 1em .7em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(0 0, calc(100% - 4px) 25%, calc(100% - 6px) 75%, 2px 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.persona-level-badge::before,
.persona-level-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.persona-level-badge::before {
    background: #FF0000;
    clip-path: polygon(0 0, calc(100% - 6px) 30%, calc(100% - 2px) 80%, 6px 100%);
    transform: scale(1.04) translateX(-0.5px) translateY(-0.3px);
    z-index: -2;
}

.persona-level-badge::after {
    background: #00FFFF;
    clip-path: polygon(0 0, calc(100% - 2px) 20%, calc(100% - 8px) 70%, 4px 100%);
    transform: scale(1.02) translateX(0.5px) translateY(0.3px);
    z-index: -1;
}

.persona-level-badge:hover::before {
    opacity: 0.5;
    transform: scale(1.06) translateX(-1px) translateY(-0.5px);
}

.persona-level-badge:hover::after {
    opacity: 0.6;
    transform: scale(1.04) translateX(1px) translateY(0.5px);
}

.persona-arcana-badge {
    background-color: #6f42c1;
    display: inline-block;
    padding: .7em 1em .7em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(8px 0, 100% 25%, calc(100% - 4px) 75%, 0 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.persona-arcana-badge::before,
.persona-arcana-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.persona-arcana-badge::before {
    background: #FF0000;
    clip-path: polygon(10px 0, 100% 30%, calc(100% - 2px) 80%, 0 100%);
    transform: scale(1.04) translateX(-0.5px) translateY(-0.3px);
    z-index: -2;
}

.persona-arcana-badge::after {
    background: #00FFFF;
    clip-path: polygon(6px 0, 100% 20%, calc(100% - 6px) 70%, 0 100%);
    transform: scale(1.02) translateX(0.5px) translateY(0.3px);
    z-index: -1;
}

.persona-arcana-badge:hover::before {
    opacity: 0.6;
    transform: scale(1.06) translateX(-1px) translateY(-0.5px);
}

.persona-arcana-badge:hover::after {
    opacity: 0.7;
    transform: scale(1.04) translateX(1px) translateY(0.5px);
}

/* Mementos Badge Styling for Persona Pages */
.mementos-area-badge {
    background-color: #6f42c1;
    display: inline-block;
    padding: .7em 1.1em .7em;
    font-size: 85%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(0 5%, calc(100% - 15px) 0, 100% 95%, 8px 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.mementos-area-badge::before,
.mementos-area-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mementos-area-badge::before {
    background: #FF0000;
    clip-path: polygon(0 10%, calc(100% - 17px) 0, 100% 100%, 10px 100%);
    transform: scale(1.05) translateX(-1px) translateY(-0.5px);
    z-index: -2;
}

.mementos-area-badge::after {
    background: #00FFFF;
    clip-path: polygon(0 0%, calc(100% - 13px) 0, 100% 90%, 6px 100%);
    transform: scale(1.03) translateX(1px) translateY(0.5px);
    z-index: -1;
}

.mementos-area-badge:hover::before {
    opacity: 0.6;
    transform: scale(1.08) translateX(-2px) translateY(-1px);
}

.mementos-area-badge:hover::after {
    opacity: 0.7;
    transform: scale(1.05) translateX(2px) translateY(1px);
}

.mementos-floor-badge {
    background-color: #17a2b8;
    display: inline-block;
    padding: 1.2em .9em 1.2em;
    font-size: 80%;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(4px 0, 100% 30%, calc(100% - 8px) 100%, 0 70%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
}

.mementos-floor-badge::before,
.mementos-floor-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mementos-floor-badge::before {
    background: #FF0000;
    clip-path: polygon(6px 0, 100% 35%, calc(100% - 6px) 100%, 0 75%);
    transform: scale(1.04) translateX(-0.5px) translateY(-0.3px);
    z-index: -2;
}

.mementos-floor-badge::after {
    background: #00FFFF;
    clip-path: polygon(2px 0, 100% 25%, calc(100% - 10px) 100%, 0 65%);
    transform: scale(1.02) translateX(0.5px) translateY(0.3px);
    z-index: -1;
}

.mementos-floor-badge:hover::before {
    opacity: 0.5;
    transform: scale(1.06) translateX(-1px) translateY(-0.5px);
}

.mementos-floor-badge:hover::after {
    opacity: 0.6;
    transform: scale(1.04) translateX(1px) translateY(0.5px);
}

/* Note Badge Styling */
.note-badge {
    display: inline-block;
    padding: .7em 1em .7em;
    font-size: 85%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    clip-path: polygon(6px 0, calc(100% - 2px) 20%, calc(100% - 8px) 80%, 0 100%);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
    margin-right: 8px;
    margin-bottom: 5px;
}

.note-badge::before,
.note-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.note-badge::before {
    background: #FF0000;
    clip-path: polygon(8px 0, calc(100% - 0px) 25%, calc(100% - 6px) 85%, 0 100%);
    transform: scale(1.03) translateX(-0.4px) translateY(-0.2px);
    z-index: -2;
}

.note-badge::after {
    background: #00FFFF;
    clip-path: polygon(4px 0, calc(100% - 4px) 15%, calc(100% - 10px) 75%, 0 100%);
    transform: scale(1.02) translateX(0.4px) translateY(0.2px);
    z-index: -1;
}

.note-badge:hover::before {
    opacity: 0.5;
    transform: scale(1.05) translateX(-0.8px) translateY(-0.4px);
}

.note-badge:hover::after {
    opacity: 0.6;
    transform: scale(1.03) translateX(0.8px) translateY(0.4px);
}

.note-max {
    background-color: #dc3545; /* Red for max social link requirement */
}

.note-rare {
    background-color: #f0ad4e; /* Yellow for rare personas - matches Unique badge */
}

.note-info {
    background-color: #17a2b8; /* Teal for general notes */
}

.note-dlc {
    background-color: #fd7e14; /* Orange for DLC */
}

/* Dark mode badge styling */
.dark-theme .persona-level-badge {
    background-color: #20c997;
}

.dark-theme .persona-arcana-badge {
    background-color: #8a63d2;
}

.dark-theme .mementos-area-badge {
    background-color: #8a63d2;
}

.dark-theme .mementos-floor-badge {
    background-color: #20c997;
}

.dark-theme .note-max {
    background-color: #e74c3c;
}

.dark-theme .note-rare {
    background-color: #f0ad4e; /* Yellow for rare personas - matches Unique badge */
}

.dark-theme .note-info {
    background-color: #20c997;
}

.dark-theme .note-dlc {
    background-color: #f39c12;
}

/* Table Bottom Padding */
.ui.table {
    margin-bottom: 40px !important;
}

/* Additional spacing for tables at the end of content */
.ui.table:last-child {
    margin-bottom: 60px !important;
}

/* Mobile responsive bottom spacing */
@media only screen and (max-width: 768px) {
    .ui.table {
        margin-bottom: 30px !important;
    }
    
    .ui.table:last-child {
        margin-bottom: 50px !important;
    }
    
    .p5-title h1 {
        font-size: 2.5rem;
    }
    
    .p5-navbar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    
    .p5-link-wrapper {
        margin: 0;
        display: inline-block;
    }
    
    .p5-link-wrapper .fallback {
        font-size: 1.2em;
        letter-spacing: 1px;
    }
}

@media only screen and (max-width: 480px) {
    .p5-title h1 {
        font-size: 1.8rem;
    }
    
    .p5-navbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .p5-link-wrapper {
        margin: 0;
        display: block;
        width: 200px;
        text-align: center;
    }
    
    .p5-link-wrapper .fallback {
        font-size: 1em;
    }
}